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

Unified Diff: include/core/SkCanvas.h

Issue 248083002: Make drawText calls non-virtual, to ease SkFont and TextBlob (https://codereview.chromium.org/24385… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/PdfViewer/SkNulCanvas.h ('k') | include/utils/SkDeferredCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 0a819694684540a99a1091fd0a030efc7f2292de..91fb642a8f1807431be8015061f75ab72d5154eb 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -26,6 +26,13 @@
//#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;
@@ -868,7 +875,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)
*/
- virtual void drawText(const void* text, size_t byteLength, SkScalar x,
+ SK_LEGACY_DRAWTEXT_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[]
@@ -878,7 +885,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)
*/
- virtual void drawPosText(const void* text, size_t byteLength,
+ SK_LEGACY_DRAWTEXT_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
@@ -890,7 +897,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)
*/
- virtual void drawPosTextH(const void* text, size_t byteLength,
+ SK_LEGACY_DRAWTEXT_VIRTUAL void drawPosTextH(const void* text, size_t byteLength,
const SkScalar xpos[], SkScalar constY,
const SkPaint& paint);
@@ -920,7 +927,7 @@ public:
mapped onto the path
@param paint The paint used for the text
*/
- virtual void drawTextOnPath(const void* text, size_t byteLength,
+ SK_LEGACY_DRAWTEXT_VIRTUAL void drawTextOnPath(const void* text, size_t byteLength,
const SkPath& path, const SkMatrix* matrix,
const SkPaint& paint);
@@ -1186,6 +1193,20 @@ protected:
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&);
+ 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);
+
enum ClipEdgeStyle {
kHard_ClipEdgeStyle,
kSoft_ClipEdgeStyle
« no previous file with comments | « experimental/PdfViewer/SkNulCanvas.h ('k') | include/utils/SkDeferredCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698