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

Unified Diff: src/core/SkLightingShader.cpp

Issue 1759323002: Revert of 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 02f75f351656e49fb20bada69a98a7acbc49ad76..c8a5a2b7372957a1dabf14dce67c523e53fd2e94 100644
--- a/src/core/SkLightingShader.cpp
+++ b/src/core/SkLightingShader.cpp
@@ -79,6 +79,8 @@
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
@@ -104,7 +106,6 @@
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;
@@ -415,6 +416,10 @@
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,
@@ -650,10 +655,6 @@
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