Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Unified Diff: src/image/SkImagePriv.cpp

Issue 251393002: remove unused functions (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
-}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698