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 "GrCaps.h" | 9 #include "GrCaps.h" |
10 #include "GrDrawingManager.h" | 10 #include "GrDrawingManager.h" |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 GrUserStencilOp::kIncMaybeClamp, | 676 GrUserStencilOp::kIncMaybeClamp, |
677 0xffff>() | 677 0xffff>() |
678 ); | 678 ); |
679 if (Element::kRect_Type == element->getType()) { | 679 if (Element::kRect_Type == element->getType()) { |
680 DrawNonAARect(drawContext, clip, viewMatrix, | 680 DrawNonAARect(drawContext, clip, viewMatrix, |
681 element->getRect(), element->isAA(), &kDrawToS
tencil); | 681 element->getRect(), element->isAA(), &kDrawToS
tencil); |
682 } else { | 682 } else { |
683 if (!clipPath.isEmpty()) { | 683 if (!clipPath.isEmpty()) { |
684 if (canRenderDirectToStencil) { | 684 if (canRenderDirectToStencil) { |
685 GrPaint paint; | 685 GrPaint paint; |
686 paint.setXPFactory(GrDisableColorXPFactory::Create()
); | 686 SkSafeUnref(paint.setXPFactory(GrDisableColorXPFacto
ry::Create())); |
687 paint.setAntiAlias(element->isAA()); | 687 paint.setAntiAlias(element->isAA()); |
688 | 688 |
689 GrPathRenderer::DrawPathArgs args; | 689 GrPathRenderer::DrawPathArgs args; |
690 args.fResourceProvider = context->resourceProvider()
; | 690 args.fResourceProvider = context->resourceProvider()
; |
691 args.fPaint = &paint; | 691 args.fPaint = &paint; |
692 args.fUserStencilSettings = &kDrawToStencil; | 692 args.fUserStencilSettings = &kDrawToStencil; |
693 args.fDrawContext = drawContext; | 693 args.fDrawContext = drawContext; |
694 args.fClip = &clip; | 694 args.fClip = &clip; |
695 args.fColor = GrColor_WHITE; | 695 args.fColor = GrColor_WHITE; |
696 args.fViewMatrix = &viewMatrix; | 696 args.fViewMatrix = &viewMatrix; |
(...skipping 20 matching lines...) Expand all Loading... |
717 // element directly or a bounding rect of the entire clip. | 717 // element directly or a bounding rect of the entire clip. |
718 clip.enableStencilClip(true); | 718 clip.enableStencilClip(true); |
719 for (GrUserStencilSettings const* const* pass = stencilPasses; *pass
; ++pass) { | 719 for (GrUserStencilSettings const* const* pass = stencilPasses; *pass
; ++pass) { |
720 | 720 |
721 if (drawDirectToClip) { | 721 if (drawDirectToClip) { |
722 if (Element::kRect_Type == element->getType()) { | 722 if (Element::kRect_Type == element->getType()) { |
723 DrawNonAARect(drawContext, clip, | 723 DrawNonAARect(drawContext, clip, |
724 viewMatrix, element->getRect(), element->i
sAA(), *pass); | 724 viewMatrix, element->getRect(), element->i
sAA(), *pass); |
725 } else { | 725 } else { |
726 GrPaint paint; | 726 GrPaint paint; |
727 paint.setXPFactory(GrDisableColorXPFactory::Create()); | 727 SkSafeUnref(paint.setXPFactory(GrDisableColorXPFactory::
Create())); |
728 paint.setAntiAlias(element->isAA()); | 728 paint.setAntiAlias(element->isAA()); |
729 | 729 |
730 GrPathRenderer::DrawPathArgs args; | 730 GrPathRenderer::DrawPathArgs args; |
731 args.fResourceProvider = context->resourceProvider(); | 731 args.fResourceProvider = context->resourceProvider(); |
732 args.fPaint = &paint; | 732 args.fPaint = &paint; |
733 args.fUserStencilSettings = *pass; | 733 args.fUserStencilSettings = *pass; |
734 args.fDrawContext = drawContext; | 734 args.fDrawContext = drawContext; |
735 args.fClip = &clip; | 735 args.fClip = &clip; |
736 args.fColor = GrColor_WHITE; | 736 args.fColor = GrColor_WHITE; |
737 args.fViewMatrix = &viewMatrix; | 737 args.fViewMatrix = &viewMatrix; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 sk_sp<GrTexture> result(texProvider->createApproxTexture(desc)); | 823 sk_sp<GrTexture> result(texProvider->createApproxTexture(desc)); |
824 if (!result) { | 824 if (!result) { |
825 return nullptr; | 825 return nullptr; |
826 } | 826 } |
827 result->resourcePriv().setUniqueKey(key); | 827 result->resourcePriv().setUniqueKey(key); |
828 | 828 |
829 helper.toTexture(result.get()); | 829 helper.toTexture(result.get()); |
830 | 830 |
831 return result; | 831 return result; |
832 } | 832 } |
OLD | NEW |