aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/animator/SkDrawShader.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-28 14:55:39 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-28 14:55:39 +0000
commit9c9005a347e9996f357bd79591bd34f74f8bbc66 (patch)
tree5e03fa9c44510f969be6dee9641968574dbed932 /src/animator/SkDrawShader.cpp
parentc76a4b2a81b5c502ded23dee1e0c5d762028d5cf (diff)
Move SkShader::fLocalMatrix into SkShader constructor.
As a first step towards removing SkShader::setLocalMatrix, which will make SkShader thread-safe, remove calls to setLocalMatrix that happen immediately after the shader is being created. Instead, pass the matrix into the constructor or factory method. BUG=skia:1976 R=scroggo@google.com, reed@google.com, skyostil@google.com, mtklein@google.com Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/245963010 git-svn-id: http://skia.googlecode.com/svn/trunk@14401 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/animator/SkDrawShader.cpp')
-rw-r--r--src/animator/SkDrawShader.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/animator/SkDrawShader.cpp b/src/animator/SkDrawShader.cpp
index e3aa4da028..f9f379bf73 100644
--- a/src/animator/SkDrawShader.cpp
+++ b/src/animator/SkDrawShader.cpp
@@ -36,9 +36,8 @@ bool SkDrawShader::add() {
return false;
}
-void SkDrawShader::addPostlude(SkShader* shader) {
- if (matrix)
- shader->setLocalMatrix(matrix->getMatrix());
+SkMatrix* SkDrawShader::getMatrix() {
+ return matrix ? &matrix->getMatrix() : NULL;
}
#if SK_USE_CONDENSED_INFO == 0
@@ -75,9 +74,9 @@ SkShader* SkDrawBitmapShader::getShader() {
// draw-time from the paint
SkShader* shader = SkShader::CreateBitmapShader(image->fBitmap,
(SkShader::TileMode) tileMode,
- (SkShader::TileMode) tileMode);
+ (SkShader::TileMode) tileMode,
+ getMatrix());
SkAutoTDelete<SkShader> autoDel(shader);
- addPostlude(shader);
(void)autoDel.detach();
return shader;
}