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

Unified Diff: src/core/SkMatrix.cpp

Issue 26491003: SK_ONCE for SkData (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: dropped assert Created 7 years, 2 months 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 | « src/core/SkData.cpp ('k') | src/core/SkOnce.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMatrix.cpp
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp
index 41c0f883a7bdc9709aade0a23e2a94f493c1e3f1..5bcb35b298874088004f5c39fba7133e85a0c323 100644
--- a/src/core/SkMatrix.cpp
+++ b/src/core/SkMatrix.cpp
@@ -1894,14 +1894,15 @@ SkScalar SkMatrix::getMaxStretch() const {
return SkScalarSqrt(largerRoot);
}
-DEF_SK_ONCE(reset_identity_matrix, SkMatrix* identity) {
+static void reset_identity_matrix(SkMatrix* identity) {
identity->reset();
}
const SkMatrix& SkMatrix::I() {
// If you can use C++11 now, you might consider replacing this with a constexpr constructor.
static SkMatrix gIdentity;
- SK_ONCE(reset_identity_matrix, &gIdentity);
+ SK_DECLARE_STATIC_ONCE(once);
+ SkOnce(&once, reset_identity_matrix, &gIdentity);
return gIdentity;
}
« no previous file with comments | « src/core/SkData.cpp ('k') | src/core/SkOnce.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698