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

Unified Diff: gm/textbloblooper.cpp

Issue 1821533002: guard rasterizer and drawlooper setters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: guard google3 Created 4 years, 9 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 | « gm/shadows.cpp ('k') | gm/texteffects.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/textbloblooper.cpp
diff --git a/gm/textbloblooper.cpp b/gm/textbloblooper.cpp
index d54490272c8e52b513bcaebab25df1f2942b75f6..d9701131a407f2dae3766b777b3a37826758d77f 100644
--- a/gm/textbloblooper.cpp
+++ b/gm/textbloblooper.cpp
@@ -107,10 +107,10 @@ static void kitchen_sink(SkPaint* paint) {
}
-static SkLayerDrawLooper* setupLooper(SkLayerDrawLooper::BitFlags bits,
- LooperProc proc,
- const LooperSettings settings[],
- size_t size) {
+static sk_sp<SkDrawLooper> setupLooper(SkLayerDrawLooper::BitFlags bits,
+ LooperProc proc,
+ const LooperSettings settings[],
+ size_t size) {
SkLayerDrawLooper::Builder looperBuilder;
SkLayerDrawLooper::LayerInfo info;
@@ -129,7 +129,7 @@ static SkLayerDrawLooper* setupLooper(SkLayerDrawLooper::BitFlags bits,
(*proc)(paint);
}
}
- return looperBuilder.detachLooper();
+ return looperBuilder.detach();
}
class TextBlobLooperGM : public GM {
@@ -186,33 +186,33 @@ protected:
{ SkXfermode::kSrcOver_Mode, 0x50FF00FF, SkPaint::kFill_Style, 0, 20.f, 0, false },
};
- fLoopers.push_back().reset(setupLooper(SkLayerDrawLooper::kMaskFilter_Bit |
- SkLayerDrawLooper::kXfermode_Bit |
- SkLayerDrawLooper::kStyle_Bit, &mask_filter,
- compound, SK_ARRAY_COUNT(compound)));
- fLoopers.push_back().reset(setupLooper(SkLayerDrawLooper::kPathEffect_Bit |
- SkLayerDrawLooper::kXfermode_Bit, &path_effect,
- looperSandwhich, SK_ARRAY_COUNT(looperSandwhich)));
- fLoopers.push_back().reset(setupLooper(SkLayerDrawLooper::kShader_Bit |
- SkLayerDrawLooper::kColorFilter_Bit |
- SkLayerDrawLooper::kXfermode_Bit, &color_filter,
- looperSandwhich, SK_ARRAY_COUNT(looperSandwhich)));
- fLoopers.push_back().reset(setupLooper(SkLayerDrawLooper::kShader_Bit |
- SkLayerDrawLooper::kColorFilter_Bit |
- SkLayerDrawLooper::kXfermode_Bit, &color_filter,
- xfermode, SK_ARRAY_COUNT(xfermode)));
- fLoopers.push_back().reset(setupLooper(0, nullptr, skew, SK_ARRAY_COUNT(skew)));
- fLoopers.push_back().reset(setupLooper(SkLayerDrawLooper::kMaskFilter_Bit |
- SkLayerDrawLooper::kShader_Bit |
- SkLayerDrawLooper::kColorFilter_Bit |
- SkLayerDrawLooper::kPathEffect_Bit |
- SkLayerDrawLooper::kStyle_Bit |
- SkLayerDrawLooper::kXfermode_Bit, &kitchen_sink,
- kitchenSink, SK_ARRAY_COUNT(kitchenSink)));
+ fLoopers.push_back(setupLooper(SkLayerDrawLooper::kMaskFilter_Bit |
+ SkLayerDrawLooper::kXfermode_Bit |
+ SkLayerDrawLooper::kStyle_Bit, &mask_filter,
+ compound, SK_ARRAY_COUNT(compound)));
+ fLoopers.push_back(setupLooper(SkLayerDrawLooper::kPathEffect_Bit |
+ SkLayerDrawLooper::kXfermode_Bit, &path_effect,
+ looperSandwhich, SK_ARRAY_COUNT(looperSandwhich)));
+ fLoopers.push_back(setupLooper(SkLayerDrawLooper::kShader_Bit |
+ SkLayerDrawLooper::kColorFilter_Bit |
+ SkLayerDrawLooper::kXfermode_Bit, &color_filter,
+ looperSandwhich, SK_ARRAY_COUNT(looperSandwhich)));
+ fLoopers.push_back(setupLooper(SkLayerDrawLooper::kShader_Bit |
+ SkLayerDrawLooper::kColorFilter_Bit |
+ SkLayerDrawLooper::kXfermode_Bit, &color_filter,
+ xfermode, SK_ARRAY_COUNT(xfermode)));
+ fLoopers.push_back(setupLooper(0, nullptr, skew, SK_ARRAY_COUNT(skew)));
+ fLoopers.push_back(setupLooper(SkLayerDrawLooper::kMaskFilter_Bit |
+ SkLayerDrawLooper::kShader_Bit |
+ SkLayerDrawLooper::kColorFilter_Bit |
+ SkLayerDrawLooper::kPathEffect_Bit |
+ SkLayerDrawLooper::kStyle_Bit |
+ SkLayerDrawLooper::kXfermode_Bit, &kitchen_sink,
+ kitchenSink, SK_ARRAY_COUNT(kitchenSink)));
// Test we respect overrides
- fLoopers.push_back().reset(setupLooper(0, &kitchen_sink,
- kitchenSink, SK_ARRAY_COUNT(kitchenSink)));
+ fLoopers.push_back(setupLooper(0, &kitchen_sink,
+ kitchenSink, SK_ARRAY_COUNT(kitchenSink)));
}
SkString onShortName() override {
@@ -247,7 +247,7 @@ protected:
private:
SkAutoTUnref<const SkTextBlob> fBlob;
- SkTArray<SkAutoTUnref<SkLayerDrawLooper>, true> fLoopers;
+ SkTArray<sk_sp<SkDrawLooper>, true> fLoopers;
typedef GM INHERITED;
};
« no previous file with comments | « gm/shadows.cpp ('k') | gm/texteffects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698