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

Unified Diff: src/core/SkLightingShader.cpp

Issue 1759653004: enforce 16byte alignment in shader contexts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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/SkEmptyShader.h ('k') | src/core/SkLocalMatrixShader.h » ('j') | 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 c8a5a2b7372957a1dabf14dce67c523e53fd2e94..02f75f351656e49fb20bada69a98a7acbc49ad76 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 {
« no previous file with comments | « src/core/SkEmptyShader.h ('k') | src/core/SkLocalMatrixShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698