aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkGlyph.cpp
diff options
context:
space:
mode:
authorGravatar Khushal <khushalsagar@chromium.org>2018-05-17 10:41:40 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-17 20:50:43 +0000
commit51371a43397424ee4d3057fd5a82ec7c01eff705 (patch)
tree0ae5f93ab2ee57ddb73a3ed32633b9774c1d00c7 /src/core/SkGlyph.cpp
parente6c0fe0b8fb4fb66b0c8d3b3abac6257c3201f00 (diff)
fonts: Handle fallback to using paths for text rendering for remoting.
SkRemoteGlyphCache only sends images for glyphs, even for cases where the gpu falls back to drawing text as paths. This includes cases in SkDraw::ShouldDrawTextAsPaths and when the glyph exceeds the max bounds that can fit on the atlas. Fix this by identifying these cases in the renderer and sending paths instead. Note: We still don't handle distance field text correctly. R=herb@google.com, bsalomon@google.com Bug: skia:7913 Change-Id: I17d4eccbeaa2e995ae67b61c76cebd27f8280329 Reviewed-on: https://skia-review.googlesource.com/128203 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Diffstat (limited to 'src/core/SkGlyph.cpp')
-rw-r--r--src/core/SkGlyph.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/SkGlyph.cpp b/src/core/SkGlyph.cpp
index 836a47d608..9e040e39a4 100644
--- a/src/core/SkGlyph.cpp
+++ b/src/core/SkGlyph.cpp
@@ -60,6 +60,11 @@ static size_t format_rowbytes(int width, SkMask::Format format) {
: width * format_alignment(format);
}
+size_t SkGlyph::formatAlignment() const {
+ auto format = static_cast<SkMask::Format>(fMaskFormat);
+ return format_alignment(format);
+}
+
size_t SkGlyph::allocImage(SkArenaAlloc* alloc) {
auto size = this->computeImageSize();
auto format = static_cast<SkMask::Format>(fMaskFormat);