Loading libs/hwui/DisplayListRenderer.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include "DisplayListLogBuffer.h" #include "DisplayListRenderer.h" #include "Caches.h" #include "Properties.h" namespace android { namespace uirenderer { Loading Loading @@ -1295,6 +1296,12 @@ status_t DisplayList::replay(OpenGLRenderer& renderer, Rect& dirty, int32_t flag DisplayListRenderer::DisplayListRenderer() : mWriter(MIN_WRITER_SIZE), mTranslateX(0.0f), mTranslateY(0.0f), mHasTranslate(false), mHasDrawOps(false) { mSubpixelText = DEFAULT_TEXT_SUBPIXEL_POSITIONING; char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_TEXT_SUBPIXEL_POSITIONING, property, NULL) > 0) { mSubpixelText = strcmp(property, "true") == 0; } } DisplayListRenderer::~DisplayListRenderer() { Loading Loading @@ -1677,6 +1684,8 @@ status_t DisplayListRenderer::drawText(const char* text, int bytesCount, int cou // its own copy as it does right now. // Beware: this needs Glyph encoding (already done on the Paint constructor) paint->setAntiAlias(true); if (mSubpixelText) paint->setSubpixelText(true); if (length < 0.0f) length = paint->measureText(text, bytesCount); bool reject = false; Loading Loading @@ -1706,6 +1715,8 @@ status_t DisplayListRenderer::drawTextOnPath(const char* text, int bytesCount, i addFloat(hOffset); addFloat(vOffset); paint->setAntiAlias(true); if (mSubpixelText) paint->setSubpixelText(true); addPaint(paint); return DrawGlInfo::kStatusDone; } Loading @@ -1718,6 +1729,8 @@ status_t DisplayListRenderer::drawPosText(const char* text, int bytesCount, int addInt(count); addFloats(positions, count * 2); paint->setAntiAlias(true); if (mSubpixelText) paint->setSubpixelText(true); addPaint(paint); return DrawGlInfo::kStatusDone; } Loading libs/hwui/DisplayListRenderer.h +2 −0 Original line number Diff line number Diff line Loading @@ -871,6 +871,8 @@ private: bool mHasDrawOps; bool mSubpixelText; friend class DisplayList; }; // class DisplayListRenderer Loading libs/hwui/Properties.h +4 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,9 @@ enum DebugLevel { #define PROPERTY_TEXT_BLACK_GAMMA_THRESHOLD "ro.text_gamma.black_threshold" #define PROPERTY_TEXT_WHITE_GAMMA_THRESHOLD "ro.text_gamma.white_threshold" // Subpixel positioning #define PROPERTY_TEXT_SUBPIXEL_POSITIONING "ro.text_subpixel_positioning" // TODO: This should be set by a system property #define PANEL_BIT_DEPTH 20 Loading @@ -92,6 +95,7 @@ enum DebugLevel { #define DEFAULT_GRADIENT_CACHE_SIZE 0.5f #define DEFAULT_DROP_SHADOW_CACHE_SIZE 2.0f #define DEFAULT_FBO_CACHE_SIZE 16 #define DEFAULT_TEXT_SUBPIXEL_POSITIONING false #define DEFAULT_TEXTURE_CACHE_FLUSH_RATE 0.6f Loading Loading
libs/hwui/DisplayListRenderer.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include "DisplayListLogBuffer.h" #include "DisplayListRenderer.h" #include "Caches.h" #include "Properties.h" namespace android { namespace uirenderer { Loading Loading @@ -1295,6 +1296,12 @@ status_t DisplayList::replay(OpenGLRenderer& renderer, Rect& dirty, int32_t flag DisplayListRenderer::DisplayListRenderer() : mWriter(MIN_WRITER_SIZE), mTranslateX(0.0f), mTranslateY(0.0f), mHasTranslate(false), mHasDrawOps(false) { mSubpixelText = DEFAULT_TEXT_SUBPIXEL_POSITIONING; char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_TEXT_SUBPIXEL_POSITIONING, property, NULL) > 0) { mSubpixelText = strcmp(property, "true") == 0; } } DisplayListRenderer::~DisplayListRenderer() { Loading Loading @@ -1677,6 +1684,8 @@ status_t DisplayListRenderer::drawText(const char* text, int bytesCount, int cou // its own copy as it does right now. // Beware: this needs Glyph encoding (already done on the Paint constructor) paint->setAntiAlias(true); if (mSubpixelText) paint->setSubpixelText(true); if (length < 0.0f) length = paint->measureText(text, bytesCount); bool reject = false; Loading Loading @@ -1706,6 +1715,8 @@ status_t DisplayListRenderer::drawTextOnPath(const char* text, int bytesCount, i addFloat(hOffset); addFloat(vOffset); paint->setAntiAlias(true); if (mSubpixelText) paint->setSubpixelText(true); addPaint(paint); return DrawGlInfo::kStatusDone; } Loading @@ -1718,6 +1729,8 @@ status_t DisplayListRenderer::drawPosText(const char* text, int bytesCount, int addInt(count); addFloats(positions, count * 2); paint->setAntiAlias(true); if (mSubpixelText) paint->setSubpixelText(true); addPaint(paint); return DrawGlInfo::kStatusDone; } Loading
libs/hwui/DisplayListRenderer.h +2 −0 Original line number Diff line number Diff line Loading @@ -871,6 +871,8 @@ private: bool mHasDrawOps; bool mSubpixelText; friend class DisplayList; }; // class DisplayListRenderer Loading
libs/hwui/Properties.h +4 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,9 @@ enum DebugLevel { #define PROPERTY_TEXT_BLACK_GAMMA_THRESHOLD "ro.text_gamma.black_threshold" #define PROPERTY_TEXT_WHITE_GAMMA_THRESHOLD "ro.text_gamma.white_threshold" // Subpixel positioning #define PROPERTY_TEXT_SUBPIXEL_POSITIONING "ro.text_subpixel_positioning" // TODO: This should be set by a system property #define PANEL_BIT_DEPTH 20 Loading @@ -92,6 +95,7 @@ enum DebugLevel { #define DEFAULT_GRADIENT_CACHE_SIZE 0.5f #define DEFAULT_DROP_SHADOW_CACHE_SIZE 2.0f #define DEFAULT_FBO_CACHE_SIZE 16 #define DEFAULT_TEXT_SUBPIXEL_POSITIONING false #define DEFAULT_TEXTURE_CACHE_FLUSH_RATE 0.6f Loading