Brian Salomon | 92ce594 | 2017-01-18 11:01:10 -0500 | [diff] [blame] | 1 | /* |
| 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 | |
| 10 | GrProcessorSet::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 Salomon | f87e2b9 | 2017-01-19 11:31:50 -0500 | [diff] [blame] | 21 | 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 Salomon | 92ce594 | 2017-01-18 11:01:10 -0500 | [diff] [blame] | 31 | } |