Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Unified Diff: include/utils/SkPaintFilterCanvas.h

Issue 1576183002: SkTCopyOnFirstWrite-based SkPaintFilterCanvas API (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: minor cleanup Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkTLazy.h ('k') | samplecode/SampleApp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/utils/SkPaintFilterCanvas.h
diff --git a/include/utils/SkPaintFilterCanvas.h b/include/utils/SkPaintFilterCanvas.h
index 505f965565882f5784c7383e4f5b8f884a134e53..35e322175290b333901bc06fd94d8e58f222e48a 100644
--- a/include/utils/SkPaintFilterCanvas.h
+++ b/include/utils/SkPaintFilterCanvas.h
@@ -49,22 +49,18 @@ public:
protected:
/**
* Called with the paint that will be used to draw the specified type.
- *
- * Upon return, if filteredPaint is initialized it will replace the original paint
- * for the current draw. Note that that implementation is responsible for
- * initializing *filteredPaint (e.g. via set(*paint)).
+ * The implementation may modify the paint as they wish (using SkTCopyOnFirstWrite::writable).
*
* The result bool is used to determine whether the draw op is to be
- * executed (true) or skipped (false). When the draw is skipped, filteredPaint is
- * ignored.
+ * executed (true) or skipped (false).
*
* Note: The base implementation calls onFilter() for top-level/explicit paints only.
* To also filter encapsulated paints (e.g. SkPicture, SkTextBlob), clients may need to
* override the relevant methods (i.e. drawPicture, drawTextBlob).
*/
- virtual bool onFilter(const SkPaint* paint, Type type, SkTLazy<SkPaint>* filteredPaint) const {
- if (paint) {
- this->onFilterPaint(filteredPaint->set(*paint), type);
+ virtual bool onFilter(SkTCopyOnFirstWrite<SkPaint>* paint, Type type) const {
+ if (*paint) {
+ this->onFilterPaint(paint->writable(), type);
}
return true;
}
« no previous file with comments | « include/core/SkTLazy.h ('k') | samplecode/SampleApp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698