• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 /*
3  * Copyright 2012 Google Inc.
4  *
5  * Use of this source code is governed by a BSD-style license that can be
6  * found in the LICENSE file.
7  */
8 
9 #ifndef SkRTreeCanvas_DEFINED
10 #define SkRTreeCanvas_DEFINED
11 
12 #include "SkBBoxHierarchy.h"
13 #include "SkBBoxRecord.h"
14 
15 /**
16  * This records bounding box information into an SkBBoxHierarchy, and clip/transform information
17  * into an SkPictureStateTree to allow for efficient culling and correct playback of draws.
18  */
19 class SkBBoxHierarchyRecord : public SkBBoxRecord, public SkBBoxHierarchyClient {
20 public:
21     /** This will take a ref of h */
22     SkBBoxHierarchyRecord(const SkISize& size, uint32_t recordFlags, SkBBoxHierarchy* h);
23 
24     virtual void handleBBox(const SkRect& bounds) SK_OVERRIDE;
25 
26     // Implementation of the SkBBoxHierarchyClient interface
27     virtual bool shouldRewind(void* data) SK_OVERRIDE;
28 
29 protected:
30     virtual void willSave(SaveFlags) SK_OVERRIDE;
31     virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE;
32     virtual void willRestore() SK_OVERRIDE;
33 
34     virtual void didConcat(const SkMatrix&) SK_OVERRIDE;
35     virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
36 
37     virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
38     virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
39     virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
40     virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
41 
42 private:
43     typedef SkBBoxRecord INHERITED;
44 };
45 
46 #endif
47