aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf
diff options
context:
space:
mode:
Diffstat (limited to 'src/pdf')
-rw-r--r--src/pdf/SkPDFDevice.cpp14
-rw-r--r--src/pdf/SkPDFDevice.h4
2 files changed, 7 insertions, 11 deletions
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 45a9b95915..72d543c67e 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -19,6 +19,7 @@
#include "SkDraw.h"
#include "SkDrawFilter.h"
#include "SkGlyphCache.h"
+#include "SkGlyphRun.h"
#include "SkImageFilterCache.h"
#include "SkJpegEncoder.h"
#include "SkMakeUnique.h"
@@ -1458,17 +1459,12 @@ void SkPDFDevice::drawPosText(const void* text, size_t len,
offset, paint, nullptr, 0, nullptr);
}
-void SkPDFDevice::drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
- const SkPaint &paint, SkDrawFilter* drawFilter) {
- for (SkTextBlobRunIterator it(blob); !it.done(); it.next()) {
- SkPaint runPaint(paint);
+void SkPDFDevice::drawGlyphRunList(SkGlyphRunList* glyphRunList) {
+ for (SkGlyphRunListIterator it(glyphRunList); !it.done(); it.next()) {
+ SkPaint runPaint;
it.applyFontToPaint(&runPaint);
- if (drawFilter && !drawFilter->filter(&runPaint, SkDrawFilter::kText_Type)) {
- continue;
- }
- SkPoint offset = it.offset() + SkPoint{x, y};
this->internalDrawText(it.glyphs(), sizeof(SkGlyphID) * it.glyphCount(),
- it.pos(), it.positioning(), offset, runPaint,
+ it.pos(), it.positioning(), glyphRunList->origin(), runPaint,
it.clusters(), it.textSize(), it.text());
}
}
diff --git a/src/pdf/SkPDFDevice.h b/src/pdf/SkPDFDevice.h
index 33d0e70e67..90f4b8e480 100644
--- a/src/pdf/SkPDFDevice.h
+++ b/src/pdf/SkPDFDevice.h
@@ -22,6 +22,7 @@
#include "SkTextBlob.h"
#include "SkKeyedImage.h"
+class SkGlyphRunList;
class SkKeyedImage;
class SkPath;
class SkPDFArray;
@@ -98,8 +99,7 @@ public:
void drawPosText(const void* text, size_t len,
const SkScalar pos[], int scalarsPerPos,
const SkPoint& offset, const SkPaint&) override;
- void drawTextBlob(const SkTextBlob*, SkScalar x, SkScalar y,
- const SkPaint &, SkDrawFilter*) override;
+ void drawGlyphRunList(SkGlyphRunList* glyphRunList) override;
void drawVertices(const SkVertices*, SkBlendMode, const SkPaint&) override;
void drawDevice(SkBaseDevice*, int x, int y,
const SkPaint&) override;