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

Unified Diff: gm/drawbitmaprect.cpp

Issue 1364443002: remove unused (by the outside) SkImage::newSurface, and simplify newImage -> newSubset (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 | gm/image.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/drawbitmaprect.cpp
diff --git a/gm/drawbitmaprect.cpp b/gm/drawbitmaprect.cpp
index dd6d2b7a7d59b1a3f9783d6ee85af79e49e9ad95..2f3362756b478bda5524e27412f870e1f166ca8d 100644
--- a/gm/drawbitmaprect.cpp
+++ b/gm/drawbitmaprect.cpp
@@ -89,33 +89,6 @@ static void imageproc(SkCanvas* canvas, SkImage* image, const SkBitmap&, const S
canvas->drawImageRect(image, srcR, dstR, nullptr);
}
-static void imagescaleproc(SkCanvas* canvas, SkImage* image, const SkBitmap&, const SkIRect& srcIR,
- const SkRect& dstR) {
- const int newW = SkScalarRoundToInt(dstR.width());
- const int newH = SkScalarRoundToInt(dstR.height());
- SkAutoTUnref<SkImage> newImage(image->newImage(newW, newH, &srcIR));
-
-#ifdef SK_DEBUG
- const SkIRect baseR = SkIRect::MakeWH(image->width(), image->height());
- const bool containsSubset = baseR.contains(srcIR);
-#endif
-
- if (newImage) {
- SkASSERT(containsSubset);
- canvas->drawImage(newImage, dstR.x(), dstR.y());
- } else {
- // newImage() does not support subsets that are not contained by the original
- // but drawImageRect does, so we just draw an X in its place to indicate that we are
- // deliberately not drawing here.
- SkASSERT(!containsSubset);
- SkPaint paint;
- paint.setStyle(SkPaint::kStroke_Style);
- paint.setStrokeWidth(4);
- canvas->drawLine(4, 4, newW - 4.0f, newH - 4.0f, paint);
- canvas->drawLine(4, newH - 4.0f, newW - 4.0f, 4, paint);
- }
-}
-
typedef void DrawRectRectProc(SkCanvas*, SkImage*, const SkBitmap&, const SkIRect&, const SkRect&);
static const int gSize = 1024;
@@ -228,4 +201,3 @@ private:
DEF_GM( return new DrawBitmapRectGM(canvasproc, nullptr); )
DEF_GM( return new DrawBitmapRectGM(imageproc, "-imagerect"); )
-DEF_GM( return new DrawBitmapRectGM(imagescaleproc, "-imagescale"); )
« no previous file with comments | « no previous file | gm/image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698