Remove discard from GrRenderTarget & force it to always go through a RenderTargetContext
This is a bit sloppy in that it ignores some instances where discards were being issued before.
The creation of the temp RTContext in the RenderTarget's discard method was causing an extra split in the opLists.
This is split out of: https://skia-review.googlesource.com/c/10284/ (Omnibus: Remove GrSurface-derived classes from ops)
Change-Id: Ic366d303280635763b0fae238c4df37c04fb8503
Reviewed-on: https://skia-review.googlesource.com/11125
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/gm/xfermodeimagefilter.cpp b/gm/xfermodeimagefilter.cpp
index bb2378e..8fd1348 100644
--- a/gm/xfermodeimagefilter.cpp
+++ b/gm/xfermodeimagefilter.cpp
@@ -201,17 +201,16 @@
private:
static void DrawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, const SkPaint& paint,
- int x, int y) {
+ int x, int y) {
canvas->save();
canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
- canvas->clipRect(SkRect::MakeWH(
- SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height())));
+ canvas->clipRect(SkRect::MakeIWH(bitmap.width(), bitmap.height()));
canvas->drawBitmap(bitmap, 0, 0, &paint);
canvas->restore();
}
static void DrawClippedPaint(SkCanvas* canvas, const SkRect& rect, const SkPaint& paint,
- int x, int y) {
+ int x, int y) {
canvas->save();
canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
canvas->clipRect(rect);