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

Unified Diff: tools/SkShaper.h

Issue 2138133002: tools/SkShaper: factor shaping out of using_skia_and_harfbuzz (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-07-11 (Monday) 15:42:21 EDT Created 4 years, 5 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 | « gyp/tools.gyp ('k') | tools/SkShaper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/SkShaper.h
diff --git a/tools/SkShaper.h b/tools/SkShaper.h
new file mode 100644
index 0000000000000000000000000000000000000000..5aa93a7dbcea508f5484af81404e5c161cd2e312
--- /dev/null
+++ b/tools/SkShaper.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkShaper_DEFINED
+#define SkShaper_DEFINED
+
+#include <memory>
+
+#include "SkPoint.h"
+#include "SkTypeface.h"
+
+class SkPaint;
+class SkTextBlobBuilder;
+
+/**
+ Shapes text using harfbuzz and places the shaped text into a
+ TextBlob.
+ */
+class SkShaper {
+public:
+ SkShaper(sk_sp<SkTypeface> face);
+ ~SkShaper();
+
+ bool good() const;
+ SkScalar shape(SkTextBlobBuilder* dest,
+ const SkPaint& srcPaint,
+ const char* utf8text,
+ size_t textBytes,
+ SkPoint point) const;
+
+private:
+ SkShaper(const SkShaper&) = delete;
+ SkShaper& operator=(const SkShaper&) = delete;
+
+ struct Impl;
+ std::unique_ptr<Impl> fImpl;
+};
+
+#endif // SkShaper_DEFINED
« no previous file with comments | « gyp/tools.gyp ('k') | tools/SkShaper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698