diff options
author | 2017-11-03 10:12:19 -0700 | |
---|---|---|
committer | 2017-11-03 10:57:44 -0700 | |
commit | 1bcacfdcab0eaa0cee92bd7f5a1b5e271dd68e52 (patch) | |
tree | 4a1366cf2d1cf50b5ec4ed1a8cf0f437053cd0d7 /libs/hwui/TextDropShadowCache.h | |
parent | 30ec71c0fe194a551d2e4abaff2159e0730488e0 (diff) |
Format the world (or just HWUI)
Test: No code changes, just ran through clang-format
Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
Diffstat (limited to 'libs/hwui/TextDropShadowCache.h')
-rw-r--r-- | libs/hwui/TextDropShadowCache.h | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/libs/hwui/TextDropShadowCache.h b/libs/hwui/TextDropShadowCache.h index 13e87749029a..86a012970f17 100644 --- a/libs/hwui/TextDropShadowCache.h +++ b/libs/hwui/TextDropShadowCache.h @@ -24,8 +24,8 @@ #include <utils/LruCache.h> #include <utils/String16.h> -#include "font/Font.h" #include "Texture.h" +#include "font/Font.h" namespace android { namespace uirenderer { @@ -34,13 +34,20 @@ class Caches; class FontRenderer; struct ShadowText { - ShadowText(): glyphCount(0), radius(0.0f), textSize(0.0f), typeface(nullptr), - flags(0), italicStyle(0.0f), scaleX(0), glyphs(nullptr), positions(nullptr) { - } + ShadowText() + : glyphCount(0) + , radius(0.0f) + , textSize(0.0f) + , typeface(nullptr) + , flags(0) + , italicStyle(0.0f) + , scaleX(0) + , glyphs(nullptr) + , positions(nullptr) {} // len is the number of bytes in text ShadowText(const SkPaint* paint, float radius, uint32_t glyphCount, const glyph_t* srcGlyphs, - const float* positions) + const float* positions) : glyphCount(glyphCount) , radius(radius) , textSize(paint->getTextSize()) @@ -49,23 +56,17 @@ struct ShadowText { , italicStyle(paint->getTextSkewX()) , scaleX(paint->getTextScaleX()) , glyphs(srcGlyphs) - , positions(positions) { - } + , positions(positions) {} - ~ShadowText() { - } + ~ShadowText() {} hash_t hash() const; static int compare(const ShadowText& lhs, const ShadowText& rhs); - bool operator==(const ShadowText& other) const { - return compare(*this, other) == 0; - } + bool operator==(const ShadowText& other) const { return compare(*this, other) == 0; } - bool operator!=(const ShadowText& other) const { - return compare(*this, other) != 0; - } + bool operator!=(const ShadowText& other) const { return compare(*this, other) != 0; } void copyTextLocally() { str.setTo(reinterpret_cast<const char16_t*>(glyphs), glyphCount); @@ -91,7 +92,7 @@ struct ShadowText { String16 str; Vector<float> positionsCopy; -}; // struct ShadowText +}; // struct ShadowText // Caching support @@ -110,15 +111,14 @@ inline hash_t hash_type(const ShadowText& entry) { /** * Alpha texture used to represent a shadow. */ -struct ShadowTexture: public Texture { - explicit ShadowTexture(Caches& caches): Texture(caches) { - } +struct ShadowTexture : public Texture { + explicit ShadowTexture(Caches& caches) : Texture(caches) {} float left; float top; -}; // struct ShadowTexture +}; // struct ShadowTexture -class TextDropShadowCache: public OnEntryRemoved<ShadowText, ShadowTexture*> { +class TextDropShadowCache : public OnEntryRemoved<ShadowText, ShadowTexture*> { public: TextDropShadowCache(); explicit TextDropShadowCache(uint32_t maxByteSize); @@ -130,17 +130,15 @@ public: */ void operator()(ShadowText& text, ShadowTexture*& texture) override; - ShadowTexture* get(const SkPaint* paint, const glyph_t* text, - int numGlyphs, float radius, const float* positions); + ShadowTexture* get(const SkPaint* paint, const glyph_t* text, int numGlyphs, float radius, + const float* positions); /** * Clears the cache. This causes all textures to be deleted. */ void clear(); - void setFontRenderer(FontRenderer& fontRenderer) { - mRenderer = &fontRenderer; - } + void setFontRenderer(FontRenderer& fontRenderer) { mRenderer = &fontRenderer; } /** * Returns the maximum size of the cache in bytes. @@ -158,9 +156,9 @@ private: const uint32_t mMaxSize; FontRenderer* mRenderer = nullptr; bool mDebugEnabled; -}; // class TextDropShadowCache +}; // class TextDropShadowCache -}; // namespace uirenderer -}; // namespace android +}; // namespace uirenderer +}; // namespace android -#endif // ANDROID_HWUI_TEXT_DROP_SHADOW_CACHE_H +#endif // ANDROID_HWUI_TEXT_DROP_SHADOW_CACHE_H |