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

Side by Side Diff: src/gpu/glsl/GrGLSLCaps.h

Issue 1584473002: Swizzle shader output and blend when using GL_RED to implement kAlpha_8_GrPixelConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@hideformats
Patch Set: Address comments Created 4 years, 11 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/builders/GrGLProgramBuilder.cpp ('k') | no next file » | 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 2012 Google Inc. 2 * Copyright 2012 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 8
9 #ifndef GrGLSLCaps_DEFINED 9 #ifndef GrGLSLCaps_DEFINED
10 #define GrGLSLCaps_DEFINED 10 #define GrGLSLCaps_DEFINED
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 return fSecondaryOutputExtensionString; 101 return fSecondaryOutputExtensionString;
102 } 102 }
103 103
104 const char* externalTextureExtensionString() const { 104 const char* externalTextureExtensionString() const {
105 return fExternalTextureExtensionString; 105 return fExternalTextureExtensionString;
106 } 106 }
107 107
108 /** 108 /**
109 * Given a texture's config, this determines what swizzle must be appended t o accesses to the 109 * Given a texture's config, this determines what swizzle must be appended t o accesses to the
110 * texture in generated shader code. Swizzling may be implemented in texture parameters or a 110 * texture in generated shader code. Swizzling may be implemented in texture parameters or a
111 * sampler rather than in the shader. In this case the shader swizzle will a lways be "rgba". 111 * sampler rather than in the shader. In this case the returned swizzle will always be "rgba".
112 */ 112 */
113 const GrSwizzle& configTextureSwizzle(GrPixelConfig config) const { 113 const GrSwizzle& configTextureSwizzle(GrPixelConfig config) const {
114 return fConfigTextureSwizzle[config]; 114 return fConfigTextureSwizzle[config];
115 } 115 }
116 116
117 /** Swizzle that should occur on the fragment shader outputs for a given con fig. */
118 const GrSwizzle& configOutputSwizzle(GrPixelConfig config) const {
119 return fConfigOutputSwizzle[config];
120 }
121
117 GrGLSLGeneration generation() const { return fGLSLGeneration; } 122 GrGLSLGeneration generation() const { return fGLSLGeneration; }
118 123
119 /** 124 /**
120 * Returns a string containing the caps info. 125 * Returns a string containing the caps info.
121 */ 126 */
122 SkString dump() const override; 127 SkString dump() const override;
123 128
124 private: 129 private:
125 void onApplyOptionsOverrides(const GrContextOptions& options) override; 130 void onApplyOptionsOverrides(const GrContextOptions& options) override;
126 131
(...skipping 16 matching lines...) Expand all
143 const char* fFragCoordConventionsExtensionString; 148 const char* fFragCoordConventionsExtensionString;
144 const char* fSecondaryOutputExtensionString; 149 const char* fSecondaryOutputExtensionString;
145 const char* fExternalTextureExtensionString; 150 const char* fExternalTextureExtensionString;
146 151
147 const char* fFBFetchColorName; 152 const char* fFBFetchColorName;
148 const char* fFBFetchExtensionString; 153 const char* fFBFetchExtensionString;
149 154
150 AdvBlendEqInteraction fAdvBlendEqInteraction; 155 AdvBlendEqInteraction fAdvBlendEqInteraction;
151 156
152 GrSwizzle fConfigTextureSwizzle[kGrPixelConfigCnt]; 157 GrSwizzle fConfigTextureSwizzle[kGrPixelConfigCnt];
158 GrSwizzle fConfigOutputSwizzle[kGrPixelConfigCnt];
153 159
154 friend class GrGLCaps; // For initialization. 160 friend class GrGLCaps; // For initialization.
155 161
156 typedef GrShaderCaps INHERITED; 162 typedef GrShaderCaps INHERITED;
157 }; 163 };
158 164
159 #endif 165 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698