aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
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
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')
-rw-r--r--src/core/SkBitmapDevice.cpp17
-rw-r--r--src/core/SkBitmapDevice.h2
-rw-r--r--src/core/SkDevice.cpp10
3 files changed, 20 insertions, 9 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(),
diff --git a/src/core/SkBitmapDevice.h b/src/core/SkBitmapDevice.h
index 5c4af03ab5..890f7e1934 100644
--- a/src/core/SkBitmapDevice.h
+++ b/src/core/SkBitmapDevice.h
@@ -112,6 +112,8 @@ protected:
*/
void drawPosText(const void* text, size_t len, const SkScalar pos[],
int scalarsPerPos, const SkPoint& offset, const SkPaint& paint) override;
+
+ void drawGlyphRunList(SkGlyphRunList* glyphRunList) override;
void drawVertices(const SkVertices*, const SkMatrix* bones, int boneCount, SkBlendMode,
const SkPaint& paint) override;
void drawDevice(SkBaseDevice*, int x, int y, const SkPaint&) override;
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 60f8cd861f..b94d7e97cf 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -240,15 +240,7 @@ void SkBaseDevice::drawImageLattice(const SkImage* image,
}
void SkBaseDevice::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);
- }
+ glyphRunList->temporaryShuntToDrawPosText(this, SkPoint::Make(0, 0));
}
void SkBaseDevice::drawBitmapLattice(const SkBitmap& bitmap,