Loading libs/hwui/DisplayListRenderer.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -1204,6 +1204,16 @@ void DisplayListRenderer::drawText(const char* text, int bytesCount, int count, addText(text, bytesCount); addInt(count); addPoint(x, y); // TODO: We should probably make a copy of the paint instead of modifying // it; modifying the paint will change its generationID the first // time, which might impact caches. More investigation needed to // see if it matters. // If we make a copy, then drawTextDecorations() should *not* make // its own copy as it does right now. paint->setAntiAlias(true); #if RENDER_TEXT_AS_GLYPHS paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding); #endif addPaint(paint); addFloat(length < 0.0f ? paint->measureText(text, bytesCount) : length); } Loading libs/hwui/DisplayListRenderer.h +1 −1 Original line number Diff line number Diff line Loading @@ -290,7 +290,7 @@ public: virtual void drawLines(float* points, int count, SkPaint* paint); virtual void drawPoints(float* points, int count, SkPaint* paint); virtual void drawText(const char* text, int bytesCount, int count, float x, float y, SkPaint* paint, float length); SkPaint* paint, float length = 1.0f); virtual void resetShader(); virtual void setupShader(SkiaShader* shader); Loading libs/hwui/OpenGLRenderer.cpp +2 −10 Original line number Diff line number Diff line Loading @@ -2069,16 +2069,7 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count, } if (mSnapshot->isIgnored()) return; // TODO: We should probably make a copy of the paint instead of modifying // it; modifying the paint will change its generationID the first // time, which might impact caches. More investigation needed to // see if it matters. // If we make a copy, then drawTextDecorations() should *not* make // its own copy as it does right now. paint->setAntiAlias(true); #if RENDER_TEXT_AS_GLYPHS paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding); #endif // NOTE: AA and glyph id encoding are set in DisplayListRenderer.cpp switch (paint->getTextAlign()) { case SkPaint::kCenter_Align: Loading @@ -2095,6 +2086,7 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count, SkPaint::FontMetrics metrics; paint->getFontMetrics(&metrics, 0.0f); // If no length was specified, just perform the hit test on the Y axis if (quickReject(x, y + metrics.fTop, x + (length >= 0.0f ? length : INT_MAX / 2), y + metrics.fBottom)) { return; Loading libs/hwui/ShapeCache.h +2 −1 Original line number Diff line number Diff line Loading @@ -503,7 +503,8 @@ PathTexture* ShapeCache<Entry>::addTexture(const Entry& entry, const SkPath *pat const uint32_t height = uint32_t(pathHeight + offset * 2.0 + 0.5); if (width > mMaxTextureSize || height > mMaxTextureSize) { LOGW("Shape %s too large to be rendered into a texture", mName); LOGW("Shape %s too large to be rendered into a texture (%dx%d, max=%dx%d)", mName, width, height, mMaxTextureSize, mMaxTextureSize); return NULL; } Loading libs/hwui/TextureCache.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,8 @@ Texture* TextureCache::get(SkBitmap* bitmap) { if (!texture) { if (bitmap->width() > mMaxTextureSize || bitmap->height() > mMaxTextureSize) { LOGW("Bitmap too large to be uploaded into a texture"); LOGW("Bitmap too large to be uploaded into a texture (%dx%d, max=%dx%d)", bitmap->width(), bitmap->height(), mMaxTextureSize, mMaxTextureSize); return NULL; } Loading Loading
libs/hwui/DisplayListRenderer.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -1204,6 +1204,16 @@ void DisplayListRenderer::drawText(const char* text, int bytesCount, int count, addText(text, bytesCount); addInt(count); addPoint(x, y); // TODO: We should probably make a copy of the paint instead of modifying // it; modifying the paint will change its generationID the first // time, which might impact caches. More investigation needed to // see if it matters. // If we make a copy, then drawTextDecorations() should *not* make // its own copy as it does right now. paint->setAntiAlias(true); #if RENDER_TEXT_AS_GLYPHS paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding); #endif addPaint(paint); addFloat(length < 0.0f ? paint->measureText(text, bytesCount) : length); } Loading
libs/hwui/DisplayListRenderer.h +1 −1 Original line number Diff line number Diff line Loading @@ -290,7 +290,7 @@ public: virtual void drawLines(float* points, int count, SkPaint* paint); virtual void drawPoints(float* points, int count, SkPaint* paint); virtual void drawText(const char* text, int bytesCount, int count, float x, float y, SkPaint* paint, float length); SkPaint* paint, float length = 1.0f); virtual void resetShader(); virtual void setupShader(SkiaShader* shader); Loading
libs/hwui/OpenGLRenderer.cpp +2 −10 Original line number Diff line number Diff line Loading @@ -2069,16 +2069,7 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count, } if (mSnapshot->isIgnored()) return; // TODO: We should probably make a copy of the paint instead of modifying // it; modifying the paint will change its generationID the first // time, which might impact caches. More investigation needed to // see if it matters. // If we make a copy, then drawTextDecorations() should *not* make // its own copy as it does right now. paint->setAntiAlias(true); #if RENDER_TEXT_AS_GLYPHS paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding); #endif // NOTE: AA and glyph id encoding are set in DisplayListRenderer.cpp switch (paint->getTextAlign()) { case SkPaint::kCenter_Align: Loading @@ -2095,6 +2086,7 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count, SkPaint::FontMetrics metrics; paint->getFontMetrics(&metrics, 0.0f); // If no length was specified, just perform the hit test on the Y axis if (quickReject(x, y + metrics.fTop, x + (length >= 0.0f ? length : INT_MAX / 2), y + metrics.fBottom)) { return; Loading
libs/hwui/ShapeCache.h +2 −1 Original line number Diff line number Diff line Loading @@ -503,7 +503,8 @@ PathTexture* ShapeCache<Entry>::addTexture(const Entry& entry, const SkPath *pat const uint32_t height = uint32_t(pathHeight + offset * 2.0 + 0.5); if (width > mMaxTextureSize || height > mMaxTextureSize) { LOGW("Shape %s too large to be rendered into a texture", mName); LOGW("Shape %s too large to be rendered into a texture (%dx%d, max=%dx%d)", mName, width, height, mMaxTextureSize, mMaxTextureSize); return NULL; } Loading
libs/hwui/TextureCache.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,8 @@ Texture* TextureCache::get(SkBitmap* bitmap) { if (!texture) { if (bitmap->width() > mMaxTextureSize || bitmap->height() > mMaxTextureSize) { LOGW("Bitmap too large to be uploaded into a texture"); LOGW("Bitmap too large to be uploaded into a texture (%dx%d, max=%dx%d)", bitmap->width(), bitmap->height(), mMaxTextureSize, mMaxTextureSize); return NULL; } Loading