| 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 "GrClipMaskManager.h" | 8 #include "GrClipMaskManager.h" |
| 9 #include "GrAAConvexPathRenderer.h" | 9 #include "GrAAConvexPathRenderer.h" |
| 10 #include "GrAAHairLinePathRenderer.h" | 10 #include "GrAAHairLinePathRenderer.h" |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 } | 434 } |
| 435 GrPathRenderer::DrawPathArgs args; | 435 GrPathRenderer::DrawPathArgs args; |
| 436 args.fTarget = fClipTarget; | 436 args.fTarget = fClipTarget; |
| 437 args.fResourceProvider = this->getContext()->resourceProvider(); | 437 args.fResourceProvider = this->getContext()->resourceProvider(); |
| 438 args.fPipelineBuilder = pipelineBuilder; | 438 args.fPipelineBuilder = pipelineBuilder; |
| 439 args.fColor = color; | 439 args.fColor = color; |
| 440 args.fViewMatrix = &viewMatrix; | 440 args.fViewMatrix = &viewMatrix; |
| 441 args.fPath = &path; | 441 args.fPath = &path; |
| 442 args.fStroke = &stroke; | 442 args.fStroke = &stroke; |
| 443 args.fAntiAlias = element->isAA(); | 443 args.fAntiAlias = element->isAA(); |
| 444 args.fOrigSrcPath = nullptr; |
| 445 args.fOrigStrokeInfo = nullptr; |
| 444 pr->drawPath(args); | 446 pr->drawPath(args); |
| 445 break; | 447 break; |
| 446 } | 448 } |
| 447 } | 449 } |
| 448 return true; | 450 return true; |
| 449 } | 451 } |
| 450 | 452 |
| 451 bool GrClipMaskManager::canStencilAndDrawElement(GrPipelineBuilder* pipelineBuil
der, | 453 bool GrClipMaskManager::canStencilAndDrawElement(GrPipelineBuilder* pipelineBuil
der, |
| 452 GrTexture* target, | 454 GrTexture* target, |
| 453 GrPathRenderer** pr, | 455 GrPathRenderer** pr, |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 | 840 |
| 839 GrPathRenderer::DrawPathArgs args; | 841 GrPathRenderer::DrawPathArgs args; |
| 840 args.fTarget = fClipTarget; | 842 args.fTarget = fClipTarget; |
| 841 args.fResourceProvider = this->getContext()->resourc
eProvider(); | 843 args.fResourceProvider = this->getContext()->resourc
eProvider(); |
| 842 args.fPipelineBuilder = &pipelineBuilder; | 844 args.fPipelineBuilder = &pipelineBuilder; |
| 843 args.fColor = GrColor_WHITE; | 845 args.fColor = GrColor_WHITE; |
| 844 args.fViewMatrix = &viewMatrix; | 846 args.fViewMatrix = &viewMatrix; |
| 845 args.fPath = &clipPath; | 847 args.fPath = &clipPath; |
| 846 args.fStroke = &stroke; | 848 args.fStroke = &stroke; |
| 847 args.fAntiAlias = false; | 849 args.fAntiAlias = false; |
| 850 args.fOrigSrcPath = nullptr; |
| 851 args.fOrigStrokeInfo = nullptr; |
| 848 pr->drawPath(args); | 852 pr->drawPath(args); |
| 849 } else { | 853 } else { |
| 850 GrPathRenderer::StencilPathArgs args; | 854 GrPathRenderer::StencilPathArgs args; |
| 851 args.fTarget = fClipTarget; | 855 args.fTarget = fClipTarget; |
| 852 args.fResourceProvider = this->getContext()->resourc
eProvider(); | 856 args.fResourceProvider = this->getContext()->resourc
eProvider(); |
| 853 args.fPipelineBuilder = &pipelineBuilder; | 857 args.fPipelineBuilder = &pipelineBuilder; |
| 854 args.fViewMatrix = &viewMatrix; | 858 args.fViewMatrix = &viewMatrix; |
| 855 args.fPath = &clipPath; | 859 args.fPath = &clipPath; |
| 856 args.fStroke = &stroke; | 860 args.fStroke = &stroke; |
| 857 pr->stencilPath(args); | 861 pr->stencilPath(args); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 876 } else { | 880 } else { |
| 877 GrPathRenderer::DrawPathArgs args; | 881 GrPathRenderer::DrawPathArgs args; |
| 878 args.fTarget = fClipTarget; | 882 args.fTarget = fClipTarget; |
| 879 args.fResourceProvider = this->getContext()->resourcePro
vider(); | 883 args.fResourceProvider = this->getContext()->resourcePro
vider(); |
| 880 args.fPipelineBuilder = &pipelineBuilder; | 884 args.fPipelineBuilder = &pipelineBuilder; |
| 881 args.fColor = GrColor_WHITE; | 885 args.fColor = GrColor_WHITE; |
| 882 args.fViewMatrix = &viewMatrix; | 886 args.fViewMatrix = &viewMatrix; |
| 883 args.fPath = &clipPath; | 887 args.fPath = &clipPath; |
| 884 args.fStroke = &stroke; | 888 args.fStroke = &stroke; |
| 885 args.fAntiAlias = false; | 889 args.fAntiAlias = false; |
| 890 args.fOrigSrcPath = nullptr; |
| 891 args.fOrigStrokeInfo = nullptr; |
| 886 pr->drawPath(args); | 892 pr->drawPath(args); |
| 887 } | 893 } |
| 888 } else { | 894 } else { |
| 889 // The view matrix is setup to do clip space -> stencil spac
e translation, so | 895 // The view matrix is setup to do clip space -> stencil spac
e translation, so |
| 890 // draw rect in clip space. | 896 // draw rect in clip space. |
| 891 fClipTarget->drawSimpleRect(pipelineBuilder, | 897 fClipTarget->drawSimpleRect(pipelineBuilder, |
| 892 GrColor_WHITE, | 898 GrColor_WHITE, |
| 893 viewMatrix, | 899 viewMatrix, |
| 894 SkRect::Make(clipSpaceIBounds)); | 900 SkRect::Make(clipSpaceIBounds)); |
| 895 } | 901 } |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 fAACache.purgeResources(); | 1156 fAACache.purgeResources(); |
| 1151 } | 1157 } |
| 1152 | 1158 |
| 1153 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc
ilAttachment, | 1159 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc
ilAttachment, |
| 1154 GrStencilSettings* settings) { | 1160 GrStencilSettings* settings) { |
| 1155 if (stencilAttachment) { | 1161 if (stencilAttachment) { |
| 1156 int stencilBits = stencilAttachment->bits(); | 1162 int stencilBits = stencilAttachment->bits(); |
| 1157 this->adjustStencilParams(settings, fClipMode, stencilBits); | 1163 this->adjustStencilParams(settings, fClipMode, stencilBits); |
| 1158 } | 1164 } |
| 1159 } | 1165 } |
| OLD | NEW |