| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 SkCanvas_DEFINED | 8 #ifndef SkCanvas_DEFINED |
| 9 #define SkCanvas_DEFINED | 9 #define SkCanvas_DEFINED |
| 10 | 10 |
| (...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 // need to overload this method. The impl must keep track of this, as it | 1235 // need to overload this method. The impl must keep track of this, as it |
| 1236 // is not released or deleted by the caller. | 1236 // is not released or deleted by the caller. |
| 1237 virtual SkCanvas* canvasForDrawIter(); | 1237 virtual SkCanvas* canvasForDrawIter(); |
| 1238 | 1238 |
| 1239 // Clip rectangle bounds. Called internally by saveLayer. | 1239 // Clip rectangle bounds. Called internally by saveLayer. |
| 1240 // returns false if the entire rectangle is entirely clipped out | 1240 // returns false if the entire rectangle is entirely clipped out |
| 1241 // If non-NULL, The imageFilter parameter will be used to expand the clip | 1241 // If non-NULL, The imageFilter parameter will be used to expand the clip |
| 1242 // and offscreen bounds for any margin required by the filter DAG. | 1242 // and offscreen bounds for any margin required by the filter DAG. |
| 1243 bool clipRectBounds(const SkRect* bounds, SaveFlags flags, | 1243 bool clipRectBounds(const SkRect* bounds, SaveFlags flags, |
| 1244 SkIRect* intersection, | 1244 SkIRect* intersection, |
| 1245 const SkImageFilter* imageFilter = NULL); | 1245 const SkImageFilter* imageFilter = NULL, |
| 1246 const SkMatrix* extraMatrix = NULL); |
| 1246 | 1247 |
| 1247 // notify our surface (if we have one) that we are about to draw, so it | 1248 // notify our surface (if we have one) that we are about to draw, so it |
| 1248 // can perform copy-on-write or invalidate any cached images | 1249 // can perform copy-on-write or invalidate any cached images |
| 1249 void predrawNotify(); | 1250 void predrawNotify(); |
| 1250 | 1251 |
| 1251 private: | 1252 private: |
| 1252 class MCRec; | 1253 class MCRec; |
| 1253 | 1254 |
| 1254 SkAutoTUnref<SkClipStack> fClipStack; | 1255 SkAutoTUnref<SkClipStack> fClipStack; |
| 1255 SkDeque fMCStack; | 1256 SkDeque fMCStack; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1315 // internal methods are not virtual, so they can safely be called by other | 1316 // internal methods are not virtual, so they can safely be called by other |
| 1316 // canvas apis, without confusing subclasses (like SkPictureRecording) | 1317 // canvas apis, without confusing subclasses (like SkPictureRecording) |
| 1317 void internalDrawBitmap(const SkBitmap&, const SkMatrix& m, const SkPaint* p
aint); | 1318 void internalDrawBitmap(const SkBitmap&, const SkMatrix& m, const SkPaint* p
aint); |
| 1318 void internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, | 1319 void internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, |
| 1319 const SkRect& dst, const SkPaint* paint, | 1320 const SkRect& dst, const SkPaint* paint, |
| 1320 DrawBitmapRectFlags flags); | 1321 DrawBitmapRectFlags flags); |
| 1321 void internalDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, | 1322 void internalDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, |
| 1322 const SkRect& dst, const SkPaint* paint); | 1323 const SkRect& dst, const SkPaint* paint); |
| 1323 void internalDrawPaint(const SkPaint& paint); | 1324 void internalDrawPaint(const SkPaint& paint); |
| 1324 void internalSaveLayer(const SkRect* bounds, const SkPaint*, SaveFlags, Save
LayerStrategy); | 1325 void internalSaveLayer(const SkRect* bounds, const SkPaint*, SaveFlags, Save
LayerStrategy); |
| 1325 void internalDrawDevice(SkBaseDevice*, int x, int y, const SkPaint*); | 1326 void internalDrawDevice(SkBaseDevice*, int x, int y, const SkPaint*, const S
kMatrix& extraMatrix); |
| 1326 | 1327 |
| 1327 // shared by save() and saveLayer() | 1328 // shared by save() and saveLayer() |
| 1328 void internalSave(); | 1329 void internalSave(); |
| 1329 void internalRestore(); | 1330 void internalRestore(); |
| 1330 static void DrawRect(const SkDraw& draw, const SkPaint& paint, | 1331 static void DrawRect(const SkDraw& draw, const SkPaint& paint, |
| 1331 const SkRect& r, SkScalar textSize); | 1332 const SkRect& r, SkScalar textSize); |
| 1332 static void DrawTextDecorations(const SkDraw& draw, const SkPaint& paint, | 1333 static void DrawTextDecorations(const SkDraw& draw, const SkPaint& paint, |
| 1333 const char text[], size_t byteLength, | 1334 const char text[], size_t byteLength, |
| 1334 SkScalar x, SkScalar y); | 1335 SkScalar x, SkScalar y); |
| 1335 | 1336 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1490 | 1491 |
| 1491 class SkCanvasClipVisitor { | 1492 class SkCanvasClipVisitor { |
| 1492 public: | 1493 public: |
| 1493 virtual ~SkCanvasClipVisitor(); | 1494 virtual ~SkCanvasClipVisitor(); |
| 1494 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1495 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
| 1495 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1496 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
| 1496 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1497 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
| 1497 }; | 1498 }; |
| 1498 | 1499 |
| 1499 #endif | 1500 #endif |
| OLD | NEW |