Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1062)

Unified Diff: src/core/SkCanvas.cpp

Issue 496773002: [SkTextBlob] Merge run font data at draw time. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 5a694db3b8e68067f3a4c888eeedae3ddf845e7a..b4cd645975be50412cbc9351290769326fbb6be4 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -2226,20 +2226,22 @@ 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();
+ it.applyFont(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");

Powered by Google App Engine
This is Rietveld 408576698