19f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com
29f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com/*
39f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com * Copyright 2012 Google Inc.
49f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com *
59f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com * Use of this source code is governed by a BSD-style license that can be
69f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com * found in the LICENSE file.
79f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com */
89f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com
99f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com#ifndef SkRTreeCanvas_DEFINED
109f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com#define SkRTreeCanvas_DEFINED
119f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com
124b32bd53c63b245707822ae83e3215863303bf43commit-bot@chromium.org#include "SkBBoxHierarchy.h"
139f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com#include "SkBBoxRecord.h"
149f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com
159f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com/**
169f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com * This records bounding box information into an SkBBoxHierarchy, and clip/transform information
179f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com * into an SkPictureStateTree to allow for efficient culling and correct playback of draws.
189f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com */
194b32bd53c63b245707822ae83e3215863303bf43commit-bot@chromium.orgclass SkBBoxHierarchyRecord : public SkBBoxRecord, public SkBBoxHierarchyClient {
209f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.compublic:
219f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com    /** This will take a ref of h */
220bdbea75ff1a6f3c313c18cab0139728967cb93erobertphillips    SkBBoxHierarchyRecord(const SkISize& size, uint32_t recordFlags, SkBBoxHierarchy* h);
23a8377402ee626bd0a6c61ef9f0c256f06eca5759tomhudson    virtual ~SkBBoxHierarchyRecord() { };
249f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com
259f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com    virtual void handleBBox(const SkRect& bounds) SK_OVERRIDE;
269f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com
274b32bd53c63b245707822ae83e3215863303bf43commit-bot@chromium.org    // Implementation of the SkBBoxHierarchyClient interface
284b32bd53c63b245707822ae83e3215863303bf43commit-bot@chromium.org    virtual bool shouldRewind(void* data) SK_OVERRIDE;
294b32bd53c63b245707822ae83e3215863303bf43commit-bot@chromium.org
308f90a892c5130d4d26b5588e1ff151d01a40688arobertphillips@google.comprotected:
315f6102d07982043542343ff0a6c67b1319ac9fc7Florin Malita    virtual void willSave() SK_OVERRIDE;
32e54a23fcfa42b2fc9d320650de72bcb2d9566b2dcommit-bot@chromium.org    virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE;
33e54a23fcfa42b2fc9d320650de72bcb2d9566b2dcommit-bot@chromium.org    virtual void willRestore() SK_OVERRIDE;
34e54a23fcfa42b2fc9d320650de72bcb2d9566b2dcommit-bot@chromium.org
3544c48d062f7996b5b46917e1b312a32ad101f326commit-bot@chromium.org    virtual void didConcat(const SkMatrix&) SK_OVERRIDE;
3644c48d062f7996b5b46917e1b312a32ad101f326commit-bot@chromium.org    virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
3744c48d062f7996b5b46917e1b312a32ad101f326commit-bot@chromium.org
388f90a892c5130d4d26b5588e1ff151d01a40688arobertphillips@google.com    virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
398f90a892c5130d4d26b5588e1ff151d01a40688arobertphillips@google.com    virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
408f90a892c5130d4d26b5588e1ff151d01a40688arobertphillips@google.com    virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
418f90a892c5130d4d26b5588e1ff151d01a40688arobertphillips@google.com    virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
428f90a892c5130d4d26b5588e1ff151d01a40688arobertphillips@google.com
439f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.comprivate:
449f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com    typedef SkBBoxRecord INHERITED;
459f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com};
469f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com
479f5898d31b91500e09a70c7f70265a2d813b2534rileya@google.com#endif
48