Index: src/image/SkImagePriv.cpp |
diff --git a/src/image/SkImagePriv.cpp b/src/image/SkImagePriv.cpp |
index dada230de82431deb94c75b925c71bdbfee9267a..334697ae3df8987622b2cc8baed1fefd17f1007c 100644 |
--- a/src/image/SkImagePriv.cpp |
+++ b/src/image/SkImagePriv.cpp |
@@ -69,59 +69,3 @@ SkImage* SkNewImageFromBitmap(const SkBitmap& bm, bool canSharePixelRef) { |
return image; |
} |
-static bool needs_layer(const SkPaint& paint) { |
- return 0xFF != paint.getAlpha() || |
- paint.getColorFilter() || |
- paint.getImageFilter() || |
- SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode); |
-} |
- |
-void SkImagePrivDrawPicture(SkCanvas* canvas, SkPicture* picture, |
- SkScalar x, SkScalar y, const SkPaint* paint) { |
- int saveCount = canvas->getSaveCount(); |
- |
- if (paint && needs_layer(*paint)) { |
- SkRect bounds; |
- bounds.set(x, y, |
- x + SkIntToScalar(picture->width()), |
- y + SkIntToScalar(picture->height())); |
- canvas->saveLayer(&bounds, paint); |
- canvas->translate(x, y); |
- } else if (x || y) { |
- canvas->save(); |
- canvas->translate(x, y); |
- } |
- |
- canvas->drawPicture(*picture); |
- canvas->restoreToCount(saveCount); |
-} |
- |
-void SkImagePrivDrawPicture(SkCanvas* canvas, SkPicture* picture, |
- const SkRect* src, const SkRect& dst, const SkPaint* paint) { |
- int saveCount = canvas->getSaveCount(); |
- |
- SkMatrix matrix; |
- SkRect tmpSrc; |
- |
- if (NULL != src) { |
- tmpSrc = *src; |
- } else { |
- tmpSrc.set(0, 0, |
- SkIntToScalar(picture->width()), |
- SkIntToScalar(picture->height())); |
- } |
- |
- matrix.setRectToRect(tmpSrc, dst, SkMatrix::kFill_ScaleToFit); |
- if (paint && needs_layer(*paint)) { |
- canvas->saveLayer(&dst, paint); |
- } else { |
- canvas->save(); |
- } |
- canvas->concat(matrix); |
- if (!paint || !needs_layer(*paint)) { |
- canvas->clipRect(tmpSrc); |
- } |
- |
- canvas->drawPicture(*picture); |
- canvas->restoreToCount(saveCount); |
-} |