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

Unified Diff: samplecode/SampleColorFilter.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/SampleBlur.cpp ('k') | samplecode/SampleDash.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleColorFilter.cpp
diff --git a/samplecode/SampleColorFilter.cpp b/samplecode/SampleColorFilter.cpp
index 7218268b625e52ac7661381e88ad203eb2575bdf..2dc2e427dcf0292c6415eb2d6539ece1e5b302ce 100644
--- a/samplecode/SampleColorFilter.cpp
+++ b/samplecode/SampleColorFilter.cpp
@@ -88,8 +88,7 @@ static void test_5bits() {
SkShader* createChecker();
SkShader* createChecker() {
SkBitmap bm;
- bm.setConfig(SkBitmap::kARGB_8888_Config, 2, 2);
- bm.allocPixels();
+ bm.allocN32Pixels(2, 2);
bm.lockPixels();
*bm.getAddr32(0, 0) = *bm.getAddr32(1, 1) = SkPreMultiplyColor(0xFFFFFFFF);
*bm.getAddr32(0, 1) = *bm.getAddr32(1, 0) = SkPreMultiplyColor(0xFFCCCCCC);
@@ -104,8 +103,7 @@ SkShader* createChecker() {
static SkBitmap createBitmap(int n) {
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, n, n);
- bitmap.allocPixels();
+ bitmap.allocN32Pixels(n, n);
bitmap.eraseColor(SK_ColorTRANSPARENT);
SkCanvas canvas(bitmap);
« no previous file with comments | « samplecode/SampleBlur.cpp ('k') | samplecode/SampleDash.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698