aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFDevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pdf/SkPDFDevice.cpp')
-rw-r--r--src/pdf/SkPDFDevice.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 72d543c67e..45a9b95915 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -19,7 +19,6 @@
#include "SkDraw.h"
#include "SkDrawFilter.h"
#include "SkGlyphCache.h"
-#include "SkGlyphRun.h"
#include "SkImageFilterCache.h"
#include "SkJpegEncoder.h"
#include "SkMakeUnique.h"
@@ -1459,12 +1458,17 @@ void SkPDFDevice::drawPosText(const void* text, size_t len,
offset, paint, nullptr, 0, nullptr);
}
-void SkPDFDevice::drawGlyphRunList(SkGlyphRunList* glyphRunList) {
- for (SkGlyphRunListIterator it(glyphRunList); !it.done(); it.next()) {
- SkPaint runPaint;
+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);
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(), glyphRunList->origin(), runPaint,
+ it.pos(), it.positioning(), offset, runPaint,
it.clusters(), it.textSize(), it.text());
}
}