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

Unified Diff: src/views/SkWindow.cpp

Issue 1697863002: blitters for sRGB and float16 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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/image/SkSurface_Raster.cpp ('k') | no next file » | 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 0e6da0b02dd832eff4ca5e66cce033e8fcc43119..ebe56b0e9561d50ebb5eeb7dc2817d297d578f77 100644
--- a/src/views/SkWindow.cpp
+++ b/src/views/SkWindow.cpp
@@ -21,6 +21,8 @@ SkWindow::SkWindow()
fClicks.reset();
fWaitingOnInval = false;
fMatrix.reset();
+
+ fBitmap.allocN32Pixels(0, 0);
}
SkWindow::~SkWindow() {
@@ -52,13 +54,21 @@ void SkWindow::postConcat(const SkMatrix& matrix) {
this->setMatrix(m);
}
-void SkWindow::resize(int width, int height) {
- if (width != fBitmap.width() || height != fBitmap.height()) {
- fBitmap.allocPixels(SkImageInfo::Make(width, height, kN32_SkColorType,
- kPremul_SkAlphaType));
+void SkWindow::resize(const SkImageInfo& info) {
+ if (fBitmap.info() != info) {
+ fBitmap.allocPixels(info);
this->inval(nullptr);
}
- this->setSize(SkIntToScalar(width), SkIntToScalar(height));
+ this->setSize(SkIntToScalar(fBitmap.width()), SkIntToScalar(fBitmap.height()));
+}
+
+void SkWindow::resize(int width, int height) {
+ this->resize(fBitmap.info().makeWH(width, height));
+}
+
+void SkWindow::setColorType(SkColorType ct, SkColorProfileType pt) {
+ const SkImageInfo& info = fBitmap.info();
+ this->resize(SkImageInfo::Make(info.width(), info.height(), ct, kPremul_SkAlphaType, pt));
}
bool SkWindow::handleInval(const SkRect* localR) {
« no previous file with comments | « src/image/SkSurface_Raster.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698