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