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

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

Issue 1663833002: Make helper function on GrGLSLProgramDataManager non virtual (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add file Created 4 years, 10 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/GrGLProgramDataManager.h ('k') | src/gpu/glsl/GrGLSLProgramDataManager.h » ('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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 if (kUnusedUniform != uni.fFSLocation) { 256 if (kUnusedUniform != uni.fFSLocation) {
257 GR_GL_CALL(fGpu->glInterface(), 257 GR_GL_CALL(fGpu->glInterface(),
258 UniformMatrix4fv(uni.fFSLocation, arrayCount, false, matrices )); 258 UniformMatrix4fv(uni.fFSLocation, arrayCount, false, matrices ));
259 } 259 }
260 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) { 260 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
261 GR_GL_CALL(fGpu->glInterface(), 261 GR_GL_CALL(fGpu->glInterface(),
262 UniformMatrix4fv(uni.fVSLocation, arrayCount, false, matrices )); 262 UniformMatrix4fv(uni.fVSLocation, arrayCount, false, matrices ));
263 } 263 }
264 } 264 }
265 265
266 void GrGLProgramDataManager::setSkMatrix(UniformHandle u, const SkMatrix& matrix ) const {
267 float mt[] = {
268 matrix.get(SkMatrix::kMScaleX),
269 matrix.get(SkMatrix::kMSkewY),
270 matrix.get(SkMatrix::kMPersp0),
271 matrix.get(SkMatrix::kMSkewX),
272 matrix.get(SkMatrix::kMScaleY),
273 matrix.get(SkMatrix::kMPersp1),
274 matrix.get(SkMatrix::kMTransX),
275 matrix.get(SkMatrix::kMTransY),
276 matrix.get(SkMatrix::kMPersp2),
277 };
278 this->setMatrix3f(u, mt);
279 }
280
281 void GrGLProgramDataManager::setPathFragmentInputTransform(VaryingHandle u, 266 void GrGLProgramDataManager::setPathFragmentInputTransform(VaryingHandle u,
282 int components, 267 int components,
283 const SkMatrix& matri x) const { 268 const SkMatrix& matri x) const {
284 SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport()); 269 SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport());
285 const PathProcVarying& fragmentInput = fPathProcVaryings[u.toIndex()]; 270 const PathProcVarying& fragmentInput = fPathProcVaryings[u.toIndex()];
286 271
287 SkASSERT((components == 2 && fragmentInput.fType == kVec2f_GrSLType) || 272 SkASSERT((components == 2 && fragmentInput.fType == kVec2f_GrSLType) ||
288 (components == 3 && fragmentInput.fType == kVec3f_GrSLType)); 273 (components == 3 && fragmentInput.fType == kVec3f_GrSLType));
289 274
290 fGpu->glPathRendering()->setProgramPathFragmentInputTransform(fProgramID, 275 fGpu->glPathRendering()->setProgramPathFragmentInputTransform(fProgramID,
291 fragmentInput. fLocation, 276 fragmentInput. fLocation,
292 GR_GL_OBJECT_L INEAR, 277 GR_GL_OBJECT_L INEAR,
293 components, 278 components,
294 matrix); 279 matrix);
295 } 280 }
296 281
297 #ifdef SK_DEBUG 282 #ifdef SK_DEBUG
298 void GrGLProgramDataManager::printUnused(const Uniform& uni) const { 283 void GrGLProgramDataManager::printUnused(const Uniform& uni) const {
299 if (kUnusedUniform == uni.fFSLocation && kUnusedUniform == uni.fVSLocation) { 284 if (kUnusedUniform == uni.fFSLocation && kUnusedUniform == uni.fVSLocation) {
300 GrCapsDebugf(fGpu->caps(), "Unused uniform in shader\n"); 285 GrCapsDebugf(fGpu->caps(), "Unused uniform in shader\n");
301 } 286 }
302 } 287 }
303 #endif 288 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgramDataManager.h ('k') | src/gpu/glsl/GrGLSLProgramDataManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698