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

Unified Diff: src/core/SkComposeShader.cpp

Issue 1757993002: add support for new bitmapshader context (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: enforce 16byte alignment in more places 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/SkBitmapProcShader.cpp ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkComposeShader.cpp
diff --git a/src/core/SkComposeShader.cpp b/src/core/SkComposeShader.cpp
index 46ff4019fc22f323649699146f3ba8695f34c3f6..57f0989e2d65b83c500b9b705e66b9485c6fdabe 100644
--- a/src/core/SkComposeShader.cpp
+++ b/src/core/SkComposeShader.cpp
@@ -31,9 +31,9 @@ SkComposeShader::~SkComposeShader() {
}
size_t SkComposeShader::contextSize(const ContextRec& rec) const {
- return sizeof(ComposeShaderContext)
- + fShaderA->contextSize(rec)
- + fShaderB->contextSize(rec);
+ return SkAlign16(sizeof(ComposeShaderContext))
+ + SkAlign16(fShaderA->contextSize(rec))
+ + SkAlign16(fShaderB->contextSize(rec));
}
class SkAutoAlphaRestore {
@@ -76,8 +76,8 @@ 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(rec);
+ char* aStorage = (char*) storage + SkAlign16(sizeof(ComposeShaderContext));
+ char* bStorage = aStorage + SkAlign16(fShaderA->contextSize(rec));
// we preconcat our localMatrix (if any) with the device matrix
// before calling our sub-shaders
« no previous file with comments | « src/core/SkBitmapProcShader.cpp ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698