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

Side by Side Diff: src/gpu/gl/GrGLSL.h

Issue 1142003003: Revert of Move copy-surface-as-draw fallback to GrGLGpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@vares
Patch Set: Created 5 years, 7 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/gl/GrGLGpuProgramCache.cpp ('k') | src/gpu/gl/GrGLSL.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 #ifndef GrGLSL_DEFINED 8 #ifndef GrGLSL_DEFINED
9 #define GrGLSL_DEFINED 9 #define GrGLSL_DEFINED
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 */ 50 */
51 bool GrGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation); 51 bool GrGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation);
52 52
53 /** 53 /**
54 * Returns a string to include at the beginning of a shader to declare the GLSL 54 * Returns a string to include at the beginning of a shader to declare the GLSL
55 * version. 55 * version.
56 */ 56 */
57 const char* GrGetGLSLVersionDecl(const GrGLContextInfo&); 57 const char* GrGetGLSLVersionDecl(const GrGLContextInfo&);
58 58
59 /** 59 /**
60 * Adds a line of GLSL code to declare the default precision for float types.
61 */
62 void GrGLSLAppendDefaultFloatPrecisionDeclaration(GrSLPrecision, GrGLStandard, S kString* out);
63
64 /**
65 * Gets the name of the function that should be used to sample a 2D texture. Coo rd type is used
66 * to indicate whether the texture is sampled using projective textured (kVec3f) or not (kVec2f).
67 */
68 inline const char* GrGLSLTexture2DFunctionName(GrSLType coordType, GrGLSLGenerat ion glslGen) {
69 if (kVec2f_GrSLType == coordType) {
70 return glslGen >= k130_GrGLSLGeneration ? "texture" : "texture2D";
71 } else {
72 SkASSERT(kVec3f_GrSLType == coordType);
73 return glslGen >= k130_GrGLSLGeneration ? "textureProj" : "texture2DProj ";
74 }
75 }
76
77 /**
78 * Converts a GrSLType to a string containing the name of the equivalent GLSL ty pe. 60 * Converts a GrSLType to a string containing the name of the equivalent GLSL ty pe.
79 */ 61 */
80 static inline const char* GrGLSLTypeString(GrSLType t) { 62 static inline const char* GrGLSLTypeString(GrSLType t) {
81 switch (t) { 63 switch (t) {
82 case kVoid_GrSLType: 64 case kVoid_GrSLType:
83 return "void"; 65 return "void";
84 case kFloat_GrSLType: 66 case kFloat_GrSLType:
85 return "float"; 67 return "float";
86 case kVec2f_GrSLType: 68 case kVec2f_GrSLType:
87 return "vec2"; 69 return "vec2";
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 318
337 /** 319 /**
338 * Does an inplace mul, *=, of vec4VarName by mulFactor. 320 * Does an inplace mul, *=, of vec4VarName by mulFactor.
339 * A semicolon is added after the assignment. 321 * A semicolon is added after the assignment.
340 */ 322 */
341 void GrGLSLMulVarBy4f(SkString* outAppend, const char* vec4VarName, const GrGLSL Expr4& mulFactor); 323 void GrGLSLMulVarBy4f(SkString* outAppend, const char* vec4VarName, const GrGLSL Expr4& mulFactor);
342 324
343 #include "GrGLSL_impl.h" 325 #include "GrGLSL_impl.h"
344 326
345 #endif 327 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGpuProgramCache.cpp ('k') | src/gpu/gl/GrGLSL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698