aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/SkPerlinNoiseShader2
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-03-03 13:25:25 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-03 13:25:25 -0800
commitd812fb458807245daa812adb7af0733cf5b54d96 (patch)
tree8a25dc8ae4bc984c78bb0a730b17130f5396d9cc /experimental/SkPerlinNoiseShader2
parente79586bf82997477b8bc95469147cd25a8e22ff0 (diff)
enforce 16byte alignment in shader contexts
Diffstat (limited to 'experimental/SkPerlinNoiseShader2')
-rw-r--r--experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp4
-rw-r--r--experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.h6
2 files changed, 4 insertions, 6 deletions
diff --git a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
index a5a2a21523..a1784a4204 100644
--- a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
+++ b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
@@ -571,8 +571,8 @@ SkShader::Context* SkPerlinNoiseShader2::onCreateContext(const ContextRec& rec,
return new (storage) PerlinNoiseShaderContext(*this, rec);
}
-size_t SkPerlinNoiseShader2::contextSize(const ContextRec&) const {
- return sizeof(PerlinNoiseShaderContext);
+size_t SkPerlinNoiseShader2::onContextSize(const ContextRec&) const {
+ return SkAlign16(sizeof(PerlinNoiseShaderContext));
}
SkPerlinNoiseShader2::PerlinNoiseShaderContext::PerlinNoiseShaderContext(
diff --git a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.h b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.h
index a129ef8bcd..fac098ab52 100644
--- a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.h
+++ b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.h
@@ -80,12 +80,9 @@ public:
static SkShader* CreateTubulence(SkScalar baseFrequencyX, SkScalar baseFrequencyY,
int numOctaves, SkScalar seed,
const SkISize* tileSize = NULL) {
- return CreateTurbulence(baseFrequencyX, baseFrequencyY, numOctaves, seed, tileSize);
+ return CreateTurbulence(baseFrequencyX, baseFrequencyY, numOctaves, seed, tileSize);
}
-
- size_t contextSize(const ContextRec&) const override;
-
class PerlinNoiseShaderContext : public SkShader::Context {
public:
PerlinNoiseShaderContext(const SkPerlinNoiseShader2& shader, const ContextRec&);
@@ -118,6 +115,7 @@ public:
protected:
void flatten(SkWriteBuffer&) const override;
+ size_t onContextSize(const ContextRec&) const override;
Context* onCreateContext(const ContextRec&, void* storage) const override;
private: