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

Unified Diff: src/gpu/glsl/GrGLSLCaps.h

Issue 1569393002: Revert of Add a class representing texture swizzle. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | src/gpu/glsl/GrGLSLCaps.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLCaps.h
diff --git a/src/gpu/glsl/GrGLSLCaps.h b/src/gpu/glsl/GrGLSLCaps.h
index eba9602e5ac270cd65f68d156d5ae96d632f5e8d..21c59e7b162f880c2074e8317fd13bdaba6c7162 100755
--- a/src/gpu/glsl/GrGLSLCaps.h
+++ b/src/gpu/glsl/GrGLSLCaps.h
@@ -11,7 +11,6 @@
#include "GrCaps.h"
#include "GrGLSL.h"
-#include "GrSwizzle.h"
class GrGLSLCaps : public GrShaderCaps {
public:
@@ -105,14 +104,14 @@
return fExternalTextureExtensionString;
}
+ bool mustSwizzleInShader() const { return fMustSwizzleInShader; }
+
/**
- * Given a texture's config, this determines what swizzle must be appended to accesses to the
- * texture in generated shader code. Swizzling may be implemented in texture parameters or a
- * sampler rather than in the shader. In this case the shader swizzle will always be "rgba".
+ * Returns a string which represents how to map from an internal GLFormat to a given
+ * GrPixelConfig. The function mustSwizzleInShader determines whether this swizzle is applied
+ * in the generated shader code or using sample state in the 3D API.
*/
- const GrSwizzle& configTextureSwizzle(GrPixelConfig config) const {
- return fConfigTextureSwizzle[config];
- }
+ const char* getSwizzleMap(GrPixelConfig config) const { return fConfigSwizzle[config]; }
GrGLSLGeneration generation() const { return fGLSLGeneration; }
@@ -149,11 +148,13 @@
AdvBlendEqInteraction fAdvBlendEqInteraction;
- GrSwizzle fConfigTextureSwizzle[kGrPixelConfigCnt];
+ bool fMustSwizzleInShader;
+ const char* fConfigSwizzle[kGrPixelConfigCnt];
friend class GrGLCaps; // For initialization.
typedef GrShaderCaps INHERITED;
};
+
#endif
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | src/gpu/glsl/GrGLSLCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698