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];
vOffset, // start vertex
0, // start index
draw.fVertexCnt,
- draw.fIndexCnt,
- &devBounds);
+ draw.fIndexCnt);
vOffset += draw.fVertexCnt;
}
GrDrawTarget::AutoStateRestore asr(target, GrDrawTarget::kPreserve_ASRInit);
GrDrawState* drawState = target->drawState();
- const SkMatrix originalVM = drawState->getViewMatrix();
GrDrawState::AutoDeviceCoordDraw adcd;
// createGeom transforms the geometry to device space when the matrix does not have
GrEffectRef* hairLineEffect = HairLineEdgeEffect::Create();
GrEffectRef* hairQuadEffect = HairQuadEdgeEffect::Create();
- SkRect devBounds;
- GetPathDevBounds(path, drawState->getRenderTarget(), originalVM, &devBounds);
-
target->setIndexSourceToBuffer(fLinesIndexBuffer);
int lines = 0;
int nBufLines = fLinesIndexBuffer->maxQuads();
kVertsPerLineSeg*lines, // startV
0, // startI
kVertsPerLineSeg*n, // vCount
- kIdxsPerLineSeg*n,
- &devBounds); // iCount
+ kIdxsPerLineSeg*n); // iCount
lines += n;
}
4 * lineCnt + kVertsPerQuad*quads, // startV
0, // startI
kVertsPerQuad*n, // vCount
- kIdxsPerQuad*n, // iCount
- &devBounds);
+ kIdxsPerQuad*n); // iCount
quads += n;
}
target->resetIndexSource();
}
}
- SkRect devBounds;
- GetPathDevBounds(path, drawState->getRenderTarget(), viewM, &devBounds);
-
+ {
for (int p = 0; p < passCount; ++p) {
drawState->setDrawFace(drawFace[p]);
if (NULL != passes[p]) {
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() &&
}
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;
}
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);
-}
-
+
/*
* Copyright 2011 Google Inc.
*
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;