Index: src/core/SkComposeShader.cpp |
diff --git a/src/core/SkComposeShader.cpp b/src/core/SkComposeShader.cpp |
index 9e5e2c6a4947f99e53859d805266680bdf0c832c..46ff4019fc22f323649699146f3ba8695f34c3f6 100644 |
--- a/src/core/SkComposeShader.cpp |
+++ b/src/core/SkComposeShader.cpp |
@@ -30,8 +30,10 @@ SkComposeShader::~SkComposeShader() { |
fShaderA->unref(); |
} |
-size_t SkComposeShader::contextSize() const { |
- return sizeof(ComposeShaderContext) + fShaderA->contextSize() + fShaderB->contextSize(); |
+size_t SkComposeShader::contextSize(const ContextRec& rec) const { |
+ return sizeof(ComposeShaderContext) |
+ + fShaderA->contextSize(rec) |
+ + fShaderB->contextSize(rec); |
} |
class SkAutoAlphaRestore { |
@@ -75,7 +77,7 @@ template <typename T> void safe_call_destructor(T* obj) { |
SkShader::Context* SkComposeShader::onCreateContext(const ContextRec& rec, void* storage) const { |
char* aStorage = (char*) storage + sizeof(ComposeShaderContext); |
- char* bStorage = aStorage + fShaderA->contextSize(); |
+ char* bStorage = aStorage + fShaderA->contextSize(rec); |
// we preconcat our localMatrix (if any) with the device matrix |
// before calling our sub-shaders |