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

Unified Diff: gm/lightingshader.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/lighting.cpp ('k') | gm/matrixconvolution.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/lightingshader.cpp
diff --git a/gm/lightingshader.cpp b/gm/lightingshader.cpp
index 8bb3595a7842374f8f53ddcbb7027659f952ad3a..9c45c9b78309e240e37c730443e645cdf3fcd84b 100644
--- a/gm/lightingshader.cpp
+++ b/gm/lightingshader.cpp
@@ -11,18 +11,6 @@
#include "SkPoint3.h"
#include "SkShader.h"
-static SkBitmap make_checkerboard(int texSize) {
- SkBitmap bitmap;
- bitmap.allocN32Pixels(texSize, texSize);
-
- SkCanvas canvas(bitmap);
- sk_tool_utils::draw_checkerboard(&canvas,
- sk_tool_utils::color_to_565(0x0),
- sk_tool_utils::color_to_565(0xFF804020),
- 8);
- return bitmap;
-}
-
// Create a hemispherical normal map
static SkBitmap make_hemi_normalmap(int texSize) {
SkBitmap hemi;
@@ -87,7 +75,11 @@ protected:
}
void onOnceBeforeDraw() override {
- fDiffuse = make_checkerboard(kTexSize);
+ fDiffuse = sk_tool_utils::create_checkerboard_bitmap(
+ kTexSize, kTexSize,
+ sk_tool_utils::color_to_565(0x0),
+ sk_tool_utils::color_to_565(0xFF804020),
+ 8);
fNormalMaps[kHemi_NormalMap] = make_hemi_normalmap(kTexSize);
fNormalMaps[kFrustum_NormalMap] = make_frustum_normalmap(kTexSize);
« no previous file with comments | « gm/lighting.cpp ('k') | gm/matrixconvolution.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698