From 44701df5ce572ac3cccec785cf52103d3d5d14a5 Mon Sep 17 00:00:00 2001 From: joshualitt Date: Mon, 23 Feb 2015 14:44:57 -0800 Subject: Move clip off of draw target BUG=skia: Review URL: https://codereview.chromium.org/947443003 --- src/gpu/GrDrawTarget.cpp | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'src/gpu/GrDrawTarget.cpp') diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp index ee111a6535..7d39c2011b 100644 --- a/src/gpu/GrDrawTarget.cpp +++ b/src/gpu/GrDrawTarget.cpp @@ -92,8 +92,7 @@ void GrDrawTarget::DrawInfo::adjustStartIndex(int indexOffset) { #define DEBUG_INVAL_START_IDX -1 GrDrawTarget::GrDrawTarget(GrContext* context) - : fClip(NULL) - , fContext(context) + : fContext(context) , fGpuTraceMarkerCount(0) { SkASSERT(context); GeometrySrcState& geoSrc = fGeoSrcStateStack.push_back(); @@ -124,14 +123,6 @@ void GrDrawTarget::releaseGeometry() { this->resetIndexSource(); } -void GrDrawTarget::setClip(const GrClipData* clip) { - fClip = clip; -} - -const GrClipData* GrDrawTarget::getClip() const { - return fClip; -} - bool GrDrawTarget::reserveVertexSpace(size_t vertexSize, int vertexCount, void** vertices) { @@ -395,9 +386,8 @@ bool GrDrawTarget::setupDstReadIfNecessary(const GrPipelineBuilder& pipelineBuil return true; } SkIRect copyRect; - const GrClipData* clip = this->getClip(); GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); - clip->getConservativeBounds(rt, ©Rect); + pipelineBuilder.clip().getConservativeBounds(rt, ©Rect); if (drawBounds) { SkIRect drawIBounds; @@ -879,15 +869,6 @@ void GrDrawTarget::AutoReleaseGeometry::reset() { fIndices = NULL; } -GrDrawTarget::AutoClipRestore::AutoClipRestore(GrDrawTarget* target, const SkIRect& newClip) { - fTarget = target; - fClip = fTarget->getClip(); - fStack.init(); - fStack.get()->clipDevRect(newClip, SkRegion::kReplace_Op); - fReplacementClip.fClipStack.reset(SkRef(fStack.get())); - target->setClip(&fReplacementClip); -} - namespace { // returns true if the read/written rect intersects the src/dst and false if not. bool clip_srcrect_and_dstpoint(const GrSurface* dst, @@ -1295,6 +1276,5 @@ bool GrClipTarget::setupClip(GrPipelineBuilder* pipelineBuilder, are, ars, scissorState, - this->getClip(), devBounds); } -- cgit v1.2.3