OLD | NEW |
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 "GrAAConvexPathRenderer.h" | 8 #include "GrAAConvexPathRenderer.h" |
9 | 9 |
10 #include "GrAAConvexTessellator.h" | 10 #include "GrAAConvexTessellator.h" |
11 #include "GrBatchFlushState.h" | 11 #include "GrBatchFlushState.h" |
12 #include "GrBatchTest.h" | 12 #include "GrBatchTest.h" |
13 #include "GrCaps.h" | 13 #include "GrCaps.h" |
14 #include "GrContext.h" | 14 #include "GrContext.h" |
15 #include "GrDefaultGeoProcFactory.h" | 15 #include "GrDefaultGeoProcFactory.h" |
16 #include "GrGeometryProcessor.h" | 16 #include "GrGeometryProcessor.h" |
17 #include "GrInvariantOutput.h" | 17 #include "GrInvariantOutput.h" |
18 #include "GrPathUtils.h" | 18 #include "GrPathUtils.h" |
19 #include "GrProcessor.h" | 19 #include "GrProcessor.h" |
20 #include "GrPipelineBuilder.h" | 20 #include "GrPipelineBuilder.h" |
21 #include "GrStrokeInfo.h" | |
22 #include "SkGeometry.h" | 21 #include "SkGeometry.h" |
23 #include "SkPathPriv.h" | 22 #include "SkPathPriv.h" |
24 #include "SkString.h" | 23 #include "SkString.h" |
25 #include "SkTraceEvent.h" | 24 #include "SkTraceEvent.h" |
26 #include "batches/GrVertexBatch.h" | 25 #include "batches/GrVertexBatch.h" |
27 #include "glsl/GrGLSLFragmentShaderBuilder.h" | 26 #include "glsl/GrGLSLFragmentShaderBuilder.h" |
28 #include "glsl/GrGLSLGeometryProcessor.h" | 27 #include "glsl/GrGLSLGeometryProcessor.h" |
29 #include "glsl/GrGLSLProgramDataManager.h" | 28 #include "glsl/GrGLSLProgramDataManager.h" |
30 #include "glsl/GrGLSLUniformHandler.h" | 29 #include "glsl/GrGLSLUniformHandler.h" |
31 #include "glsl/GrGLSLVarying.h" | 30 #include "glsl/GrGLSLVarying.h" |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 return d->fCaps->shaderCaps()->shaderDerivativeSupport() ? | 674 return d->fCaps->shaderCaps()->shaderDerivativeSupport() ? |
676 QuadEdgeEffect::Create(GrRandomColor(d->fRandom), | 675 QuadEdgeEffect::Create(GrRandomColor(d->fRandom), |
677 GrTest::TestMatrix(d->fRandom), | 676 GrTest::TestMatrix(d->fRandom), |
678 d->fRandom->nextBool()) : nullptr; | 677 d->fRandom->nextBool()) : nullptr; |
679 } | 678 } |
680 | 679 |
681 /////////////////////////////////////////////////////////////////////////////// | 680 /////////////////////////////////////////////////////////////////////////////// |
682 | 681 |
683 bool GrAAConvexPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { | 682 bool GrAAConvexPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { |
684 return (args.fShaderCaps->shaderDerivativeSupport() && args.fAntiAlias && | 683 return (args.fShaderCaps->shaderDerivativeSupport() && args.fAntiAlias && |
685 args.fStroke->isFillStyle() && !args.fPath->isInverseFillType() && | 684 args.fStyle->isSimpleFill() && !args.fPath->isInverseFillType() && |
686 args.fPath->isConvex()); | 685 args.fPath->isConvex()); |
687 } | 686 } |
688 | 687 |
689 // extract the result vertices and indices from the GrAAConvexTessellator | 688 // extract the result vertices and indices from the GrAAConvexTessellator |
690 static void extract_verts(const GrAAConvexTessellator& tess, | 689 static void extract_verts(const GrAAConvexTessellator& tess, |
691 void* vertices, | 690 void* vertices, |
692 size_t vertexStride, | 691 size_t vertexStride, |
693 GrColor color, | 692 GrColor color, |
694 uint16_t* idxs, | 693 uint16_t* idxs, |
695 bool tweakAlphaForCoverage) { | 694 bool tweakAlphaForCoverage) { |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { | 1019 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { |
1021 AAConvexPathBatch::Geometry geometry; | 1020 AAConvexPathBatch::Geometry geometry; |
1022 geometry.fColor = GrRandomColor(random); | 1021 geometry.fColor = GrRandomColor(random); |
1023 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 1022 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
1024 geometry.fPath = GrTest::TestPathConvex(random); | 1023 geometry.fPath = GrTest::TestPathConvex(random); |
1025 | 1024 |
1026 return AAConvexPathBatch::Create(geometry); | 1025 return AAConvexPathBatch::Create(geometry); |
1027 } | 1026 } |
1028 | 1027 |
1029 #endif | 1028 #endif |
OLD | NEW |