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

Unified Diff: tools/SkShaper_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.cpp ('k') | tools/SkShaper_primitive.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/SkShaper_harfbuzz.cpp
diff --git a/tools/SkShaper.cpp b/tools/SkShaper_harfbuzz.cpp
similarity index 92%
rename from tools/SkShaper.cpp
rename to tools/SkShaper_harfbuzz.cpp
index 44dd8fc7f1bbf0e72c47ffd2c469885ca045d144..29dd1b00f59775860edec3aa1de4d22616638f96 100644
--- a/tools/SkShaper.cpp
+++ b/tools/SkShaper_harfbuzz.cpp
@@ -23,7 +23,7 @@ std::unique_ptr<hb_blob_t, HBFBlobDel> stream_to_blob(std::unique_ptr<SkStreamAs
size_t size = asset->getLength();
std::unique_ptr<hb_blob_t, HBFBlobDel> blob;
if (const void* base = asset->getMemoryBase()) {
- blob.reset(hb_blob_create((char*)base, size,
+ blob.reset(hb_blob_create((char*)base, SkToUInt(size),
HB_MEMORY_MODE_READONLY, asset.release(),
[](void* p) { delete (SkStreamAsset*)p; }));
} else {
@@ -31,7 +31,7 @@ std::unique_ptr<hb_blob_t, HBFBlobDel> stream_to_blob(std::unique_ptr<SkStreamAs
SkAutoMalloc autoMalloc(size);
asset->read(autoMalloc.get(), size);
void* ptr = autoMalloc.get();
- blob.reset(hb_blob_create((char*)autoMalloc.release(), size,
+ blob.reset(hb_blob_create((char*)autoMalloc.release(), SkToUInt(size),
HB_MEMORY_MODE_READONLY, ptr, sk_free));
}
SkASSERT(blob);
@@ -116,8 +116,8 @@ SkScalar SkShaper::shape(SkTextBlobBuilder* builder,
for (unsigned i = 0; i < len; i++) {
runBuffer.glyphs[i] = info[i].codepoint;
reinterpret_cast<SkPoint*>(runBuffer.pos)[i] =
- SkPoint::Make(x + pos[i].x_offset * textSizeX,
- y - pos[i].y_offset * textSizeY);
+ SkPoint::Make(SkDoubleToScalar(x + pos[i].x_offset * textSizeX),
+ SkDoubleToScalar(y - pos[i].y_offset * textSizeY));
x += pos[i].x_advance * textSizeX;
y += pos[i].y_advance * textSizeY;
}
« no previous file with comments | « tools/SkShaper.cpp ('k') | tools/SkShaper_primitive.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698