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 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 // Clip rectangle bounds. Called internally by saveLayer. | 1350 // Clip rectangle bounds. Called internally by saveLayer. |
1351 // returns false if the entire rectangle is entirely clipped out | 1351 // returns false if the entire rectangle is entirely clipped out |
1352 // If non-NULL, The imageFilter parameter will be used to expand the clip | 1352 // If non-NULL, The imageFilter parameter will be used to expand the clip |
1353 // and offscreen bounds for any margin required by the filter DAG. | 1353 // and offscreen bounds for any margin required by the filter DAG. |
1354 bool clipRectBounds(const SkRect* bounds, SaveFlags flags, | 1354 bool clipRectBounds(const SkRect* bounds, SaveFlags flags, |
1355 SkIRect* intersection, | 1355 SkIRect* intersection, |
1356 const SkImageFilter* imageFilter = NULL); | 1356 const SkImageFilter* imageFilter = NULL); |
1357 | 1357 |
1358 // notify our surface (if we have one) that we are about to draw, so it | 1358 // notify our surface (if we have one) that we are about to draw, so it |
1359 // can perform copy-on-write or invalidate any cached images | 1359 // can perform copy-on-write or invalidate any cached images |
1360 void predrawNotify(); | 1360 void predrawNotify(bool completeOverwrite = false); |
| 1361 void predrawNotify(const SkRect*, const SkPaint*); |
1361 | 1362 |
1362 private: | 1363 private: |
1363 class MCRec; | 1364 class MCRec; |
1364 | 1365 |
1365 SkAutoTUnref<SkClipStack> fClipStack; | 1366 SkAutoTUnref<SkClipStack> fClipStack; |
1366 SkDeque fMCStack; | 1367 SkDeque fMCStack; |
1367 // points to top of stack | 1368 // points to top of stack |
1368 MCRec* fMCRec; | 1369 MCRec* fMCRec; |
1369 // the first N recs that can fit here mean we won't call malloc | 1370 // the first N recs that can fit here mean we won't call malloc |
1370 enum { | 1371 enum { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1446 void internalRestore(); | 1447 void internalRestore(); |
1447 static void DrawRect(const SkDraw& draw, const SkPaint& paint, | 1448 static void DrawRect(const SkDraw& draw, const SkPaint& paint, |
1448 const SkRect& r, SkScalar textSize); | 1449 const SkRect& r, SkScalar textSize); |
1449 static void DrawTextDecorations(const SkDraw& draw, const SkPaint& paint, | 1450 static void DrawTextDecorations(const SkDraw& draw, const SkPaint& paint, |
1450 const char text[], size_t byteLength, | 1451 const char text[], size_t byteLength, |
1451 SkScalar x, SkScalar y); | 1452 SkScalar x, SkScalar y); |
1452 | 1453 |
1453 // only for canvasutils | 1454 // only for canvasutils |
1454 const SkRegion& internal_private_getTotalClip() const; | 1455 const SkRegion& internal_private_getTotalClip() const; |
1455 | 1456 |
| 1457 bool willOverwriteAllPixels(const SkRect*, const SkPaint*) const; |
| 1458 |
| 1459 |
1456 /* These maintain a cache of the clip bounds in local coordinates, | 1460 /* These maintain a cache of the clip bounds in local coordinates, |
1457 (converted to 2s-compliment if floats are slow). | 1461 (converted to 2s-compliment if floats are slow). |
1458 */ | 1462 */ |
1459 mutable SkRect fCachedLocalClipBounds; | 1463 mutable SkRect fCachedLocalClipBounds; |
1460 mutable bool fCachedLocalClipBoundsDirty; | 1464 mutable bool fCachedLocalClipBoundsDirty; |
1461 bool fAllowSoftClip; | 1465 bool fAllowSoftClip; |
1462 bool fAllowSimplifyClip; | 1466 bool fAllowSimplifyClip; |
1463 bool fConservativeRasterClip; | 1467 bool fConservativeRasterClip; |
1464 | 1468 |
1465 const SkRect& getLocalClipBounds() const { | 1469 const SkRect& getLocalClipBounds() const { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 | 1589 |
1586 class SkCanvasClipVisitor { | 1590 class SkCanvasClipVisitor { |
1587 public: | 1591 public: |
1588 virtual ~SkCanvasClipVisitor(); | 1592 virtual ~SkCanvasClipVisitor(); |
1589 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1593 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1590 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1594 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1591 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1595 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1592 }; | 1596 }; |
1593 | 1597 |
1594 #endif | 1598 #endif |
OLD | NEW |