| 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 kIsOpaque_SaveLayerFlag = 1 << 0, | 415 kIsOpaque_SaveLayerFlag = 1 << 0, |
| 416 kPreserveLCDText_SaveLayerFlag = 1 << 1, | 416 kPreserveLCDText_SaveLayerFlag = 1 << 1, |
| 417 | 417 |
| 418 #ifdef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG | 418 #ifdef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG |
| 419 kDontClipToLayer_Legacy_SaveLayerFlag = kDontClipToLayer_PrivateSaveLaye
rFlag, | 419 kDontClipToLayer_Legacy_SaveLayerFlag = kDontClipToLayer_PrivateSaveLaye
rFlag, |
| 420 #endif | 420 #endif |
| 421 }; | 421 }; |
| 422 typedef uint32_t SaveLayerFlags; | 422 typedef uint32_t SaveLayerFlags; |
| 423 | 423 |
| 424 struct SaveLayerRec { | 424 struct SaveLayerRec { |
| 425 SaveLayerRec() | 425 SaveLayerRec() : fBounds(nullptr), fPaint(nullptr), fSaveLayerFlags(0) {
} |
| 426 : fBounds(nullptr), fPaint(nullptr), fBackdrop(nullptr), fSaveLayerF
lags(0) | |
| 427 {} | |
| 428 SaveLayerRec(const SkRect* bounds, const SkPaint* paint, SaveLayerFlags
saveLayerFlags = 0) | 426 SaveLayerRec(const SkRect* bounds, const SkPaint* paint, SaveLayerFlags
saveLayerFlags = 0) |
| 429 : fBounds(bounds) | 427 : fBounds(bounds) |
| 430 , fPaint(paint) | 428 , fPaint(paint) |
| 431 , fBackdrop(nullptr) | |
| 432 , fSaveLayerFlags(saveLayerFlags) | |
| 433 {} | |
| 434 SaveLayerRec(const SkRect* bounds, const SkPaint* paint, const SkImageFi
lter* backdrop, | |
| 435 SaveLayerFlags saveLayerFlags) | |
| 436 : fBounds(bounds) | |
| 437 , fPaint(paint) | |
| 438 , fBackdrop(backdrop) | |
| 439 , fSaveLayerFlags(saveLayerFlags) | 429 , fSaveLayerFlags(saveLayerFlags) |
| 440 {} | 430 {} |
| 441 | 431 |
| 442 const SkRect* fBounds; // optional | 432 const SkRect* fBounds; // optional |
| 443 const SkPaint* fPaint; // optional | 433 const SkPaint* fPaint; // optional |
| 444 const SkImageFilter* fBackdrop; // optional | 434 SaveLayerFlags fSaveLayerFlags; |
| 445 SaveLayerFlags fSaveLayerFlags; | |
| 446 }; | 435 }; |
| 447 | 436 |
| 448 int saveLayer(const SaveLayerRec&); | 437 int saveLayer(const SaveLayerRec&); |
| 449 | 438 |
| 450 /** This call balances a previous call to save(), and is used to remove all | 439 /** This call balances a previous call to save(), and is used to remove all |
| 451 modifications to the matrix/clip/drawFilter state since the last save | 440 modifications to the matrix/clip/drawFilter state since the last save |
| 452 call. | 441 call. |
| 453 It is an error to call restore() more times than save() was called. | 442 It is an error to call restore() more times than save() was called. |
| 454 */ | 443 */ |
| 455 void restore(); | 444 void restore(); |
| (...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1585 | 1574 |
| 1586 class SkCanvasClipVisitor { | 1575 class SkCanvasClipVisitor { |
| 1587 public: | 1576 public: |
| 1588 virtual ~SkCanvasClipVisitor(); | 1577 virtual ~SkCanvasClipVisitor(); |
| 1589 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1578 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
| 1590 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1579 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
| 1591 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1580 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
| 1592 }; | 1581 }; |
| 1593 | 1582 |
| 1594 #endif | 1583 #endif |
| OLD | NEW |