From: mtklein Date: Mon, 1 Dec 2014 20:06:24 +0000 (-0800) Subject: Pre-cache local matrix type in shader constructor. X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~4664 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=435eba7e1eb6f6622ebe171274a8d595d947a9cd;p=platform%2Fupstream%2FlibSkiaSharp.git 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 --- diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp index 816d6fd..9c2fc2f 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() {