| Index: ui/gfx/harfbuzz_font_skia.cc
|
| diff --git a/ui/gfx/harfbuzz_font_skia.cc b/ui/gfx/harfbuzz_font_skia.cc
|
| index 889fa2d22954f8e33f87a53f98cdb4d942536bab..04129588418f114a6f50bd3d308c3b37ea41f329 100644
|
| --- a/ui/gfx/harfbuzz_font_skia.cc
|
| +++ b/ui/gfx/harfbuzz_font_skia.cc
|
| @@ -13,6 +13,7 @@
|
| #include "base/lazy_instance.h"
|
| #include "base/logging.h"
|
| #include "base/macros.h"
|
| +#include "skia/ext/cdl_paint.h"
|
| #include "third_party/skia/include/core/SkPaint.h"
|
| #include "third_party/skia/include/core/SkTypeface.h"
|
| #include "ui/gfx/render_text.h"
|
| @@ -34,7 +35,7 @@ typedef std::pair<HarfBuzzFace, GlyphCache> FaceCache;
|
| struct FontData {
|
| FontData(GlyphCache* glyph_cache) : glyph_cache_(glyph_cache) {}
|
|
|
| - SkPaint paint_;
|
| + CdlPaint paint_;
|
| GlyphCache* glyph_cache_;
|
| };
|
|
|
| @@ -53,18 +54,18 @@ void DeleteArrayByType(void* data) {
|
|
|
| // Outputs the |width| and |extents| of the glyph with index |codepoint| in
|
| // |paint|'s font.
|
| -void GetGlyphWidthAndExtents(SkPaint* paint,
|
| +void GetGlyphWidthAndExtents(CdlPaint* paint,
|
| hb_codepoint_t codepoint,
|
| hb_position_t* width,
|
| hb_glyph_extents_t* extents) {
|
| DCHECK_LE(codepoint, std::numeric_limits<uint16_t>::max());
|
| - paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding);
|
| + paint->setTextEncoding(CdlPaint::kGlyphID_TextEncoding);
|
|
|
| SkScalar sk_width;
|
| SkRect sk_bounds;
|
| uint16_t glyph = static_cast<uint16_t>(codepoint);
|
|
|
| - paint->getTextWidths(&glyph, sizeof(glyph), &sk_width, &sk_bounds);
|
| + ToSkPaint(*paint).getTextWidths(&glyph, sizeof(glyph), &sk_width, &sk_bounds);
|
| if (width)
|
| *width = SkiaScalarToHarfBuzzUnits(sk_width);
|
| if (extents) {
|
| @@ -90,9 +91,10 @@ hb_bool_t GetGlyph(hb_font_t* font,
|
|
|
| bool exists = cache->count(unicode) != 0;
|
| if (!exists) {
|
| - SkPaint* paint = &font_data->paint_;
|
| - paint->setTextEncoding(SkPaint::kUTF32_TextEncoding);
|
| - paint->textToGlyphs(&unicode, sizeof(hb_codepoint_t), &(*cache)[unicode]);
|
| + CdlPaint* paint = &font_data->paint_;
|
| + paint->setTextEncoding(CdlPaint::kUTF32_TextEncoding);
|
| + ToSkPaint(*paint).textToGlyphs(&unicode, sizeof(hb_codepoint_t),
|
| + &(*cache)[unicode]);
|
| }
|
| *glyph = (*cache)[unicode];
|
| return !!*glyph;
|
|
|