diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkCanvas.cpp | 8 | ||||
-rw-r--r-- | src/core/SkDevice.cpp | 9 | ||||
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 7 | ||||
-rw-r--r-- | src/pdf/SkPDFDevice.cpp | 3 |
4 files changed, 15 insertions, 12 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 88b012defe..94db24cfe5 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -99,7 +99,7 @@ struct DeviceCM { } void updateMC(const SkMatrix& totalMatrix, const SkRegion& totalClip, - SkRegion* updateClip) { + const SkClipStack& clipStack, SkRegion* updateClip) { int x = fX; int y = fY; int width = fDevice->width(); @@ -126,7 +126,7 @@ struct DeviceCM { SkRegion::kDifference_Op); } - fDevice->setMatrixClip(*fMatrix, fClip); + fDevice->setMatrixClip(*fMatrix, fClip, clipStack); #ifdef SK_DEBUG if (!fClip.isEmpty()) { @@ -610,7 +610,7 @@ void SkCanvas::updateDeviceCMCache() { DeviceCM* layer = fMCRec->fTopLayer; if (NULL == layer->fNext) { // only one layer - layer->updateMC(totalMatrix, totalClip, NULL); + layer->updateMC(totalMatrix, totalClip, fClipStack, NULL); if (fUseExternalMatrix) { layer->updateExternalMatrix(fExternalMatrix, fExternalInverse); @@ -619,7 +619,7 @@ void SkCanvas::updateDeviceCMCache() { SkRegion clip; clip = totalClip; // make a copy do { - layer->updateMC(totalMatrix, clip, &clip); + layer->updateMC(totalMatrix, clip, fClipStack, &clip); if (fUseExternalMatrix) { layer->updateExternalMatrix(fExternalMatrix, fExternalInverse); diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp index 8df0e41d72..2383ed98b8 100644 --- a/src/core/SkDevice.cpp +++ b/src/core/SkDevice.cpp @@ -11,7 +11,7 @@ SkDevice::SkDevice(SkCanvas* canvas, const SkBitmap& bitmap, bool isForLayer) // auto-allocate if we're for offscreen drawing if (isForLayer) { if (NULL == fBitmap.getPixels() && NULL == fBitmap.pixelRef()) { - fBitmap.allocPixels(); + fBitmap.allocPixels(); if (!fBitmap.isOpaque()) { fBitmap.eraseColor(0); } @@ -43,7 +43,7 @@ void SkDevice::getBounds(SkIRect* bounds) const { bool SkDevice::intersects(const SkIRect& r, SkIRect* sect) const { SkIRect bounds; - + this->getBounds(&bounds); return sect ? sect->intersect(r, bounds) : SkIRect::Intersects(r, bounds); } @@ -54,7 +54,8 @@ void SkDevice::eraseColor(SkColor eraseColor) { void SkDevice::onAccessBitmap(SkBitmap* bitmap) {} -void SkDevice::setMatrixClip(const SkMatrix&, const SkRegion&) {} +void SkDevice::setMatrixClip(const SkMatrix&, const SkRegion&, + const SkClipStack&) {} /////////////////////////////////////////////////////////////////////////////// @@ -116,7 +117,7 @@ void SkDevice::drawBitmap(const SkDraw& draw, const SkBitmap& bitmap, const SkMatrix& matrix, const SkPaint& paint) { SkBitmap tmp; // storage if we need a subset of bitmap const SkBitmap* bitmapPtr = &bitmap; - + if (srcRect) { if (!bitmap.extractSubset(&tmp, *srcRect)) { return; // extraction failed diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 3bf157bfa9..71c0c48e71 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -294,8 +294,9 @@ void SkGpuDevice::prepareRenderTarget(const SkDraw& draw) { } } -void SkGpuDevice::setMatrixClip(const SkMatrix& matrix, const SkRegion& clip) { - this->INHERITED::setMatrixClip(matrix, clip); +void SkGpuDevice::setMatrixClip(const SkMatrix& matrix, const SkRegion& clip, + const SkClipStack& clipStack) { + this->INHERITED::setMatrixClip(matrix, clip, clipStack); convert_matrixclip(fContext, matrix, clip); } @@ -912,7 +913,7 @@ void SkGpuDevice::internalDrawBitmap(const SkDraw& draw, } grPaint->setTexture(texture); - + GrRect dstRect(0, 0, GrIntToScalar(srcRect.width()), GrIntToScalar(srcRect.height())); GrRect paintRect; paintRect.setLTRB(GrFixedToScalar((srcRect.fLeft << 16) / bitmap.width()), diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp index 8a74556c70..72b2e1bf6a 100644 --- a/src/pdf/SkPDFDevice.cpp +++ b/src/pdf/SkPDFDevice.cpp @@ -152,7 +152,8 @@ SkPDFDevice::~SkPDFDevice() { } void SkPDFDevice::setMatrixClip(const SkMatrix& matrix, - const SkRegion& region) { + const SkRegion& region, + const SkClipStack&) { // See the comment in the header file above GraphicStackEntry. if (region != fGraphicStack[fGraphicStackIndex].fClip) { while (fGraphicStackIndex > 0) |