Index: src/views/SkWindow.cpp |
diff --git a/src/views/SkWindow.cpp b/src/views/SkWindow.cpp |
index 5451fca075ac369fddd2ded1795e158937b4aa71..cca291a4e9e176971bb7e743c9dddac1923ae844 100644 |
--- a/src/views/SkWindow.cpp |
+++ b/src/views/SkWindow.cpp |
@@ -51,9 +51,9 @@ SkWindow::SkWindow() : fFocusView(NULL) { |
fWaitingOnInval = false; |
#ifdef SK_BUILD_FOR_WINCE |
- fConfig = SkBitmap::kRGB_565_Config; |
+ fColorType = kRGB_565_SkColorType; |
#else |
- fConfig = SkBitmap::kARGB_8888_Config; |
+ fColorType = kPMColor_SkColorType; |
#endif |
fMatrix.reset(); |
@@ -87,18 +87,18 @@ void SkWindow::postConcat(const SkMatrix& matrix) { |
this->setMatrix(m); |
} |
-void SkWindow::setConfig(SkBitmap::Config config) { |
- this->resize(fBitmap.width(), fBitmap.height(), config); |
+void SkWindow::setColorType(SkColorType ct) { |
+ this->resize(fBitmap.width(), fBitmap.height(), ct); |
} |
-void SkWindow::resize(int width, int height, SkBitmap::Config config) { |
- if (config == SkBitmap::kNo_Config) |
- config = fConfig; |
+void SkWindow::resize(int width, int height, SkColorType ct) { |
+ if (ct == kUnknown_SkColorType) |
+ ct = fColorType; |
- if (width != fBitmap.width() || height != fBitmap.height() || config != fConfig) { |
- fConfig = config; |
- fBitmap.setConfig(config, width, height, 0, kOpaque_SkAlphaType); |
- fBitmap.allocPixels(); |
+ if (width != fBitmap.width() || height != fBitmap.height() || ct != fColorType) { |
+ fColorType = ct; |
+ fBitmap.allocPixels(SkImageInfo::Make(width, height, |
+ ct, kPremul_SkAlphaType)); |
this->setSize(SkIntToScalar(width), SkIntToScalar(height)); |
this->inval(NULL); |