From 292bf7a163729330ec6d337992ddd2403a0ed8a2 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Wed, 17 May 2017 09:43:55 -0400 Subject: [PATCH] Remove static initializer of GrProcessorSet::gEmpty Change-Id: I9d4cb34c54458ad42a413f251d1018217de26b90 Reviewed-on: https://skia-review.googlesource.com/17206 Reviewed-by: Mike Klein Commit-Queue: Brian Salomon --- src/gpu/GrProcessorSet.cpp | 5 ++++- src/gpu/GrProcessorSet.h | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gpu/GrProcessorSet.cpp b/src/gpu/GrProcessorSet.cpp index db73266..22fa635 100644 --- a/src/gpu/GrProcessorSet.cpp +++ b/src/gpu/GrProcessorSet.cpp @@ -11,7 +11,10 @@ #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; diff --git a/src/gpu/GrProcessorSet.h b/src/gpu/GrProcessorSet.h index b15da1e..b13175a 100644 --- a/src/gpu/GrProcessorSet.h +++ b/src/gpu/GrProcessorSet.h @@ -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; -- 2.7.4