OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrBatchTest.h" | 8 #include "GrBatchTest.h" |
9 #include "GrColor.h" | 9 #include "GrColor.h" |
10 #include "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 | 969 |
970 bool useCoverageAA = should_apply_coverage_aa(paint, fRenderTarget.get()); | 970 bool useCoverageAA = should_apply_coverage_aa(paint, fRenderTarget.get()); |
971 constexpr bool kHasUserStencilSettings = false; | 971 constexpr bool kHasUserStencilSettings = false; |
972 bool isStencilBufferMSAA = fRenderTarget->isStencilBufferMultisampled(); | 972 bool isStencilBufferMSAA = fRenderTarget->isStencilBufferMultisampled(); |
973 | 973 |
974 const GrPathRendererChain::DrawType type = | 974 const GrPathRendererChain::DrawType type = |
975 useCoverageAA ? GrPathRendererChain::kColorAntiAlias_DrawType | 975 useCoverageAA ? GrPathRendererChain::kColorAntiAlias_DrawType |
976 : GrPathRendererChain::kColor_DrawType; | 976 : GrPathRendererChain::kColor_DrawType; |
977 | 977 |
978 GrShape shape(path, style); | 978 GrShape shape(path, style); |
| 979 if (shape.isEmpty()) { |
| 980 return; |
| 981 } |
979 GrPathRenderer::CanDrawPathArgs canDrawArgs; | 982 GrPathRenderer::CanDrawPathArgs canDrawArgs; |
980 canDrawArgs.fShaderCaps = fDrawingManager->getContext()->caps()->shaderCaps(
); | 983 canDrawArgs.fShaderCaps = fDrawingManager->getContext()->caps()->shaderCaps(
); |
981 canDrawArgs.fViewMatrix = &viewMatrix; | 984 canDrawArgs.fViewMatrix = &viewMatrix; |
982 canDrawArgs.fShape = &shape; | 985 canDrawArgs.fShape = &shape; |
983 canDrawArgs.fAntiAlias = useCoverageAA; | 986 canDrawArgs.fAntiAlias = useCoverageAA; |
984 canDrawArgs.fHasUserStencilSettings = kHasUserStencilSettings; | 987 canDrawArgs.fHasUserStencilSettings = kHasUserStencilSettings; |
985 canDrawArgs.fIsStencilBufferMSAA = isStencilBufferMSAA; | 988 canDrawArgs.fIsStencilBufferMSAA = isStencilBufferMSAA; |
986 | 989 |
987 // Try a 1st time without applying any of the style to the geometry (and bar
ring sw) | 990 // Try a 1st time without applying any of the style to the geometry (and bar
ring sw) |
988 GrPathRenderer* pr = fDrawingManager->getPathRenderer(canDrawArgs, false, ty
pe); | 991 GrPathRenderer* pr = fDrawingManager->getPathRenderer(canDrawArgs, false, ty
pe); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 | 1033 |
1031 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, | 1034 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, |
1032 GrDrawBatch* batch) { | 1035 GrDrawBatch* batch) { |
1033 ASSERT_SINGLE_OWNER | 1036 ASSERT_SINGLE_OWNER |
1034 RETURN_IF_ABANDONED | 1037 RETURN_IF_ABANDONED |
1035 SkDEBUGCODE(this->validate();) | 1038 SkDEBUGCODE(this->validate();) |
1036 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); | 1039 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); |
1037 | 1040 |
1038 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); | 1041 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); |
1039 } | 1042 } |
OLD | NEW |