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

Unified Diff: src/core/SkBBoxRecord.cpp

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 | « src/core/SkBBoxRecord.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBBoxRecord.cpp
diff --git a/src/core/SkBBoxRecord.cpp b/src/core/SkBBoxRecord.cpp
index 7075cd165129294e166ff867f67ca26b840c8984..0dadb5c382cc92ae185e4a174209301da199d4bc 100644
--- a/src/core/SkBBoxRecord.cpp
+++ b/src/core/SkBBoxRecord.cpp
@@ -84,8 +84,8 @@ void SkBBoxRecord::clear(SkColor color) {
INHERITED::clear(color);
}
-void SkBBoxRecord::drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
- const SkPaint& paint) {
+void SkBBoxRecord::onDrawText(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::drawText(const void* text, size_t byteLength, SkScalar x, SkS
bbox.fTop += y;
bbox.fBottom += y;
if (this->transformBounds(bbox, &paint)) {
- INHERITED::drawText(text, byteLength, x, y, paint);
+ INHERITED::onDrawText(text, byteLength, x, y, paint);
}
}
@@ -165,8 +165,8 @@ void SkBBoxRecord::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
}
}
-void SkBBoxRecord::drawPosText(const void* text, size_t byteLength,
- const SkPoint pos[], const SkPaint& paint) {
+void SkBBoxRecord::onDrawPosText(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::drawPosText(const void* text, size_t byteLength,
bbox.fRight -= pad;
if (this->transformBounds(bbox, &paint)) {
- INHERITED::drawPosText(text, byteLength, pos, paint);
+ INHERITED::onDrawPosText(text, byteLength, pos, paint);
}
}
-void SkBBoxRecord::drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
- SkScalar constY, const SkPaint& paint) {
+void SkBBoxRecord::onDrawPosTextH(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,9 +235,8 @@ void SkBBoxRecord::drawSprite(const SkBitmap& bitmap, int left, int top,
INHERITED::drawSprite(bitmap, left, top, paint);
}
-void SkBBoxRecord::drawTextOnPath(const void* text, size_t byteLength,
- const SkPath& path, const SkMatrix* matrix,
- const SkPaint& paint) {
+void SkBBoxRecord::onDrawTextOnPath(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);
@@ -250,7 +249,7 @@ void SkBBoxRecord::drawTextOnPath(const void* text, size_t byteLength,
bbox.fBottom -= pad;
if (this->transformBounds(bbox, &paint)) {
- INHERITED::drawTextOnPath(text, byteLength, path, matrix, paint);
+ INHERITED::onDrawTextOnPath(text, byteLength, path, matrix, paint);
}
}
« no previous file with comments | « src/core/SkBBoxRecord.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698