Loading libs/hwui/SkiaCanvas.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -735,8 +735,7 @@ void SkiaCanvas::drawVectorDrawable(VectorDrawableRoot* vectorDrawable) { // ---------------------------------------------------------------------------- void SkiaCanvas::drawGlyphs(ReadGlyphFunc glyphFunc, int count, const Paint& paint, float x, float y, float boundsLeft, float boundsTop, float boundsRight, float boundsBottom, float totalAdvance) { float y, float totalAdvance) { if (count <= 0 || paint.nothingToDraw()) return; Paint paintCopy(paint); if (mPaintFilter) { Loading libs/hwui/SkiaCanvas.h +1 −2 Original line number Diff line number Diff line Loading @@ -161,8 +161,7 @@ protected: void drawDrawable(SkDrawable* drawable) { mCanvas->drawDrawable(drawable); } virtual void drawGlyphs(ReadGlyphFunc glyphFunc, int count, const Paint& paint, float x, float y, float boundsLeft, float boundsTop, float boundsRight, float boundsBottom, float totalAdvance) override; float y, float totalAdvance) override; virtual void drawLayoutOnPath(const minikin::Layout& layout, float hOffset, float vOffset, const Paint& paint, const SkPath& path, size_t start, size_t end) override; Loading libs/hwui/hwui/Canvas.cpp +5 −13 Original line number Diff line number Diff line Loading @@ -84,13 +84,12 @@ static void simplifyPaint(int color, Paint* paint) { class DrawTextFunctor { public: DrawTextFunctor(const minikin::Layout& layout, Canvas* canvas, const Paint& paint, float x, float y, minikin::MinikinRect& bounds, float totalAdvance) float y, float totalAdvance) : layout(layout) , canvas(canvas) , paint(paint) , x(x) , y(y) , bounds(bounds) , totalAdvance(totalAdvance) {} void operator()(size_t start, size_t end) { Loading @@ -114,19 +113,16 @@ public: Paint outlinePaint(paint); simplifyPaint(darken ? SK_ColorWHITE : SK_ColorBLACK, &outlinePaint); outlinePaint.setStyle(SkPaint::kStrokeAndFill_Style); canvas->drawGlyphs(glyphFunc, glyphCount, outlinePaint, x, y, bounds.mLeft, bounds.mTop, bounds.mRight, bounds.mBottom, totalAdvance); canvas->drawGlyphs(glyphFunc, glyphCount, outlinePaint, x, y, totalAdvance); // inner Paint innerPaint(paint); simplifyPaint(darken ? SK_ColorBLACK : SK_ColorWHITE, &innerPaint); innerPaint.setStyle(SkPaint::kFill_Style); canvas->drawGlyphs(glyphFunc, glyphCount, innerPaint, x, y, bounds.mLeft, bounds.mTop, bounds.mRight, bounds.mBottom, totalAdvance); canvas->drawGlyphs(glyphFunc, glyphCount, innerPaint, x, y, totalAdvance); } else { // standard draw path canvas->drawGlyphs(glyphFunc, glyphCount, paint, x, y, bounds.mLeft, bounds.mTop, bounds.mRight, bounds.mBottom, totalAdvance); canvas->drawGlyphs(glyphFunc, glyphCount, paint, x, y, totalAdvance); } } Loading @@ -136,7 +132,6 @@ private: const Paint& paint; float x; float y; minikin::MinikinRect& bounds; float totalAdvance; }; Loading @@ -156,15 +151,12 @@ void Canvas::drawText(const uint16_t* text, int textSize, int start, int count, x += MinikinUtils::xOffsetForTextAlign(&paint, layout); minikin::MinikinRect bounds; layout.getBounds(&bounds); // Set align to left for drawing, as we don't want individual // glyphs centered or right-aligned; the offset above takes // care of all alignment. paint.setTextAlign(Paint::kLeft_Align); DrawTextFunctor f(layout, this, paint, x, y, bounds, layout.getAdvance()); DrawTextFunctor f(layout, this, paint, x, y, layout.getAdvance()); MinikinUtils::forFontRun(layout, &paint, f); } Loading libs/hwui/hwui/Canvas.h +1 −2 Original line number Diff line number Diff line Loading @@ -288,8 +288,7 @@ protected: * totalAdvance: used to define width of text decorations (underlines, strikethroughs). */ virtual void drawGlyphs(ReadGlyphFunc glyphFunc, int count, const Paint& paint, float x, float y, float boundsLeft, float boundsTop, float boundsRight, float boundsBottom, float totalAdvance) = 0; float y,float totalAdvance) = 0; virtual void drawLayoutOnPath(const minikin::Layout& layout, float hOffset, float vOffset, const Paint& paint, const SkPath& path, size_t start, size_t end) = 0; Loading Loading
libs/hwui/SkiaCanvas.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -735,8 +735,7 @@ void SkiaCanvas::drawVectorDrawable(VectorDrawableRoot* vectorDrawable) { // ---------------------------------------------------------------------------- void SkiaCanvas::drawGlyphs(ReadGlyphFunc glyphFunc, int count, const Paint& paint, float x, float y, float boundsLeft, float boundsTop, float boundsRight, float boundsBottom, float totalAdvance) { float y, float totalAdvance) { if (count <= 0 || paint.nothingToDraw()) return; Paint paintCopy(paint); if (mPaintFilter) { Loading
libs/hwui/SkiaCanvas.h +1 −2 Original line number Diff line number Diff line Loading @@ -161,8 +161,7 @@ protected: void drawDrawable(SkDrawable* drawable) { mCanvas->drawDrawable(drawable); } virtual void drawGlyphs(ReadGlyphFunc glyphFunc, int count, const Paint& paint, float x, float y, float boundsLeft, float boundsTop, float boundsRight, float boundsBottom, float totalAdvance) override; float y, float totalAdvance) override; virtual void drawLayoutOnPath(const minikin::Layout& layout, float hOffset, float vOffset, const Paint& paint, const SkPath& path, size_t start, size_t end) override; Loading
libs/hwui/hwui/Canvas.cpp +5 −13 Original line number Diff line number Diff line Loading @@ -84,13 +84,12 @@ static void simplifyPaint(int color, Paint* paint) { class DrawTextFunctor { public: DrawTextFunctor(const minikin::Layout& layout, Canvas* canvas, const Paint& paint, float x, float y, minikin::MinikinRect& bounds, float totalAdvance) float y, float totalAdvance) : layout(layout) , canvas(canvas) , paint(paint) , x(x) , y(y) , bounds(bounds) , totalAdvance(totalAdvance) {} void operator()(size_t start, size_t end) { Loading @@ -114,19 +113,16 @@ public: Paint outlinePaint(paint); simplifyPaint(darken ? SK_ColorWHITE : SK_ColorBLACK, &outlinePaint); outlinePaint.setStyle(SkPaint::kStrokeAndFill_Style); canvas->drawGlyphs(glyphFunc, glyphCount, outlinePaint, x, y, bounds.mLeft, bounds.mTop, bounds.mRight, bounds.mBottom, totalAdvance); canvas->drawGlyphs(glyphFunc, glyphCount, outlinePaint, x, y, totalAdvance); // inner Paint innerPaint(paint); simplifyPaint(darken ? SK_ColorBLACK : SK_ColorWHITE, &innerPaint); innerPaint.setStyle(SkPaint::kFill_Style); canvas->drawGlyphs(glyphFunc, glyphCount, innerPaint, x, y, bounds.mLeft, bounds.mTop, bounds.mRight, bounds.mBottom, totalAdvance); canvas->drawGlyphs(glyphFunc, glyphCount, innerPaint, x, y, totalAdvance); } else { // standard draw path canvas->drawGlyphs(glyphFunc, glyphCount, paint, x, y, bounds.mLeft, bounds.mTop, bounds.mRight, bounds.mBottom, totalAdvance); canvas->drawGlyphs(glyphFunc, glyphCount, paint, x, y, totalAdvance); } } Loading @@ -136,7 +132,6 @@ private: const Paint& paint; float x; float y; minikin::MinikinRect& bounds; float totalAdvance; }; Loading @@ -156,15 +151,12 @@ void Canvas::drawText(const uint16_t* text, int textSize, int start, int count, x += MinikinUtils::xOffsetForTextAlign(&paint, layout); minikin::MinikinRect bounds; layout.getBounds(&bounds); // Set align to left for drawing, as we don't want individual // glyphs centered or right-aligned; the offset above takes // care of all alignment. paint.setTextAlign(Paint::kLeft_Align); DrawTextFunctor f(layout, this, paint, x, y, bounds, layout.getAdvance()); DrawTextFunctor f(layout, this, paint, x, y, layout.getAdvance()); MinikinUtils::forFontRun(layout, &paint, f); } Loading
libs/hwui/hwui/Canvas.h +1 −2 Original line number Diff line number Diff line Loading @@ -288,8 +288,7 @@ protected: * totalAdvance: used to define width of text decorations (underlines, strikethroughs). */ virtual void drawGlyphs(ReadGlyphFunc glyphFunc, int count, const Paint& paint, float x, float y, float boundsLeft, float boundsTop, float boundsRight, float boundsBottom, float totalAdvance) = 0; float y,float totalAdvance) = 0; virtual void drawLayoutOnPath(const minikin::Layout& layout, float hOffset, float vOffset, const Paint& paint, const SkPath& path, size_t start, size_t end) = 0; Loading