aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2018-03-27 10:36:57 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-27 16:29:14 +0000
commitb412f5bd0695f83a7741f520bc0978792c36ca01 (patch)
tree5af908ae6b476823a7d5cb1e7401a2797b152c2c /src
parentcc47335dede2b40f90ba37e5486270b9acbce38b (diff)
cache SkMatrix44 type in makeColorSpin()
This helps prevent races on getType() later, e.g. https://luci-milo.appspot.com/swarming/task/3c80715df637a810/steps/symbolized_dm/0/stdout Change-Id: I3dbc9f6bf2fddff9ca416b0001bfd5da123e6b25 Reviewed-on: https://skia-review.googlesource.com/116466 Commit-Queue: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/SkColorSpace_XYZ.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/SkColorSpace_XYZ.cpp b/src/core/SkColorSpace_XYZ.cpp
index ed1446f8e9..adfe3f6608 100644
--- a/src/core/SkColorSpace_XYZ.cpp
+++ b/src/core/SkColorSpace_XYZ.cpp
@@ -100,6 +100,7 @@ sk_sp<SkColorSpace> SkColorSpace_XYZ::makeColorSpin() const {
SkMatrix44 spin(SkMatrix44::kUninitialized_Constructor);
spin.set3x3(0, 1, 0, 0, 0, 1, 1, 0, 0);
spin.postConcat(fToXYZD50);
+ (void)spin.getType(); // Pre-cache spin matrix type to avoid races in future getType() calls.
return sk_sp<SkColorSpace>(new SkColorSpace_XYZ(fGammaNamed, fGammas, spin, fProfileData));
}