use SkColorType instead of SkBitmap::Config in views/effects
R=scroggo@google.com, reed@google.com
TBR=scroggo
Author: reed@chromium.org
Review URL: https://codereview.chromium.org/168843002
git-svn-id: http://skia.googlecode.com/svn/trunk@13469 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 15e56a3..5b37662 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -442,39 +442,6 @@
}
}
-#if 0
-#include <CoreFoundation/CoreFoundation.h>
-#include <CoreFoundation/CFURLAccess.h>
-
-static void testpdf() {
- CFStringRef path = CFStringCreateWithCString(NULL, "/test.pdf",
- kCFStringEncodingUTF8);
- CFURLRef url = CFURLCreateWithFileSystemPath(NULL, path,
- kCFURLPOSIXPathStyle,
- false);
- CFRelease(path);
- CGRect box = CGRectMake(0, 0, 8*72, 10*72);
- CGContextRef cg = CGPDFContextCreateWithURL(url, &box, NULL);
- CFRelease(url);
-
- CGContextBeginPage(cg, &box);
- CGRect r = CGRectMake(10, 10, 40 + 0.5, 50 + 0.5);
- CGContextFillEllipseInRect(cg, r);
- CGContextEndPage(cg);
- CGContextRelease(cg);
-
- if (false) {
- SkBitmap bm;
- bm.setConfig(SkBitmap::kA8_Config, 64, 64);
- bm.allocPixels();
- bm.eraseColor(SK_ColorTRANSPARENT);
-
- SkCanvas canvas(bm);
-
- }
-}
-#endif
-
//////////////////////////////////////////////////////////////////////////////
enum FlipAxisEnum {
@@ -991,8 +958,7 @@
fSlideMenu = new SkOSMenu;
this->addMenu(fSlideMenu);
-// this->setConfig(SkBitmap::kRGB_565_Config);
- this->setConfig(SkBitmap::kARGB_8888_Config);
+ this->setColorType(kPMColor_SkColorType);
this->setVisibleP(true);
this->setClipToBounds(false);
@@ -1600,17 +1566,18 @@
canvas->setDrawFilter(NULL);
}
-static SkBitmap::Config gConfigCycle[] = {
- SkBitmap::kNo_Config, // none -> none
- SkBitmap::kNo_Config, // a8 -> none
- SkBitmap::kNo_Config, // index8 -> none
- SkBitmap::kARGB_4444_Config, // 565 -> 4444
- SkBitmap::kARGB_8888_Config, // 4444 -> 8888
- SkBitmap::kRGB_565_Config // 8888 -> 565
+static SkColorType gColorTypeCycle[] = {
+ kUnknown_SkColorType, // none -> none
+ kUnknown_SkColorType, // a8 -> none
+ kARGB_4444_SkColorType, // 565 -> 4444
+ kPMColor_SkColorType, // 4444 -> 8888
+ kRGB_565_SkColorType, // 8888 -> 565
+ kRGB_565_SkColorType, // 8888 -> 565
+ kUnknown_SkColorType, // index8 -> none
};
-static SkBitmap::Config cycle_configs(SkBitmap::Config c) {
- return gConfigCycle[c];
+static SkColorType cycle_configs(SkColorType c) {
+ return gColorTypeCycle[c];
}
void SampleWindow::changeZoomLevel(float delta) {
@@ -2007,7 +1974,7 @@
if (USE_ARROWS_FOR_ZOOM) {
this->changeZoomLevel(-1.f / 32.f);
} else {
- this->setConfig(cycle_configs(this->getBitmap().config()));
+ this->setColorType(cycle_configs(this->getBitmap().colorType()));
this->updateTitle();
}
return true;