diff options
Diffstat (limited to 'src/atlastext/SkAtlasTextTarget.cpp')
-rw-r--r-- | src/atlastext/SkAtlasTextTarget.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/atlastext/SkAtlasTextTarget.cpp b/src/atlastext/SkAtlasTextTarget.cpp index fa756fe327..89e1ad8b4c 100644 --- a/src/atlastext/SkAtlasTextTarget.cpp +++ b/src/atlastext/SkAtlasTextTarget.cpp @@ -7,6 +7,8 @@ #include "SkAtlasTextTarget.h" #include "GrClip.h" +#include "GrContextPriv.h" +#include "GrDrawingManager.h" #include "SkAtlasTextContext.h" #include "SkAtlasTextFont.h" #include "SkAtlasTextRenderer.h" @@ -50,7 +52,7 @@ public: /** SkAtlasTextTarget overrides */ - void drawText(const SkGlyphID*, int glyphCnt, SkScalar x, SkScalar y, uint32_t color, + void drawText(const SkGlyphID[], const SkPoint[], int glyphCnt, uint32_t color, const SkAtlasTextFont&) override; void flush() override; @@ -75,11 +77,9 @@ std::unique_ptr<SkAtlasTextTarget> SkAtlasTextTarget::Make(sk_sp<SkAtlasTextCont ////////////////////////////////////////////////////////////////////////////// -#include "GrContextPriv.h" -#include "GrDrawingManager.h" - -void SkInternalAtlasTextTarget::drawText(const SkGlyphID* glyphs, int glyphCnt, SkScalar x, - SkScalar y, uint32_t color, const SkAtlasTextFont& font) { +void SkInternalAtlasTextTarget::drawText(const SkGlyphID glyphs[], const SkPoint positions[], + int glyphCnt, uint32_t color, + const SkAtlasTextFont& font) { SkPaint paint; paint.setAntiAlias(true); paint.setTypeface(font.refTypeface()); @@ -91,14 +91,14 @@ void SkInternalAtlasTextTarget::drawText(const SkGlyphID* glyphs, int glyphCnt, // and the context will write it into the final vertices given to the client's renderer. fColor = color; - // The pixel geometry here is arbitrary. We don't draw LCD text. SkSurfaceProps props(SkSurfaceProps::kUseDistanceFieldFonts_Flag, kUnknown_SkPixelGeometry); auto* grContext = this->context()->internal().grContext(); auto bounds = SkIRect::MakeWH(fWidth, fHeight); auto atlasTextContext = grContext->contextPriv().drawingManager()->getAtlasTextContext(); size_t byteLength = sizeof(SkGlyphID) * glyphCnt; - atlasTextContext->drawText(grContext, this, GrNoClip(), paint, SkMatrix::I(), props, - (const char*)glyphs, byteLength, x, y, bounds); + const SkScalar* pos = &positions->fX; + atlasTextContext->drawPosText(grContext, this, GrNoClip(), paint, SkMatrix::I(), props, + (const char*)glyphs, byteLength, pos, 2, {0, 0}, bounds); } void SkInternalAtlasTextTarget::addDrawOp(const GrClip& clip, std::unique_ptr<GrAtlasTextOp> op) { |