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

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

Issue 580863004: Adding 3D lut color filter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: New version Created 6 years, 3 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/GrGLProgramEffects.cpp
diff --git a/src/gpu/gl/GrGLProgramEffects.cpp b/src/gpu/gl/GrGLProgramEffects.cpp
index 369ec1076030f25e8abccf694006692abb1fbf3a..222fa3c3d12db91d5bd43474d3b3cd7f83852b10 100644
--- a/src/gpu/gl/GrGLProgramEffects.cpp
+++ b/src/gpu/gl/GrGLProgramEffects.cpp
@@ -215,11 +215,12 @@ void GrGLProgramEffects::emitSamplers(GrGLProgramBuilder* builder,
SkString name;
for (int t = 0; t < numTextures; ++t) {
name.printf("Sampler%d", t);
+ const GrTextureAccess& textureAccess = effect->textureAccess(t);
samplers[t].fUniform = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kSampler2D_GrSLType,
- name.c_str());
+ SkToBool(textureAccess.getTexture()->desc().fFlags & k3DTexture_GrTextureFlagBit) ?
+ kSampler3D_GrSLType : kSampler2D_GrSLType, name.c_str());
SkNEW_APPEND_TO_TARRAY(outSamplers, TextureSampler,
- (samplers[t].fUniform, effect->textureAccess(t)));
+ (samplers[t].fUniform, textureAccess));
}
}

Powered by Google App Engine
This is Rietveld 408576698