| 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 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 canDrawArgs.fHasUserStencilSettings = hasUserStencilSettings; | 953 canDrawArgs.fHasUserStencilSettings = hasUserStencilSettings; |
| 954 canDrawArgs.fIsStencilBufferMSAA = isStencilBufferMSAA; | 954 canDrawArgs.fIsStencilBufferMSAA = isStencilBufferMSAA; |
| 955 | 955 |
| 956 // Don't allow the SW renderer | 956 // Don't allow the SW renderer |
| 957 GrPathRenderer* pr = fDrawContext->fDrawingManager->getPathRenderer(canDrawA
rgs, false, type); | 957 GrPathRenderer* pr = fDrawContext->fDrawingManager->getPathRenderer(canDrawA
rgs, false, type); |
| 958 if (!pr) { | 958 if (!pr) { |
| 959 return false; | 959 return false; |
| 960 } | 960 } |
| 961 | 961 |
| 962 GrPaint paint; | 962 GrPaint paint; |
| 963 paint.setColor4f(GrColor4f(1.0f, 1.0f, 1.0f, 1.0f)); |
| 963 paint.setCoverageSetOpXPFactory(op, invert); | 964 paint.setCoverageSetOpXPFactory(op, invert); |
| 964 | 965 |
| 965 GrPathRenderer::DrawPathArgs args; | 966 GrPathRenderer::DrawPathArgs args; |
| 966 args.fResourceProvider = fDrawContext->fDrawingManager->getContext()->resour
ceProvider(); | 967 args.fResourceProvider = fDrawContext->fDrawingManager->getContext()->resour
ceProvider(); |
| 967 args.fPaint = &paint; | 968 args.fPaint = &paint; |
| 968 args.fUserStencilSettings = ss; | 969 args.fUserStencilSettings = ss; |
| 969 args.fDrawContext = fDrawContext; | 970 args.fDrawContext = fDrawContext; |
| 970 args.fClip = &clip; | 971 args.fClip = &clip; |
| 971 args.fColor = GrColor_WHITE; | |
| 972 args.fViewMatrix = &viewMatrix; | 972 args.fViewMatrix = &viewMatrix; |
| 973 args.fShape = &shape; | 973 args.fShape = &shape; |
| 974 args.fAntiAlias = useCoverageAA; | 974 args.fAntiAlias = useCoverageAA; |
| 975 args.fGammaCorrect = fDrawContext->isGammaCorrect(); | 975 args.fGammaCorrect = fDrawContext->isGammaCorrect(); |
| 976 pr->drawPath(args); | 976 pr->drawPath(args); |
| 977 return true; | 977 return true; |
| 978 } | 978 } |
| 979 | 979 |
| 980 void GrDrawContext::internalDrawPath(const GrClip& clip, | 980 void GrDrawContext::internalDrawPath(const GrClip& clip, |
| 981 const GrPaint& paint, | 981 const GrPaint& paint, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 #endif | 1035 #endif |
| 1036 return; | 1036 return; |
| 1037 } | 1037 } |
| 1038 | 1038 |
| 1039 GrPathRenderer::DrawPathArgs args; | 1039 GrPathRenderer::DrawPathArgs args; |
| 1040 args.fResourceProvider = fDrawingManager->getContext()->resourceProvider(); | 1040 args.fResourceProvider = fDrawingManager->getContext()->resourceProvider(); |
| 1041 args.fPaint = &paint; | 1041 args.fPaint = &paint; |
| 1042 args.fUserStencilSettings = &GrUserStencilSettings::kUnused; | 1042 args.fUserStencilSettings = &GrUserStencilSettings::kUnused; |
| 1043 args.fDrawContext = this; | 1043 args.fDrawContext = this; |
| 1044 args.fClip = &clip; | 1044 args.fClip = &clip; |
| 1045 args.fColor = paint.getColor(); | |
| 1046 args.fViewMatrix = &viewMatrix; | 1045 args.fViewMatrix = &viewMatrix; |
| 1047 args.fShape = canDrawArgs.fShape; | 1046 args.fShape = canDrawArgs.fShape; |
| 1048 args.fAntiAlias = useCoverageAA; | 1047 args.fAntiAlias = useCoverageAA; |
| 1049 args.fGammaCorrect = this->isGammaCorrect(); | 1048 args.fGammaCorrect = this->isGammaCorrect(); |
| 1050 pr->drawPath(args); | 1049 pr->drawPath(args); |
| 1051 } | 1050 } |
| 1052 | 1051 |
| 1053 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, | 1052 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, |
| 1054 GrDrawBatch* batch) { | 1053 GrDrawBatch* batch) { |
| 1055 ASSERT_SINGLE_OWNER | 1054 ASSERT_SINGLE_OWNER |
| 1056 RETURN_IF_ABANDONED | 1055 RETURN_IF_ABANDONED |
| 1057 SkDEBUGCODE(this->validate();) | 1056 SkDEBUGCODE(this->validate();) |
| 1058 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); | 1057 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); |
| 1059 | 1058 |
| 1060 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); | 1059 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); |
| 1061 } | 1060 } |
| OLD | NEW |