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

Side by Side Diff: src/gpu/gl/builders/GrGLShaderBuilder.cpp

Issue 808593003: Rename GrGpuGL to GrGLGpu for consistency (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years 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
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrGLShaderBuilder.h" 8 #include "GrGLShaderBuilder.h"
9 #include "GrGLProgramBuilder.h" 9 #include "GrGLProgramBuilder.h"
10 #include "GrGLProgramBuilder.h" 10 #include "GrGLProgramBuilder.h"
11 #include "../GrGpuGL.h" 11 #include "../GrGpuGL.h"
12 #include "../GrGLShaderVar.h" 12 #include "../GrGLShaderVar.h"
13 13
14 namespace { 14 namespace {
15 inline const char* sample_function_name(GrSLType type, GrGLSLGeneration glslGen) { 15 inline const char* sample_function_name(GrSLType type, GrGLSLGeneration glslGen) {
16 if (kVec2f_GrSLType == type) { 16 if (kVec2f_GrSLType == type) {
17 return glslGen >= k130_GrGLSLGeneration ? "texture" : "texture2D"; 17 return glslGen >= k130_GrGLSLGeneration ? "texture" : "texture2D";
18 } else { 18 } else {
19 SkASSERT(kVec3f_GrSLType == type); 19 SkASSERT(kVec3f_GrSLType == type);
20 return glslGen >= k130_GrGLSLGeneration ? "textureProj" : "texture2DProj "; 20 return glslGen >= k130_GrGLSLGeneration ? "textureProj" : "texture2DProj ";
21 } 21 }
22 } 22 }
23 void append_texture_lookup(SkString* out, 23 void append_texture_lookup(SkString* out,
24 GrGpuGL* gpu, 24 GrGLGpu* gpu,
25 const char* samplerName, 25 const char* samplerName,
26 const char* coordName, 26 const char* coordName,
27 uint32_t configComponentMask, 27 uint32_t configComponentMask,
28 const char* swizzle, 28 const char* swizzle,
29 GrSLType varyingType = kVec2f_GrSLType) { 29 GrSLType varyingType = kVec2f_GrSLType) {
30 SkASSERT(coordName); 30 SkASSERT(coordName);
31 31
32 out->appendf("%s(%s, %s)", 32 out->appendf("%s(%s, %s)",
33 sample_function_name(varyingType, gpu->glslGeneration()), 33 sample_function_name(varyingType, gpu->glslGeneration()),
34 samplerName, 34 samplerName,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 uint32_t configComponentMask, 154 uint32_t configComponentMask,
155 const char* swizzle) { 155 const char* swizzle) {
156 append_texture_lookup(&fCode, 156 append_texture_lookup(&fCode,
157 fProgramBuilder->gpu(), 157 fProgramBuilder->gpu(),
158 samplerName, 158 samplerName,
159 coordName, 159 coordName,
160 configComponentMask, 160 configComponentMask,
161 swizzle, 161 swizzle,
162 kVec2f_GrSLType); 162 kVec2f_GrSLType);
163 } 163 }
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698