New issue
Advanced search Search tips

Issue 689578 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

getTextIntercepts in Font.cpp does not need to look at cachedBlobs

Project Member Reported by drott@chromium.org, Feb 7 2017

Issue description

https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/paint/TextPainter.cpp?l=260

TextPainter always creates a new TextRunPaintInfo with an empty cachedTextBlob so getTextIntercepts in Font.cpp does not need the following block:

  if (runInfo.cachedTextBlob && runInfo.cachedTextBlob->get()) {
    SkScalar boundsArray[2] = {std::get<0>(bounds), std::get<1>(bounds)};
    int numIntervals = paint.getTextBlobIntercepts(
        runInfo.cachedTextBlob->get(), boundsArray, nullptr);
    if (!numIntervals)
      return;
    DCHECK_EQ(numIntervals % 2, 0);
    intercepts.resize(numIntervals / 2);
    paint.getTextBlobIntercepts(runInfo.cachedTextBlob->get(), boundsArray,
                                reinterpret_cast<SkScalar*>(intercepts.data()));
    return;
  }



 
Project Member

Comment 1 by bugdroid1@chromium.org, Feb 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/16f3d2401ca5d2e68d956507a86d57fb3b60d350

commit 16f3d2401ca5d2e68d956507a86d57fb3b60d350
Author: drott <drott@chromium.org>
Date: Wed Feb 08 02:50:17 2017

Remove cachedTextBlob lookup in Font::getTextIntercepts

This doesn't do anything since the callsite creates a new
TextRunPaintInfo every time.

BUG= 689578 

Review-Url: https://codereview.chromium.org/2679213002
Cr-Commit-Position: refs/heads/master@{#448874}

[modify] https://crrev.com/16f3d2401ca5d2e68d956507a86d57fb3b60d350/third_party/WebKit/Source/platform/fonts/Font.cpp

Comment 2 by drott@chromium.org, Feb 8 2017

Status: Fixed (was: Assigned)

Sign in to add a comment