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

Unified Diff: src/utils/debugger/SkDebugCanvas.cpp

Issue 1577933002: SkPaintFilterCanvas skip-draw support (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: lazy paint copy + missing onDrawImageNine override 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 | « src/utils/SkPaintFilterCanvas.cpp ('k') | tests/CanvasTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/debugger/SkDebugCanvas.cpp
diff --git a/src/utils/debugger/SkDebugCanvas.cpp b/src/utils/debugger/SkDebugCanvas.cpp
index 560976cbb7b3261c5c68f6e4c717c62c84cb9bc9..9f11a9e3f31d11c253a3ee8e1764391c92cb93cb 100644
--- a/src/utils/debugger/SkDebugCanvas.cpp
+++ b/src/utils/debugger/SkDebugCanvas.cpp
@@ -69,15 +69,19 @@ public:
, fFilterQuality(quality) {}
protected:
- void onFilterPaint(SkPaint* paint, Type) const override {
- if (nullptr != fOverdrawXfermode.get()) {
- paint->setAntiAlias(false);
- paint->setXfermode(fOverdrawXfermode.get());
- }
+ bool onFilter(const SkPaint* paint, Type, SkTLazy<SkPaint>* filteredPaint) const override {
+ if (paint) {
+ filteredPaint->set(*paint);
+ if (nullptr != fOverdrawXfermode.get()) {
+ filteredPaint->get()->setAntiAlias(false);
+ filteredPaint->get()->setXfermode(fOverdrawXfermode.get());
+ }
- if (fOverrideFilterQuality) {
- paint->setFilterQuality(fFilterQuality);
+ if (fOverrideFilterQuality) {
+ filteredPaint->get()->setFilterQuality(fFilterQuality);
+ }
}
+ return true;
}
void onDrawPicture(const SkPicture* picture,
« no previous file with comments | « src/utils/SkPaintFilterCanvas.cpp ('k') | tests/CanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698