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

Unified Diff: gm/composeshader.cpp

Issue 1544873002: handle halfway case in scan converter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add more comments Created 4 years, 12 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 | « no previous file | include/core/SkRect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | include/core/SkRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698