Index: src/utils/SkPaintFilterCanvas.cpp |
diff --git a/src/utils/SkPaintFilterCanvas.cpp b/src/utils/SkPaintFilterCanvas.cpp |
index 0a5b7e66295fb6b6510c0760eea71b5cb492aab1..ea94068cb6e754ef913e0c6755eddfc564a6948c 100644 |
--- a/src/utils/SkPaintFilterCanvas.cpp |
+++ b/src/utils/SkPaintFilterCanvas.cpp |
@@ -13,23 +13,20 @@ |
class SkPaintFilterCanvas::AutoPaintFilter { |
public: |
AutoPaintFilter(const SkPaintFilterCanvas* canvas, Type type, const SkPaint* paint) |
- : fOrigPaint(paint) { |
- fShouldDraw = canvas->onFilter(fOrigPaint, type, &fFilteredPaint); |
+ : fPaint(paint) { |
+ fShouldDraw = canvas->onFilter(&fPaint, type); |
} |
AutoPaintFilter(const SkPaintFilterCanvas* canvas, Type type, const SkPaint& paint) |
: AutoPaintFilter(canvas, type, &paint) { } |
- const SkPaint* paint() const { |
- return fFilteredPaint.isValid() ? fFilteredPaint.get() : fOrigPaint; |
- } |
+ const SkPaint* paint() const { return fPaint; } |
bool shouldDraw() const { return fShouldDraw; } |
private: |
- const SkPaint* fOrigPaint; |
- SkTLazy<SkPaint> fFilteredPaint; |
- bool fShouldDraw; |
+ SkTCopyOnFirstWrite<SkPaint> fPaint; |
+ bool fShouldDraw; |
}; |
SkPaintFilterCanvas::SkPaintFilterCanvas(int width, int height) : INHERITED(width, height) { } |