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

Unified Diff: src/gpu/GrImageIDTextureAdjuster.cpp

Issue 2150113002: Add getColorSpace to GrTextureProducer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix newline Created 4 years, 5 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/gpu/GrImageIDTextureAdjuster.h ('k') | src/gpu/GrTextureParamsAdjuster.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrImageIDTextureAdjuster.cpp
diff --git a/src/gpu/GrImageIDTextureAdjuster.cpp b/src/gpu/GrImageIDTextureAdjuster.cpp
index 4ff3ed5d956f4e4daec4ee597e175cab2d55d381..4b57757da60f27a719a5336861a9fbad8fc48aaf 100644
--- a/src/gpu/GrImageIDTextureAdjuster.cpp
+++ b/src/gpu/GrImageIDTextureAdjuster.cpp
@@ -41,6 +41,10 @@ void GrBitmapTextureAdjuster::didCacheCopy(const GrUniqueKey& copyKey) {
GrInstallBitmapUniqueKeyInvalidator(copyKey, fBmp->pixelRef());
}
+SkColorSpace* GrBitmapTextureAdjuster::getColorSpace() {
+ return fBmp->colorSpace();
+}
+
//////////////////////////////////////////////////////////////////////////////
// SkImage's don't have a way of communicating whether they're alpha-only. So we fallback to
@@ -67,6 +71,10 @@ void GrImageTextureAdjuster::didCacheCopy(const GrUniqueKey& copyKey) {
// We don't currently have a mechanism for notifications on Images!
}
+SkColorSpace* GrImageTextureAdjuster::getColorSpace() {
+ return fImageBase->onImageInfo().colorSpace();
+}
+
//////////////////////////////////////////////////////////////////////////////
GrBitmapTextureMaker::GrBitmapTextureMaker(GrContext* context, const SkBitmap& bitmap)
@@ -114,6 +122,10 @@ void GrBitmapTextureMaker::didCacheCopy(const GrUniqueKey& copyKey) {
GrInstallBitmapUniqueKeyInvalidator(copyKey, fBitmap.pixelRef());
}
+SkColorSpace* GrBitmapTextureMaker::getColorSpace() {
+ return fBitmap.colorSpace();
+}
+
//////////////////////////////////////////////////////////////////////////////
static bool cacher_is_alpha_only(const SkImageCacherator& cacher) {
return kAlpha_8_SkColorType == cacher.info().colorType();
@@ -148,3 +160,7 @@ void GrImageTextureMaker::didCacheCopy(const GrUniqueKey& copyKey) {
as_IB(fClient)->notifyAddedToCache();
}
}
+
+SkColorSpace* GrImageTextureMaker::getColorSpace() {
+ return fCacher->info().colorSpace();
+}
« no previous file with comments | « src/gpu/GrImageIDTextureAdjuster.h ('k') | src/gpu/GrTextureParamsAdjuster.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698