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

Unified Diff: src/core/SkBitmapProcShader.cpp

Issue 2029373004: respect srgb gamma when building mips (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Need to know when we're in L32 compatibility mode !!!? 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/SkBitmapProcShader.cpp
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index a372b5199041d9c608d608ecac302ae8f24aced6..50d3898a3ca957b70c9abdb2b0fe404a6ae9640f 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -226,10 +226,11 @@ SkShader::Context* SkBitmapProcShader::MakeContext(const SkShader& shader,
// Decide if we can/want to use the new linear pipeline
bool useLinearPipeline = choose_linear_pipeline(rec, provider.info());
+ SkMipMap::SrcGammaMode mode = SkMipMap::DeduceMode(rec);
if (useLinearPipeline) {
void* infoStorage = (char*)storage + sizeof(LinearPipelineContext);
- SkBitmapProcInfo* info = new (infoStorage) SkBitmapProcInfo(provider, tmx, tmy);
+ SkBitmapProcInfo* info = new (infoStorage) SkBitmapProcInfo(provider, tmx, tmy, mode);
if (!info->init(totalInverse, *rec.fPaint)) {
info->~SkBitmapProcInfo();
return nullptr;
@@ -238,7 +239,7 @@ SkShader::Context* SkBitmapProcShader::MakeContext(const SkShader& shader,
return new (storage) LinearPipelineContext(shader, rec, info);
} else {
void* stateStorage = (char*)storage + sizeof(BitmapProcShaderContext);
- SkBitmapProcState* state = new (stateStorage) SkBitmapProcState(provider, tmx, tmy);
+ SkBitmapProcState* state = new (stateStorage) SkBitmapProcState(provider, tmx, tmy, mode);
if (!state->setup(totalInverse, *rec.fPaint)) {
state->~SkBitmapProcState();
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698