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

Unified Diff: gm/perspshaders.cpp

Issue 1320673011: Minor code cleanup (left over from prior CL) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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/offsetimagefilter.cpp ('k') | gm/repeated_bitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/perspshaders.cpp
diff --git a/gm/perspshaders.cpp b/gm/perspshaders.cpp
index 07a41e94667f4a947a05e00cbd5040a15931b8b3..59fab47fc8ed2d5c66b76d7f3bab373a7f87687f 100644
--- a/gm/perspshaders.cpp
+++ b/gm/perspshaders.cpp
@@ -23,15 +23,6 @@ static SkImage* make_image(SkCanvas* origCanvas, int w, int h) {
return surface->newImageSnapshot();
}
-static SkBitmap make_bitmap(int w, int h) {
- SkBitmap bitmap;
- bitmap.allocN32Pixels(w, h);
- SkCanvas canvas(bitmap);
-
- sk_tool_utils::draw_checkerboard(&canvas, SK_ColorBLUE, SK_ColorYELLOW, w/10);
- return bitmap;
-}
-
namespace skiagm {
class PerspShadersGM : public GM {
@@ -51,7 +42,9 @@ protected:
}
void onOnceBeforeDraw() override {
- fBitmap = make_bitmap(kCellSize, kCellSize);
+ fBitmap = sk_tool_utils::create_checkerboard_bitmap(kCellSize, kCellSize,
+ SK_ColorBLUE, SK_ColorYELLOW,
+ kCellSize/10);
fBitmapShader.reset(SkShader::CreateBitmapShader(fBitmap,
SkShader::kClamp_TileMode,
« no previous file with comments | « gm/offsetimagefilter.cpp ('k') | gm/repeated_bitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698