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

Side by Side Diff: src/core/SkPictureRecord.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 | « src/core/SkCanvas.cpp ('k') | src/core/SkPictureRecord.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkPictureRecord_DEFINED 8 #ifndef SkPictureRecord_DEFINED
9 #define SkPictureRecord_DEFINED 9 #define SkPictureRecord_DEFINED
10 10
(...skipping 19 matching lines...) Expand all
30 small = (combined >> 24) & 0xFF; \ 30 small = (combined >> 24) & 0xFF; \
31 large = combined & MASK_24; 31 large = combined & MASK_24;
32 #define PACK_8_24(small, large) ((small << 24) | large) 32 #define PACK_8_24(small, large) ((small << 24) | large)
33 33
34 34
35 class SkPictureRecord : public SkCanvas { 35 class SkPictureRecord : public SkCanvas {
36 public: 36 public:
37 SkPictureRecord(const SkISize& dimensions, uint32_t recordFlags); 37 SkPictureRecord(const SkISize& dimensions, uint32_t recordFlags);
38 virtual ~SkPictureRecord(); 38 virtual ~SkPictureRecord();
39 39
40 virtual int save(SaveFlags) SK_OVERRIDE;
41 virtual int saveLayer(const SkRect* bounds, const SkPaint*, SaveFlags) SK_OV ERRIDE;
42 virtual void restore() SK_OVERRIDE;
43 virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE; 40 virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE;
44 virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE; 41 virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE;
45 virtual bool rotate(SkScalar degrees) SK_OVERRIDE; 42 virtual bool rotate(SkScalar degrees) SK_OVERRIDE;
46 virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE; 43 virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE;
47 virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE; 44 virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE;
48 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; 45 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE;
49 virtual void clear(SkColor) SK_OVERRIDE; 46 virtual void clear(SkColor) SK_OVERRIDE;
50 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; 47 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
51 virtual void drawPoints(PointMode, size_t count, const SkPoint pts[], 48 virtual void drawPoints(PointMode, size_t count, const SkPoint pts[],
52 const SkPaint&) SK_OVERRIDE; 49 const SkPaint&) SK_OVERRIDE;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 void validate(size_t initialOffset, uint32_t size) const { 217 void validate(size_t initialOffset, uint32_t size) const {
221 SkASSERT(fWriter.bytesWritten() == initialOffset + size); 218 SkASSERT(fWriter.bytesWritten() == initialOffset + size);
222 } 219 }
223 #endif 220 #endif
224 221
225 protected: 222 protected:
226 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE; 223 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE;
227 const void* onPeekPixels(SkImageInfo*, size_t*) SK_OVERRIDE { 224 const void* onPeekPixels(SkImageInfo*, size_t*) SK_OVERRIDE {
228 return NULL; 225 return NULL;
229 } 226 }
227
228 virtual void onSave(SaveFlags) SK_OVERRIDE;
229 virtual bool onSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRI DE;
230 virtual void onRestore() SK_OVERRIDE;
231
230 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK _OVERRIDE; 232 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK _OVERRIDE;
231 virtual void onPushCull(const SkRect&) SK_OVERRIDE; 233 virtual void onPushCull(const SkRect&) SK_OVERRIDE;
232 virtual void onPopCull() SK_OVERRIDE; 234 virtual void onPopCull() SK_OVERRIDE;
233 235
234 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE; 236 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE;
235 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE RRIDE; 237 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE RRIDE;
236 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE; 238 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE;
237 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; 239 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
238 240
239 // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been 241 // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 friend class SkPictureTester; // for unit testing 305 friend class SkPictureTester; // for unit testing
304 306
305 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE 307 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
306 SkMatrixClipStateMgr fMCMgr; 308 SkMatrixClipStateMgr fMCMgr;
307 #endif 309 #endif
308 310
309 typedef SkCanvas INHERITED; 311 typedef SkCanvas INHERITED;
310 }; 312 };
311 313
312 #endif 314 #endif
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkPictureRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698