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

Unified Diff: src/views/SkWindow.cpp

Issue 168843002: use SkColorType instead of SkBitmap::Config in views/effects (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 | « src/views/SkWidgets.cpp ('k') | src/views/mac/SkNSView.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/views/SkWidgets.cpp ('k') | src/views/mac/SkNSView.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698