blitters for sRGB and float16
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1697863002
Review URL: https://codereview.chromium.org/1697863002
diff --git a/src/views/SkWindow.cpp b/src/views/SkWindow.cpp
index 0e6da0b..ebe56b0 100644
--- a/src/views/SkWindow.cpp
+++ b/src/views/SkWindow.cpp
@@ -21,6 +21,8 @@
fClicks.reset();
fWaitingOnInval = false;
fMatrix.reset();
+
+ fBitmap.allocN32Pixels(0, 0);
}
SkWindow::~SkWindow() {
@@ -52,13 +54,21 @@
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) {