Remove drawTextBlob from SkBaseDevice

Change-Id: I6f25c438a1d3baf78b83376affcfe4324900e417
Reviewed-on: https://skia-review.googlesource.com/145645
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This commit is contained in:
Herb Derby 2018-08-06 17:37:36 -04:00 committed by Skia Commit-Bot
parent 4ed73e09d3
commit e504efab60
2 changed files with 0 additions and 39 deletions

View File

@ -139,40 +139,6 @@ void SkBaseDevice::drawPatch(const SkPoint cubics[12], const SkColor colors[4],
}
}
void SkBaseDevice::drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint &paint) {
SkPaint runPaint = paint;
SkTextBlobRunIterator it(blob);
for (;!it.done(); it.next()) {
size_t textLen = it.glyphCount() * sizeof(uint16_t);
const SkPoint& offset = it.offset();
// applyFontToPaint() always overwrites the exact same attributes,
// so it is safe to not re-seed the paint for this reason.
it.applyFontToPaint(&runPaint);
switch (it.positioning()) {
case SkTextBlobRunIterator::kDefault_Positioning: {
auto origin = SkPoint::Make(x + offset.x(), y + offset.y());
SkGlyphRunBuilder builder;
builder.drawText(runPaint, (const char*) it.glyphs(), textLen, origin);
auto glyphRunList = builder.useGlyphRunList();
glyphRunList.temporaryShuntToDrawPosText(this, SkPoint::Make(0, 0));
}
break;
case SkTextBlobRunIterator::kHorizontal_Positioning:
this->drawPosText(it.glyphs(), textLen, it.pos(), 1,
SkPoint::Make(x, y + offset.y()), runPaint);
break;
case SkTextBlobRunIterator::kFull_Positioning:
this->drawPosText(it.glyphs(), textLen, it.pos(), 2,
SkPoint::Make(x, y), runPaint);
break;
}
}
}
void SkBaseDevice::drawImage(const SkImage* image, SkScalar x, SkScalar y,
const SkPaint& paint) {
SkBitmap bm;

View File

@ -345,11 +345,6 @@ private:
const SkScalar pos[], int scalarsPerPos,
const SkPoint& offset, const SkPaint& paint) = 0;
// Does not handle text decoration.
// Decorations (underline and stike-thru) will be handled by SkCanvas.
// default implementation unrolls the blob runs.
virtual void drawTextBlob(const SkTextBlob*, SkScalar x, SkScalar y, const SkPaint& paint);
// used to change the backend's pixels (and possibly config/rowbytes)
// but cannot change the width/height, so there should be no change to
// any clip information.