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

Unified Diff: src/core/SkShader.cpp

Issue 773563002: Pre-cache local matrix type in shader constructor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkShader.cpp
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp
index 816d6fd3298c0142cd9102d056961adcc11692cd..9c2fc2f100f143850376f030d95624b6eaab0dd8 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() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698