Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Side by Side Diff: src/core/SkBBoxHierarchyRecord.h

Issue 196323003: Revert of Revert "De-virtualize SkCanvas save/restore." (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/utils/SkProxyCanvas.h ('k') | src/core/SkBBoxHierarchyRecord.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #ifndef SkRTreeCanvas_DEFINED 9 #ifndef SkRTreeCanvas_DEFINED
10 #define SkRTreeCanvas_DEFINED 10 #define SkRTreeCanvas_DEFINED
11 11
12 #include "SkBBoxHierarchy.h" 12 #include "SkBBoxHierarchy.h"
13 #include "SkBBoxRecord.h" 13 #include "SkBBoxRecord.h"
14 14
15 /** 15 /**
16 * This records bounding box information into an SkBBoxHierarchy, and clip/trans form information 16 * This records bounding box information into an SkBBoxHierarchy, and clip/trans form information
17 * into an SkPictureStateTree to allow for efficient culling and correct playbac k of draws. 17 * into an SkPictureStateTree to allow for efficient culling and correct playbac k of draws.
18 */ 18 */
19 class SkBBoxHierarchyRecord : public SkBBoxRecord, public SkBBoxHierarchyClient { 19 class SkBBoxHierarchyRecord : public SkBBoxRecord, public SkBBoxHierarchyClient {
20 public: 20 public:
21 /** This will take a ref of h */ 21 /** This will take a ref of h */
22 SkBBoxHierarchyRecord(const SkISize& size, uint32_t recordFlags, SkBBoxHiera rchy* h); 22 SkBBoxHierarchyRecord(const SkISize& size, uint32_t recordFlags, SkBBoxHiera rchy* h);
23 23
24 virtual void handleBBox(const SkRect& bounds) SK_OVERRIDE; 24 virtual void handleBBox(const SkRect& bounds) SK_OVERRIDE;
25 25
26 virtual int save(SaveFlags flags = kMatrixClip_SaveFlag) SK_OVERRIDE;
27 virtual int saveLayer(const SkRect* bounds, const SkPaint* paint,
28 SaveFlags flags = kARGB_ClipLayer_SaveFlag) SK_OVERRID E;
29 virtual void restore() SK_OVERRIDE;
30
31 virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE; 26 virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE;
32 virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE; 27 virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE;
33 virtual bool rotate(SkScalar degrees) SK_OVERRIDE; 28 virtual bool rotate(SkScalar degrees) SK_OVERRIDE;
34 virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE; 29 virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE;
35 virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE; 30 virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE;
36 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; 31 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE;
37 32
38 // Implementation of the SkBBoxHierarchyClient interface 33 // Implementation of the SkBBoxHierarchyClient interface
39 virtual bool shouldRewind(void* data) SK_OVERRIDE; 34 virtual bool shouldRewind(void* data) SK_OVERRIDE;
40 35
41 protected: 36 protected:
37 virtual void onSave(SaveFlags) SK_OVERRIDE;
38 virtual bool onSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRI DE;
39 virtual void onRestore() SK_OVERRIDE;
40
42 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE; 41 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE;
43 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE RRIDE; 42 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE RRIDE;
44 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE; 43 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE;
45 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; 44 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
46 45
47 private: 46 private:
48 typedef SkBBoxRecord INHERITED; 47 typedef SkBBoxRecord INHERITED;
49 }; 48 };
50 49
51 #endif 50 #endif
OLDNEW
« no previous file with comments | « include/utils/SkProxyCanvas.h ('k') | src/core/SkBBoxHierarchyRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698