aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/atlastext
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-11-20 13:17:43 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-20 19:43:18 +0000
commita0ba714ad5ee26b3f1929aa572eb77cc71809e64 (patch)
treeef549bf038a299f1c9f6466b85aba976d4ca056c /src/atlastext
parent32eb5ba7af4da511df2c7ec9e560018c3060f914 (diff)
Require glyph positions in SkAtlasTextTarget::drawText
Change-Id: Idf0977befc8ed4fd9eb3b733db5e945457b2164c Reviewed-on: https://skia-review.googlesource.com/73701 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/atlastext')
-rw-r--r--src/atlastext/SkAtlasTextTarget.cpp18
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) {