diff options
author | Herb Derby <herb@google.com> | 2018-06-21 16:03:47 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-28 03:36:16 +0000 |
commit | e2e52e46ca63540d429656baeee48fd3a402be26 (patch) | |
tree | 574c2f990282798988f47a5519a5ed5f3a990569 /src/core/SkRemoteGlyphCache.cpp | |
parent | 0ce5ab9d3122bcd9dce65ecb51a0da973da09816 (diff) |
Remove drawTextBlob from device use drawGlyphRunList
Convert all backends to use GlyphRunList instead of
text blobs. If the device did not originally implement
drawTextBlob it will be simulated by drawPosText on the
device.
Other changes:
Change to using an origin from absolulte positioning. The GPU
code uses origin change to update blobs under translation.
Change cluster to use const uint32_t instead of just
uint32_t.
Add SkPaint to runs.
The draw filter is hosted up to the canavas level and applied there.
Change-Id: Ib105b6bd26b67db55f1c954e37c79fbdcaa9d4a2
Reviewed-on: https://skia-review.googlesource.com/137224
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/core/SkRemoteGlyphCache.cpp')
-rw-r--r-- | src/core/SkRemoteGlyphCache.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/core/SkRemoteGlyphCache.cpp b/src/core/SkRemoteGlyphCache.cpp index 774a1eb77c..18e47f3f4c 100644 --- a/src/core/SkRemoteGlyphCache.cpp +++ b/src/core/SkRemoteGlyphCache.cpp @@ -16,9 +16,9 @@ #include "SkDevice.h" #include "SkDraw.h" #include "SkFindAndPlaceGlyph.h" +#include "SkGlyphRun.h" #include "SkPathEffect.h" #include "SkStrikeCache.h" -#include "SkTextBlobRunIterator.h" #include "SkTraceEvent.h" #include "SkTypeface_remote.h" @@ -240,27 +240,20 @@ public: } protected: - void drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint, - SkDrawFilter* drawFilter) override { - // The looper should be applied by the SkCanvas. - SkASSERT(paint.getDrawLooper() == nullptr); - // We don't support SkDrawFilter. - SkASSERT(drawFilter == nullptr); - - SkPoint position{x, y}; - SkPaint runPaint{paint}; - SkTextBlobRunIterator it(blob); + void drawGlyphRunList(SkGlyphRunList* glyphRunList) override { + SkPaint runPaint; + SkGlyphRunListIterator it(glyphRunList); for (; !it.done(); it.next()) { // applyFontToPaint() always overwrites the exact same attributes, // so it is safe to not re-seed the paint for this reason. it.applyFontToPaint(&runPaint); - this->processGlyphRun(position, it, runPaint); + this->processGlyphRun(glyphRunList->origin(), it, runPaint); } } private: void processGlyphRun(const SkPoint& position, - const SkTextBlobRunIterator& it, + const SkGlyphRunListIterator& it, const SkPaint& runPaint) { TRACE_EVENT0("skia", "SkTextBlobCacheDiffCanvas::processGlyphRun"); @@ -344,7 +337,7 @@ private: } } - void processGlyphRunForPaths(const SkTextBlobRunIterator& it, + void processGlyphRunForPaths(const SkGlyphRunListIterator& it, const SkPaint& runPaint, const SkMatrix& runMatrix) { TRACE_EVENT0("skia", "SkTextBlobCacheDiffCanvas::processGlyphRunForPaths"); @@ -394,7 +387,7 @@ private: } #if SK_SUPPORT_GPU - bool processGlyphRunForDFT(const SkTextBlobRunIterator& it, + bool processGlyphRunForDFT(const SkGlyphRunListIterator& it, const SkPaint& runPaint, const SkMatrix& runMatrix) { TRACE_EVENT0("skia", "SkTextBlobCacheDiffCanvas::processGlyphRunForDFT"); |