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

Unified Diff: src/core/SkImageCacherator.cpp

Issue 2037413002: Add SkSourceGammaTreatment enum so we know how to create mips (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix DM compilation Created 4 years, 6 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/core/SkImageCacherator.h ('k') | src/core/SkLightingShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageCacherator.cpp
diff --git a/src/core/SkImageCacherator.cpp b/src/core/SkImageCacherator.cpp
index 4a8521743d3acad2ab9c0cf2a2e734e8319ae629..b4101f15c73b59ccffcf48b76eb6605ff52b342a 100644
--- a/src/core/SkImageCacherator.cpp
+++ b/src/core/SkImageCacherator.cpp
@@ -249,7 +249,8 @@ static GrTexture* set_key_and_return(GrTexture* tex, const GrUniqueKey& key) {
*/
GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& key,
const SkImage* client, SkImage::CachingHint chint,
- bool willBeMipped) {
+ bool willBeMipped,
+ SkSourceGammaTreatment gammaTreatment) {
// Values representing the various texture lock paths we can take. Used for logging the path
// taken to a histogram.
enum LockTexturePath {
@@ -315,7 +316,7 @@ GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& key
if (this->tryLockAsBitmap(&bitmap, client, chint)) {
GrTexture* tex = nullptr;
if (willBeMipped) {
- tex = GrGenerateMipMapsAndUploadToTexture(ctx, bitmap);
+ tex = GrGenerateMipMapsAndUploadToTexture(ctx, bitmap, gammaTreatment);
}
if (!tex) {
tex = GrUploadBitmapToTexture(ctx, bitmap);
@@ -334,17 +335,20 @@ GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& key
///////////////////////////////////////////////////////////////////////////////////////////////////
GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParams& params,
+ SkSourceGammaTreatment gammaTreatment,
const SkImage* client, SkImage::CachingHint chint) {
if (!ctx) {
return nullptr;
}
- return GrImageTextureMaker(ctx, this, client, chint).refTextureForParams(params);
+ return GrImageTextureMaker(ctx, this, client, chint).refTextureForParams(params,
+ gammaTreatment);
}
#else
GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParams&,
+ SkSourceGammaTreatment gammaTreatment,
const SkImage* client, SkImage::CachingHint) {
return nullptr;
}
« no previous file with comments | « src/core/SkImageCacherator.h ('k') | src/core/SkLightingShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698