Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/gpu/GrClipMaskManager.cpp

Issue 2037243002: More Unref GrXPFactory. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/gpu/batches/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/batches/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698