aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-05-06 10:16:02 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-06 10:16:02 -0700
commit06dad4b92f1fcb593bc686f9537d3e0d866b2241 (patch)
tree3b97c5085b52d904c52f497db74a3acef6226bb2 /include
parentd9b6be197fe9cc75e068aaaf941455c13b2e38c3 (diff)
Revert of Revert of Revert of Make drawImage a virtual on SkDevice (patchset #1 id:1 of https://codereview.chromium.org/1126273002/)
Reason for revert: still breaking webglconformance Original issue's description: > Revert of Revert of Make drawImage a virtual on SkDevice (patchset #1 id:1 of https://codereview.chromium.org/1124003002/) > > Reason for revert: > retry now that some fixes (onDrawImage overrides) have landed in chrome/blink > > Original issue's description: > > Revert of Make drawImage a virtual on SkDevice (patchset #4 id:60001 of https://codereview.chromium.org/1122643005/) > > > > Reason for revert: > > speculative to see if it unblocks DEPS roll > > > > Original issue's description: > > > Make drawImage a virtual on SkDevice > > > > > > Now with patch for SkDeferredCanvas > > > > > > This reverts commit 119468b71f8f4f45657ab30ead331be665de5a57. > > > > > > BUG=skia: > > > > > > Committed: https://skia.googlesource.com/skia/+/14fe8fd3e53b5e988aac189a8bc3ed28904d85c8 > > > > TBR=robertphillips@google.com,mtklein@google.com,reed@google.com > > NOPRESUBMIT=true > > NOTREECHECKS=true > > NOTRY=true > > BUG=skia: > > > > Committed: https://skia.googlesource.com/skia/+/3538e3bfe2e00bc1b5b48d977fa7adff64d8c96b > > TBR=robertphillips@google.com,mtklein@google.com,reed@chromium.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/620ba3afe09d4173c87537040fe50c1c1895fb1a TBR=robertphillips@google.com,mtklein@google.com,reed@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1127993004
Diffstat (limited to 'include')
-rw-r--r--include/core/SkDevice.h4
-rw-r--r--include/core/SkImage.h13
-rw-r--r--include/utils/SkDeferredCanvas.h3
3 files changed, 16 insertions, 4 deletions
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index b474687cfb..8a219d7053 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -209,10 +209,6 @@ protected:
const SkPaint& paint,
SkCanvas::DrawBitmapRectFlags flags) = 0;
- virtual void drawImage(const SkDraw&, const SkImage*, SkScalar x, SkScalar y, const SkPaint&);
- virtual void drawImageRect(const SkDraw&, const SkImage*, const SkRect* src, const SkRect& dst,
- const SkPaint&);
-
/**
* Does not handle text decoration.
* Decorations (underline and stike-thru) will be handled by SkCanvas.
diff --git a/include/core/SkImage.h b/include/core/SkImage.h
index ebc9a29394..ec85516619 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -172,6 +172,19 @@ private:
static uint32_t NextUniqueID();
typedef SkRefCnt INHERITED;
+
+ friend class SkCanvas;
+
+ void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) const;
+
+ /**
+ * Draw the image, cropped to the src rect, to the dst rect of a canvas.
+ * If src is larger than the bounds of the image, the rest of the image is
+ * filled with transparent black pixels.
+ *
+ * See SkCanvas::drawBitmapRectToRect for similar behavior.
+ */
+ void drawRect(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint*) const;
};
#endif
diff --git a/include/utils/SkDeferredCanvas.h b/include/utils/SkDeferredCanvas.h
index a8330493a7..ac8556f539 100644
--- a/include/utils/SkDeferredCanvas.h
+++ b/include/utils/SkDeferredCanvas.h
@@ -177,9 +177,12 @@ protected:
void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) override;
void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*,
DrawBitmapRectFlags flags) override;
+#if 0
+ // rely on conversion to bitmap(for now)
void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) override;
void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
const SkPaint*) override;
+#endif
void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*) override;
void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) override;