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; |
}; |