Flutter Engine
The Flutter Engine
GrGLSLUniformHandler.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2020 Google LLC
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
9
11 SkString rawName) const {
12 for (int i = this->numUniforms() - 1; i >= 0; i--) {
13 const UniformInfo& u = this->uniform(i);
14 if (u.fOwner == &owner && u.fRawName == rawName) {
15 return u.fVariable;
16 }
17 }
18 return GrShaderVar();
19}
20
22 SkString rawName) {
23 for (int i = this->numUniforms() - 1; i >= 0; i--) {
24 UniformInfo& u = this->uniform(i);
25 if (u.fOwner == &owner && u.fRawName == rawName) {
27 return u.fVariable;
28 }
29 }
30 // Uniform not found; it's better to return a void variable than to assert because sample
31 // matrices that are uniform are treated the same for most of the code. When the sample
32 // matrix expression can't be found as a uniform, we can infer it's a constant.
33 return GrShaderVar();
34}
@ kVertex_GrShaderFlag
Definition: GrTypesPriv.h:286
virtual UniformInfo & uniform(int idx)=0
virtual int numUniforms() const =0
GrShaderVar liftUniformToVertexShader(const GrProcessor &owner, SkString rawName)
GrShaderVar getUniformMapping(const GrProcessor &owner, SkString rawName) const