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

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

Issue 894693003: Add refcnting to SkClipStack on SkCanvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc Created 5 years, 10 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 | « src/core/SkCanvas.cpp ('k') | src/gpu/SkGpuDevice.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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrDrawTarget.h" 9 #include "GrDrawTarget.h"
10 10
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 } 873 }
874 fVertices = NULL; 874 fVertices = NULL;
875 fIndices = NULL; 875 fIndices = NULL;
876 } 876 }
877 877
878 GrDrawTarget::AutoClipRestore::AutoClipRestore(GrDrawTarget* target, const SkIRe ct& newClip) { 878 GrDrawTarget::AutoClipRestore::AutoClipRestore(GrDrawTarget* target, const SkIRe ct& newClip) {
879 fTarget = target; 879 fTarget = target;
880 fClip = fTarget->getClip(); 880 fClip = fTarget->getClip();
881 fStack.init(); 881 fStack.init();
882 fStack.get()->clipDevRect(newClip, SkRegion::kReplace_Op); 882 fStack.get()->clipDevRect(newClip, SkRegion::kReplace_Op);
883 fReplacementClip.fClipStack = fStack.get(); 883 fReplacementClip.fClipStack.reset(SkRef(fStack.get()));
884 target->setClip(&fReplacementClip); 884 target->setClip(&fReplacementClip);
885 } 885 }
886 886
887 namespace { 887 namespace {
888 // returns true if the read/written rect intersects the src/dst and false if not . 888 // returns true if the read/written rect intersects the src/dst and false if not .
889 bool clip_srcrect_and_dstpoint(const GrSurface* dst, 889 bool clip_srcrect_and_dstpoint(const GrSurface* dst,
890 const GrSurface* src, 890 const GrSurface* src,
891 const SkIRect& srcRect, 891 const SkIRect& srcRect,
892 const SkIPoint& dstPoint, 892 const SkIPoint& dstPoint,
893 SkIRect* clippedSrcRect, 893 SkIRect* clippedSrcRect,
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 GrPipelineBuilder::AutoRestoreStencil* ars, 1244 GrPipelineBuilder::AutoRestoreStencil* ars,
1245 GrScissorState* scissorState, 1245 GrScissorState* scissorState,
1246 const SkRect* devBounds) { 1246 const SkRect* devBounds) {
1247 return fClipMaskManager.setupClipping(pipelineBuilder, 1247 return fClipMaskManager.setupClipping(pipelineBuilder,
1248 are, 1248 are,
1249 ars, 1249 ars,
1250 scissorState, 1250 scissorState,
1251 this->getClip(), 1251 this->getClip(),
1252 devBounds); 1252 devBounds);
1253 } 1253 }
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698