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

Unified Diff: src/gpu/gl/GrGLProgramDesc.cpp

Issue 1431433003: Move shader compiling to ProgramBuilder and various ShaderBuilder cleanups. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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
Index: src/gpu/gl/GrGLProgramDesc.cpp
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index 281f2c06a6241ef92b77c56184a4f30c17d9dcd2..d531ed53fb045e908f8c80d5d761511376cf0697 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -18,7 +18,7 @@
* present in the texture's config. swizzleComponentMask indicates the channels present in the
* shader swizzle.
*/
-static bool swizzle_requires_alpha_remapping(const GrGLCaps& caps,
+static bool swizzle_requires_alpha_remapping(const GrGLSLCaps& caps,
uint32_t configComponentMask,
uint32_t swizzleComponentMask) {
if (caps.textureSwizzleSupport()) {
@@ -46,7 +46,9 @@ static uint32_t gen_texture_key(const GrProcessor& proc, const GrGLCaps& caps) {
for (int t = 0; t < numTextures; ++t) {
const GrTextureAccess& access = proc.textureAccess(t);
uint32_t configComponentMask = GrPixelConfigComponentMask(access.getTexture()->config());
- if (swizzle_requires_alpha_remapping(caps, configComponentMask, access.swizzleMask())) {
+ if (swizzle_requires_alpha_remapping(*caps.glslCaps(),
+ configComponentMask,
+ access.swizzleMask())) {
key |= 1 << t;
}
}
@@ -159,8 +161,7 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc,
if (pipeline.readsFragPosition()) {
header->fFragPosKey =
- GrGLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.getRenderTarget(),
- gpu->glCaps());
+ GrGLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.getRenderTarget());
} else {
header->fFragPosKey = 0;
}

Powered by Google App Engine
This is Rietveld 408576698