diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkBitmapDevice.cpp | 17 | ||||
-rw-r--r-- | src/core/SkBitmapDevice.h | 2 | ||||
-rw-r--r-- | src/core/SkDevice.cpp | 10 |
3 files changed, 20 insertions, 9 deletions
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp index 08c36d3980..cb169dca87 100644 --- a/src/core/SkBitmapDevice.cpp +++ b/src/core/SkBitmapDevice.cpp @@ -7,6 +7,7 @@ #include "SkBitmapDevice.h" #include "SkDraw.h" +#include "SkGlyphRun.h" #include "SkImageFilter.h" #include "SkImageFilterCache.h" #include "SkMallocPixelRef.h" @@ -570,6 +571,22 @@ void SkBitmapDevice::drawPosText(const void* text, size_t len, const SkScalar xp nullptr) } +void SkBitmapDevice::drawGlyphRunList(SkGlyphRunList* glyphRunList) { +#ifdef SK_SUPPORT_LEGACY_TEXT_BLOB + auto blob = glyphRunList->blob(); + + if (blob == nullptr) { + glyphRunList->temporaryShuntToDrawPosText(this, SkPoint::Make(0, 0)); + } else { + auto origin = glyphRunList->origin(); + auto paint = glyphRunList->paint(); + this->drawTextBlob(blob, origin.x(), origin.y(), paint); + } +#else + glyphRunList->temporaryShuntToDrawPosText(this, glyphRunList->origin()); +#endif +} + void SkBitmapDevice::drawVertices(const SkVertices* vertices, const SkMatrix* bones, int boneCount, SkBlendMode bmode, const SkPaint& paint) { BDDraw(this).drawVertices(vertices->mode(), vertices->vertexCount(), vertices->positions(), diff --git a/src/core/SkBitmapDevice.h b/src/core/SkBitmapDevice.h index 5c4af03ab5..890f7e1934 100644 --- a/src/core/SkBitmapDevice.h +++ b/src/core/SkBitmapDevice.h @@ -112,6 +112,8 @@ protected: */ void drawPosText(const void* text, size_t len, const SkScalar pos[], int scalarsPerPos, const SkPoint& offset, const SkPaint& paint) override; + + void drawGlyphRunList(SkGlyphRunList* glyphRunList) override; void drawVertices(const SkVertices*, const SkMatrix* bones, int boneCount, SkBlendMode, const SkPaint& paint) override; void drawDevice(SkBaseDevice*, int x, int y, const SkPaint&) override; diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp index 60f8cd861f..b94d7e97cf 100644 --- a/src/core/SkDevice.cpp +++ b/src/core/SkDevice.cpp @@ -240,15 +240,7 @@ void SkBaseDevice::drawImageLattice(const SkImage* image, } void SkBaseDevice::drawGlyphRunList(SkGlyphRunList* glyphRunList) { - auto blob = glyphRunList->blob(); - - if (blob == nullptr) { - glyphRunList->temporaryShuntToDrawPosText(this, SkPoint::Make(0, 0)); - } else { - auto origin = glyphRunList->origin(); - auto paint = glyphRunList->paint(); - this->drawTextBlob(blob, origin.x(), origin.y(), paint); - } + glyphRunList->temporaryShuntToDrawPosText(this, SkPoint::Make(0, 0)); } void SkBaseDevice::drawBitmapLattice(const SkBitmap& bitmap, |