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

Unified Diff: src/views/SkWindow.cpp

Issue 1595503002: SampleApp: Remove SkWindow::setColorType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: mac build fix Created 4 years, 11 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/SampleApp.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 d93bc96a66ae8df9214ac9d88f40357485b6846f..0e6da0b02dd832eff4ca5e66cce033e8fcc43119 100644
--- a/src/views/SkWindow.cpp
+++ b/src/views/SkWindow.cpp
@@ -20,7 +20,6 @@ SkWindow::SkWindow()
{
fClicks.reset();
fWaitingOnInval = false;
- fColorType = kN32_SkColorType;
fMatrix.reset();
}
@@ -53,22 +52,13 @@ void SkWindow::postConcat(const SkMatrix& matrix) {
this->setMatrix(m);
}
-void SkWindow::setColorType(SkColorType ct) {
- this->resize(fBitmap.width(), fBitmap.height(), ct);
-}
-
-void SkWindow::resize(int width, int height, SkColorType ct) {
- if (ct == kUnknown_SkColorType)
- ct = fColorType;
-
- 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));
+void SkWindow::resize(int width, int height) {
+ if (width != fBitmap.width() || height != fBitmap.height()) {
+ fBitmap.allocPixels(SkImageInfo::Make(width, height, kN32_SkColorType,
+ kPremul_SkAlphaType));
this->inval(nullptr);
}
+ this->setSize(SkIntToScalar(width), SkIntToScalar(height));
}
bool SkWindow::handleInval(const SkRect* localR) {
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | src/views/mac/SkNSView.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698