Index: src/core/SkCanvas.cpp |
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
index 5a694db3b8e68067f3a4c888eeedae3ddf845e7a..af25b46f3f808f386a04387a14eb78a36fe418bd 100644 |
--- a/src/core/SkCanvas.cpp |
+++ b/src/core/SkCanvas.cpp |
@@ -2226,20 +2226,24 @@ void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
this->translate(x, y); |
} |
+ SkPaint runPaint = paint; |
SkTextBlob::RunIterator it(blob); |
while (!it.done()) { |
size_t textLen = it.glyphCount() * sizeof(uint16_t); |
const SkPoint& offset = it.offset(); |
+ // applyFontToPaint() always overwrites the exact same attributes, |
+ // so it is safe to not re-seed the paint. |
+ it.applyFontToPaint(&runPaint); |
switch (it.positioning()) { |
case SkTextBlob::kDefault_Positioning: |
- this->drawText(it.glyphs(), textLen, offset.x(), offset.y(), paint); |
+ this->drawText(it.glyphs(), textLen, offset.x(), offset.y(), runPaint); |
break; |
case SkTextBlob::kHorizontal_Positioning: |
- this->drawPosTextH(it.glyphs(), textLen, it.pos(), offset.y(), paint); |
+ this->drawPosTextH(it.glyphs(), textLen, it.pos(), offset.y(), runPaint); |
break; |
case SkTextBlob::kFull_Positioning: |
- this->drawPosText(it.glyphs(), textLen, (const SkPoint*)it.pos(), paint); |
+ this->drawPosText(it.glyphs(), textLen, (const SkPoint*)it.pos(), runPaint); |
break; |
default: |
SkFAIL("unhandled positioning mode"); |