Add class GrProcessorSet which represents color and coverage FPs and a XPFactory.
Eventually ops can use this to hold their ops and create GrPipelines at flush time.
For now it is used by GrPipelineBuilder.
Change-Id: I0db3892032f2d07238e4c847a790678b3aab456f
Reviewed-on: https://skia-review.googlesource.com/7132
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrProcessorSet.cpp b/src/gpu/GrProcessorSet.cpp
new file mode 100644
index 0000000..0d72d9b
--- /dev/null
+++ b/src/gpu/GrProcessorSet.cpp
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "GrProcessorSet.h"
+
+GrProcessorSet::GrProcessorSet(GrPaint&& paint) {
+ fXPFactory = paint.fXPFactory;
+ fColorFragmentProcessorCnt = paint.numColorFragmentProcessors();
+ fFragmentProcessors.reset(paint.numTotalFragmentProcessors());
+ int i = 0;
+ for (auto& fp : paint.fColorFragmentProcessors) {
+ fFragmentProcessors[i++] = fp.release();
+ }
+ for (auto& fp : paint.fCoverageFragmentProcessors) {
+ fFragmentProcessors[i++] = fp.release();
+ }
+}