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

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: Remove leftover comments 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
Index: src/core/SkImageCacherator.cpp
diff --git a/src/core/SkImageCacherator.cpp b/src/core/SkImageCacherator.cpp
index 4a8521743d3acad2ab9c0cf2a2e734e8319ae629..199ca946c5b83b7ff6c5f5666d90c155e96aee11 100644
--- a/src/core/SkImageCacherator.cpp
+++ b/src/core/SkImageCacherator.cpp
@@ -249,7 +249,7 @@ 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, bool gammaCorrect) {
// Values representing the various texture lock paths we can take. Used for logging the path
// taken to a histogram.
enum LockTexturePath {
@@ -315,7 +315,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, gammaCorrect);
}
if (!tex) {
tex = GrUploadBitmapToTexture(ctx, bitmap);
@@ -334,18 +334,20 @@ GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& key
///////////////////////////////////////////////////////////////////////////////////////////////////
GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParams& params,
- const SkImage* client, SkImage::CachingHint chint) {
+ bool gammaCorrect, 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, gammaCorrect);
}
#else
GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParams&,
- const SkImage* client, SkImage::CachingHint) {
+ bool gammaCorrect, const SkImage* client,
+ SkImage::CachingHint) {
return nullptr;
}
« no previous file with comments | « src/core/SkImageCacherator.h ('k') | src/core/SkLightingShader.cpp » ('j') | src/gpu/SkGr.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698