diff options
author | 2016-03-03 13:25:25 -0800 | |
---|---|---|
committer | 2016-03-03 13:25:25 -0800 | |
commit | d812fb458807245daa812adb7af0733cf5b54d96 (patch) | |
tree | 8a25dc8ae4bc984c78bb0a730b17130f5396d9cc /src/core/SkLightingShader.cpp | |
parent | e79586bf82997477b8bc95469147cd25a8e22ff0 (diff) |
enforce 16byte alignment in shader contexts
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1759653004
Review URL: https://codereview.chromium.org/1759653004
Diffstat (limited to 'src/core/SkLightingShader.cpp')
-rw-r--r-- | src/core/SkLightingShader.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp index c8a5a2b737..02f75f3516 100644 --- a/src/core/SkLightingShader.cpp +++ b/src/core/SkLightingShader.cpp @@ -79,8 +79,6 @@ public: SkFilterQuality) const override; #endif - size_t contextSize(const ContextRec&) const override; - class LightingShaderContext : public SkShader::Context { public: // The context takes ownership of the states. It will call their destructors @@ -106,6 +104,7 @@ public: protected: void flatten(SkWriteBuffer&) const override; + size_t onContextSize(const ContextRec&) const override; Context* onCreateContext(const ContextRec&, void*) const override; bool computeNormTotalInverse(const ContextRec& rec, SkMatrix* normTotalInverse) const; @@ -416,10 +415,6 @@ bool SkLightingShaderImpl::isOpaque() const { return fDiffuseMap.isOpaque(); } -size_t SkLightingShaderImpl::contextSize(const ContextRec&) const { - return 2 * sizeof(SkBitmapProcState) + sizeof(LightingShaderContext); -} - SkLightingShaderImpl::LightingShaderContext::LightingShaderContext(const SkLightingShaderImpl& shader, const ContextRec& rec, SkBitmapProcState* diffuseState, @@ -655,6 +650,10 @@ bool SkLightingShaderImpl::computeNormTotalInverse(const ContextRec& rec, return m->invert(normTotalInverse); } +size_t SkLightingShaderImpl::onContextSize(const ContextRec&) const { + return 2 * sizeof(SkBitmapProcState) + sizeof(LightingShaderContext); +} + SkShader::Context* SkLightingShaderImpl::onCreateContext(const ContextRec& rec, void* storage) const { |