Commit 27cc4419 authored by Miyoung Shin's avatar Miyoung Shin Committed by Commit Bot

Refactor: unsigned short/unsigned -> uint16_t in third_party/blink/renderer/platform/fonts

- unsigned short/unsigned -> uint16_t.
- No logic changes.
- Reference: https://google.github.io/styleguide/cppguide.html#Integer_Types

Bug: 929986
Change-Id: I3de2acf4bae0290e636c284b91f100a1c2b4c955
Reviewed-on: https://chromium-review.googlesource.com/c/1488473Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Miyoung Shin <myid.shin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635478}
parent 61fe0044
...@@ -372,7 +372,7 @@ void FontCache::AddClient(FontCacheClient* client) { ...@@ -372,7 +372,7 @@ void FontCache::AddClient(FontCacheClient* client) {
font_cache_clients_->insert(client); font_cache_clients_->insert(client);
} }
unsigned short FontCache::Generation() { uint16_t FontCache::Generation() {
return generation_; return generation_;
} }
......
...@@ -149,7 +149,7 @@ class PLATFORM_EXPORT FontCache { ...@@ -149,7 +149,7 @@ class PLATFORM_EXPORT FontCache {
void AddClient(FontCacheClient*); void AddClient(FontCacheClient*);
unsigned short Generation(); uint16_t Generation();
void Invalidate(); void Invalidate();
sk_sp<SkFontMgr> FontManager() { return font_manager_; } sk_sp<SkFontMgr> FontManager() { return font_manager_; }
...@@ -332,7 +332,7 @@ class PLATFORM_EXPORT FontCache { ...@@ -332,7 +332,7 @@ class PLATFORM_EXPORT FontCache {
static float device_scale_factor_; static float device_scale_factor_;
#endif #endif
unsigned short generation_ = 0; uint16_t generation_ = 0;
bool platform_init_ = false; bool platform_init_ = false;
Persistent<HeapHashSet<WeakMember<FontCacheClient>>> font_cache_clients_; Persistent<HeapHashSet<WeakMember<FontCacheClient>>> font_cache_clients_;
FontPlatformDataCache font_platform_data_cache_; FontPlatformDataCache font_platform_data_cache_;
......
...@@ -54,7 +54,7 @@ class PLATFORM_EXPORT FontFallbackList : public RefCounted<FontFallbackList> { ...@@ -54,7 +54,7 @@ class PLATFORM_EXPORT FontFallbackList : public RefCounted<FontFallbackList> {
FontSelector* GetFontSelector() const { return font_selector_.Get(); } FontSelector* GetFontSelector() const { return font_selector_.Get(); }
// FIXME: It should be possible to combine fontSelectorVersion and generation. // FIXME: It should be possible to combine fontSelectorVersion and generation.
unsigned FontSelectorVersion() const { return font_selector_version_; } unsigned FontSelectorVersion() const { return font_selector_version_; }
unsigned Generation() const { return generation_; } uint16_t Generation() const { return generation_; }
ShapeCache* GetShapeCache(const FontDescription& font_description) const { ShapeCache* GetShapeCache(const FontDescription& font_description) const {
if (!shape_cache_) { if (!shape_cache_) {
...@@ -96,7 +96,7 @@ class PLATFORM_EXPORT FontFallbackList : public RefCounted<FontFallbackList> { ...@@ -96,7 +96,7 @@ class PLATFORM_EXPORT FontFallbackList : public RefCounted<FontFallbackList> {
Persistent<FontSelector> font_selector_; Persistent<FontSelector> font_selector_;
unsigned font_selector_version_; unsigned font_selector_version_;
mutable int family_index_; mutable int family_index_;
unsigned short generation_; uint16_t generation_;
mutable bool has_loading_fallback_ : 1; mutable bool has_loading_fallback_ : 1;
mutable base::WeakPtr<ShapeCache> shape_cache_; mutable base::WeakPtr<ShapeCache> shape_cache_;
......
...@@ -30,9 +30,11 @@ ...@@ -30,9 +30,11 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_GLYPH_H_ #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_GLYPH_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_GLYPH_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_GLYPH_H_
#include <cstdint>
namespace blink { namespace blink {
typedef unsigned short Glyph; typedef uint16_t Glyph;
} // namespace blink } // namespace blink
......
...@@ -64,12 +64,12 @@ class ShapeCache { ...@@ -64,12 +64,12 @@ class ShapeCache {
direction_(static_cast<unsigned>(TextDirection::kLtr)) {} direction_(static_cast<unsigned>(TextDirection::kLtr)) {}
SmallStringKey(const LChar* characters, SmallStringKey(const LChar* characters,
unsigned short length, uint16_t length,
TextDirection direction) TextDirection direction)
: length_(length), direction_(static_cast<unsigned>(direction)) { : length_(length), direction_(static_cast<unsigned>(direction)) {
DCHECK(length <= kCapacity); DCHECK(length <= kCapacity);
// Up-convert from LChar to UChar. // Up-convert from LChar to UChar.
for (unsigned short i = 0; i < length; ++i) { for (uint16_t i = 0; i < length; ++i) {
characters_[i] = characters[i]; characters_[i] = characters[i];
} }
...@@ -77,7 +77,7 @@ class ShapeCache { ...@@ -77,7 +77,7 @@ class ShapeCache {
} }
SmallStringKey(const UChar* characters, SmallStringKey(const UChar* characters,
unsigned short length, uint16_t length,
TextDirection direction) TextDirection direction)
: length_(length), direction_(static_cast<unsigned>(direction)) { : length_(length), direction_(static_cast<unsigned>(direction)) {
DCHECK(length <= kCapacity); DCHECK(length <= kCapacity);
...@@ -86,7 +86,7 @@ class ShapeCache { ...@@ -86,7 +86,7 @@ class ShapeCache {
} }
const UChar* Characters() const { return characters_; } const UChar* Characters() const { return characters_; }
unsigned short length() const { return length_; } uint16_t length() const { return length_; }
TextDirection Direction() const { TextDirection Direction() const {
return static_cast<TextDirection>(direction_); return static_cast<TextDirection>(direction_);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment