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

Unified Diff: src/core/SkLightingShader.cpp

Issue 1343123005: use SkBitmapProvider for shader-context (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: restore privacy Created 5 years, 3 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.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLightingShader.cpp
diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp
index 4ab233a82890c37ace8e9362a0976443a772d19d..2907dba7d57f816f273c9cc8fd2694805c14aeba 100644
--- a/src/core/SkLightingShader.cpp
+++ b/src/core/SkLightingShader.cpp
@@ -664,24 +664,18 @@ SkShader::Context* SkLightingShaderImpl::onCreateContext(const ContextRec& rec,
}
void* diffuseStateStorage = (char*)storage + sizeof(LightingShaderContext);
- SkBitmapProcState* diffuseState = new (diffuseStateStorage) SkBitmapProcState;
+ SkBitmapProcState* diffuseState = new (diffuseStateStorage) SkBitmapProcState(fDiffuseMap,
+ SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);
SkASSERT(diffuseState);
-
- diffuseState->fTileModeX = SkShader::kClamp_TileMode;
- diffuseState->fTileModeY = SkShader::kClamp_TileMode;
- diffuseState->fOrigBitmap = fDiffuseMap;
if (!diffuseState->chooseProcs(diffTotalInv, *rec.fPaint)) {
diffuseState->~SkBitmapProcState();
return nullptr;
}
void* normalStateStorage = (char*)storage + sizeof(LightingShaderContext) + sizeof(SkBitmapProcState);
- SkBitmapProcState* normalState = new (normalStateStorage) SkBitmapProcState;
+ SkBitmapProcState* normalState = new (normalStateStorage) SkBitmapProcState(fNormalMap,
+ SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);
SkASSERT(normalState);
-
- normalState->fTileModeX = SkShader::kClamp_TileMode;
- normalState->fTileModeY = SkShader::kClamp_TileMode;
- normalState->fOrigBitmap = fNormalMap;
if (!normalState->chooseProcs(normTotalInv, *rec.fPaint)) {
diffuseState->~SkBitmapProcState();
normalState->~SkBitmapProcState();
« no previous file with comments | « src/core/SkBitmapProcState.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698