aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-12-01 12:06:24 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-01 12:06:24 -0800
commit435eba7e1eb6f6622ebe171274a8d595d947a9cd (patch)
tree7f6930325893cf79469508e3b75d7546cde47543 /src
parent3f3b3d003527861dc0bd89733857576408906431 (diff)
Pre-cache local matrix type in shader constructor.
TSAN points out we race when choosing our blitter without this. BUG=437511 Review URL: https://codereview.chromium.org/773563002
Diffstat (limited to 'src')
-rw-r--r--src/core/SkShader.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp
index 816d6fd329..9c2fc2f100 100644
--- a/src/core/SkShader.cpp
+++ b/src/core/SkShader.cpp
@@ -44,6 +44,8 @@ SkShader::SkShader(const SkMatrix* localMatrix) {
} else {
fLocalMatrix.reset();
}
+ // Pre-cache so future calls to fLocalMatrix.getType() are threadsafe.
+ (void)fLocalMatrix.getType();
}
SkShader::~SkShader() {