blob: 595d05cc4597708f533aa479d8bbc2c5495987f8 [file] [log] [blame]
Brian Salomon92ce5942017-01-18 11:01:10 -05001/*
2 * Copyright 2017 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "GrProcessorSet.h"
9
10GrProcessorSet::GrProcessorSet(GrPaint&& paint) {
11 fXPFactory = paint.fXPFactory;
12 fColorFragmentProcessorCnt = paint.numColorFragmentProcessors();
13 fFragmentProcessors.reset(paint.numTotalFragmentProcessors());
14 int i = 0;
15 for (auto& fp : paint.fColorFragmentProcessors) {
16 fFragmentProcessors[i++] = fp.release();
17 }
18 for (auto& fp : paint.fCoverageFragmentProcessors) {
19 fFragmentProcessors[i++] = fp.release();
20 }
Brian Salomonf87e2b92017-01-19 11:31:50 -050021 fFlags = 0;
22 if (paint.usesDistanceVectorField()) {
23 fFlags |= kUseDistanceVectorField_Flag;
24 }
25 if (paint.getDisableOutputConversionToSRGB()) {
26 fFlags |= kDisableOutputConversionToSRGB_Flag;
27 }
28 if (paint.getAllowSRGBInputs()) {
29 fFlags |= kAllowSRGBInputs_Flag;
30 }
Brian Salomon92ce5942017-01-18 11:01:10 -050031}