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

Unified Diff: gm/drawbitmaprect.cpp

Issue 1240753003: Revert[2] of guard to remove DrawBitmapRectFlags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 | « gm/bitmaprect.cpp ('k') | gm/tallstretchedbitmaps.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 715f45b90468d420faed6add78bc152d92cf172a..9db5ca71dae4b303245ce8428cc631ad300b45d7 100644
--- a/gm/drawbitmaprect.cpp
+++ b/gm/drawbitmaprect.cpp
@@ -79,30 +79,25 @@ static SkImage* makebm(SkBitmap* bm, int w, int h) {
return image_from_bitmap(*bm);
}
-static void canvasproc(SkCanvas* canvas, SkImage*, const SkBitmap& bm, const SkIRect* srcR,
+static void canvasproc(SkCanvas* canvas, SkImage*, const SkBitmap& bm, const SkIRect& srcR,
const SkRect& dstR) {
- canvas->drawBitmapRect(bm, srcR, dstR);
+ canvas->drawBitmapRect(bm, srcR, dstR, NULL);
}
-static void imageproc(SkCanvas* canvas, SkImage* image, const SkBitmap&, const SkIRect* srcIR,
+static void imageproc(SkCanvas* canvas, SkImage* image, const SkBitmap&, const SkIRect& srcR,
const SkRect& dstR) {
- SkRect storage, *srcR = NULL;
- if (srcIR) {
- storage.set(*srcIR);
- srcR = &storage;
- }
- canvas->drawImageRect(image, srcR, dstR);
+ canvas->drawImageRect(image, srcR, dstR, NULL);
}
-static void imagescaleproc(SkCanvas* canvas, SkImage* image, const SkBitmap&, const SkIRect* srcIR,
+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));
+ SkAutoTUnref<SkImage> newImage(image->newImage(newW, newH, &srcIR));
#ifdef SK_DEBUG
const SkIRect baseR = SkIRect::MakeWH(image->width(), image->height());
- const bool containsSubset = !srcIR || baseR.contains(*srcIR);
+ const bool containsSubset = baseR.contains(srcIR);
#endif
if (newImage) {
@@ -121,7 +116,7 @@ static void imagescaleproc(SkCanvas* canvas, SkImage* image, const SkBitmap&, co
}
}
-typedef void DrawRectRectProc(SkCanvas*, SkImage*, const SkBitmap&, const SkIRect*, const SkRect&);
+typedef void DrawRectRectProc(SkCanvas*, SkImage*, const SkBitmap&, const SkIRect&, const SkRect&);
static const int gSize = 1024;
static const int gBmpSize = 2048;
@@ -181,7 +176,7 @@ protected:
for (int h = 1; h <= kMaxSrcRectSize; h *= 4) {
SkIRect srcRect = SkIRect::MakeXYWH((gBmpSize - w) / 2, (gBmpSize - h) / 2, w, h);
- fProc(canvas, fImage, fLargeBitmap, &srcRect, dstRect);
+ fProc(canvas, fImage, fLargeBitmap, srcRect, dstRect);
SkString label;
label.appendf("%d x %d", w, h);
@@ -226,7 +221,7 @@ protected:
SkBlurMaskFilter::kHighQuality_BlurFlag |
SkBlurMaskFilter::kIgnoreTransform_BlurFlag);
paint.setMaskFilter(mf)->unref();
- canvas->drawBitmapRect(bm, &srcRect, dstRect, &paint);
+ canvas->drawBitmapRect(bm, srcRect, dstRect, &paint);
}
}
« no previous file with comments | « gm/bitmaprect.cpp ('k') | gm/tallstretchedbitmaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698