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

Unified Diff: samplecode/SampleApp.cpp

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/utils/SkPaintFilterCanvas.h ('k') | src/utils/SkPaintFilterCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleApp.cpp
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index ce2cfb259009bf54ec22779aaa43853c2f15cf6a..a3a81d8516843ed18e09555b02db35153a5e0307 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -475,27 +475,25 @@ public:
}
protected:
- bool onFilter(const SkPaint* paint, Type t, SkTLazy<SkPaint>* filteredPaint) const override {
- if (!paint) {
+ bool onFilter(SkTCopyOnFirstWrite<SkPaint>* paint, Type t) const override {
+ if (!*paint) {
return true;
}
- filteredPaint->set(*paint);
if (kText_Type == t && SkOSMenu::kMixedState != fLCDState) {
- filteredPaint->get()->setLCDRenderText(SkOSMenu::kOnState == fLCDState);
+ paint->writable()->setLCDRenderText(SkOSMenu::kOnState == fLCDState);
}
if (SkOSMenu::kMixedState != fAAState) {
- filteredPaint->get()->setAntiAlias(SkOSMenu::kOnState == fAAState);
+ paint->writable()->setAntiAlias(SkOSMenu::kOnState == fAAState);
}
if (0 != fFilterQualityIndex) {
- filteredPaint->get()->setFilterQuality(
- gFilterQualityStates[fFilterQualityIndex].fQuality);
+ paint->writable()->setFilterQuality(gFilterQualityStates[fFilterQualityIndex].fQuality);
}
if (SkOSMenu::kMixedState != fSubpixelState) {
- filteredPaint->get()->setSubpixelText(SkOSMenu::kOnState == fSubpixelState);
+ paint->writable()->setSubpixelText(SkOSMenu::kOnState == fSubpixelState);
}
if (0 != fHintingState && fHintingState < (int)SK_ARRAY_COUNT(gHintingStates)) {
- filteredPaint->get()->setHinting(gHintingStates[fHintingState].hinting);
+ paint->writable()->setHinting(gHintingStates[fHintingState].hinting);
}
return true;
}
« no previous file with comments | « include/utils/SkPaintFilterCanvas.h ('k') | src/utils/SkPaintFilterCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698