aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleShaderText.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'samplecode/SampleShaderText.cpp')
-rw-r--r--samplecode/SampleShaderText.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/samplecode/SampleShaderText.cpp b/samplecode/SampleShaderText.cpp
index 6855824d3f..c7048ab401 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);
}