Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: src/gpu/glsl/GrGLSL.cpp

Issue 1202293002: Move GLSL-specific routines/classes to separate glsl directory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rename GrGLGLSL.{cpp,h} Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/glsl/GrGLSL.h ('k') | src/gpu/glsl/GrGLSLCaps.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2011 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 "GrGLSL.h"
9 #include "SkString.h"
10
11 bool GrGLSLSupportsNamedFragmentShaderOutputs(GrGLSLGeneration gen) {
12 switch (gen) {
13 case k110_GrGLSLGeneration:
14 return false;
15 case k130_GrGLSLGeneration:
16 case k140_GrGLSLGeneration:
17 case k150_GrGLSLGeneration:
18 case k330_GrGLSLGeneration:
19 case k310es_GrGLSLGeneration:
20 return true;
21 }
22 return false;
23 }
24
25 void GrGLSLMulVarBy4f(SkString* outAppend, const char* vec4VarName, const GrGLSL Expr4& mulFactor) {
26 if (mulFactor.isOnes()) {
27 *outAppend = SkString();
28 }
29
30 if (mulFactor.isZeros()) {
31 outAppend->appendf("%s = vec4(0);", vec4VarName);
32 } else {
33 outAppend->appendf("%s *= %s;", vec4VarName, mulFactor.c_str());
34 }
35 }
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSL.h ('k') | src/gpu/glsl/GrGLSLCaps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698