Revert of make drawText calls non-virtual, to ease SkFont and TextBlob (https://codereview.chromium.org/243853006/)
Reason for revert: need to test more the code-path where we don't opt into the new virtuals Original issue's description: > make drawText calls non-virtual, to ease SkFont and TextBlob > > BUG=skia: > > Committed: http://code.google.com/p/skia/source/detail?r=14307 R=robertphillips@google.com TBR=robertphillips@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: reed@google.com Review URL: https://codereview.chromium.org/247983003 git-svn-id: http://skia.googlecode.com/svn/trunk@14314 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
d10ec40031
commit
945ec3a2be
@ -13,7 +13,6 @@
|
||||
# If these become 'permanent', they should be moved into skia_common.gypi
|
||||
#
|
||||
'skia_for_chromium_defines': [
|
||||
'SK_SUPPORT_LEGACY_DRAWTEXT_VIRTUAL',
|
||||
'SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1',
|
||||
'SK_SUPPORT_LEGACY_GETTOPDEVICE',
|
||||
'SK_SUPPORT_LEGACY_PICTURE_CAN_RECORD',
|
||||
|
@ -26,13 +26,6 @@
|
||||
//#define SK_SUPPORT_LEGACY_GETTOTALCLIP
|
||||
//#define SK_SUPPORT_LEGACY_GETTOPDEVICE
|
||||
|
||||
//#define SK_SUPPORT_LEGACY_DRAWTEXT_VIRTUAL
|
||||
#ifdef SK_SUPPORT_LEGACY_DRAWTEXT_VIRTUAL
|
||||
#define SK_LEGACY_DRAWTEXT_VIRTUAL virtual
|
||||
#else
|
||||
#define SK_LEGACY_DRAWTEXT_VIRTUAL
|
||||
#endif
|
||||
|
||||
class SkBounder;
|
||||
class SkBaseDevice;
|
||||
class SkDraw;
|
||||
@ -875,7 +868,7 @@ public:
|
||||
@param y The y-coordinate of the origin of the text being drawn
|
||||
@param paint The paint used for the text (e.g. color, size, style)
|
||||
*/
|
||||
SK_LEGACY_DRAWTEXT_VIRTUAL void drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
virtual void drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint& paint);
|
||||
|
||||
/** Draw the text, with each character/glyph origin specified by the pos[]
|
||||
@ -885,7 +878,7 @@ public:
|
||||
@param pos Array of positions, used to position each character
|
||||
@param paint The paint used for the text (e.g. color, size, style)
|
||||
*/
|
||||
SK_LEGACY_DRAWTEXT_VIRTUAL void drawPosText(const void* text, size_t byteLength,
|
||||
virtual void drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint);
|
||||
|
||||
/** Draw the text, with each character/glyph origin specified by the x
|
||||
@ -897,7 +890,7 @@ public:
|
||||
@param constY The shared Y coordinate for all of the positions
|
||||
@param paint The paint used for the text (e.g. color, size, style)
|
||||
*/
|
||||
SK_LEGACY_DRAWTEXT_VIRTUAL void drawPosTextH(const void* text, size_t byteLength,
|
||||
virtual void drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint);
|
||||
|
||||
@ -927,7 +920,7 @@ public:
|
||||
mapped onto the path
|
||||
@param paint The paint used for the text
|
||||
*/
|
||||
SK_LEGACY_DRAWTEXT_VIRTUAL void drawTextOnPath(const void* text, size_t byteLength,
|
||||
virtual void drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint);
|
||||
|
||||
@ -1193,22 +1186,6 @@ protected:
|
||||
|
||||
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&);
|
||||
|
||||
#ifndef SK_SUPPORT_LEGACY_DRAWTEXT_VIRTUAL
|
||||
virtual void onDrawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint& paint);
|
||||
|
||||
virtual void onDrawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint);
|
||||
|
||||
virtual void onDrawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint);
|
||||
|
||||
virtual void onDrawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint);
|
||||
#endif
|
||||
|
||||
enum ClipEdgeStyle {
|
||||
kHard_ClipEdgeStyle,
|
||||
kSoft_ClipEdgeStyle
|
||||
|
@ -162,6 +162,17 @@ public:
|
||||
SK_OVERRIDE;
|
||||
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
|
||||
const SkPaint* paint) SK_OVERRIDE;
|
||||
virtual void drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint)
|
||||
SK_OVERRIDE;
|
||||
virtual void drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawPicture(SkPicture& picture) SK_OVERRIDE;
|
||||
virtual void drawVertices(VertexMode vmode, int vertexCount,
|
||||
const SkPoint vertices[], const SkPoint texs[],
|
||||
@ -179,15 +190,8 @@ protected:
|
||||
virtual void didConcat(const SkMatrix&) SK_OVERRIDE;
|
||||
virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
|
||||
|
||||
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawDRRect(const SkRRect&, const SkRRect&,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
|
||||
virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
|
||||
virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
|
||||
|
@ -90,6 +90,16 @@ public:
|
||||
const SkPaint* paint) SK_OVERRIDE;
|
||||
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
|
||||
const SkPaint* paint) SK_OVERRIDE;
|
||||
virtual void drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawPicture(SkPicture&) SK_OVERRIDE;
|
||||
virtual void drawVertices(VertexMode vmode, int vertexCount,
|
||||
const SkPoint vertices[], const SkPoint texs[],
|
||||
@ -110,14 +120,6 @@ protected:
|
||||
virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
|
||||
|
||||
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onPushCull(const SkRect& cullRect) SK_OVERRIDE;
|
||||
virtual void onPopCull() SK_OVERRIDE;
|
||||
|
||||
|
@ -36,6 +36,16 @@ public:
|
||||
const SkPaint* paint) SK_OVERRIDE;
|
||||
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
|
||||
const SkPaint* paint) SK_OVERRIDE;
|
||||
virtual void drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawPicture(SkPicture&) SK_OVERRIDE;
|
||||
virtual void drawVertices(VertexMode vmode, int vertexCount,
|
||||
const SkPoint vertices[], const SkPoint texs[],
|
||||
@ -53,14 +63,6 @@ protected:
|
||||
virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
|
||||
|
||||
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint&) SK_OVERRIDE;
|
||||
|
||||
virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
|
||||
virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
|
||||
|
@ -43,6 +43,16 @@ public:
|
||||
const SkPaint* paint = NULL) SK_OVERRIDE;
|
||||
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
|
||||
const SkPaint*) SK_OVERRIDE;
|
||||
virtual void drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint&) SK_OVERRIDE;
|
||||
virtual void drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void drawPicture(SkPicture&) SK_OVERRIDE;
|
||||
virtual void drawVertices(VertexMode vmode, int vertexCount,
|
||||
const SkPoint vertices[], const SkPoint texs[],
|
||||
@ -69,14 +79,6 @@ protected:
|
||||
virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
|
||||
|
||||
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint&) SK_OVERRIDE;
|
||||
|
||||
virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
|
||||
virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
|
||||
|
@ -42,6 +42,16 @@ public:
|
||||
const SkPaint* paint = NULL) SK_OVERRIDE;
|
||||
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
|
||||
const SkPaint* paint = NULL) SK_OVERRIDE;
|
||||
virtual void drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawPicture(SkPicture&) SK_OVERRIDE;
|
||||
virtual void drawVertices(VertexMode vmode, int vertexCount,
|
||||
const SkPoint vertices[], const SkPoint texs[],
|
||||
@ -66,14 +76,6 @@ protected:
|
||||
virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
|
||||
|
||||
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint&) SK_OVERRIDE;
|
||||
|
||||
virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
|
||||
virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
|
||||
|
@ -84,8 +84,8 @@ void SkBBoxRecord::clear(SkColor color) {
|
||||
INHERITED::clear(color);
|
||||
}
|
||||
|
||||
void SkBBoxRecord::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint& paint) {
|
||||
void SkBBoxRecord::drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint& paint) {
|
||||
SkRect bbox;
|
||||
paint.measureText(text, byteLength, &bbox);
|
||||
SkPaint::FontMetrics metrics;
|
||||
@ -128,7 +128,7 @@ void SkBBoxRecord::onDrawText(const void* text, size_t byteLength, SkScalar x, S
|
||||
bbox.fTop += y;
|
||||
bbox.fBottom += y;
|
||||
if (this->transformBounds(bbox, &paint)) {
|
||||
INHERITED::onDrawText(text, byteLength, x, y, paint);
|
||||
INHERITED::drawText(text, byteLength, x, y, paint);
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,8 +165,8 @@ void SkBBoxRecord::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
|
||||
}
|
||||
}
|
||||
|
||||
void SkBBoxRecord::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint& paint) {
|
||||
void SkBBoxRecord::drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) {
|
||||
SkRect bbox;
|
||||
bbox.set(pos, paint.countText(text, byteLength));
|
||||
SkPaint::FontMetrics metrics;
|
||||
@ -180,12 +180,12 @@ void SkBBoxRecord::onDrawPosText(const void* text, size_t byteLength, const SkPo
|
||||
bbox.fRight -= pad;
|
||||
|
||||
if (this->transformBounds(bbox, &paint)) {
|
||||
INHERITED::onDrawPosText(text, byteLength, pos, paint);
|
||||
INHERITED::drawPosText(text, byteLength, pos, paint);
|
||||
}
|
||||
}
|
||||
|
||||
void SkBBoxRecord::onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint& paint) {
|
||||
void SkBBoxRecord::drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint& paint) {
|
||||
size_t numChars = paint.countText(text, byteLength);
|
||||
if (numChars == 0) {
|
||||
return;
|
||||
@ -235,8 +235,9 @@ void SkBBoxRecord::drawSprite(const SkBitmap& bitmap, int left, int top,
|
||||
INHERITED::drawSprite(bitmap, left, top, paint);
|
||||
}
|
||||
|
||||
void SkBBoxRecord::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint& paint) {
|
||||
void SkBBoxRecord::drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint) {
|
||||
SkRect bbox = path.getBounds();
|
||||
SkPaint::FontMetrics metrics;
|
||||
paint.getFontMetrics(&metrics);
|
||||
@ -249,7 +250,7 @@ void SkBBoxRecord::onDrawTextOnPath(const void* text, size_t byteLength, const S
|
||||
bbox.fBottom -= pad;
|
||||
|
||||
if (this->transformBounds(bbox, &paint)) {
|
||||
INHERITED::onDrawTextOnPath(text, byteLength, path, matrix, paint);
|
||||
INHERITED::drawTextOnPath(text, byteLength, path, matrix, paint);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,8 @@ public:
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void clear(SkColor) SK_OVERRIDE;
|
||||
virtual void drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
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,
|
||||
@ -45,8 +47,16 @@ public:
|
||||
const SkPaint* paint) SK_OVERRIDE;
|
||||
virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
|
||||
const SkRect& dst, const SkPaint* paint) SK_OVERRIDE;
|
||||
virtual void drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
|
||||
const SkPaint* paint) SK_OVERRIDE;
|
||||
virtual void drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
virtual void drawVertices(VertexMode mode, int vertexCount,
|
||||
const SkPoint vertices[], const SkPoint texs[],
|
||||
const SkColor colors[], SkXfermode* xfer,
|
||||
@ -56,14 +66,6 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint&) SK_OVERRIDE;
|
||||
|
||||
private:
|
||||
/**
|
||||
|
@ -2356,8 +2356,8 @@ void SkCanvas::DrawTextDecorations(const SkDraw& draw, const SkPaint& paint,
|
||||
}
|
||||
}
|
||||
|
||||
void SkCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint& paint) {
|
||||
void SkCanvas::drawText(const void* text, size_t byteLength,
|
||||
SkScalar x, SkScalar y, const SkPaint& paint) {
|
||||
CHECK_SHADER_NOSETCONTEXT(paint);
|
||||
|
||||
LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL)
|
||||
@ -2372,66 +2372,50 @@ void SkCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkSca
|
||||
LOOPER_END
|
||||
}
|
||||
|
||||
void SkCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint& paint) {
|
||||
void SkCanvas::drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) {
|
||||
CHECK_SHADER_NOSETCONTEXT(paint);
|
||||
|
||||
|
||||
LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL)
|
||||
|
||||
|
||||
while (iter.next()) {
|
||||
SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint());
|
||||
iter.fDevice->drawPosText(iter, text, byteLength, &pos->fX, 0, 2,
|
||||
dfp.paint());
|
||||
}
|
||||
|
||||
|
||||
LOOPER_END
|
||||
}
|
||||
|
||||
void SkCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint& paint) {
|
||||
void SkCanvas::drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint) {
|
||||
CHECK_SHADER_NOSETCONTEXT(paint);
|
||||
|
||||
|
||||
LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL)
|
||||
|
||||
|
||||
while (iter.next()) {
|
||||
SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint());
|
||||
iter.fDevice->drawPosText(iter, text, byteLength, xpos, constY, 1,
|
||||
dfp.paint());
|
||||
}
|
||||
|
||||
|
||||
LOOPER_END
|
||||
}
|
||||
|
||||
void SkCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint& paint) {
|
||||
void SkCanvas::drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint) {
|
||||
CHECK_SHADER_NOSETCONTEXT(paint);
|
||||
|
||||
|
||||
LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL)
|
||||
|
||||
|
||||
while (iter.next()) {
|
||||
iter.fDevice->drawTextOnPath(iter, text, byteLength, path,
|
||||
matrix, looper.paint());
|
||||
}
|
||||
|
||||
LOOPER_END
|
||||
}
|
||||
|
||||
// These will become non-virtual, so they always call the (virtual) onDraw... method
|
||||
void SkCanvas::drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint& paint) {
|
||||
this->onDrawText(text, byteLength, x, y, paint);
|
||||
}
|
||||
void SkCanvas::drawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint& paint) {
|
||||
this->onDrawPosText(text, byteLength, pos, paint);
|
||||
}
|
||||
void SkCanvas::drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint& paint) {
|
||||
this->onDrawPosTextH(text, byteLength, xpos, constY, paint);
|
||||
}
|
||||
void SkCanvas::drawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint& paint) {
|
||||
this->onDrawTextOnPath(text, byteLength, path, matrix, paint);
|
||||
LOOPER_END
|
||||
}
|
||||
|
||||
void SkCanvas::drawVertices(VertexMode vmode, int vertexCount,
|
||||
|
@ -1209,8 +1209,8 @@ void SkPictureRecord::addFontMetricsTopBottom(const SkPaint& paint, const SkFlat
|
||||
this->addScalar(flat.topBot()[1] + maxY);
|
||||
}
|
||||
|
||||
void SkPictureRecord::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint& paint) {
|
||||
void SkPictureRecord::drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint& paint) {
|
||||
|
||||
#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
|
||||
fMCMgr.call(SkMatrixClipStateMgr::kOther_CallType);
|
||||
@ -1238,8 +1238,8 @@ void SkPictureRecord::onDrawText(const void* text, size_t byteLength, SkScalar x
|
||||
this->validate(initialOffset, size);
|
||||
}
|
||||
|
||||
void SkPictureRecord::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint& paint) {
|
||||
void SkPictureRecord::drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) {
|
||||
|
||||
#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
|
||||
fMCMgr.call(SkMatrixClipStateMgr::kOther_CallType);
|
||||
@ -1327,8 +1327,10 @@ void SkPictureRecord::onDrawPosText(const void* text, size_t byteLength, const S
|
||||
this->validate(initialOffset, size);
|
||||
}
|
||||
|
||||
void SkPictureRecord::onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint& paint) {
|
||||
void SkPictureRecord::drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint) {
|
||||
|
||||
#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
|
||||
fMCMgr.call(SkMatrixClipStateMgr::kOther_CallType);
|
||||
#endif
|
||||
@ -1376,8 +1378,10 @@ void SkPictureRecord::drawPosTextHImpl(const void* text, size_t byteLength,
|
||||
this->validate(initialOffset, size);
|
||||
}
|
||||
|
||||
void SkPictureRecord::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint& paint) {
|
||||
void SkPictureRecord::drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint) {
|
||||
|
||||
#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
|
||||
fMCMgr.call(SkMatrixClipStateMgr::kOther_CallType);
|
||||
#endif
|
||||
|
@ -55,6 +55,15 @@ public:
|
||||
const SkRect& dst, const SkPaint*) SK_OVERRIDE;
|
||||
virtual void drawSprite(const SkBitmap&, int left, int top,
|
||||
const SkPaint*) SK_OVERRIDE;
|
||||
virtual void drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint&) SK_OVERRIDE;
|
||||
virtual void drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void drawPicture(SkPicture& picture) SK_OVERRIDE;
|
||||
virtual void drawVertices(VertexMode, int vertexCount,
|
||||
const SkPoint vertices[], const SkPoint texs[],
|
||||
@ -219,15 +228,6 @@ protected:
|
||||
virtual void onPushCull(const SkRect&) SK_OVERRIDE;
|
||||
virtual void onPopCull() SK_OVERRIDE;
|
||||
|
||||
virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, 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;
|
||||
|
@ -249,6 +249,16 @@ public:
|
||||
const SkRect& dst, const SkPaint* paint = NULL) SK_OVERRIDE;
|
||||
virtual void drawSprite(const SkBitmap&, int left, int top,
|
||||
const SkPaint*) SK_OVERRIDE;
|
||||
virtual void drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint&) SK_OVERRIDE;
|
||||
virtual void drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void drawPicture(SkPicture& picture) SK_OVERRIDE;
|
||||
virtual void drawVertices(VertexMode, int vertexCount,
|
||||
const SkPoint vertices[], const SkPoint texs[],
|
||||
@ -275,14 +285,6 @@ protected:
|
||||
virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
|
||||
|
||||
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint&) SK_OVERRIDE;
|
||||
|
||||
virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
|
||||
virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
|
||||
@ -848,8 +850,8 @@ void SkGPipeCanvas::drawSprite(const SkBitmap& bm, int left, int top,
|
||||
}
|
||||
}
|
||||
|
||||
void SkGPipeCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint& paint) {
|
||||
void SkGPipeCanvas::drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint& paint) {
|
||||
if (byteLength) {
|
||||
NOTIFY_SETUP(this);
|
||||
this->writePaint(paint);
|
||||
@ -863,8 +865,8 @@ void SkGPipeCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x,
|
||||
}
|
||||
}
|
||||
|
||||
void SkGPipeCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint& paint) {
|
||||
void SkGPipeCanvas::drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) {
|
||||
if (byteLength) {
|
||||
NOTIFY_SETUP(this);
|
||||
this->writePaint(paint);
|
||||
@ -879,8 +881,9 @@ void SkGPipeCanvas::onDrawPosText(const void* text, size_t byteLength, const SkP
|
||||
}
|
||||
}
|
||||
|
||||
void SkGPipeCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint& paint) {
|
||||
void SkGPipeCanvas::drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint) {
|
||||
if (byteLength) {
|
||||
NOTIFY_SETUP(this);
|
||||
this->writePaint(paint);
|
||||
@ -896,8 +899,9 @@ void SkGPipeCanvas::onDrawPosTextH(const void* text, size_t byteLength, const Sk
|
||||
}
|
||||
}
|
||||
|
||||
void SkGPipeCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint& paint) {
|
||||
void SkGPipeCanvas::drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint) {
|
||||
if (byteLength) {
|
||||
NOTIFY_SETUP(this);
|
||||
unsigned flags = 0;
|
||||
|
@ -145,30 +145,30 @@ void SkRecorder::drawSprite(const SkBitmap& bitmap, int left, int top, const SkP
|
||||
APPEND(DrawSprite, delay_copy(bitmap), left, top, this->copy(paint));
|
||||
}
|
||||
|
||||
void SkRecorder::onDrawText(const void* text, size_t byteLength,
|
||||
SkScalar x, SkScalar y, const SkPaint& paint) {
|
||||
void SkRecorder::drawText(const void* text, size_t byteLength,
|
||||
SkScalar x, SkScalar y, const SkPaint& paint) {
|
||||
APPEND(DrawText,
|
||||
this->copy((const char*)text, byteLength), byteLength, x, y, delay_copy(paint));
|
||||
}
|
||||
|
||||
void SkRecorder::onDrawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) {
|
||||
void SkRecorder::drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) {
|
||||
const unsigned points = paint.countText(text, byteLength);
|
||||
APPEND(DrawPosText,
|
||||
this->copy((const char*)text, byteLength), byteLength,
|
||||
this->copy(pos, points), delay_copy(paint));
|
||||
}
|
||||
|
||||
void SkRecorder::onDrawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY, const SkPaint& paint) {
|
||||
void SkRecorder::drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY, const SkPaint& paint) {
|
||||
const unsigned points = paint.countText(text, byteLength);
|
||||
APPEND(DrawPosTextH,
|
||||
this->copy((const char*)text, byteLength), byteLength,
|
||||
this->copy(xpos, points), constY, delay_copy(paint));
|
||||
}
|
||||
|
||||
void SkRecorder::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint& paint) {
|
||||
void SkRecorder::drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix, const SkPaint& paint) {
|
||||
APPEND(DrawTextOnPath,
|
||||
this->copy((const char*)text, byteLength), byteLength,
|
||||
delay_copy(path), this->copy(matrix), delay_copy(paint));
|
||||
|
@ -58,6 +58,25 @@ public:
|
||||
int left,
|
||||
int top,
|
||||
const SkPaint* paint = NULL) SK_OVERRIDE;
|
||||
void drawText(const void* text,
|
||||
size_t byteLength,
|
||||
SkScalar x,
|
||||
SkScalar y,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
void drawPosText(const void* text,
|
||||
size_t byteLength,
|
||||
const SkPoint pos[],
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
void drawPosTextH(const void* text,
|
||||
size_t byteLength,
|
||||
const SkScalar xpos[],
|
||||
SkScalar constY,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
void drawTextOnPath(const void* text,
|
||||
size_t byteLength,
|
||||
const SkPath& path,
|
||||
const SkMatrix* matrix,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
void drawPicture(SkPicture& picture) SK_OVERRIDE;
|
||||
void drawVertices(VertexMode vmode,
|
||||
int vertexCount,
|
||||
@ -77,25 +96,6 @@ public:
|
||||
void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
|
||||
|
||||
void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
|
||||
void onDrawText(const void* text,
|
||||
size_t byteLength,
|
||||
SkScalar x,
|
||||
SkScalar y,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
void onDrawPosText(const void* text,
|
||||
size_t byteLength,
|
||||
const SkPoint pos[],
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
void onDrawPosTextH(const void* text,
|
||||
size_t byteLength,
|
||||
const SkScalar xpos[],
|
||||
SkScalar constY,
|
||||
const SkPaint& paint) SK_OVERRIDE;
|
||||
void onDrawTextOnPath(const void* text,
|
||||
size_t byteLength,
|
||||
const SkPath& path,
|
||||
const SkMatrix* matrix,
|
||||
const SkPaint& paint) 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;
|
||||
|
@ -904,29 +904,32 @@ void SkDeferredCanvas::drawSprite(const SkBitmap& bitmap, int left, int top,
|
||||
this->recordedDrawCommand();
|
||||
}
|
||||
|
||||
void SkDeferredCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint& paint) {
|
||||
void SkDeferredCanvas::drawText(const void* text, size_t byteLength,
|
||||
SkScalar x, SkScalar y, const SkPaint& paint) {
|
||||
AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
|
||||
this->drawingCanvas()->drawText(text, byteLength, x, y, paint);
|
||||
this->recordedDrawCommand();
|
||||
}
|
||||
|
||||
void SkDeferredCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint& paint) {
|
||||
void SkDeferredCanvas::drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) {
|
||||
AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
|
||||
this->drawingCanvas()->drawPosText(text, byteLength, pos, paint);
|
||||
this->recordedDrawCommand();
|
||||
}
|
||||
|
||||
void SkDeferredCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint& paint) {
|
||||
void SkDeferredCanvas::drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint) {
|
||||
AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
|
||||
this->drawingCanvas()->drawPosTextH(text, byteLength, xpos, constY, paint);
|
||||
this->recordedDrawCommand();
|
||||
}
|
||||
|
||||
void SkDeferredCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint& paint) {
|
||||
void SkDeferredCanvas::drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path,
|
||||
const SkMatrix* matrix,
|
||||
const SkPaint& paint) {
|
||||
AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
|
||||
this->drawingCanvas()->drawTextOnPath(text, byteLength, path, matrix, paint);
|
||||
this->recordedDrawCommand();
|
||||
|
@ -388,16 +388,16 @@ void SkDumpCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
|
||||
x, y);
|
||||
}
|
||||
|
||||
void SkDumpCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint& paint) {
|
||||
void SkDumpCanvas::drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint& paint) {
|
||||
SkString str;
|
||||
toString(text, byteLength, paint.getTextEncoding(), &str);
|
||||
this->dump(kDrawText_Verb, &paint, "drawText(%s [%d] %g %g)", str.c_str(),
|
||||
byteLength, SkScalarToFloat(x), SkScalarToFloat(y));
|
||||
}
|
||||
|
||||
void SkDumpCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint& paint) {
|
||||
void SkDumpCanvas::drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) {
|
||||
SkString str;
|
||||
toString(text, byteLength, paint.getTextEncoding(), &str);
|
||||
this->dump(kDrawText_Verb, &paint, "drawPosText(%s [%d] %g %g ...)",
|
||||
@ -405,8 +405,9 @@ void SkDumpCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPo
|
||||
SkScalarToFloat(pos[0].fY));
|
||||
}
|
||||
|
||||
void SkDumpCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint& paint) {
|
||||
void SkDumpCanvas::drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint) {
|
||||
SkString str;
|
||||
toString(text, byteLength, paint.getTextEncoding(), &str);
|
||||
this->dump(kDrawText_Verb, &paint, "drawPosTextH(%s [%d] %g %g ...)",
|
||||
@ -414,8 +415,9 @@ void SkDumpCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkS
|
||||
SkScalarToFloat(constY));
|
||||
}
|
||||
|
||||
void SkDumpCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint& paint) {
|
||||
void SkDumpCanvas::drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint) {
|
||||
SkString str;
|
||||
toString(text, byteLength, paint.getTextEncoding(), &str);
|
||||
this->dump(kDrawText_Verb, &paint, "drawTextOnPath(%s [%d])",
|
||||
|
@ -237,29 +237,31 @@ void SkLuaCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
|
||||
}
|
||||
}
|
||||
|
||||
void SkLuaCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint& paint) {
|
||||
void SkLuaCanvas::drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint& paint) {
|
||||
AUTO_LUA("drawText");
|
||||
lua.pushEncodedText(paint.getTextEncoding(), text, byteLength);
|
||||
lua.pushPaint(paint, "paint");
|
||||
}
|
||||
|
||||
void SkLuaCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint& paint) {
|
||||
void SkLuaCanvas::drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) {
|
||||
AUTO_LUA("drawPosText");
|
||||
lua.pushEncodedText(paint.getTextEncoding(), text, byteLength);
|
||||
lua.pushPaint(paint, "paint");
|
||||
}
|
||||
|
||||
void SkLuaCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint& paint) {
|
||||
void SkLuaCanvas::drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint) {
|
||||
AUTO_LUA("drawPosTextH");
|
||||
lua.pushEncodedText(paint.getTextEncoding(), text, byteLength);
|
||||
lua.pushPaint(paint, "paint");
|
||||
}
|
||||
|
||||
void SkLuaCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint& paint) {
|
||||
void SkLuaCanvas::drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint) {
|
||||
AUTO_LUA("drawTextOnPath");
|
||||
lua.pushPath(path, "path");
|
||||
lua.pushEncodedText(paint.getTextEncoding(), text, byteLength);
|
||||
|
@ -233,32 +233,34 @@ void SkNWayCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
|
||||
}
|
||||
}
|
||||
|
||||
void SkNWayCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint& paint) {
|
||||
void SkNWayCanvas::drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint& paint) {
|
||||
Iter iter(fList);
|
||||
while (iter.next()) {
|
||||
iter->drawText(text, byteLength, x, y, paint);
|
||||
}
|
||||
}
|
||||
|
||||
void SkNWayCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint& paint) {
|
||||
void SkNWayCanvas::drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) {
|
||||
Iter iter(fList);
|
||||
while (iter.next()) {
|
||||
iter->drawPosText(text, byteLength, pos, paint);
|
||||
}
|
||||
}
|
||||
|
||||
void SkNWayCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint& paint) {
|
||||
void SkNWayCanvas::drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint) {
|
||||
Iter iter(fList);
|
||||
while (iter.next()) {
|
||||
iter->drawPosTextH(text, byteLength, xpos, constY, paint);
|
||||
}
|
||||
}
|
||||
|
||||
void SkNWayCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint& paint) {
|
||||
void SkNWayCanvas::drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint) {
|
||||
Iter iter(fList);
|
||||
while (iter.next()) {
|
||||
iter->drawTextOnPath(text, byteLength, path, matrix, paint);
|
||||
|
@ -116,23 +116,25 @@ void SkProxyCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
|
||||
fProxy->drawSprite(bitmap, x, y, paint);
|
||||
}
|
||||
|
||||
void SkProxyCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint& paint) {
|
||||
void SkProxyCanvas::drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint& paint) {
|
||||
fProxy->drawText(text, byteLength, x, y, paint);
|
||||
}
|
||||
|
||||
void SkProxyCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint& paint) {
|
||||
void SkProxyCanvas::drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) {
|
||||
fProxy->drawPosText(text, byteLength, pos, paint);
|
||||
}
|
||||
|
||||
void SkProxyCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint& paint) {
|
||||
void SkProxyCanvas::drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint) {
|
||||
fProxy->drawPosTextH(text, byteLength, xpos, constY, paint);
|
||||
}
|
||||
|
||||
void SkProxyCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint& paint) {
|
||||
void SkProxyCanvas::drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint& paint) {
|
||||
fProxy->drawTextOnPath(text, byteLength, path, matrix, paint);
|
||||
}
|
||||
|
||||
|
@ -506,13 +506,13 @@ void SkDebugCanvas::drawPoints(PointMode mode, size_t count,
|
||||
this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint));
|
||||
}
|
||||
|
||||
void SkDebugCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint& paint) {
|
||||
void SkDebugCanvas::drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint& paint) {
|
||||
this->addDrawCommand(new SkDrawPosTextCommand(text, byteLength, pos, paint));
|
||||
}
|
||||
|
||||
void SkDebugCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint& paint) {
|
||||
void SkDebugCanvas::drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY, const SkPaint& paint) {
|
||||
this->addDrawCommand(
|
||||
new SkDrawPosTextHCommand(text, byteLength, xpos, constY, paint));
|
||||
}
|
||||
@ -536,13 +536,13 @@ void SkDebugCanvas::drawSprite(const SkBitmap& bitmap, int left, int top,
|
||||
this->addDrawCommand(new SkDrawSpriteCommand(bitmap, left, top, paint));
|
||||
}
|
||||
|
||||
void SkDebugCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint& paint) {
|
||||
void SkDebugCanvas::drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint& paint) {
|
||||
this->addDrawCommand(new SkDrawTextCommand(text, byteLength, x, y, paint));
|
||||
}
|
||||
|
||||
void SkDebugCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint& paint) {
|
||||
void SkDebugCanvas::drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix, const SkPaint& paint) {
|
||||
this->addDrawCommand(
|
||||
new SkDrawTextOnPathCommand(text, byteLength, path, matrix, paint));
|
||||
}
|
||||
|
@ -189,6 +189,13 @@ public:
|
||||
virtual void drawPoints(PointMode, size_t count, const SkPoint pts[],
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
|
||||
virtual void drawPosText(const void* text, size_t byteLength,
|
||||
const SkPoint pos[], const SkPaint&) SK_OVERRIDE;
|
||||
|
||||
virtual void drawPosTextH(const void* text, size_t byteLength,
|
||||
const SkScalar xpos[], SkScalar constY,
|
||||
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;
|
||||
@ -196,6 +203,13 @@ public:
|
||||
virtual void drawSprite(const SkBitmap&, int left, int top,
|
||||
const SkPaint*) SK_OVERRIDE;
|
||||
|
||||
virtual void drawText(const void* text, size_t byteLength, SkScalar x,
|
||||
SkScalar y, const SkPaint&) SK_OVERRIDE;
|
||||
|
||||
virtual void drawTextOnPath(const void* text, size_t byteLength,
|
||||
const SkPath& path, const SkMatrix* matrix,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
|
||||
virtual void drawVertices(VertexMode, int vertexCount,
|
||||
const SkPoint vertices[], const SkPoint texs[],
|
||||
const SkColor colors[], SkXfermode*,
|
||||
@ -236,14 +250,6 @@ protected:
|
||||
virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
|
||||
|
||||
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
||||
SkScalar constY, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint&) SK_OVERRIDE;
|
||||
virtual void onPushCull(const SkRect& cullRect) SK_OVERRIDE;
|
||||
virtual void onPopCull() SK_OVERRIDE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user