Revert "Pass bounds into draw calls in path renderers."
This reverts commit 9e6c4259d8453b893b4abc28beba8f77226d18d1.
git-svn-id: http://skia.googlecode.com/svn/trunk@9173 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index 93404b4..fc6cae6 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -660,9 +660,6 @@
SkSTArray<kPreallocDrawCnt, Draw, true> draws;
create_vertices(segments, fanPt, &draws, verts, idxs);
- SkRect devBounds;
- GetPathDevBounds(origPath, drawState->getRenderTarget(), adcd.getOriginalMatrix(), &devBounds);
-
int vOffset = 0;
for (int i = 0; i < draws.count(); ++i) {
const Draw& draw = draws[i];
@@ -670,8 +667,7 @@
vOffset, // start vertex
0, // start index
draw.fVertexCnt,
- draw.fIndexCnt,
- &devBounds);
+ draw.fIndexCnt);
vOffset += draw.fVertexCnt;
}
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index e78b563..da54ed6 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -816,9 +816,6 @@
GrEffectRef* hairLineEffect = HairLineEdgeEffect::Create();
GrEffectRef* hairQuadEffect = HairQuadEdgeEffect::Create();
- SkRect devBounds;
- GetPathDevBounds(path, drawState->getRenderTarget(), adcd.getOriginalMatrix(), &devBounds);
-
target->setIndexSourceToBuffer(fLinesIndexBuffer);
int lines = 0;
int nBufLines = fLinesIndexBuffer->maxQuads();
@@ -829,8 +826,7 @@
kVertsPerLineSeg*lines, // startV
0, // startI
kVertsPerLineSeg*n, // vCount
- kIdxsPerLineSeg*n,
- &devBounds); // iCount
+ kIdxsPerLineSeg*n); // iCount
lines += n;
}
@@ -843,8 +839,7 @@
4 * lineCnt + kVertsPerQuad*quads, // startV
0, // startI
kVertsPerQuad*n, // vCount
- kIdxsPerQuad*n, // iCount
- &devBounds);
+ kIdxsPerQuad*n); // iCount
quads += n;
}
target->resetIndexSource();
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index 87deb9c..43809ed 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -445,9 +445,7 @@
}
}
- SkRect devBounds;
- GetPathDevBounds(path, drawState->getRenderTarget(), viewM, &devBounds);
-
+ {
for (int p = 0; p < passCount; ++p) {
drawState->setDrawFace(drawFace[p]);
if (NULL != passes[p]) {
@@ -462,8 +460,10 @@
GrDrawState::AutoDeviceCoordDraw adcd;
if (reverse) {
GrAssert(NULL != drawState->getRenderTarget());
- // draw over the dev bounds (which will be the whole dst surface for inv fill).
- bounds = devBounds;
+ // draw over the whole world.
+ bounds.setLTRB(0, 0,
+ SkIntToScalar(drawState->getRenderTarget()->width()),
+ SkIntToScalar(drawState->getRenderTarget()->height()));
SkMatrix vmi;
// mapRect through persp matrix may not be correct
if (!drawState->getViewMatrix().hasPerspective() &&
@@ -483,12 +483,13 @@
}
if (indexCnt) {
target->drawIndexed(primType, 0, 0,
- vertexCnt, indexCnt, &devBounds);
+ vertexCnt, indexCnt);
} else {
- target->drawNonIndexed(primType, 0, vertexCnt, &devBounds);
+ target->drawNonIndexed(primType, 0, vertexCnt);
}
}
}
+ }
return true;
}
diff --git a/src/gpu/GrPathRenderer.cpp b/src/gpu/GrPathRenderer.cpp
index e88db22..e0d2682 100644
--- a/src/gpu/GrPathRenderer.cpp
+++ b/src/gpu/GrPathRenderer.cpp
@@ -12,15 +12,3 @@
GrPathRenderer::GrPathRenderer() {
}
-
-void GrPathRenderer::GetPathDevBounds(const SkPath& path,
- int devW, int devH,
- const SkMatrix& matrix,
- SkRect* bounds) {
- if (path.isInverseFillType()) {
- *bounds = SkRect::MakeWH(SkIntToScalar(devW), SkIntToScalar(devH));
- return;
- }
- *bounds = path.getBounds();
- matrix.mapRect(bounds);
-}
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h
index 3d4c993..ebd464f 100644
--- a/src/gpu/GrPathRenderer.h
+++ b/src/gpu/GrPathRenderer.h
@@ -1,4 +1,4 @@
-
+
/*
* Copyright 2011 Google Inc.
*
@@ -173,22 +173,6 @@
this->drawPath(path, stroke, target, false);
}
- // Helper for getting the device bounds of a path. Inverse filled paths will have bounds set
- // by devSize. Non-inverse path bounds will not necessarily be clipped to devSize.
- static void GetPathDevBounds(const SkPath& path,
- int devW,
- int devH,
- const SkMatrix& matrix,
- SkRect* bounds);
-
- // Helper version that gets the dev width and height from a GrSurface.
- static void GetPathDevBounds(const SkPath& path,
- const GrSurface* device,
- const SkMatrix& matrix,
- SkRect* bounds) {
- GetPathDevBounds(path, device->width(), device->height(), matrix, bounds);
- }
-
private:
typedef GrRefCnt INHERITED;