aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/views/SkWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/SkWindow.cpp')
-rw-r--r--src/views/SkWindow.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/views/SkWindow.cpp b/src/views/SkWindow.cpp
index 5451fca075..cca291a4e9 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);