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

Unified Diff: src/image/SkImage_Gpu.cpp

Issue 2416453004: Preserve color space of images in deferred texture API (Closed)
Patch Set: Rebase Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Gpu.cpp
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index b769e0a68409d9e6f7678602134a18a643885a5c..af1668193384d398dc140b8980ef0bfb00593867 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -492,7 +492,7 @@ size_t SkImage::getDeferredTextureImageData(const GrContextThreadSafeProxy& prox
if (!data && !this->peekPixels(nullptr)) {
return 0;
}
- info = SkImageInfo::MakeN32(scaledSize.width(), scaledSize.height(), this->alphaType());
+ info = as_IB(this)->onImageInfo().makeWH(scaledSize.width(), scaledSize.height());
pixelSize = SkAlign8(SkAutoPixmapStorage::AllocSize(info, nullptr));
if (fillMode) {
pixmap.alloc(info);
@@ -509,7 +509,6 @@ size_t SkImage::getDeferredTextureImageData(const GrContextThreadSafeProxy& prox
SkASSERT(!pixmap.ctable());
}
}
- SkAlphaType at = this->isOpaque() ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
int mipMapLevelCount = 1;
if (useMipMaps) {
// SkMipMap only deals with the mipmap levels it generates, which does
@@ -528,7 +527,7 @@ size_t SkImage::getDeferredTextureImageData(const GrContextThreadSafeProxy& prox
currentMipMapLevelIndex--) {
SkISize mipSize = SkMipMap::ComputeLevelSize(scaledSize.width(), scaledSize.height(),
currentMipMapLevelIndex);
- SkImageInfo mipInfo = SkImageInfo::MakeN32(mipSize.fWidth, mipSize.fHeight, at);
+ SkImageInfo mipInfo = info.makeWH(mipSize.fWidth, mipSize.fHeight);
pixelSize += SkAlign8(SkAutoPixmapStorage::AllocSize(mipInfo, nullptr));
}
}
@@ -614,10 +613,6 @@ size_t SkImage::getDeferredTextureImageData(const GrContextThreadSafeProxy& prox
// range 0-(x-1).
for (int generatedMipLevelIndex = 0; generatedMipLevelIndex < mipMapLevelCount - 1;
generatedMipLevelIndex++) {
- SkISize mipSize = SkMipMap::ComputeLevelSize(scaledSize.width(), scaledSize.height(),
- generatedMipLevelIndex);
-
- SkImageInfo mipInfo = SkImageInfo::MakeN32(mipSize.fWidth, mipSize.fHeight, at);
SkMipMap::Level mipLevel;
mipmaps->getLevel(generatedMipLevelIndex, &mipLevel);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698