aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-04-14 12:41:55 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-14 20:29:12 +0000
commitade76e9236788120d8a1a4a7a252d8f66b8b9b02 (patch)
treeb8a999464c435623d03f6b3e528a28c2cab4f5aa /src
parentdcbe2c8a567be14c7498639f0bd40d0b8c2058ea (diff)
getDeferredTextureImageData(): use legacy scaling in legacy mode
Bug:709341 Change-Id: I0dc1dcc3874f9741e0303e376a0ad4a68cd8b03e Reviewed-on: https://skia-review.googlesource.com/13500 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/image/SkImage_Gpu.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index f81708f051..97a657a680 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -621,6 +621,10 @@ size_t SkImage::getDeferredTextureImageData(const GrContextThreadSafeProxy& prox
if (!isScaled && this->peekPixels(&pixmap) && !pixmap.ctable()) {
info = pixmap.info();
pixelSize = SkAlign8(pixmap.getSafeSize());
+ if (!dstColorSpace) {
+ pixmap.setColorSpace(nullptr);
+ info = info.makeColorSpace(nullptr);
+ }
} else {
// Here we're just using presence of data to know whether there is a codec behind the image.
// In the future we will access the cacherator and get the exact data that we want to (e.g.
@@ -637,6 +641,9 @@ size_t SkImage::getDeferredTextureImageData(const GrContextThreadSafeProxy& prox
scaledSize.height());
} else {
info = as_IB(this)->onImageInfo().makeWH(scaledSize.width(), scaledSize.height());
+ if (!dstColorSpace) {
+ info = info.makeColorSpace(nullptr);
+ }
}
if (kIndex_8_SkColorType == info.colorType()) {
// Force Index8 to be N32 instead. Index8 is unsupported in Ganesh.
@@ -692,6 +699,7 @@ size_t SkImage::getDeferredTextureImageData(const GrContextThreadSafeProxy& prox
size_t colorSpaceSize = 0;
SkColorSpaceTransferFn fn;
if (info.colorSpace()) {
+ SkASSERT(dstColorSpace);
colorSpaceOffset = size;
colorSpaceSize = info.colorSpace()->writeToMemory(nullptr);
size += colorSpaceSize;