aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawTarget.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-02-23 14:44:57 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-23 14:44:58 -0800
commit44701df5ce572ac3cccec785cf52103d3d5d14a5 (patch)
treeb2f3b5465cc8490261163006376c7f7a30b5399e /src/gpu/GrDrawTarget.cpp
parent98c251bc7eec5aa236700d9936c740f2744788db (diff)
Move clip off of draw target
Diffstat (limited to 'src/gpu/GrDrawTarget.cpp')
-rw-r--r--src/gpu/GrDrawTarget.cpp24
1 files changed, 2 insertions, 22 deletions
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, &copyRect);
+ pipelineBuilder.clip().getConservativeBounds(rt, &copyRect);
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);
}