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

Unified Diff: src/core/SkBitmapProcState.cpp

Issue 2029373004: respect srgb gamma when building mips (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix warning 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/SkBitmapProcState.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/SkBitmapProcState.cpp
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index 33dd8f5194e938891ef32731ec5901f4073e4521..900b367b5d0a926f1e296c0724b90df5d39d8bb1 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -37,18 +37,22 @@ extern void Clamp_S32_opaque_D32_nofilter_DX_shaderproc(const void*, int, int, u
#include "SkBitmapProcState_procs.h"
SkBitmapProcInfo::SkBitmapProcInfo(const SkBitmapProvider& provider,
- SkShader::TileMode tmx, SkShader::TileMode tmy)
+ SkShader::TileMode tmx, SkShader::TileMode tmy,
+ SkSourceGammaTreatment treatment)
: fProvider(provider)
, fTileModeX(tmx)
, fTileModeY(tmy)
+ , fSrcGammaTreatment(treatment)
, fBMState(nullptr)
{}
SkBitmapProcInfo::SkBitmapProcInfo(const SkBitmap& bm,
- SkShader::TileMode tmx, SkShader::TileMode tmy)
+ SkShader::TileMode tmx, SkShader::TileMode tmy,
+ SkSourceGammaTreatment treatment)
: fProvider(SkBitmapProvider(bm))
, fTileModeX(tmx)
, fTileModeY(tmy)
+ , fSrcGammaTreatment(treatment)
, fBMState(nullptr)
{}
@@ -129,7 +133,7 @@ bool SkBitmapProcInfo::init(const SkMatrix& inv, const SkPaint& paint) {
allow_ignore_fractional_translate = false;
}
- SkDefaultBitmapController controller;
+ SkDefaultBitmapController controller(fSrcGammaTreatment);
fBMState = controller.requestBitmap(fProvider, inv, paint.getFilterQuality(),
fBMStateStorage.get(), fBMStateStorage.size());
// Note : we allow the controller to return an empty (zero-dimension) result. Should we?
« no previous file with comments | « src/core/SkBitmapProcState.h ('k') | src/core/SkLightingShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698