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

Unified Diff: samplecode/SampleUnpremul.cpp

Issue 834303005: Factor out checkerboard function in gm and sampleapp into tools. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rename to sk_tools::DrawCheckerboard Created 5 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 | « samplecode/SampleFatBits.cpp ('k') | tools/Checkerboard.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleUnpremul.cpp
diff --git a/samplecode/SampleUnpremul.cpp b/samplecode/SampleUnpremul.cpp
index 9591fec159797929a85de6a448defd9f0a205b63..889d06780e2a46bddcc5af247cab93205c530ead 100644
--- a/samplecode/SampleUnpremul.cpp
+++ b/samplecode/SampleUnpremul.cpp
@@ -7,6 +7,7 @@
#include "gm.h"
+#include "Checkerboard.h"
#include "Resources.h"
#include "SampleCode.h"
#include "SkBlurMask.h"
@@ -25,9 +26,6 @@
__SK_FORCE_IMAGE_DECODER_LINKING;
-// Defined in SampleColorFilter.cpp
-extern SkShader* createChecker();
-
/**
* Interprets c as an unpremultiplied color, and returns the
* premultiplied equivalent.
@@ -78,10 +76,7 @@ protected:
}
void onDrawBackground(SkCanvas* canvas) SK_OVERRIDE {
- SkPaint paint;
- SkAutoTUnref<SkShader> shader(createChecker());
- paint.setShader(shader.get());
- canvas->drawPaint(paint);
+ sk_tools::DrawCheckerboard(canvas, 0xFFCCCCCC, 0xFFFFFFFF, 12);
}
void onDrawContent(SkCanvas* canvas) SK_OVERRIDE {
« no previous file with comments | « samplecode/SampleFatBits.cpp ('k') | tools/Checkerboard.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698