Reland of move drawSprite from canvas (patchset #1 id:1 of https://codereview.chromium.org/1529803004/ )
Reason for revert:
guard has landed in chrome
Original issue's description:
> Revert of remove drawSprite from canvas (patchset #4 id:60001 of https://codereview.chromium.org/1534443003/ )
>
> Reason for revert:
> need to remove an override in chrome
>
> Original issue's description:
> > remove drawSprite from canvas
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/4657ce2324ea197507c4ba728d81138f56da13b1
>
> TBR=fmalita@chromium.org,robertphillips@google.com,senorblanco@chromium.org,mtklein@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/32704674f64cb6a14356dfebe060cd3484c06cc7
TBR=fmalita@chromium.org,robertphillips@google.com,senorblanco@chromium.org,mtklein@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1530203002
diff --git a/gm/dropshadowimagefilter.cpp b/gm/dropshadowimagefilter.cpp
index 81824ab..512c82d 100644
--- a/gm/dropshadowimagefilter.cpp
+++ b/gm/dropshadowimagefilter.cpp
@@ -67,29 +67,6 @@
canvas->restore();
}
-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 DropShadowImageFilterGM : public skiagm::GM {
@@ -113,7 +90,7 @@
virtual void onDraw(SkCanvas* canvas) {
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(