Don't intersect clipstack with root device bounds

Review URL: Don't intersect clipstack with root device bounds



git-svn-id: http://skia.googlecode.com/svn/trunk@2175 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bsalomon@google.com 2011-08-25 21:12:57 +00:00
parent fafe599284
commit 3a9eaeccb0
3 changed files with 4 additions and 10 deletions

View File

@ -138,13 +138,9 @@ void GrClip::setFromIterator(GrClipIterator* iter, GrScalar tx, GrScalar ty,
} }
} }
fConservativeBoundsValid = false; fConservativeBoundsValid = false;
if (isectRectValid) { if (isectRectValid && rectCount) {
fConservativeBounds = fList[0].fRect;
fConservativeBoundsValid = true; fConservativeBoundsValid = true;
if (rectCount > 0) {
fConservativeBounds = fList[0].fRect;
} else {
fConservativeBounds.setEmpty();
}
} else if (NULL != conservativeBounds) { } else if (NULL != conservativeBounds) {
fConservativeBounds = *conservativeBounds; fConservativeBounds = *conservativeBounds;
fConservativeBoundsValid = true; fConservativeBoundsValid = true;

View File

@ -528,7 +528,6 @@ SkDevice* SkCanvas::setDevice(SkDevice* device) {
while ((rec = (MCRec*)iter.next()) != NULL) { while ((rec = (MCRec*)iter.next()) != NULL) {
(void)rec->fRegion->op(bounds, SkRegion::kIntersect_Op); (void)rec->fRegion->op(bounds, SkRegion::kIntersect_Op);
} }
fClipStack.clipDevRect(bounds, SkRegion::kIntersect_Op);
} }
return device; return device;
} }
@ -1384,11 +1383,11 @@ private:
void SkCanvas::DrawRect(const SkDraw& draw, const SkPaint& paint, void SkCanvas::DrawRect(const SkDraw& draw, const SkPaint& paint,
const SkRect& r, SkScalar textSize) { const SkRect& r, SkScalar textSize) {
if (paint.getStyle() == SkPaint::kFill_Style) { if (paint.getStyle() == SkPaint::kFill_Style) {
draw.fDevice->drawRect(draw, r, paint); draw.fDevice->drawRect(draw, r, paint);
} else { } else {
SkPaint p(paint); SkPaint p(paint);
p.setStrokeWidth(SkScalarMul(textSize, paint.getStrokeWidth())); p.setStrokeWidth(SkScalarMul(textSize, paint.getStrokeWidth()));
draw.fDevice->drawRect(draw, r, p); draw.fDevice->drawRect(draw, r, p);
} }
} }

View File

@ -517,7 +517,6 @@ SkPDFDevice::SkPDFDevice(const SkISize& pageSize, const SkISize& contentSize,
fInitialTransform.preConcat(initialTransform); fInitialTransform.preConcat(initialTransform);
SkIRect existingClip = SkIRect::MakeWH(this->width(), this->height()); SkIRect existingClip = SkIRect::MakeWH(this->width(), this->height());
fExistingClipStack.clipDevRect(existingClip);
fExistingClipRegion.setRect(existingClip); fExistingClipRegion.setRect(existingClip);
this->init(); this->init();