aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapDevice.cpp
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-07-19 11:07:44 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-21 21:19:27 +0000
commitdfe1fe40796ea5b61bba177488aa7eb63c9495cf (patch)
tree079adad824edc18a2c96894cabd386947ec7fcf1 /src/core/SkBitmapDevice.cpp
parentcc22d4d2fb02ce54aa08a9258515896227421647 (diff)
Convert bitmap to use runs instead of blobs
Adding the flag SK_SUPPORT_LEGACY_TEXT_BLOB to allow progress without rebaselining many times. Flag landed with chrome cl 1144232. Change-Id: I78ea100085be7db442b703d465533ceb9b124652 Reviewed-on: https://skia-review.googlesource.com/142580 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'src/core/SkBitmapDevice.cpp')
-rw-r--r--src/core/SkBitmapDevice.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index 08c36d3980..cb169dca87 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -7,6 +7,7 @@
#include "SkBitmapDevice.h"
#include "SkDraw.h"
+#include "SkGlyphRun.h"
#include "SkImageFilter.h"
#include "SkImageFilterCache.h"
#include "SkMallocPixelRef.h"
@@ -570,6 +571,22 @@ void SkBitmapDevice::drawPosText(const void* text, size_t len, const SkScalar xp
nullptr)
}
+void SkBitmapDevice::drawGlyphRunList(SkGlyphRunList* glyphRunList) {
+#ifdef SK_SUPPORT_LEGACY_TEXT_BLOB
+ 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);
+ }
+#else
+ glyphRunList->temporaryShuntToDrawPosText(this, glyphRunList->origin());
+#endif
+}
+
void SkBitmapDevice::drawVertices(const SkVertices* vertices, const SkMatrix* bones, int boneCount,
SkBlendMode bmode, const SkPaint& paint) {
BDDraw(this).drawVertices(vertices->mode(), vertices->vertexCount(), vertices->positions(),