blob: 1f3edadf997b99f52838954419abd616d626fac0 [file] [log] [blame]
egdanielb6cbc382014-11-13 11:00:34 -08001/*
2 * Copyright 2014 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 "GrProcOptInfo.h"
egdaniel95131432014-12-09 11:15:43 -08009#include "GrGeometryProcessor.h"
Brian Salomon89527432016-12-16 09:52:16 -050010#include "ops/GrDrawOp.h"
joshualitt74417822015-08-07 11:42:16 -070011
Brian Salomon0831f1b2017-01-18 11:08:41 -050012void GrProcOptInfo::analyzeProcessors(const GrFragmentProcessor* const* processors, int cnt) {
bsalomonac856c92015-08-27 06:30:17 -070013 for (int i = 0; i < cnt; ++i) {
14 const GrFragmentProcessor* processor = processors[i];
egdanielb6cbc382014-11-13 11:00:34 -080015 processor->computeInvariantOutput(&fInOut);
egdanielb6cbc382014-11-13 11:00:34 -080016 if (kRGBA_GrColorComponentFlags == fInOut.validFlags()) {
bsalomonac856c92015-08-27 06:30:17 -070017 fFirstEffectiveProcessorIndex = i + 1;
egdanielb6cbc382014-11-13 11:00:34 -080018 fInputColor = fInOut.color();
egdanielb6cbc382014-11-13 11:00:34 -080019 // Since we are clearing all previous color stages we are in a state where we have found
20 // zero stages that don't multiply the inputColor.
21 fInOut.resetNonMulStageFound();
egdanielb6cbc382014-11-13 11:00:34 -080022 }
23 }
24}