| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #ifndef SkPictureRecord_DEFINED | 8 #ifndef SkPictureRecord_DEFINED |
| 9 #define SkPictureRecord_DEFINED | 9 #define SkPictureRecord_DEFINED |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; | 46 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; |
| 47 virtual bool clipRect(const SkRect&, SkRegion::Op, bool) SK_OVERRIDE; | 47 virtual bool clipRect(const SkRect&, SkRegion::Op, bool) SK_OVERRIDE; |
| 48 virtual bool clipRRect(const SkRRect&, SkRegion::Op, bool) SK_OVERRIDE; | 48 virtual bool clipRRect(const SkRRect&, SkRegion::Op, bool) SK_OVERRIDE; |
| 49 virtual bool clipPath(const SkPath&, SkRegion::Op, bool) SK_OVERRIDE; | 49 virtual bool clipPath(const SkPath&, SkRegion::Op, bool) SK_OVERRIDE; |
| 50 virtual bool clipRegion(const SkRegion& region, SkRegion::Op op) SK_OVERRIDE
; | 50 virtual bool clipRegion(const SkRegion& region, SkRegion::Op op) SK_OVERRIDE
; |
| 51 virtual void clear(SkColor) SK_OVERRIDE; | 51 virtual void clear(SkColor) SK_OVERRIDE; |
| 52 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; | 52 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; |
| 53 virtual void drawPoints(PointMode, size_t count, const SkPoint pts[], | 53 virtual void drawPoints(PointMode, size_t count, const SkPoint pts[], |
| 54 const SkPaint&) SK_OVERRIDE; | 54 const SkPaint&) SK_OVERRIDE; |
| 55 virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE; | 55 virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE; |
| 56 virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE; |
| 56 virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; | 57 virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; |
| 58 virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE; |
| 57 virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top, | 59 virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top, |
| 58 const SkPaint*) SK_OVERRIDE; | 60 const SkPaint*) SK_OVERRIDE; |
| 59 virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src, | 61 virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src, |
| 60 const SkRect& dst, const SkPaint* paint, | 62 const SkRect& dst, const SkPaint* paint, |
| 61 DrawBitmapRectFlags flags) SK_OVERRIDE; | 63 DrawBitmapRectFlags flags) SK_OVERRIDE; |
| 62 virtual void drawBitmapMatrix(const SkBitmap&, const SkMatrix&, | 64 virtual void drawBitmapMatrix(const SkBitmap&, const SkMatrix&, |
| 63 const SkPaint*) SK_OVERRIDE; | 65 const SkPaint*) SK_OVERRIDE; |
| 64 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, | 66 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, |
| 65 const SkRect& dst, const SkPaint*) SK_OVERRIDE; | 67 const SkRect& dst, const SkPaint*) SK_OVERRIDE; |
| 66 virtual void drawSprite(const SkBitmap&, int left, int top, | 68 virtual void drawSprite(const SkBitmap&, int left, int top, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 97 fRecordFlags = recordFlags; | 99 fRecordFlags = recordFlags; |
| 98 } | 100 } |
| 99 | 101 |
| 100 const SkWriter32& writeStream() const { | 102 const SkWriter32& writeStream() const { |
| 101 return fWriter; | 103 return fWriter; |
| 102 } | 104 } |
| 103 | 105 |
| 104 void beginRecording(); | 106 void beginRecording(); |
| 105 void endRecording(); | 107 void endRecording(); |
| 106 | 108 |
| 107 protected: | |
| 108 virtual void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE; | |
| 109 virtual void onDrawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE; | |
| 110 | |
| 111 private: | 109 private: |
| 112 void handleOptimization(int opt); | 110 void handleOptimization(int opt); |
| 113 void recordRestoreOffsetPlaceholder(SkRegion::Op); | 111 void recordRestoreOffsetPlaceholder(SkRegion::Op); |
| 114 void fillRestoreOffsetPlaceholdersForCurrentStackLevel( | 112 void fillRestoreOffsetPlaceholdersForCurrentStackLevel( |
| 115 uint32_t restoreOffset); | 113 uint32_t restoreOffset); |
| 116 | 114 |
| 117 SkTDArray<int32_t> fRestoreOffsetStack; | 115 SkTDArray<int32_t> fRestoreOffsetStack; |
| 118 int fFirstSavedLayerIndex; | 116 int fFirstSavedLayerIndex; |
| 119 enum { | 117 enum { |
| 120 kNoSavedLayerIndex = -1 | 118 kNoSavedLayerIndex = -1 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 uint32_t fRecordFlags; | 262 uint32_t fRecordFlags; |
| 265 int fInitialSaveCount; | 263 int fInitialSaveCount; |
| 266 | 264 |
| 267 friend class SkPicturePlayback; | 265 friend class SkPicturePlayback; |
| 268 friend class SkPictureTester; // for unit testing | 266 friend class SkPictureTester; // for unit testing |
| 269 | 267 |
| 270 typedef SkCanvas INHERITED; | 268 typedef SkCanvas INHERITED; |
| 271 }; | 269 }; |
| 272 | 270 |
| 273 #endif | 271 #endif |
| OLD | NEW |