aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProcessorSet.cpp
blob: 595d05cc4597708f533aa479d8bbc2c5495987f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * 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();
    }
    fFlags = 0;
    if (paint.usesDistanceVectorField()) {
        fFlags |= kUseDistanceVectorField_Flag;
    }
    if (paint.getDisableOutputConversionToSRGB()) {
        fFlags |= kDisableOutputConversionToSRGB_Flag;
    }
    if (paint.getAllowSRGBInputs()) {
        fFlags |= kAllowSRGBInputs_Flag;
    }
}