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

Side by Side Diff: tools/SkShaper.h

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 unified diff | Download patch
« no previous file with comments | « gyp/tools.gyp ('k') | tools/SkShaper.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkShaper_DEFINED 8 #ifndef SkShaper_DEFINED
9 #define SkShaper_DEFINED 9 #define SkShaper_DEFINED
10 10
11 #include <memory> 11 #include <memory>
12 12
13 #include "SkPoint.h" 13 #include "SkPoint.h"
14 #include "SkTypeface.h" 14 #include "SkTypeface.h"
15 15
16 class SkPaint; 16 class SkPaint;
17 class SkTextBlobBuilder; 17 class SkTextBlobBuilder;
18 18
19 /** 19 /**
20 Shapes text using harfbuzz and places the shaped text into a 20 Shapes text using HarfBuzz and places the shaped text into a
21 TextBlob. 21 TextBlob.
22
23 If compiled without HarfBuzz, fall back on SkPaint::textToGlyphs.
22 */ 24 */
23 class SkShaper { 25 class SkShaper {
24 public: 26 public:
25 SkShaper(sk_sp<SkTypeface> face); 27 SkShaper(sk_sp<SkTypeface> face);
26 ~SkShaper(); 28 ~SkShaper();
27 29
28 bool good() const; 30 bool good() const;
29 SkScalar shape(SkTextBlobBuilder* dest, 31 SkScalar shape(SkTextBlobBuilder* dest,
30 const SkPaint& srcPaint, 32 const SkPaint& srcPaint,
31 const char* utf8text, 33 const char* utf8text,
32 size_t textBytes, 34 size_t textBytes,
33 SkPoint point) const; 35 SkPoint point) const;
34 36
35 private: 37 private:
36 SkShaper(const SkShaper&) = delete; 38 SkShaper(const SkShaper&) = delete;
37 SkShaper& operator=(const SkShaper&) = delete; 39 SkShaper& operator=(const SkShaper&) = delete;
38 40
39 struct Impl; 41 struct Impl;
40 std::unique_ptr<Impl> fImpl; 42 std::unique_ptr<Impl> fImpl;
41 }; 43 };
42 44
43 #endif // SkShaper_DEFINED 45 #endif // SkShaper_DEFINED
OLDNEW
« 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