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

Unified Diff: include/core/SkCanvas.h

Issue 920513003: Make filters use SkImage instead of SkBitmap Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index f790213d96394ac7b412ae2bcb1763f2c2d146a7..099a98ec79c7bb464c69a854a17ef879f91444c4 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -775,6 +775,7 @@ public:
@param paint The paint used to draw the image, or NULL
*/
void drawImage(const SkImage* image, SkScalar left, SkScalar top, const SkPaint* paint = NULL);
+
/** Draw the specified image, with the specified matrix applied (before the
canvas' matrix is applied).
@@ -875,6 +876,19 @@ public:
*/
void drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint = NULL);
+ /** Draw the specified image, with its top/left corner at (x,y),
+ NOT transformed by the current matrix. Note: if the paint
+ contains a maskfilter that generates a mask which extends beyond the
+ image's original width/height, then the image will be drawn as if it
+ were in a Shader with CLAMP mode. Thus the color outside of the original
+ width/height will be the edge color replicated.
+ @param image The image to be drawn
+ @param left The position of the left side of the image being drawn
+ @param top The position of the top side of the image being drawn
+ @param paint The paint used to draw the image, or NULL
+ */
+ void drawSprite(const SkImage& image, int left, int top, const SkPaint* paint = NULL);
+
/** Draw the text, with origin at (x,y), using the specified paint.
The origin is interpreted based on the Align setting in the paint.
@param text The text to be drawn
@@ -1214,6 +1228,7 @@ protected:
virtual void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*);
virtual void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*);
+ virtual void onDrawSprite(const SkImage&, int left, int top, const SkPaint*);
reed1 2015/02/25 16:36:20 same nit about shadowing virtuals w/ the same name
enum ClipEdgeStyle {
kHard_ClipEdgeStyle,
« no previous file with comments | « include/core/SkBitmapDevice.h ('k') | include/core/SkDevice.h » ('j') | include/core/SkDevice.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698