Remove static initializer of GrProcessorSet::gEmpty
authorBrian Salomon <bsalomon@google.com>
Wed, 17 May 2017 13:43:55 +0000 (09:43 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Wed, 17 May 2017 14:18:20 +0000 (14:18 +0000)
Change-Id: I9d4cb34c54458ad42a413f251d1018217de26b90
Reviewed-on: https://skia-review.googlesource.com/17206
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>

src/gpu/GrProcessorSet.cpp
src/gpu/GrProcessorSet.h

index db73266..22fa635 100644 (file)
 #include "GrXferProcessor.h"
 #include "effects/GrPorterDuffXferProcessor.h"
 
-const GrProcessorSet GrProcessorSet::gEmpty{GrProcessorSet::Empty::kEmpty};
+const GrProcessorSet& GrProcessorSet::EmptySet() {
+    static const GrProcessorSet gEmpty(GrProcessorSet::Empty::kEmpty);
+    return gEmpty;
+}
 
 GrProcessorSet::GrProcessorSet(GrPaint&& paint) : fXP(paint.getXPFactory()) {
     fFlags = 0;
index b15da1e..b13175a 100644 (file)
@@ -134,12 +134,11 @@ public:
 
     bool isFinalized() const { return SkToBool(kFinalized_Flag & fFlags); }
 
-    static const GrProcessorSet& EmptySet() { return gEmpty; }
+    static const GrProcessorSet& EmptySet();
     static constexpr const Analysis EmptySetAnalysis() { return Analysis(Empty::kEmpty); }
 
 private:
     GrProcessorSet(Empty) : fXP((const GrXferProcessor*)nullptr), fFlags(kFinalized_Flag) {}
-    static const GrProcessorSet gEmpty;
 
     // This absurdly large limit allows Analysis and this to pack fields together.
     static constexpr int kMaxColorProcessors = UINT8_MAX;