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

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

Issue 183453002: add new onClip* methods to SkCanvas (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: more cleanup 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
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 27 matching lines...) Expand all
38 38
39 virtual int save(SaveFlags) SK_OVERRIDE; 39 virtual int save(SaveFlags) SK_OVERRIDE;
40 virtual int saveLayer(const SkRect* bounds, const SkPaint*, SaveFlags) SK_OV ERRIDE; 40 virtual int saveLayer(const SkRect* bounds, const SkPaint*, SaveFlags) SK_OV ERRIDE;
41 virtual void restore() SK_OVERRIDE; 41 virtual void restore() SK_OVERRIDE;
42 virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE; 42 virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE;
43 virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE; 43 virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE;
44 virtual bool rotate(SkScalar degrees) SK_OVERRIDE; 44 virtual bool rotate(SkScalar degrees) SK_OVERRIDE;
45 virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE; 45 virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE;
46 virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE; 46 virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE;
47 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; 47 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE;
48 virtual bool clipRect(const SkRect&, SkRegion::Op, bool) SK_OVERRIDE;
49 virtual bool clipRRect(const SkRRect&, SkRegion::Op, bool) SK_OVERRIDE;
50 virtual bool clipPath(const SkPath&, SkRegion::Op, bool) SK_OVERRIDE;
51 virtual bool clipRegion(const SkRegion& region, SkRegion::Op op) SK_OVERRIDE ;
52 virtual void clear(SkColor) SK_OVERRIDE; 48 virtual void clear(SkColor) SK_OVERRIDE;
53 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; 49 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
54 virtual void drawPoints(PointMode, size_t count, const SkPoint pts[], 50 virtual void drawPoints(PointMode, size_t count, const SkPoint pts[],
55 const SkPaint&) SK_OVERRIDE; 51 const SkPaint&) SK_OVERRIDE;
56 virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE; 52 virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
57 virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE; 53 virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
58 virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; 54 virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
59 virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE; 55 virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
60 virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top, 56 virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top,
61 const SkPaint*) SK_OVERRIDE; 57 const SkPaint*) SK_OVERRIDE;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 } 213 }
218 #endif 214 #endif
219 215
220 protected: 216 protected:
221 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE; 217 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE;
222 const void* onPeekPixels(SkImageInfo*, size_t*) SK_OVERRIDE { 218 const void* onPeekPixels(SkImageInfo*, size_t*) SK_OVERRIDE {
223 return NULL; 219 return NULL;
224 } 220 }
225 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK _OVERRIDE; 221 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK _OVERRIDE;
226 222
223 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE;
224 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE RRIDE;
225 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE;
226 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
227
227 // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been 228 // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been
228 // tweaked by paint.computeFastBounds(). 229 // tweaked by paint.computeFastBounds().
229 static void ComputeFontMetricsTopBottom(const SkPaint& paint, SkScalar topbo t[2]); 230 static void ComputeFontMetricsTopBottom(const SkPaint& paint, SkScalar topbo t[2]);
230 231
231 // Make sure that flat has fTopBot written. 232 // Make sure that flat has fTopBot written.
232 static void WriteTopBot(const SkPaint& paint, const SkFlatData& flat) { 233 static void WriteTopBot(const SkPaint& paint, const SkFlatData& flat) {
233 if (!flat.isTopBotWritten()) { 234 if (!flat.isTopBotWritten()) {
234 ComputeFontMetricsTopBottom(paint, flat.writableTopBot()); 235 ComputeFontMetricsTopBottom(paint, flat.writableTopBot());
235 SkASSERT(flat.isTopBotWritten()); 236 SkASSERT(flat.isTopBotWritten());
236 } 237 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 friend class SkPictureTester; // for unit testing 289 friend class SkPictureTester; // for unit testing
289 290
290 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE 291 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
291 SkMatrixClipStateMgr fMCMgr; 292 SkMatrixClipStateMgr fMCMgr;
292 #endif 293 #endif
293 294
294 typedef SkCanvas INHERITED; 295 typedef SkCanvas INHERITED;
295 }; 296 };
296 297
297 #endif 298 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698