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

Unified Diff: src/ports/SkGlobalInitialization_default.cpp

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Adapting code to sk_once changes 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/ports/SkGlobalInitialization_chromium.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkGlobalInitialization_default.cpp
diff --git a/src/ports/SkGlobalInitialization_default.cpp b/src/ports/SkGlobalInitialization_default.cpp
index 1c22f231789150fa3a6b5e165970e1f47220bbdf..d402c02e21e04dffa9f46d2cda7b0bf2aed03e3e 100644
--- a/src/ports/SkGlobalInitialization_default.cpp
+++ b/src/ports/SkGlobalInitialization_default.cpp
@@ -15,7 +15,6 @@
#include "Sk1DPathEffect.h"
#include "Sk2DPathEffect.h"
-#include "SkAnnotation.h"
#include "SkArithmeticMode.h"
#include "SkAvoidXfermode.h"
#include "SkBicubicImageFilter.h"
@@ -31,7 +30,6 @@
#include "SkComposeShader.h"
#include "SkCornerPathEffect.h"
#include "SkDashPathEffect.h"
-#include "SkData.h"
#include "SkDiscretePathEffect.h"
#include "SkDisplacementMapEffect.h"
#include "SkDropShadowImageFilter.h"
@@ -50,6 +48,7 @@
#include "SkMergeImageFilter.h"
#include "SkMorphologyImageFilter.h"
#include "SkOffsetImageFilter.h"
+#include "SkOnce.h"
#include "SkPerlinNoiseShader.h"
#include "SkPixelXorXfermode.h"
#include "SkRectShaderImageFilter.h"
@@ -59,8 +58,7 @@
#include "SkTileImageFilter.h"
#include "SkXfermodeImageFilter.h"
-void SkFlattenable::InitializeFlattenables() {
-
+static void InitializeFlattenables(int*) {
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkAvoidXfermode)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBicubicImageFilter)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapProcShader)
@@ -114,3 +112,9 @@ void SkFlattenable::InitializeFlattenables() {
SkTableColorFilter::InitializeFlattenables();
SkXfermode::InitializeFlattenables();
}
+
+void SkFlattenable::InitializeFlattenablesIfNeeded() {
+ int dummy;
+ SK_DECLARE_STATIC_ONCE(once);
+ SkOnce(&once, InitializeFlattenables, &dummy);
+}
« no previous file with comments | « src/ports/SkGlobalInitialization_chromium.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698