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

Unified Diff: samplecode/SampleShaderText.cpp

Issue 169063002: use SkColorType instead of SkBitmap::Config in samplecode (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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/SampleRotateCircles.cpp ('k') | samplecode/SampleSlides.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleShaderText.cpp
diff --git a/samplecode/SampleShaderText.cpp b/samplecode/SampleShaderText.cpp
index 6855824d3fb669946c032b68b2e025979e8ff659..c7048ab401c37c5a928c8206ffc9ab5e08167303 100644
--- a/samplecode/SampleShaderText.cpp
+++ b/samplecode/SampleShaderText.cpp
@@ -11,9 +11,8 @@
#include "SkGradientShader.h"
#include "SkUnitMappers.h"
-static void makebm(SkBitmap* bm, SkBitmap::Config config, int w, int h) {
- bm->setConfig(config, w, h);
- bm->allocPixels();
+static void makebm(SkBitmap* bm, int w, int h) {
+ bm->allocN32Pixels(w, h);
bm->eraseColor(SK_ColorTRANSPARENT);
SkCanvas canvas(*bm);
@@ -39,7 +38,7 @@ static SkShader* MakeBitmapShader(SkShader::TileMode tx, SkShader::TileMode ty,
int w, int h) {
static SkBitmap bmp;
if (bmp.isNull()) {
- makebm(&bmp, SkBitmap::kARGB_8888_Config, w/2, h/4);
+ makebm(&bmp, w/2, h/4);
}
return SkShader::CreateBitmapShader(bmp, tx, ty);
}
« no previous file with comments | « samplecode/SampleRotateCircles.cpp ('k') | samplecode/SampleSlides.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698