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 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 AutoCheckFlush acf(fDrawingManager); | 815 AutoCheckFlush acf(fDrawingManager); |
816 | 816 |
817 if (should_apply_coverage_aa(paint, fRenderTarget.get()) && !strokeInfo.isDa
shed()) { | 817 if (should_apply_coverage_aa(paint, fRenderTarget.get()) && !strokeInfo.isDa
shed()) { |
818 if (strokeInfo.getWidth() < 0 && !path.isConvex()) { | 818 if (strokeInfo.getWidth() < 0 && !path.isConvex()) { |
819 // Concave AA paths are expensive - try to avoid them for special ca
ses | 819 // Concave AA paths are expensive - try to avoid them for special ca
ses |
820 SkRect rects[2]; | 820 SkRect rects[2]; |
821 | 821 |
822 if (is_nested_rects(viewMatrix, path, strokeInfo, rects)) { | 822 if (is_nested_rects(viewMatrix, path, strokeInfo, rects)) { |
823 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateAAFill
NestedRects( | 823 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateAAFill
NestedRects( |
824 paint.getColor(), viewMatrix, rects)); | 824 paint.getColor(), viewMatrix, rects)); |
825 | 825 if (batch) { |
826 GrPipelineBuilder pipelineBuilder(paint, fRenderTarget.get(), cl
ip); | 826 GrPipelineBuilder pipelineBuilder(paint, fRenderTarget.get()
, clip); |
827 this->getDrawTarget()->drawBatch(pipelineBuilder, batch); | 827 this->getDrawTarget()->drawBatch(pipelineBuilder, batch); |
| 828 } |
828 return; | 829 return; |
829 } | 830 } |
830 } | 831 } |
831 SkRect ovalRect; | 832 SkRect ovalRect; |
832 bool isOval = path.isOval(&ovalRect); | 833 bool isOval = path.isOval(&ovalRect); |
833 | 834 |
834 if (isOval && !path.isInverseFillType()) { | 835 if (isOval && !path.isInverseFillType()) { |
835 GrShaderCaps* shaderCaps = fContext->caps()->shaderCaps(); | 836 GrShaderCaps* shaderCaps = fContext->caps()->shaderCaps(); |
836 SkAutoTUnref<GrDrawBatch> batch(GrOvalRenderer::CreateOvalBatch(pain
t.getColor(), | 837 SkAutoTUnref<GrDrawBatch> batch(GrOvalRenderer::CreateOvalBatch(pain
t.getColor(), |
837 view
Matrix, | 838 view
Matrix, |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 } | 1034 } |
1034 | 1035 |
1035 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b
atch) { | 1036 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b
atch) { |
1036 ASSERT_SINGLE_OWNER | 1037 ASSERT_SINGLE_OWNER |
1037 RETURN_IF_ABANDONED | 1038 RETURN_IF_ABANDONED |
1038 SkDEBUGCODE(this->validate();) | 1039 SkDEBUGCODE(this->validate();) |
1039 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); | 1040 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); |
1040 | 1041 |
1041 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); | 1042 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); |
1042 } | 1043 } |
OLD | NEW |