Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1248)

Unified Diff: tools/using_skia_and_harfbuzz.cpp

Issue 2201153002: SkShaper: optionally disable harfbuzz (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-08-02 (Tuesday) 18:27:47 EDT Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/SkShaper_primitive.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/using_skia_and_harfbuzz.cpp
diff --git a/tools/using_skia_and_harfbuzz.cpp b/tools/using_skia_and_harfbuzz.cpp
index 782103465eaea72916a629e7a6ddff80c3a04f9b..f17a26d12b9900a2a6c3b1e9ea2205d75ad74546 100644
--- a/tools/using_skia_and_harfbuzz.cpp
+++ b/tools/using_skia_and_harfbuzz.cpp
@@ -134,7 +134,7 @@ public:
glyph_paint.setColor(SK_ColorBLACK);
glyph_paint.setFlags(SkPaint::kAntiAlias_Flag |
SkPaint::kSubpixelText_Flag);
- glyph_paint.setTextSize(config->font_size.value);
+ glyph_paint.setTextSize(SkDoubleToScalar(config->font_size.value));
}
void WriteLine(const SkShaper& shaper, const char *text, size_t textBytes) {
@@ -142,8 +142,9 @@ public:
if (pageCanvas) {
document->endPage();
}
- pageCanvas = document->beginPage(config->page_width.value,
- config->page_height.value);
+ pageCanvas = document->beginPage(
+ SkDoubleToScalar(config->page_width.value),
+ SkDoubleToScalar(config->page_height.value));
pageCanvas->drawPaint(white_paint);
current_x = config->left_margin.value;
current_y = config->line_spacing_ratio.value * config->font_size.value;
@@ -151,8 +152,9 @@ public:
SkTextBlobBuilder textBlobBuilder;
shaper.shape(&textBlobBuilder, glyph_paint, text, textBytes, SkPoint{0, 0});
sk_sp<const SkTextBlob> blob(textBlobBuilder.build());
- pageCanvas->drawTextBlob(blob.get(), current_x, current_y, glyph_paint);
-
+ pageCanvas->drawTextBlob(
+ blob.get(), SkDoubleToScalar(current_x),
+ SkDoubleToScalar(current_y), glyph_paint);
// Advance to the next line.
current_y += config->line_spacing_ratio.value * config->font_size.value;
}
« no previous file with comments | « tools/SkShaper_primitive.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698