OLD | NEW |
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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 if (components >= 3) { | 332 if (components >= 3) { |
333 coefficients[6] = SkScalarToFloat(matrix[SkMatrix::kMPersp0]); | 333 coefficients[6] = SkScalarToFloat(matrix[SkMatrix::kMPersp0]); |
334 coefficients[7] = SkScalarToFloat(matrix[SkMatrix::kMPersp1]); | 334 coefficients[7] = SkScalarToFloat(matrix[SkMatrix::kMPersp1]); |
335 coefficients[8] = SkScalarToFloat(matrix[SkMatrix::kMPersp2]); | 335 coefficients[8] = SkScalarToFloat(matrix[SkMatrix::kMPersp2]); |
336 } | 336 } |
337 | 337 |
338 GL_CALL(ProgramPathFragmentInputGen(program, location, genMode, components,
coefficients)); | 338 GL_CALL(ProgramPathFragmentInputGen(program, location, genMode, components,
coefficients)); |
339 } | 339 } |
340 | 340 |
341 void GrGLPathRendering::setProjectionMatrix(const SkMatrix& matrix, | 341 void GrGLPathRendering::setProjectionMatrix(const SkMatrix& matrix, |
342 const SkISize& renderTargetSize, | 342 const SkISize& renderTargetSize, |
343 GrSurfaceOrigin renderTargetOrigin) { | 343 GrSurfaceOrigin renderTargetOrigin)
{ |
344 | 344 |
345 SkASSERT(fGpu->glCaps().pathRenderingSupport()); | 345 SkASSERT(fGpu->glCaps().pathRenderingSupport()); |
346 | 346 |
347 if (renderTargetOrigin == fHWProjectionMatrixState.fRenderTargetOrigin && | 347 if (renderTargetOrigin == fHWProjectionMatrixState.fRenderTargetOrigin && |
348 renderTargetSize == fHWProjectionMatrixState.fRenderTargetSize && | 348 renderTargetSize == fHWProjectionMatrixState.fRenderTargetSize && |
349 matrix.cheapEqualTo(fHWProjectionMatrixState.fViewMatrix)) { | 349 matrix.cheapEqualTo(fHWProjectionMatrixState.fViewMatrix)) { |
350 return; | 350 return; |
351 } | 351 } |
352 | 352 |
353 fHWProjectionMatrixState.fViewMatrix = matrix; | 353 fHWProjectionMatrixState.fViewMatrix = matrix; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 reference, mask, coverMode,
transformType, | 469 reference, mask, coverMode,
transformType, |
470 transformValues)); | 470 transformValues)); |
471 return; | 471 return; |
472 } | 472 } |
473 | 473 |
474 GL_CALL(StencilStrokePathInstanced(numPaths, pathNameType, paths, pathBase, | 474 GL_CALL(StencilStrokePathInstanced(numPaths, pathNameType, paths, pathBase, |
475 reference, mask, transformType, transform
Values)); | 475 reference, mask, transformType, transform
Values)); |
476 GL_CALL(CoverStrokePathInstanced(numPaths, pathNameType, paths, pathBase, | 476 GL_CALL(CoverStrokePathInstanced(numPaths, pathNameType, paths, pathBase, |
477 coverMode, transformType, transformValues))
; | 477 coverMode, transformType, transformValues))
; |
478 } | 478 } |
OLD | NEW |