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

Unified Diff: gm/imagefilterscropped.cpp

Issue 1530203002: Reland of move drawSprite from canvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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/imagefiltersbase.cpp ('k') | gm/spritebitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefilterscropped.cpp
diff --git a/gm/imagefilterscropped.cpp b/gm/imagefilterscropped.cpp
index 745e8984dbdc2b7947770f7bd955f6a4a61fd7ed..4c6ef623561a450834afb2600f1b9f37d50f09b0 100644
--- a/gm/imagefilterscropped.cpp
+++ b/gm/imagefilterscropped.cpp
@@ -65,29 +65,6 @@
canvas->drawBitmap(bm, 0, 0, &paint);
}
-static void draw_sprite(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
- SkPaint paint;
-
- SkIRect bounds;
- r.roundOut(&bounds);
-
- SkBitmap bm;
- bm.allocN32Pixels(bounds.width(), bounds.height());
- bm.eraseColor(SK_ColorRED);
- SkCanvas c(bm);
-
- SkIRect cropRect = SkIRect::MakeXYWH(10, 10, 44, 44);
- paint.setColor(SK_ColorGREEN);
- c.drawRect(SkRect::Make(cropRect), paint);
-
- paint.setImageFilter(imf);
- SkPoint loc = { r.fLeft, r.fTop };
- canvas->getTotalMatrix().mapPoints(&loc, 1);
- canvas->drawSprite(bm,
- SkScalarRoundToInt(loc.fX), SkScalarRoundToInt(loc.fY),
- &paint);
-}
-
///////////////////////////////////////////////////////////////////////////////
class ImageFiltersCroppedGM : public skiagm::GM {
@@ -135,7 +112,7 @@
virtual void onDraw(SkCanvas* canvas) override {
void (*drawProc[])(SkCanvas*, const SkRect&, SkImageFilter*) = {
- draw_sprite, draw_bitmap, draw_path, draw_paint, draw_text
+ draw_bitmap, draw_path, draw_paint, draw_text
};
SkAutoTUnref<SkColorFilter> cf(
« no previous file with comments | « gm/imagefiltersbase.cpp ('k') | gm/spritebitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698