Index: gm/composeshader.cpp |
diff --git a/gm/composeshader.cpp b/gm/composeshader.cpp |
index e012bbb28590b21282b59b47a3da5173c4e8603b..b2be9ba28e463b7aba3b22d053406e5d835ef28e 100644 |
--- a/gm/composeshader.cpp |
+++ b/gm/composeshader.cpp |
@@ -162,7 +162,14 @@ static SkShader* make_linear_gradient_shader(int length) { |
class ComposeShaderBitmapGM : public skiagm::GM { |
public: |
- ComposeShaderBitmapGM() { |
+ ComposeShaderBitmapGM() |
+ : fColorBitmapShader(nullptr) |
+ , fAlpha8BitmapShader(nullptr) |
+ , fLinearGradientShader(nullptr) |
+ { |
+ } |
+ |
+ void onOnceBeforeDraw() override { |
draw_color_bm(&fColorBitmap, squareLength); |
draw_alpha8_bm(&fAlpha8Bitmap, squareLength); |
SkMatrix s; |
@@ -173,6 +180,7 @@ public: |
SkShader::kRepeat_TileMode, &s); |
fLinearGradientShader = make_linear_gradient_shader(squareLength); |
} |
+ |
~ComposeShaderBitmapGM() { |
SkSafeUnref(fColorBitmapShader); |
SkSafeUnref(fAlpha8BitmapShader); |