This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -254,21 +254,17 @@ SkTextBlobBuilder::~SkTextBlobBuilder() {
254254}
255255
256256SkRect SkTextBlobBuilder::TightRunBounds (const SkTextBlob::RunRecord& run) {
257+ const SkFont& font = run.font ();
257258 SkRect bounds;
258- SkPaint paint;
259- run.font ().LEGACY_applyToPaint (&paint);
260- paint.setTextEncoding (kGlyphID_SkTextEncoding );
261259
262260 if (SkTextBlob::kDefault_Positioning == run.positioning ()) {
263- paint.measureText (run.glyphBuffer (), run.glyphCount () * sizeof (uint16_t ), &bounds);
261+ font.measureText (run.glyphBuffer (), run.glyphCount () * sizeof (uint16_t ),
262+ kGlyphID_SkTextEncoding , &bounds);
264263 return bounds.makeOffset (run.offset ().x (), run.offset ().y ());
265264 }
266265
267266 SkAutoSTArray<16 , SkRect> glyphBounds (run.glyphCount ());
268- paint.getTextWidths (run.glyphBuffer (),
269- run.glyphCount () * sizeof (uint16_t ),
270- nullptr ,
271- glyphBounds.get ());
267+ font.getBounds (run.glyphBuffer (), run.glyphCount (), glyphBounds.get (), nullptr );
272268
273269 SkASSERT (SkTextBlob::kFull_Positioning == run.positioning () ||
274270 SkTextBlob::kHorizontal_Positioning == run.positioning ());
You can’t perform that action at this time.
0 commit comments