aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-07-13 13:26:29 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-16 17:42:19 +0000
commitb983e6baa1db462a047e14ed83be759f2361838c (patch)
treeaa635035b8c573f2e93d3d38a723ea2d46028405 /src/pdf
parentb965fcb47296870643d001acb4a43cec3d88579a (diff)
Device interface uses glyph run list
Have devices just treat all runs as drawPosText except for SkGPUDevice and SkRemoteGlyphCache. Those two just pass the blob to the old code. This way the change over from blobs to run lists can happen in smaller steps. Change-Id: I3407bffeafe7fbd1c369f6b3c3db8d64b4b6c3b1 Reviewed-on: https://skia-review.googlesource.com/141300 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/pdf')
-rw-r--r--src/pdf/SkPDFDevice.cpp12
-rw-r--r--src/pdf/SkPDFDevice.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index a933972009..46dff0722a 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -1457,6 +1457,18 @@ void SkPDFDevice::drawPosText(const void* text, size_t len,
offset, paint, nullptr, 0, nullptr);
}
+void SkPDFDevice::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);
+ }
+}
+
void SkPDFDevice::drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint &paint) {
for (SkTextBlobRunIterator it(blob); !it.done(); it.next()) {
diff --git a/src/pdf/SkPDFDevice.h b/src/pdf/SkPDFDevice.h
index 6077aafd7a..1691baa51e 100644
--- a/src/pdf/SkPDFDevice.h
+++ b/src/pdf/SkPDFDevice.h
@@ -98,6 +98,7 @@ public:
const SkScalar pos[], int scalarsPerPos,
const SkPoint& offset, const SkPaint&) override;
void drawTextBlob(const SkTextBlob*, SkScalar x, SkScalar y, const SkPaint &) override;
+ void drawGlyphRunList(SkGlyphRunList* glyphRunList) override;
void drawVertices(const SkVertices*, const SkMatrix* bones, int boneCount, SkBlendMode,
const SkPaint&) override;
void drawDevice(SkBaseDevice*, int x, int y,