OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkDeferredCanvas_DEFINED | 8 #ifndef SkDeferredCanvas_DEFINED |
9 #define SkDeferredCanvas_DEFINED | 9 #define SkDeferredCanvas_DEFINED |
10 | 10 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 * rendered using the deferred canvas. | 131 * rendered using the deferred canvas. |
132 */ | 132 */ |
133 void setBitmapSizeThreshold(size_t sizeThreshold); | 133 void setBitmapSizeThreshold(size_t sizeThreshold); |
134 | 134 |
135 /** | 135 /** |
136 * Executes all pending commands without drawing | 136 * Executes all pending commands without drawing |
137 */ | 137 */ |
138 void silentFlush(); | 138 void silentFlush(); |
139 | 139 |
140 // Overrides of the SkCanvas interface | 140 // Overrides of the SkCanvas interface |
| 141 virtual int save(SaveFlags flags) SK_OVERRIDE; |
| 142 virtual int saveLayer(const SkRect* bounds, const SkPaint* paint, |
| 143 SaveFlags flags) SK_OVERRIDE; |
| 144 virtual void restore() SK_OVERRIDE; |
141 virtual bool isDrawingToLayer() const SK_OVERRIDE; | 145 virtual bool isDrawingToLayer() const SK_OVERRIDE; |
142 virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE; | 146 virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE; |
143 virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE; | 147 virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE; |
144 virtual bool rotate(SkScalar degrees) SK_OVERRIDE; | 148 virtual bool rotate(SkScalar degrees) SK_OVERRIDE; |
145 virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE; | 149 virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE; |
146 virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE; | 150 virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE; |
147 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; | 151 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; |
148 virtual void clear(SkColor) SK_OVERRIDE; | 152 virtual void clear(SkColor) SK_OVERRIDE; |
149 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; | 153 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; |
150 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], | 154 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 virtual void drawPicture(SkPicture& picture) SK_OVERRIDE; | 186 virtual void drawPicture(SkPicture& picture) SK_OVERRIDE; |
183 virtual void drawVertices(VertexMode vmode, int vertexCount, | 187 virtual void drawVertices(VertexMode vmode, int vertexCount, |
184 const SkPoint vertices[], const SkPoint texs[], | 188 const SkPoint vertices[], const SkPoint texs[], |
185 const SkColor colors[], SkXfermode* xmode, | 189 const SkColor colors[], SkXfermode* xmode, |
186 const uint16_t indices[], int indexCount, | 190 const uint16_t indices[], int indexCount, |
187 const SkPaint& paint) SK_OVERRIDE; | 191 const SkPaint& paint) SK_OVERRIDE; |
188 virtual SkBounder* setBounder(SkBounder* bounder) SK_OVERRIDE; | 192 virtual SkBounder* setBounder(SkBounder* bounder) SK_OVERRIDE; |
189 virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) SK_OVERRIDE; | 193 virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) SK_OVERRIDE; |
190 | 194 |
191 protected: | 195 protected: |
192 virtual void onSave(SaveFlags) SK_OVERRIDE; | |
193 virtual bool onSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRI
DE; | |
194 virtual void onRestore() SK_OVERRIDE; | |
195 | |
196 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, | 196 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, |
197 const SkPaint&) SK_OVERRIDE; | 197 const SkPaint&) SK_OVERRIDE; |
198 | 198 |
199 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; | 199 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; |
200 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE
RRIDE; | 200 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE
RRIDE; |
201 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; | 201 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; |
202 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; | 202 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; |
203 | 203 |
204 public: | 204 public: |
205 class NotificationClient { | 205 class NotificationClient { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 void validate() const; | 248 void validate() const; |
249 void init(); | 249 void init(); |
250 bool fDeferredDrawing; | 250 bool fDeferredDrawing; |
251 | 251 |
252 friend class SkDeferredCanvasTester; // for unit testing | 252 friend class SkDeferredCanvasTester; // for unit testing |
253 typedef SkCanvas INHERITED; | 253 typedef SkCanvas INHERITED; |
254 }; | 254 }; |
255 | 255 |
256 | 256 |
257 #endif | 257 #endif |
OLD | NEW |