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

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

Issue 850953003: possible bug fix for nvpr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « no previous file | no next file » | 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 2014 Google Inc. 2 * Copyright 2014 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 "gl/GrGLPathRendering.h" 8 #include "gl/GrGLPathRendering.h"
9 #include "gl/GrGLNameAllocator.h" 9 #include "gl/GrGLNameAllocator.h"
10 #include "gl/GrGLUtil.h" 10 #include "gl/GrGLUtil.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 void GrGLPathRendering::abandonGpuResources() { 83 void GrGLPathRendering::abandonGpuResources() {
84 fPathNameAllocator.reset(NULL); 84 fPathNameAllocator.reset(NULL);
85 } 85 }
86 86
87 void GrGLPathRendering::resetContext() { 87 void GrGLPathRendering::resetContext() {
88 fHWProjectionMatrixState.invalidate(); 88 fHWProjectionMatrixState.invalidate();
89 // we don't use the model view matrix. 89 // we don't use the model view matrix.
90 GrGLenum matrixMode = 90 GrGLenum matrixMode =
91 fGpu->glStandard() == kGLES_GrGLStandard ? GR_GL_PATH_MODELVIEW : GR_GL_ MODELVIEW; 91 fGpu->glCaps().nvprSupport() == GrGLCaps::kNormal_NvprSupport ? GR_G L_PATH_MODELVIEW :
92 GR_G L_MODELVIEW;
92 GL_CALL(MatrixLoadIdentity(matrixMode)); 93 GL_CALL(MatrixLoadIdentity(matrixMode));
93 94
94 if (!caps().fragmentInputGenSupport) { 95 if (!caps().fragmentInputGenSupport) {
95 for (int i = 0; i < fGpu->glCaps().maxFixedFunctionTextureCoords(); ++i) { 96 for (int i = 0; i < fGpu->glCaps().maxFixedFunctionTextureCoords(); ++i) {
96 GL_CALL(PathTexGen(GR_GL_TEXTURE0 + i, GR_GL_NONE, 0, NULL)); 97 GL_CALL(PathTexGen(GR_GL_TEXTURE0 + i, GR_GL_NONE, 0, NULL));
97 fHWPathTexGenSettings[i].fMode = GR_GL_NONE; 98 fHWPathTexGenSettings[i].fMode = GR_GL_NONE;
98 fHWPathTexGenSettings[i].fNumComponents = 0; 99 fHWPathTexGenSettings[i].fNumComponents = 0;
99 } 100 }
100 fHWActivePathTexGenSets = 0; 101 fHWActivePathTexGenSets = 0;
101 } 102 }
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 return; 350 return;
350 } 351 }
351 352
352 fHWProjectionMatrixState.fViewMatrix = matrix; 353 fHWProjectionMatrixState.fViewMatrix = matrix;
353 fHWProjectionMatrixState.fRenderTargetSize = renderTargetSize; 354 fHWProjectionMatrixState.fRenderTargetSize = renderTargetSize;
354 fHWProjectionMatrixState.fRenderTargetOrigin = renderTargetOrigin; 355 fHWProjectionMatrixState.fRenderTargetOrigin = renderTargetOrigin;
355 356
356 GrGLfloat glMatrix[4 * 4]; 357 GrGLfloat glMatrix[4 * 4];
357 fHWProjectionMatrixState.getRTAdjustedGLMatrix<4>(glMatrix); 358 fHWProjectionMatrixState.getRTAdjustedGLMatrix<4>(glMatrix);
358 GrGLenum matrixMode = 359 GrGLenum matrixMode =
359 fGpu->glStandard() == kGLES_GrGLStandard ? GR_GL_PATH_PROJECTION : GR_G L_PROJECTION; 360 fGpu->glCaps().nvprSupport() == GrGLCaps::kNormal_NvprSupport ? GR_ GL_PATH_PROJECTION :
361 GR_ GL_PROJECTION;
360 GL_CALL(MatrixLoadf(matrixMode, glMatrix)); 362 GL_CALL(MatrixLoadf(matrixMode, glMatrix));
361 } 363 }
362 364
363 GrGLuint GrGLPathRendering::genPaths(GrGLsizei range) { 365 GrGLuint GrGLPathRendering::genPaths(GrGLsizei range) {
364 if (range > 1) { 366 if (range > 1) {
365 GrGLuint name; 367 GrGLuint name;
366 GL_CALL_RET(name, GenPaths(range)); 368 GL_CALL_RET(name, GenPaths(range));
367 return name; 369 return name;
368 } 370 }
369 371
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 reference, mask, coverMode, transformType, 470 reference, mask, coverMode, transformType,
469 transformValues)); 471 transformValues));
470 return; 472 return;
471 } 473 }
472 474
473 GL_CALL(StencilStrokePathInstanced(numPaths, pathNameType, paths, pathBase, 475 GL_CALL(StencilStrokePathInstanced(numPaths, pathNameType, paths, pathBase,
474 reference, mask, transformType, transform Values)); 476 reference, mask, transformType, transform Values));
475 GL_CALL(CoverStrokePathInstanced(numPaths, pathNameType, paths, pathBase, 477 GL_CALL(CoverStrokePathInstanced(numPaths, pathNameType, paths, pathBase,
476 coverMode, transformType, transformValues)) ; 478 coverMode, transformType, transformValues)) ;
477 } 479 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698