Revert of move remaining virtual draw methods to onDraw (patchset #5 id:80001 of https://codereview.chromium.org/817723005/)

Reason for revert:
did this cause chromeos heap corruption on skp?

Original issue's description:
> move remaining virtual draw methods to onDraw
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2e0f7d53bba5438c9bf11ee5ccae2c301e348419

TBR=robertphillips@google.com,djsollen@google.com,bsalomon@google.com,mtklein@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/835913002
This commit is contained in:
reed 2015-01-05 04:49:38 -08:00 committed by Commit bot
parent f3a9e99339
commit e87e383351
24 changed files with 489 additions and 585 deletions

View File

@ -21,7 +21,6 @@
# TODO(tfarina): Remove this when Android is fixed. skbug.com/3178
'SK_SUPPORT_LEGACY_PORTER_DUFF',
'SK_SUPPORT_LEGACY_DRAWDATA',
'SK_SUPPORT_LEGACY_CANVAS_VIRTUAL',
],
},
}

View File

@ -14,7 +14,6 @@
#
'skia_for_chromium_defines': [
'SK_SUPPORT_LEGACY_DRAWDATA',
'SK_SUPPORT_LEGACY_CANVAS_VIRTUAL',
],
},
}

View File

@ -36,12 +36,6 @@ class GrRenderTarget;
class SkCanvasState;
#ifdef SK_SUPPORT_LEGACY_CANVAS_VIRTUAL
#define SK_LEGACY_CANVAS_VIRTUAL virtual
#else
#define SK_LEGACY_CANVAS_VIRTUAL
#endif
/** \class SkCanvas
A Canvas encapsulates all of the state about drawing into a device (bitmap).
@ -614,7 +608,7 @@ public:
* specified paint.
* @param paint The paint used to fill the canvas
*/
SK_LEGACY_CANVAS_VIRTUAL void drawPaint(const SkPaint& paint);
virtual void drawPaint(const SkPaint& paint);
enum PointMode {
/** drawPoints draws each point separately */
@ -646,8 +640,8 @@ public:
@param pts Array of points to draw
@param paint The paint used to draw the points
*/
SK_LEGACY_CANVAS_VIRTUAL void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint);
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint);
/** Helper method for drawing a single point. See drawPoints() for a more
details.
@ -678,7 +672,7 @@ public:
@param rect The rect to be drawn
@param paint The paint used to draw the rect
*/
SK_LEGACY_CANVAS_VIRTUAL void drawRect(const SkRect& rect, const SkPaint& paint);
virtual void drawRect(const SkRect& rect, const SkPaint& paint);
/** Draw the specified rectangle using the specified paint. The rectangle
will be filled or framed based on the Style in the paint.
@ -707,7 +701,7 @@ public:
@param oval The rectangle bounds of the oval to be drawn
@param paint The paint used to draw the oval
*/
SK_LEGACY_CANVAS_VIRTUAL void drawOval(const SkRect& oval, const SkPaint&);
virtual void drawOval(const SkRect& oval, const SkPaint&);
/**
* Draw the specified RRect using the specified paint The rrect will be filled or stroked
@ -716,7 +710,7 @@ public:
* @param rrect The round-rect to draw
* @param paint The paint used to draw the round-rect
*/
SK_LEGACY_CANVAS_VIRTUAL void drawRRect(const SkRRect& rrect, const SkPaint& paint);
virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint);
/**
* Draw the annulus formed by the outer and inner rrects. The results
@ -764,7 +758,7 @@ public:
@param path The path to be drawn
@param paint The paint used to draw the path
*/
SK_LEGACY_CANVAS_VIRTUAL void drawPath(const SkPath& path, const SkPaint& paint);
virtual void drawPath(const SkPath& path, const SkPaint& paint);
/** Draw the specified image, with its top/left corner at (x,y), using the
specified paint, transformed by the current matrix.
@ -774,7 +768,7 @@ public:
@param top The position of the top side of the image being drawn
@param paint The paint used to draw the image, or NULL
*/
SK_LEGACY_CANVAS_VIRTUAL void drawImage(const SkImage* image, SkScalar left, SkScalar top,
virtual 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).
@ -785,7 +779,7 @@ public:
image will be drawn
@param paint The paint used to draw the image, or NULL
*/
SK_LEGACY_CANVAS_VIRTUAL void drawImageRect(const SkImage* image, const SkRect* src,
virtual void drawImageRect(const SkImage* image, const SkRect* src,
const SkRect& dst,
const SkPaint* paint = NULL);
@ -805,7 +799,7 @@ public:
@param top The position of the top side of the bitmap being drawn
@param paint The paint used to draw the bitmap, or NULL
*/
SK_LEGACY_CANVAS_VIRTUAL void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
const SkPaint* paint = NULL);
enum DrawBitmapRectFlags {
@ -826,7 +820,7 @@ public:
image will be drawn
@param paint The paint used to draw the bitmap, or NULL
*/
SK_LEGACY_CANVAS_VIRTUAL void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst,
const SkPaint* paint = NULL,
DrawBitmapRectFlags flags = kNone_DrawBitmapRectFlag);
@ -862,7 +856,7 @@ public:
* - The corners shrink proportionally
* - The sides (along the shrink axis) and center are not drawn
*/
SK_LEGACY_CANVAS_VIRTUAL void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint = NULL);
/** Draw the specified bitmap, with its top/left corner at (x,y),
@ -876,7 +870,7 @@ public:
@param top The position of the top side of the bitmap being drawn
@param paint The paint used to draw the bitmap, or NULL
*/
SK_LEGACY_CANVAS_VIRTUAL void drawSprite(const SkBitmap& bitmap, int left, int top,
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
const SkPaint* paint = NULL);
/** Draw the text, with origin at (x,y), using the specified paint.
@ -999,7 +993,7 @@ public:
@param indexCount number of entries in the indices array (if not null)
@param paint Specifies the shader/texture if present.
*/
SK_LEGACY_CANVAS_VIRTUAL void drawVertices(VertexMode vmode, int vertexCount,
virtual void drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
@ -1203,24 +1197,6 @@ protected:
virtual void onDrawDrawable(SkCanvasDrawable*);
virtual void onDrawPaint(const SkPaint&);
virtual void onDrawRect(const SkRect&, const SkPaint&);
virtual void onDrawOval(const SkRect&, const SkPaint&);
virtual void onDrawRRect(const SkRRect&, const SkPaint&);
virtual void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&);
virtual void onDrawVertices(VertexMode, int vertexCount, const SkPoint vertices[],
const SkPoint texs[], const SkColor colors[], SkXfermode*,
const uint16_t indices[], int indexCount, const SkPaint&);
virtual void onDrawPath(const SkPath&, const SkPaint&);
virtual void onDrawImage(const SkImage*, SkScalar dx, SkScalar dy, const SkPaint*);
virtual void onDrawImageRect(const SkImage*, const SkRect*, const SkRect&, const SkPaint*);
virtual void onDrawBitmap(const SkBitmap&, SkScalar dx, SkScalar dy, const SkPaint*);
virtual void onDrawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const SkPaint*,
DrawBitmapRectFlags);
virtual void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*);
virtual void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*);
enum ClipEdgeStyle {
kHard_ClipEdgeStyle,
kSoft_ClipEdgeStyle

View File

@ -18,7 +18,6 @@ class SkData;
class SkCanvas;
class SkImageGenerator;
class SkPaint;
class SkString;
class SkSurface;
class SkSurfaceProps;
class GrContext;

View File

@ -143,6 +143,32 @@ public:
*/
void silentFlush();
// Overrides of the SkCanvas interface
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawPath(const SkPath& path, const SkPaint& paint)
SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left,
SkScalar top, const SkPaint* paint)
SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags flags) SK_OVERRIDE;
virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint)
SK_OVERRIDE;
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
const SkPaint* paint) SK_OVERRIDE;
virtual void drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) SK_OVERRIDE;
virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) SK_OVERRIDE;
protected:
@ -167,31 +193,7 @@ protected:
virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
const SkPoint texCoords[4], SkXfermode* xmode,
const SkPaint& paint) SK_OVERRIDE;
void onDrawPaint(const SkPaint&) SK_OVERRIDE;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) SK_OVERRIDE;
void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
void onDrawPath(const SkPath&, const SkPaint&) SK_OVERRIDE;
void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*,
DrawBitmapRectFlags flags) SK_OVERRIDE;
#if 0
// rely on conversion to bitmap(for now)
void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
#endif
void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) SK_OVERRIDE;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;

View File

@ -75,6 +75,25 @@ public:
int getNestLevel() const { return fNestLevel; }
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawRect(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
const SkPaint* paint) SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags flags) SK_OVERRIDE;
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
const SkPaint* paint) SK_OVERRIDE;
virtual void drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) SK_OVERRIDE;
virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
virtual void endCommentGroup() SK_OVERRIDE;
@ -102,27 +121,6 @@ protected:
const SkPoint texCoords[4], SkXfermode* xmode,
const SkPaint& paint) SK_OVERRIDE;
void onDrawPaint(const SkPaint&) SK_OVERRIDE;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) SK_OVERRIDE;
void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
void onDrawPath(const SkPath&, const SkPaint&) SK_OVERRIDE;
void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*,
DrawBitmapRectFlags flags) SK_OVERRIDE;
void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) SK_OVERRIDE;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;

View File

@ -20,6 +20,26 @@ public:
SkLuaCanvas(int width, int height, lua_State*, const char function[]);
virtual ~SkLuaCanvas();
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawRect(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
const SkPaint* paint) SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags flags) SK_OVERRIDE;
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
const SkPaint* paint) SK_OVERRIDE;
virtual void drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) SK_OVERRIDE;
protected:
virtual void willSave() SK_OVERRIDE;
virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE;
@ -40,27 +60,6 @@ protected:
virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) SK_OVERRIDE;
void onDrawPaint(const SkPaint&) SK_OVERRIDE;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) SK_OVERRIDE;
void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
void onDrawPath(const SkPath&, const SkPaint&) SK_OVERRIDE;
void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*,
DrawBitmapRectFlags flags) SK_OVERRIDE;
void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) SK_OVERRIDE;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;

View File

@ -23,6 +23,34 @@ public:
///////////////////////////////////////////////////////////////////////////
// These are forwarded to the N canvases we're referencing
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint&) SK_OVERRIDE;
virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
const SkPaint*) SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags flags) SK_OVERRIDE;
virtual void drawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint) SK_OVERRIDE;
virtual void drawImageRect(const SkImage* image, const SkRect* src,
const SkRect& dst,
const SkPaint* paint) SK_OVERRIDE;
virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst,
const SkPaint* paint = NULL) SK_OVERRIDE;
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
const SkPaint*) SK_OVERRIDE;
virtual void drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
virtual SkDrawFilter* setDrawFilter(SkDrawFilter*) SK_OVERRIDE;
virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
@ -54,27 +82,6 @@ protected:
const SkPoint texCoords[4], SkXfermode* xmode,
const SkPaint& paint) SK_OVERRIDE;
void onDrawPaint(const SkPaint&) SK_OVERRIDE;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) SK_OVERRIDE;
void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
void onDrawPath(const SkPath&, const SkPaint&) SK_OVERRIDE;
void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*,
DrawBitmapRectFlags flags) SK_OVERRIDE;
void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) SK_OVERRIDE;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;

View File

@ -26,6 +26,31 @@ public:
SkCanvas* getProxy() const { return fProxy; }
void setProxy(SkCanvas* proxy);
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawRect(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
const SkPaint* paint = NULL) SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags flags) SK_OVERRIDE;
virtual void drawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint = NULL) SK_OVERRIDE;
virtual void drawImageRect(const SkImage* image, const SkRect* src,
const SkRect& dst,
const SkPaint* paint = NULL) SK_OVERRIDE;
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
const SkPaint* paint = NULL) SK_OVERRIDE;
virtual void drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) SK_OVERRIDE;
virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
virtual void endCommentGroup() SK_OVERRIDE;
@ -54,27 +79,6 @@ protected:
virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
const SkPoint texCoords[4], SkXfermode* xmode,
const SkPaint& paint) SK_OVERRIDE;
void onDrawPaint(const SkPaint&) SK_OVERRIDE;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) SK_OVERRIDE;
void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
void onDrawPath(const SkPath&, const SkPaint&) SK_OVERRIDE;
void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*,
DrawBitmapRectFlags flags) SK_OVERRIDE;
void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) SK_OVERRIDE;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;

View File

@ -1196,7 +1196,8 @@ void SkCanvas::internalDrawDevice(SkBaseDevice* srcDev, int x, int y,
LOOPER_END
}
void SkCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint* paint) {
void SkCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
const SkPaint* paint) {
if (gTreatSpriteAsBitmap) {
this->save();
this->resetMatrix();
@ -1670,66 +1671,6 @@ void SkCanvas::drawDRRect(const SkRRect& outer, const SkRRect& inner,
this->onDrawDRRect(outer, inner, paint);
}
// These need to stop being virtual -- clients need to override the onDraw... versions
void SkCanvas::drawPaint(const SkPaint& paint) {
this->onDrawPaint(paint);
}
void SkCanvas::drawRect(const SkRect& r, const SkPaint& paint) {
this->onDrawRect(r, paint);
}
void SkCanvas::drawOval(const SkRect& r, const SkPaint& paint) {
this->onDrawOval(r, paint);
}
void SkCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
this->onDrawRRect(rrect, paint);
}
void SkCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint& paint) {
this->onDrawPoints(mode, count, pts, paint);
}
void SkCanvas::drawVertices(VertexMode vmode, int vertexCount, const SkPoint vertices[],
const SkPoint texs[], const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount, const SkPaint& paint) {
this->onDrawVertices(vmode, vertexCount, vertices, texs, colors, xmode,
indices, indexCount, paint);
}
void SkCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
this->onDrawPath(path, paint);
}
void SkCanvas::drawImage(const SkImage* image, SkScalar dx, SkScalar dy, const SkPaint* paint) {
this->onDrawImage(image, dx, dy, paint);
}
void SkCanvas::drawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
const SkPaint* paint) {
this->onDrawImageRect(image, src, dst, paint);
}
void SkCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar dx, SkScalar dy, const SkPaint* paint) {
this->onDrawBitmap(bitmap, dx, dy, paint);
}
void SkCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
const SkPaint* paint, DrawBitmapRectFlags flags) {
this->onDrawBitmapRect(bitmap, src, dst, paint, flags);
}
void SkCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst,
const SkPaint* paint) {
this->onDrawBitmapNine(bitmap, center, dst, paint);
}
void SkCanvas::drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint) {
this->onDrawSprite(bitmap, left, top, paint);
}
//////////////////////////////////////////////////////////////////////////////
// These are the virtual drawing methods
//////////////////////////////////////////////////////////////////////////////
@ -1740,7 +1681,7 @@ void SkCanvas::onDiscard() {
}
}
void SkCanvas::onDrawPaint(const SkPaint& paint) {
void SkCanvas::drawPaint(const SkPaint& paint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawPaint()");
this->internalDrawPaint(paint);
}
@ -1755,8 +1696,8 @@ void SkCanvas::internalDrawPaint(const SkPaint& paint) {
LOOPER_END
}
void SkCanvas::onDrawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) {
void SkCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) {
TRACE_EVENT1("disabled-by-default-skia", "SkCanvas::drawPoints()", "count", static_cast<uint64_t>(count));
if ((long)count <= 0) {
return;
@ -1788,7 +1729,7 @@ void SkCanvas::onDrawPoints(PointMode mode, size_t count, const SkPoint pts[],
LOOPER_END
}
void SkCanvas::onDrawRect(const SkRect& r, const SkPaint& paint) {
void SkCanvas::drawRect(const SkRect& r, const SkPaint& paint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawRect()");
SkRect storage;
const SkRect* bounds = NULL;
@ -1808,7 +1749,7 @@ void SkCanvas::onDrawRect(const SkRect& r, const SkPaint& paint) {
LOOPER_END
}
void SkCanvas::onDrawOval(const SkRect& oval, const SkPaint& paint) {
void SkCanvas::drawOval(const SkRect& oval, const SkPaint& paint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawOval()");
SkRect storage;
const SkRect* bounds = NULL;
@ -1828,7 +1769,7 @@ void SkCanvas::onDrawOval(const SkRect& oval, const SkPaint& paint) {
LOOPER_END
}
void SkCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
void SkCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawRRect()");
SkRect storage;
const SkRect* bounds = NULL;
@ -1878,7 +1819,7 @@ void SkCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
LOOPER_END
}
void SkCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
void SkCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawPath()");
if (!path.isFinite()) {
return;
@ -1911,18 +1852,21 @@ void SkCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
LOOPER_END
}
void SkCanvas::onDrawImage(const SkImage* image, SkScalar dx, SkScalar dy, const SkPaint* paint) {
void SkCanvas::drawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawImage()");
image->draw(this, dx, dy, paint);
image->draw(this, left, top, paint);
}
void SkCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
const SkPaint* paint) {
void SkCanvas::drawImageRect(const SkImage* image, const SkRect* src,
const SkRect& dst,
const SkPaint* paint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawImageRect()");
image->drawRect(this, src, dst, paint);
}
void SkCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, const SkPaint* paint) {
void SkCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y,
const SkPaint* paint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawBitmap()");
SkDEBUGCODE(bitmap.validate();)
@ -1978,8 +1922,9 @@ void SkCanvas::internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
LOOPER_END
}
void SkCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
const SkPaint* paint, DrawBitmapRectFlags flags) {
void SkCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags flags) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawBitmapRectToRect()");
SkDEBUGCODE(bitmap.validate();)
this->internalDrawBitmapRect(bitmap, src, dst, paint, flags);
@ -2055,8 +2000,8 @@ void SkCanvas::internalDrawBitmapNine(const SkBitmap& bitmap,
}
}
void SkCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst,
const SkPaint* paint) {
void SkCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawBitmapNine()");
SkDEBUGCODE(bitmap.validate();)
@ -2263,11 +2208,11 @@ void SkCanvas::drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
}
}
void SkCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint verts[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
void SkCanvas::drawVertices(VertexMode vmode, int vertexCount,
const SkPoint verts[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawVertices()");
LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL)

View File

@ -451,7 +451,7 @@ size_t SkPictureRecord::recordClipRegion(const SkRegion& region, SkRegion::Op op
return offset;
}
void SkPictureRecord::onDrawPaint(const SkPaint& paint) {
void SkPictureRecord::drawPaint(const SkPaint& paint) {
// op + paint index
size_t size = 2 * kUInt32Size;
size_t initialOffset = this->addDraw(DRAW_PAINT, &size);
@ -460,8 +460,8 @@ void SkPictureRecord::onDrawPaint(const SkPaint& paint) {
this->validate(initialOffset, size);
}
void SkPictureRecord::onDrawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) {
void SkPictureRecord::drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) {
fContentInfo.onDrawPoints(count, paint);
// op + paint index + mode + count + point data
@ -476,7 +476,7 @@ void SkPictureRecord::onDrawPoints(PointMode mode, size_t count, const SkPoint p
this->validate(initialOffset, size);
}
void SkPictureRecord::onDrawOval(const SkRect& oval, const SkPaint& paint) {
void SkPictureRecord::drawOval(const SkRect& oval, const SkPaint& paint) {
// op + paint index + rect
size_t size = 2 * kUInt32Size + sizeof(oval);
size_t initialOffset = this->addDraw(DRAW_OVAL, &size);
@ -486,7 +486,7 @@ void SkPictureRecord::onDrawOval(const SkRect& oval, const SkPaint& paint) {
this->validate(initialOffset, size);
}
void SkPictureRecord::onDrawRect(const SkRect& rect, const SkPaint& paint) {
void SkPictureRecord::drawRect(const SkRect& rect, const SkPaint& paint) {
// op + paint index + rect
size_t size = 2 * kUInt32Size + sizeof(rect);
size_t initialOffset = this->addDraw(DRAW_RECT, &size);
@ -496,7 +496,7 @@ void SkPictureRecord::onDrawRect(const SkRect& rect, const SkPaint& paint) {
this->validate(initialOffset, size);
}
void SkPictureRecord::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
void SkPictureRecord::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
// op + paint index + rrect
size_t size = 2 * kUInt32Size + SkRRect::kSizeInMemory;
size_t initialOffset = this->addDraw(DRAW_RRECT, &size);
@ -518,7 +518,7 @@ void SkPictureRecord::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
this->validate(initialOffset, size);
}
void SkPictureRecord::onDrawPath(const SkPath& path, const SkPaint& paint) {
void SkPictureRecord::drawPath(const SkPath& path, const SkPaint& paint) {
fContentInfo.onDrawPath(path, paint);
// op + paint index + path index
@ -530,8 +530,8 @@ void SkPictureRecord::onDrawPath(const SkPath& path, const SkPaint& paint) {
this->validate(initialOffset, size);
}
void SkPictureRecord::onDrawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
const SkPaint* paint) {
void SkPictureRecord::drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
const SkPaint* paint = NULL) {
// op + paint index + bitmap index + left + top
size_t size = 3 * kUInt32Size + 2 * sizeof(SkScalar);
size_t initialOffset = this->addDraw(DRAW_BITMAP, &size);
@ -543,8 +543,9 @@ void SkPictureRecord::onDrawBitmap(const SkBitmap& bitmap, SkScalar left, SkScal
this->validate(initialOffset, size);
}
void SkPictureRecord::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
const SkPaint* paint, DrawBitmapRectFlags flags) {
void SkPictureRecord::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags flags) {
// id + paint index + bitmap index + bool for 'src' + flags
size_t size = 5 * kUInt32Size;
if (src) {
@ -563,8 +564,8 @@ void SkPictureRecord::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src
this->validate(initialOffset, size);
}
void SkPictureRecord::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint) {
void SkPictureRecord::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint) {
// op + paint index + bitmap id + center + dst rect
size_t size = 3 * kUInt32Size + sizeof(center) + sizeof(dst);
size_t initialOffset = this->addDraw(DRAW_BITMAP_NINE, &size);
@ -576,8 +577,8 @@ void SkPictureRecord::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& ce
this->validate(initialOffset, size);
}
void SkPictureRecord::onDrawSprite(const SkBitmap& bitmap, int left, int top,
const SkPaint* paint) {
void SkPictureRecord::drawSprite(const SkBitmap& bitmap, int left, int top,
const SkPaint* paint = NULL) {
// op + paint index + bitmap index + left + top
size_t size = 5 * kUInt32Size;
size_t initialOffset = this->addDraw(DRAW_SPRITE, &size);
@ -692,11 +693,11 @@ void SkPictureRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* ma
this->validate(initialOffset, size);
}
void SkPictureRecord::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xfer,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
void SkPictureRecord::drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xfer,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
uint32_t flags = 0;
if (texs) {
flags |= DRAW_VERTICES_HAS_TEXS;

View File

@ -29,6 +29,27 @@ public:
SkPictureRecord(const SkISize& dimensions, uint32_t recordFlags);
virtual ~SkPictureRecord();
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
virtual void drawPoints(PointMode, size_t count, const SkPoint pts[],
const SkPaint&) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top,
const SkPaint*) SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags flags) SK_OVERRIDE;
virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint*) SK_OVERRIDE;
virtual void drawSprite(const SkBitmap&, int left, int top,
const SkPaint*) SK_OVERRIDE;
virtual void drawVertices(VertexMode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode*,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
virtual void endCommentGroup() SK_OVERRIDE;
@ -175,30 +196,6 @@ protected:
const SkPoint texCoords[4], SkXfermode* xmode,
const SkPaint& paint) SK_OVERRIDE;
void onDrawPaint(const SkPaint&) SK_OVERRIDE;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) SK_OVERRIDE;
void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
void onDrawPath(const SkPath&, const SkPaint&) SK_OVERRIDE;
void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*,
DrawBitmapRectFlags flags) SK_OVERRIDE;
#if 0
// rely on conversion to bitmap (for now)
void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
#endif
void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) SK_OVERRIDE;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;

View File

@ -116,26 +116,26 @@ char* SkRecorder::copy(const char* src) {
}
void SkRecorder::onDrawPaint(const SkPaint& paint) {
void SkRecorder::drawPaint(const SkPaint& paint) {
APPEND(DrawPaint, delay_copy(paint));
}
void SkRecorder::onDrawPoints(PointMode mode,
size_t count,
const SkPoint pts[],
const SkPaint& paint) {
void SkRecorder::drawPoints(PointMode mode,
size_t count,
const SkPoint pts[],
const SkPaint& paint) {
APPEND(DrawPoints, delay_copy(paint), mode, SkToUInt(count), this->copy(pts, count));
}
void SkRecorder::onDrawRect(const SkRect& rect, const SkPaint& paint) {
void SkRecorder::drawRect(const SkRect& rect, const SkPaint& paint) {
APPEND(DrawRect, delay_copy(paint), rect);
}
void SkRecorder::onDrawOval(const SkRect& oval, const SkPaint& paint) {
void SkRecorder::drawOval(const SkRect& oval, const SkPaint& paint) {
APPEND(DrawOval, delay_copy(paint), oval);
}
void SkRecorder::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
void SkRecorder::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
APPEND(DrawRRect, delay_copy(paint), rrect);
}
@ -151,22 +151,22 @@ void SkRecorder::onDrawDrawable(SkCanvasDrawable* drawable) {
APPEND(DrawDrawable, drawable->getBounds(), fDrawableList->count() - 1);
}
void SkRecorder::onDrawPath(const SkPath& path, const SkPaint& paint) {
void SkRecorder::drawPath(const SkPath& path, const SkPaint& paint) {
APPEND(DrawPath, delay_copy(paint), delay_copy(path));
}
void SkRecorder::onDrawBitmap(const SkBitmap& bitmap,
SkScalar left,
SkScalar top,
const SkPaint* paint) {
void SkRecorder::drawBitmap(const SkBitmap& bitmap,
SkScalar left,
SkScalar top,
const SkPaint* paint) {
APPEND(DrawBitmap, this->copy(paint), delay_copy(bitmap), left, top);
}
void SkRecorder::onDrawBitmapRect(const SkBitmap& bitmap,
const SkRect* src,
const SkRect& dst,
const SkPaint* paint,
DrawBitmapRectFlags flags) {
void SkRecorder::drawBitmapRectToRect(const SkBitmap& bitmap,
const SkRect* src,
const SkRect& dst,
const SkPaint* paint,
DrawBitmapRectFlags flags) {
if (kBleed_DrawBitmapRectFlag == flags) {
APPEND(DrawBitmapRectToRectBleed,
this->copy(paint), delay_copy(bitmap), this->copy(src), dst);
@ -177,25 +177,25 @@ void SkRecorder::onDrawBitmapRect(const SkBitmap& bitmap,
this->copy(paint), delay_copy(bitmap), this->copy(src), dst);
}
void SkRecorder::onDrawBitmapNine(const SkBitmap& bitmap,
const SkIRect& center,
const SkRect& dst,
const SkPaint* paint) {
void SkRecorder::drawBitmapNine(const SkBitmap& bitmap,
const SkIRect& center,
const SkRect& dst,
const SkPaint* paint) {
APPEND(DrawBitmapNine, this->copy(paint), delay_copy(bitmap), center, dst);
}
void SkRecorder::onDrawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint) {
void SkRecorder::drawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint) {
APPEND(DrawImage, this->copy(paint), image, left, top);
}
void SkRecorder::onDrawImageRect(const SkImage* image, const SkRect* src,
const SkRect& dst,
const SkPaint* paint) {
void SkRecorder::drawImageRect(const SkImage* image, const SkRect* src,
const SkRect& dst,
const SkPaint* paint) {
APPEND(DrawImageRect, this->copy(paint), image, this->copy(src), dst);
}
void SkRecorder::onDrawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint) {
void SkRecorder::drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint) {
APPEND(DrawSprite, this->copy(paint), delay_copy(bitmap), left, top);
}
@ -245,11 +245,11 @@ void SkRecorder::onDrawPicture(const SkPicture* pic, const SkMatrix* matrix, con
APPEND(DrawPicture, this->copy(paint), pic, matrix ? *matrix : SkMatrix::I());
}
void SkRecorder::onDrawVertices(VertexMode vmode,
int vertexCount, const SkPoint vertices[],
const SkPoint texs[], const SkColor colors[],
SkXfermode* xmode,
const uint16_t indices[], int indexCount, const SkPaint& paint) {
void SkRecorder::drawVertices(VertexMode vmode,
int vertexCount, const SkPoint vertices[],
const SkPoint texs[], const SkColor colors[],
SkXfermode* xmode,
const uint16_t indices[], int indexCount, const SkPaint& paint) {
APPEND(DrawVertices, delay_copy(paint),
vmode,
vertexCount,

View File

@ -45,6 +45,47 @@ public:
// Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecorder will fail.
void forgetRecord();
void drawPaint(const SkPaint& paint) SK_OVERRIDE;
void drawPoints(PointMode mode,
size_t count,
const SkPoint pts[],
const SkPaint& paint) SK_OVERRIDE;
void drawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE;
void drawOval(const SkRect& oval, const SkPaint&) SK_OVERRIDE;
void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRIDE;
void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
void drawBitmap(const SkBitmap& bitmap,
SkScalar left,
SkScalar top,
const SkPaint* paint = NULL) SK_OVERRIDE;
void drawBitmapRectToRect(const SkBitmap& bitmap,
const SkRect* src,
const SkRect& dst,
const SkPaint* paint = NULL,
DrawBitmapRectFlags flags = kNone_DrawBitmapRectFlag) SK_OVERRIDE;
void drawBitmapNine(const SkBitmap& bitmap,
const SkIRect& center,
const SkRect& dst,
const SkPaint* paint = NULL) SK_OVERRIDE;
virtual void drawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint = NULL) SK_OVERRIDE;
virtual void drawImageRect(const SkImage* image, const SkRect* src,
const SkRect& dst,
const SkPaint* paint = NULL) SK_OVERRIDE;
void drawSprite(const SkBitmap& bitmap,
int left,
int top,
const SkPaint* paint = NULL) SK_OVERRIDE;
void drawVertices(VertexMode vmode,
int vertexCount,
const SkPoint vertices[],
const SkPoint texs[],
const SkColor colors[],
SkXfermode* xmode,
const uint16_t indices[],
int indexCount,
const SkPaint& paint) SK_OVERRIDE;
void willSave() SK_OVERRIDE;
SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::SaveFlags) SK_OVERRIDE;
void willRestore() SK_OVERRIDE {}
@ -82,27 +123,6 @@ public:
const SkPoint texCoords[4], SkXfermode* xmode,
const SkPaint& paint) SK_OVERRIDE;
void onDrawPaint(const SkPaint&) SK_OVERRIDE;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) SK_OVERRIDE;
void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
void onDrawPath(const SkPath&, const SkPaint&) SK_OVERRIDE;
void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*,
DrawBitmapRectFlags flags) SK_OVERRIDE;
void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) SK_OVERRIDE;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle) SK_OVERRIDE;
void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeStyle) SK_OVERRIDE;
void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle) SK_OVERRIDE;

View File

@ -231,6 +231,28 @@ public:
return (NULL == fBitmapHeap) ? 0 : fBitmapHeap->bytesAllocated();
}
// overrides from SkCanvas
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
virtual void drawPoints(PointMode, size_t count, const SkPoint pts[],
const SkPaint&) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
virtual void drawRect(const SkRect& rect, const SkPaint&) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top,
const SkPaint*) SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags flags) SK_OVERRIDE;
virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint = NULL) SK_OVERRIDE;
virtual void drawSprite(const SkBitmap&, int left, int top,
const SkPaint*) SK_OVERRIDE;
virtual void drawVertices(VertexMode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode*,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
virtual void endCommentGroup() SK_OVERRIDE;
@ -263,29 +285,6 @@ protected:
virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
const SkPoint texCoords[4], SkXfermode* xmode,
const SkPaint& paint) SK_OVERRIDE;
void onDrawPaint(const SkPaint&) SK_OVERRIDE;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) SK_OVERRIDE;
void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
void onDrawPath(const SkPath&, const SkPaint&) SK_OVERRIDE;
void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*,
DrawBitmapRectFlags flags) SK_OVERRIDE;
#if 0
// rely on decomposition into bitmap (for now)
void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
#endif
void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) SK_OVERRIDE;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
@ -669,7 +668,7 @@ void SkGPipeCanvas::onClipRegion(const SkRegion& region, SkRegion::Op rgnOp) {
///////////////////////////////////////////////////////////////////////////////
void SkGPipeCanvas::onDrawPaint(const SkPaint& paint) {
void SkGPipeCanvas::drawPaint(const SkPaint& paint) {
NOTIFY_SETUP(this);
this->writePaint(paint);
if (this->needOpBytes()) {
@ -677,8 +676,8 @@ void SkGPipeCanvas::onDrawPaint(const SkPaint& paint) {
}
}
void SkGPipeCanvas::onDrawPoints(PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
void SkGPipeCanvas::drawPoints(PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
if (count) {
NOTIFY_SETUP(this);
this->writePaint(paint);
@ -690,7 +689,7 @@ void SkGPipeCanvas::onDrawPoints(PointMode mode, size_t count,
}
}
void SkGPipeCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) {
void SkGPipeCanvas::drawOval(const SkRect& rect, const SkPaint& paint) {
NOTIFY_SETUP(this);
this->writePaint(paint);
if (this->needOpBytes(sizeof(SkRect))) {
@ -699,7 +698,7 @@ void SkGPipeCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) {
}
}
void SkGPipeCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
void SkGPipeCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
NOTIFY_SETUP(this);
this->writePaint(paint);
if (this->needOpBytes(sizeof(SkRect))) {
@ -708,7 +707,7 @@ void SkGPipeCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
}
}
void SkGPipeCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
void SkGPipeCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
NOTIFY_SETUP(this);
this->writePaint(paint);
if (this->needOpBytes(kSizeOfFlatRRect)) {
@ -728,7 +727,7 @@ void SkGPipeCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
}
}
void SkGPipeCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
void SkGPipeCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
NOTIFY_SETUP(this);
this->writePaint(paint);
if (this->needOpBytes(path.writeToMemory(NULL))) {
@ -764,8 +763,8 @@ bool SkGPipeCanvas::commonDrawBitmap(const SkBitmap& bm, DrawOps op,
return false;
}
void SkGPipeCanvas::onDrawBitmap(const SkBitmap& bm, SkScalar left, SkScalar top,
const SkPaint* paint) {
void SkGPipeCanvas::drawBitmap(const SkBitmap& bm, SkScalar left, SkScalar top,
const SkPaint* paint) {
NOTIFY_SETUP(this);
size_t opBytesNeeded = sizeof(SkScalar) * 2;
@ -775,8 +774,9 @@ void SkGPipeCanvas::onDrawBitmap(const SkBitmap& bm, SkScalar left, SkScalar top
}
}
void SkGPipeCanvas::onDrawBitmapRect(const SkBitmap& bm, const SkRect* src, const SkRect& dst,
const SkPaint* paint, DrawBitmapRectFlags dbmrFlags) {
void SkGPipeCanvas::drawBitmapRectToRect(const SkBitmap& bm, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags dbmrFlags) {
NOTIFY_SETUP(this);
size_t opBytesNeeded = sizeof(SkRect);
bool hasSrc = src != NULL;
@ -799,8 +799,8 @@ void SkGPipeCanvas::onDrawBitmapRect(const SkBitmap& bm, const SkRect* src, cons
}
}
void SkGPipeCanvas::onDrawBitmapNine(const SkBitmap& bm, const SkIRect& center,
const SkRect& dst, const SkPaint* paint) {
void SkGPipeCanvas::drawBitmapNine(const SkBitmap& bm, const SkIRect& center,
const SkRect& dst, const SkPaint* paint) {
NOTIFY_SETUP(this);
size_t opBytesNeeded = sizeof(int32_t) * 4 + sizeof(SkRect);
@ -813,7 +813,8 @@ void SkGPipeCanvas::onDrawBitmapNine(const SkBitmap& bm, const SkIRect& center,
}
}
void SkGPipeCanvas::onDrawSprite(const SkBitmap& bm, int left, int top, const SkPaint* paint) {
void SkGPipeCanvas::drawSprite(const SkBitmap& bm, int left, int top,
const SkPaint* paint) {
NOTIFY_SETUP(this);
size_t opBytesNeeded = sizeof(int32_t) * 2;
@ -979,11 +980,11 @@ void SkGPipeCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matr
this->INHERITED::onDrawPicture(picture, matrix, paint);
}
void SkGPipeCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xfer,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
void SkGPipeCanvas::drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xfer,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
if (0 == vertexCount) {
return;
}

View File

@ -754,7 +754,7 @@ void SkDeferredCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op)
this->recordedDrawCommand();
}
void SkDeferredCanvas::onDrawPaint(const SkPaint& paint) {
void SkDeferredCanvas::drawPaint(const SkPaint& paint) {
if (fDeferredDrawing && this->isFullFrame(NULL, &paint) &&
isPaintOpaque(&paint)) {
this->getDeferredDevice()->skipPendingCommands();
@ -764,20 +764,20 @@ void SkDeferredCanvas::onDrawPaint(const SkPaint& paint) {
this->recordedDrawCommand();
}
void SkDeferredCanvas::onDrawPoints(PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
void SkDeferredCanvas::drawPoints(PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
this->drawingCanvas()->drawPoints(mode, count, pts, paint);
this->recordedDrawCommand();
}
void SkDeferredCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) {
void SkDeferredCanvas::drawOval(const SkRect& rect, const SkPaint& paint) {
AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
this->drawingCanvas()->drawOval(rect, paint);
this->recordedDrawCommand();
}
void SkDeferredCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
void SkDeferredCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
if (fDeferredDrawing && this->isFullFrame(&rect, &paint) &&
isPaintOpaque(&paint)) {
this->getDeferredDevice()->skipPendingCommands();
@ -788,7 +788,7 @@ void SkDeferredCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
this->recordedDrawCommand();
}
void SkDeferredCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
void SkDeferredCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
if (rrect.isRect()) {
this->SkDeferredCanvas::drawRect(rrect.getBounds(), paint);
} else if (rrect.isOval()) {
@ -807,14 +807,14 @@ void SkDeferredCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
this->recordedDrawCommand();
}
void SkDeferredCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
void SkDeferredCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
this->drawingCanvas()->drawPath(path, paint);
this->recordedDrawCommand();
}
void SkDeferredCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar left,
SkScalar top, const SkPaint* paint) {
void SkDeferredCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar left,
SkScalar top, const SkPaint* paint) {
SkRect bitmapRect = SkRect::MakeXYWH(left, top,
SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height()));
if (fDeferredDrawing &&
@ -828,9 +828,11 @@ void SkDeferredCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar left,
this->recordedDrawCommand();
}
void SkDeferredCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst,
const SkPaint* paint, DrawBitmapRectFlags flags) {
void SkDeferredCanvas::drawBitmapRectToRect(const SkBitmap& bitmap,
const SkRect* src,
const SkRect& dst,
const SkPaint* paint,
DrawBitmapRectFlags flags) {
if (fDeferredDrawing &&
this->isFullFrame(&dst, paint) &&
isPaintOpaque(paint, &bitmap)) {
@ -842,9 +844,9 @@ void SkDeferredCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* sr
this->recordedDrawCommand();
}
void SkDeferredCanvas::onDrawBitmapNine(const SkBitmap& bitmap,
const SkIRect& center, const SkRect& dst,
const SkPaint* paint) {
void SkDeferredCanvas::drawBitmapNine(const SkBitmap& bitmap,
const SkIRect& center, const SkRect& dst,
const SkPaint* paint) {
// TODO: reset recording canvas if paint+bitmap is opaque and clip rect
// covers canvas entirely and dst covers canvas entirely
AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint);
@ -852,8 +854,8 @@ void SkDeferredCanvas::onDrawBitmapNine(const SkBitmap& bitmap,
this->recordedDrawCommand();
}
void SkDeferredCanvas::onDrawSprite(const SkBitmap& bitmap, int left, int top,
const SkPaint* paint) {
void SkDeferredCanvas::drawSprite(const SkBitmap& bitmap, int left, int top,
const SkPaint* paint) {
SkRect bitmapRect = SkRect::MakeXYWH(
SkIntToScalar(left),
SkIntToScalar(top),
@ -911,12 +913,12 @@ void SkDeferredCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* m
this->recordedDrawCommand();
}
void SkDeferredCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[],
const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
void SkDeferredCanvas::drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[],
const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
this->drawingCanvas()->drawVertices(vmode, vertexCount, vertices, texs, colors, xmode,
indices, indexCount, paint);

View File

@ -294,29 +294,29 @@ void SkDumpCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
///////////////////////////////////////////////////////////////////////////////
void SkDumpCanvas::onDrawPaint(const SkPaint& paint) {
void SkDumpCanvas::drawPaint(const SkPaint& paint) {
this->dump(kDrawPaint_Verb, &paint, "drawPaint()");
}
void SkDumpCanvas::onDrawPoints(PointMode mode, size_t count,
void SkDumpCanvas::drawPoints(PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
this->dump(kDrawPoints_Verb, &paint, "drawPoints(%s, %d)", toString(mode),
count);
}
void SkDumpCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) {
void SkDumpCanvas::drawOval(const SkRect& rect, const SkPaint& paint) {
SkString str;
toString(rect, &str);
this->dump(kDrawOval_Verb, &paint, "drawOval(%s)", str.c_str());
}
void SkDumpCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
void SkDumpCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
SkString str;
toString(rect, &str);
this->dump(kDrawRect_Verb, &paint, "drawRect(%s)", str.c_str());
}
void SkDumpCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
void SkDumpCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
SkString str;
toString(rrect, &str);
this->dump(kDrawDRRect_Verb, &paint, "drawRRect(%s)", str.c_str());
@ -331,22 +331,23 @@ void SkDumpCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
str0.c_str(), str1.c_str());
}
void SkDumpCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
void SkDumpCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
SkString str;
toString(path, &str);
this->dump(kDrawPath_Verb, &paint, "drawPath(%s)", str.c_str());
}
void SkDumpCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y,
const SkPaint* paint) {
void SkDumpCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y,
const SkPaint* paint) {
SkString str;
bitmap.toString(&str);
this->dump(kDrawBitmap_Verb, paint, "drawBitmap(%s %g %g)", str.c_str(),
SkScalarToFloat(x), SkScalarToFloat(y));
}
void SkDumpCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
const SkPaint* paint, DrawBitmapRectFlags flags) {
void SkDumpCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags flags) {
SkString bs, rs;
bitmap.toString(&bs);
toString(dst, &rs);
@ -363,42 +364,8 @@ void SkDumpCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, c
bs.c_str(), rs.c_str());
}
void SkDumpCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint) {
SkString str, centerStr, dstStr;
bitmap.toString(&str);
toString(center, &centerStr);
toString(dst, &dstStr);
this->dump(kDrawBitmap_Verb, paint, "drawBitmapNine(%s %s %s)", str.c_str(),
centerStr.c_str(), dstStr.c_str());
}
void SkDumpCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, const SkPaint* paint) {
SkString str;
image->toString(&str);
this->dump(kDrawBitmap_Verb, paint, "drawImage(%s %g %g)", str.c_str(),
SkScalarToFloat(x), SkScalarToFloat(y));
}
void SkDumpCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
const SkPaint* paint) {
SkString bs, rs;
image->toString(&bs);
toString(dst, &rs);
// show the src-rect only if its not everything
if (src && (src->fLeft > 0 || src->fTop > 0 ||
src->fRight < SkIntToScalar(image->width()) ||
src->fBottom < SkIntToScalar(image->height()))) {
SkString ss;
toString(*src, &ss);
rs.prependf("%s ", ss.c_str());
}
this->dump(kDrawBitmap_Verb, paint, "drawImageRectToRect(%s %s)",
bs.c_str(), rs.c_str());
}
void SkDumpCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint* paint) {
void SkDumpCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
const SkPaint* paint) {
SkString str;
bitmap.toString(&str);
this->dump(kDrawBitmap_Verb, paint, "drawSprite(%s %d %d)", str.c_str(),
@ -460,11 +427,11 @@ void SkDumpCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matri
picture->cullRect().fRight, picture->cullRect().fBottom);
}
void SkDumpCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
void SkDumpCanvas::drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
this->dump(kDrawVertices_Verb, &paint, "drawVertices(%s [%d] %g %g ...)",
toString(vmode), vertexCount, SkScalarToFloat(vertices[0].fX),
SkScalarToFloat(vertices[0].fY));

View File

@ -162,31 +162,31 @@ void SkLuaCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
this->INHERITED::onClipRegion(deviceRgn, op);
}
void SkLuaCanvas::onDrawPaint(const SkPaint& paint) {
void SkLuaCanvas::drawPaint(const SkPaint& paint) {
AUTO_LUA("drawPaint");
lua.pushPaint(paint, "paint");
}
void SkLuaCanvas::onDrawPoints(PointMode mode, size_t count,
void SkLuaCanvas::drawPoints(PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
AUTO_LUA("drawPoints");
lua.pushArrayPoint(pts, SkToInt(count), "points");
lua.pushPaint(paint, "paint");
}
void SkLuaCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) {
void SkLuaCanvas::drawOval(const SkRect& rect, const SkPaint& paint) {
AUTO_LUA("drawOval");
lua.pushRect(rect, "rect");
lua.pushPaint(paint, "paint");
}
void SkLuaCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
void SkLuaCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
AUTO_LUA("drawRect");
lua.pushRect(rect, "rect");
lua.pushPaint(paint, "paint");
}
void SkLuaCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
void SkLuaCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
AUTO_LUA("drawRRect");
lua.pushRRect(rrect, "rrect");
lua.pushPaint(paint, "paint");
@ -200,52 +200,31 @@ void SkLuaCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
lua.pushPaint(paint, "paint");
}
void SkLuaCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
void SkLuaCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
AUTO_LUA("drawPath");
lua.pushPath(path, "path");
lua.pushPaint(paint, "paint");
}
void SkLuaCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y,
const SkPaint* paint) {
void SkLuaCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y,
const SkPaint* paint) {
AUTO_LUA("drawBitmap");
if (paint) {
lua.pushPaint(*paint, "paint");
}
}
void SkLuaCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
const SkPaint* paint, DrawBitmapRectFlags flags) {
AUTO_LUA("drawBitmapRect");
void SkLuaCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags flags) {
AUTO_LUA("drawBitmapRectToRect");
if (paint) {
lua.pushPaint(*paint, "paint");
}
}
void SkLuaCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst,
const SkPaint* paint) {
AUTO_LUA("drawBitmapNine");
if (paint) {
lua.pushPaint(*paint, "paint");
}
}
void SkLuaCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, const SkPaint* paint) {
AUTO_LUA("drawImage");
if (paint) {
lua.pushPaint(*paint, "paint");
}
}
void SkLuaCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
const SkPaint* paint) {
AUTO_LUA("drawImageRect");
if (paint) {
lua.pushPaint(*paint, "paint");
}
}
void SkLuaCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint* paint) {
void SkLuaCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
const SkPaint* paint) {
AUTO_LUA("drawSprite");
if (paint) {
lua.pushPaint(*paint, "paint");
@ -297,7 +276,7 @@ void SkLuaCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix
this->INHERITED::onDrawPicture(picture, matrix, paint);
}
void SkLuaCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
void SkLuaCanvas::drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,

View File

@ -134,36 +134,36 @@ void SkNWayCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
this->INHERITED::onClipRegion(deviceRgn, op);
}
void SkNWayCanvas::onDrawPaint(const SkPaint& paint) {
void SkNWayCanvas::drawPaint(const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawPaint(paint);
}
}
void SkNWayCanvas::onDrawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) {
void SkNWayCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawPoints(mode, count, pts, paint);
}
}
void SkNWayCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
void SkNWayCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawRect(rect, paint);
}
}
void SkNWayCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) {
void SkNWayCanvas::drawOval(const SkRect& rect, const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawOval(rect, paint);
}
}
void SkNWayCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
void SkNWayCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawRRect(rrect, paint);
@ -178,54 +178,57 @@ void SkNWayCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
}
}
void SkNWayCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
void SkNWayCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawPath(path, paint);
}
}
void SkNWayCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y,
const SkPaint* paint) {
void SkNWayCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y,
const SkPaint* paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawBitmap(bitmap, x, y, paint);
}
}
void SkNWayCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
const SkPaint* paint, DrawBitmapRectFlags flags) {
void SkNWayCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags flags) {
Iter iter(fList);
while (iter.next()) {
iter->drawBitmapRectToRect(bitmap, src, dst, paint, flags);
}
}
void SkNWayCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint) {
void SkNWayCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawBitmapNine(bitmap, center, dst, paint);
}
}
void SkNWayCanvas::onDrawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint) {
void SkNWayCanvas::drawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawImage(image, left, top, paint);
}
}
void SkNWayCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
const SkPaint* paint) {
void SkNWayCanvas::drawImageRect(const SkImage* image, const SkRect* src,
const SkRect& dst,
const SkPaint* paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawImageRect(image, src, dst, paint);
}
}
void SkNWayCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint* paint) {
void SkNWayCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
const SkPaint* paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawSprite(bitmap, x, y, paint);
@ -280,11 +283,11 @@ void SkNWayCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matri
}
}
void SkNWayCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
void SkNWayCanvas::drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawVertices(vmode, vertexCount, vertices, texs, colors, xmode,

View File

@ -65,24 +65,24 @@ void SkProxyCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
fProxy->clipRegion(deviceRgn, op);
}
void SkProxyCanvas::onDrawPaint(const SkPaint& paint) {
void SkProxyCanvas::drawPaint(const SkPaint& paint) {
fProxy->drawPaint(paint);
}
void SkProxyCanvas::onDrawPoints(PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
void SkProxyCanvas::drawPoints(PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
fProxy->drawPoints(mode, count, pts, paint);
}
void SkProxyCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) {
void SkProxyCanvas::drawOval(const SkRect& rect, const SkPaint& paint) {
fProxy->drawOval(rect, paint);
}
void SkProxyCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
void SkProxyCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
fProxy->drawRect(rect, paint);
}
void SkProxyCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
void SkProxyCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
fProxy->drawRRect(rrect, paint);
}
@ -91,36 +91,34 @@ void SkProxyCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
fProxy->drawDRRect(outer, inner, paint);
}
void SkProxyCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
void SkProxyCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
fProxy->drawPath(path, paint);
}
void SkProxyCanvas::onDrawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint) {
void SkProxyCanvas::drawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint) {
fProxy->drawImage(image, left, top, paint);
}
void SkProxyCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
const SkPaint* paint) {
void SkProxyCanvas::drawImageRect(const SkImage* image, const SkRect* src,
const SkRect& dst,
const SkPaint* paint) {
fProxy->drawImageRect(image, src, dst, paint);
}
void SkProxyCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y,
const SkPaint* paint) {
void SkProxyCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y,
const SkPaint* paint) {
fProxy->drawBitmap(bitmap, x, y, paint);
}
void SkProxyCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
const SkPaint* paint, DrawBitmapRectFlags flags) {
void SkProxyCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags flags) {
fProxy->drawBitmapRectToRect(bitmap, src, dst, paint, flags);
}
void SkProxyCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint) {
fProxy->drawBitmapNine(bitmap, center, dst, paint);
}
void SkProxyCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint* paint) {
void SkProxyCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
const SkPaint* paint) {
fProxy->drawSprite(bitmap, x, y, paint);
}
@ -154,11 +152,11 @@ void SkProxyCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matr
fProxy->drawPicture(picture, matrix, paint);
}
void SkProxyCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
void SkProxyCanvas::drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint& paint) {
fProxy->drawVertices(vmode, vertexCount, vertices, texs, colors,
xmode, indices, indexCount, paint);
}

View File

@ -431,31 +431,23 @@ void SkDebugCanvas::didConcat(const SkMatrix& matrix) {
this->INHERITED::didConcat(matrix);
}
void SkDebugCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar left,
SkScalar top, const SkPaint* paint) {
void SkDebugCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar left,
SkScalar top, const SkPaint* paint = NULL) {
this->addDrawCommand(new SkDrawBitmapCommand(bitmap, left, top, paint));
}
void SkDebugCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
const SkPaint* paint, DrawBitmapRectFlags flags) {
void SkDebugCanvas::drawBitmapRectToRect(const SkBitmap& bitmap,
const SkRect* src, const SkRect& dst,
const SkPaint* paint,
SkCanvas::DrawBitmapRectFlags flags) {
this->addDrawCommand(new SkDrawBitmapRectCommand(bitmap, src, dst, paint, flags));
}
void SkDebugCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint) {
void SkDebugCanvas::drawBitmapNine(const SkBitmap& bitmap,
const SkIRect& center, const SkRect& dst, const SkPaint* paint) {
this->addDrawCommand(new SkDrawBitmapNineCommand(bitmap, center, dst, paint));
}
void SkDebugCanvas::onDrawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint) {
SkDebugf("SkDebugCanvas::onDrawImage unimplemented\n");
}
void SkDebugCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
const SkPaint* paint) {
SkDebugf("SkDebugCanvas::onDrawImageRect unimplemented\n");
}
void SkDebugCanvas::beginCommentGroup(const char* description) {
this->addDrawCommand(new SkBeginCommentGroupCommand(description));
}
@ -468,15 +460,15 @@ void SkDebugCanvas::endCommentGroup() {
this->addDrawCommand(new SkEndCommentGroupCommand());
}
void SkDebugCanvas::onDrawOval(const SkRect& oval, const SkPaint& paint) {
void SkDebugCanvas::drawOval(const SkRect& oval, const SkPaint& paint) {
this->addDrawCommand(new SkDrawOvalCommand(oval, paint));
}
void SkDebugCanvas::onDrawPaint(const SkPaint& paint) {
void SkDebugCanvas::drawPaint(const SkPaint& paint) {
this->addDrawCommand(new SkDrawPaintCommand(paint));
}
void SkDebugCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
void SkDebugCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
this->addDrawCommand(new SkDrawPathCommand(path, paint));
}
@ -486,8 +478,8 @@ void SkDebugCanvas::onDrawPicture(const SkPicture* picture,
this->addDrawCommand(new SkDrawPictureCommand(picture, matrix, paint));
}
void SkDebugCanvas::onDrawPoints(PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
void SkDebugCanvas::drawPoints(PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint));
}
@ -502,12 +494,12 @@ void SkDebugCanvas::onDrawPosTextH(const void* text, size_t byteLength, const Sk
new SkDrawPosTextHCommand(text, byteLength, xpos, constY, paint));
}
void SkDebugCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
void SkDebugCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
// NOTE(chudy): Messing up when renamed to DrawRect... Why?
addDrawCommand(new SkDrawRectCommand(rect, paint));
}
void SkDebugCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
void SkDebugCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
this->addDrawCommand(new SkDrawRRectCommand(rrect, paint));
}
@ -516,7 +508,8 @@ void SkDebugCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
this->addDrawCommand(new SkDrawDRRectCommand(outer, inner, paint));
}
void SkDebugCanvas::onDrawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint) {
void SkDebugCanvas::drawSprite(const SkBitmap& bitmap, int left, int top,
const SkPaint* paint = NULL) {
this->addDrawCommand(new SkDrawSpriteCommand(bitmap, left, top, paint));
}
@ -536,10 +529,10 @@ void SkDebugCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar
this->addDrawCommand(new SkDrawTextBlobCommand(blob, x, y, paint));
}
void SkDebugCanvas::onDrawVertices(VertexMode vmode, int vertexCount, const SkPoint vertices[],
const SkPoint texs[], const SkColor colors[],
SkXfermode*, const uint16_t indices[], int indexCount,
const SkPaint& paint) {
void SkDebugCanvas::drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[], const SkColor colors[],
SkXfermode*, const uint16_t indices[], int indexCount,
const SkPaint& paint) {
this->addDrawCommand(new SkDrawVerticesCommand(vmode, vertexCount, vertices,
texs, colors, NULL, indices, indexCount, paint));
}

View File

@ -148,10 +148,44 @@ public:
// Inherited from SkCanvas
////////////////////////////////////////////////////////////////////////////////
virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top,
const SkPaint*) SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
DrawBitmapRectFlags flags) SK_OVERRIDE;
virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint*) SK_OVERRIDE;
virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
virtual void endCommentGroup() SK_OVERRIDE;
virtual void drawOval(const SkRect& oval, const SkPaint&) SK_OVERRIDE;
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
virtual void drawPoints(PointMode, size_t count, const SkPoint pts[],
const SkPaint&) SK_OVERRIDE;
virtual void drawRect(const SkRect& rect, const SkPaint&) SK_OVERRIDE;
virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRIDE;
virtual void drawSprite(const SkBitmap&, int left, int top,
const SkPaint*) SK_OVERRIDE;
virtual void drawVertices(VertexMode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode*,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
static const int kVizImageHeight = 256;
static const int kVizImageWidth = 256;
@ -192,27 +226,6 @@ protected:
virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) SK_OVERRIDE;
void onDrawPaint(const SkPaint&) SK_OVERRIDE;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) SK_OVERRIDE;
void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
void onDrawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
void onDrawPath(const SkPath&, const SkPaint&) SK_OVERRIDE;
void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*,
DrawBitmapRectFlags flags) SK_OVERRIDE;
void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*) SK_OVERRIDE;
void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) SK_OVERRIDE;
void onDrawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;

View File

@ -288,14 +288,16 @@ DEF_TEST(RecordDraw_drawImage, r){
SkCanvasMock(int width, int height) : SkCanvas(width, height) {
this->resetTestValues();
}
virtual ~SkCanvasMock() {}
virtual void drawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint = NULL) SK_OVERRIDE {
void onDrawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint) SK_OVERRIDE {
fDrawImageCalled = true;
}
void onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
const SkPaint* paint) SK_OVERRIDE {
virtual void drawImageRect(const SkImage* image, const SkRect* src,
const SkRect& dst,
const SkPaint* paint = NULL) SK_OVERRIDE {
fDrawImageRectCalled = true;
}

View File

@ -23,7 +23,7 @@ class MockCanvas : public SkCanvas {
public:
MockCanvas(const SkBitmap& bm) : SkCanvas(bm) {}
void onDrawRect(const SkRect& rect, const SkPaint&) SK_OVERRIDE {
virtual void drawRect(const SkRect& rect, const SkPaint&) {
// This capture occurs before quick reject.
fRects.push(rect);
}