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

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

Issue 194923008: 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;
40 virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE; 43 virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE;
41 virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE; 44 virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE;
42 virtual bool rotate(SkScalar degrees) SK_OVERRIDE; 45 virtual bool rotate(SkScalar degrees) SK_OVERRIDE;
43 virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE; 46 virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE;
44 virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE; 47 virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE;
45 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; 48 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE;
46 virtual void clear(SkColor) SK_OVERRIDE; 49 virtual void clear(SkColor) SK_OVERRIDE;
47 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; 50 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
48 virtual void drawPoints(PointMode, size_t count, const SkPoint pts[], 51 virtual void drawPoints(PointMode, size_t count, const SkPoint pts[],
49 const SkPaint&) SK_OVERRIDE; 52 const SkPaint&) SK_OVERRIDE;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 void validate(size_t initialOffset, uint32_t size) const { 220 void validate(size_t initialOffset, uint32_t size) const {
218 SkASSERT(fWriter.bytesWritten() == initialOffset + size); 221 SkASSERT(fWriter.bytesWritten() == initialOffset + size);
219 } 222 }
220 #endif 223 #endif
221 224
222 protected: 225 protected:
223 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE; 226 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE;
224 const void* onPeekPixels(SkImageInfo*, size_t*) SK_OVERRIDE { 227 const void* onPeekPixels(SkImageInfo*, size_t*) SK_OVERRIDE {
225 return NULL; 228 return NULL;
226 } 229 }
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
232 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK _OVERRIDE; 230 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK _OVERRIDE;
233 virtual void onPushCull(const SkRect&) SK_OVERRIDE; 231 virtual void onPushCull(const SkRect&) SK_OVERRIDE;
234 virtual void onPopCull() SK_OVERRIDE; 232 virtual void onPopCull() SK_OVERRIDE;
235 233
236 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE; 234 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE;
237 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE RRIDE; 235 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE RRIDE;
238 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE; 236 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE;
239 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; 237 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
240 238
241 // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been 239 // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 friend class SkPictureTester; // for unit testing 303 friend class SkPictureTester; // for unit testing
306 304
307 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE 305 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
308 SkMatrixClipStateMgr fMCMgr; 306 SkMatrixClipStateMgr fMCMgr;
309 #endif 307 #endif
310 308
311 typedef SkCanvas INHERITED; 309 typedef SkCanvas INHERITED;
312 }; 310 };
313 311
314 #endif 312 #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