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

Side by Side Diff: src/gpu/gl/GrGLProgramDataManager.cpp

Issue 1583863002: Beginning of support for texture rectangles. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
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/GrGLGpu.cpp ('k') | src/gpu/gl/GrGLProgramDesc.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 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 #include "SkMatrix.h" 8 #include "SkMatrix.h"
9 #include "gl/GrGLProgramDataManager.h" 9 #include "gl/GrGLProgramDataManager.h"
10 #include "gl/GrGLGpu.h" 10 #include "gl/GrGLGpu.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 SkDEBUGCODE( 56 SkDEBUGCODE(
57 pathProcVarying.fArrayCount = builderPathProcVarying.fVariable.getAr rayCount(); 57 pathProcVarying.fArrayCount = builderPathProcVarying.fVariable.getAr rayCount();
58 pathProcVarying.fType = builderPathProcVarying.fVariable.getType(); 58 pathProcVarying.fType = builderPathProcVarying.fVariable.getType();
59 ); 59 );
60 pathProcVarying.fLocation = builderPathProcVarying.fLocation; 60 pathProcVarying.fLocation = builderPathProcVarying.fLocation;
61 } 61 }
62 } 62 }
63 63
64 void GrGLProgramDataManager::setSampler(UniformHandle u, int texUnit) const { 64 void GrGLProgramDataManager::setSampler(UniformHandle u, int texUnit) const {
65 const Uniform& uni = fUniforms[u.toIndex()]; 65 const Uniform& uni = fUniforms[u.toIndex()];
66 SkASSERT(uni.fType == kSampler2D_GrSLType || uni.fType == kSamplerExternal_G rSLType); 66 SkASSERT(uni.fType == kSampler2D_GrSLType || uni.fType == kSamplerExternal_G rSLType ||
67 uni.fType == kSampler2DRect_GrSLType);
67 SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount); 68 SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount);
68 // FIXME: We still insert a single sampler uniform for every stage. If the s hader does not 69 // FIXME: We still insert a single sampler uniform for every stage. If the s hader does not
69 // reference the sampler then the compiler may have optimized it out. Uncomm ent this assert 70 // reference the sampler then the compiler may have optimized it out. Uncomm ent this assert
70 // once stages insert their own samplers. 71 // once stages insert their own samplers.
71 // this->printUnused(uni); 72 // this->printUnused(uni);
72 if (kUnusedUniform != uni.fFSLocation) { 73 if (kUnusedUniform != uni.fFSLocation) {
73 GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fFSLocation, texUnit)); 74 GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fFSLocation, texUnit));
74 } 75 }
75 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) { 76 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
76 GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fVSLocation, texUnit)); 77 GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fVSLocation, texUnit));
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 matrix); 294 matrix);
294 } 295 }
295 296
296 #ifdef SK_DEBUG 297 #ifdef SK_DEBUG
297 void GrGLProgramDataManager::printUnused(const Uniform& uni) const { 298 void GrGLProgramDataManager::printUnused(const Uniform& uni) const {
298 if (kUnusedUniform == uni.fFSLocation && kUnusedUniform == uni.fVSLocation) { 299 if (kUnusedUniform == uni.fFSLocation && kUnusedUniform == uni.fVSLocation) {
299 GrCapsDebugf(fGpu->caps(), "Unused uniform in shader\n"); 300 GrCapsDebugf(fGpu->caps(), "Unused uniform in shader\n");
300 } 301 }
301 } 302 }
302 #endif 303 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/gl/GrGLProgramDesc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698