change virtual setMatrixClip() to take a SkClipStack parameter.
git-svn-id: http://skia.googlecode.com/svn/trunk@831 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 88b012d..94db24c 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -99,7 +99,7 @@
}
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 @@
SkRegion::kDifference_Op);
}
- fDevice->setMatrixClip(*fMatrix, fClip);
+ fDevice->setMatrixClip(*fMatrix, fClip, clipStack);
#ifdef SK_DEBUG
if (!fClip.isEmpty()) {
@@ -610,7 +610,7 @@
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 @@
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 8df0e41..2383ed9 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -11,7 +11,7 @@
// 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 @@
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::onAccessBitmap(SkBitmap* bitmap) {}
-void SkDevice::setMatrixClip(const SkMatrix&, const SkRegion&) {}
+void SkDevice::setMatrixClip(const SkMatrix&, const SkRegion&,
+ const SkClipStack&) {}
///////////////////////////////////////////////////////////////////////////////
@@ -116,7 +117,7 @@
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 3bf157b..71c0c48 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -294,8 +294,9 @@
}
}
-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 @@
}
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 8a74556..72b2e1b 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -152,7 +152,8 @@
}
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)