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

Unified Diff: Source/platform/fonts/Font.cpp

Issue 856613002: Always use deferred text blob bounds. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: TestExpectations (progressions) Created 5 years, 11 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/Font.cpp
diff --git a/Source/platform/fonts/Font.cpp b/Source/platform/fonts/Font.cpp
index 02d2e3ac7366aa89324bd04a9c4184ae73de42b5..f6c979590fe3c451eeabc3eb1cdc09c5fc596c5d 100644
--- a/Source/platform/fonts/Font.cpp
+++ b/Source/platform/fonts/Font.cpp
@@ -256,26 +256,12 @@ float Font::width(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFo
return result;
}
-static bool requiresRecomputingBounds(const Font& font, const FloatRect& bounds)
-{
- // Blobs should never have empty bounds, but see http://crbug.com/445527
- if (bounds.isEmpty())
- return true;
-
- const FontDescription& fontDescription = font.fontDescription();
- return fontDescription.letterSpacing() < 0 || fontDescription.wordSpacing() < 0;
-}
-
PassTextBlobPtr Font::buildTextBlob(const GlyphBuffer& glyphBuffer, const FloatRect& bounds,
bool couldUseLCD) const
{
ASSERT(RuntimeEnabledFeatures::textBlobEnabled());
SkTextBlobBuilder builder;
- SkRect skBounds = bounds;
- // FIXME: Identify these cases earlier on and avoid using bounds that are
- // not visually correct in other places.
- const SkRect* skBoundsPtr = requiresRecomputingBounds(*this, bounds) ? nullptr : &skBounds;
bool hasVerticalOffsets = glyphBuffer.hasVerticalOffsets();
unsigned i = 0;
@@ -302,8 +288,8 @@ PassTextBlobPtr Font::buildTextBlob(const GlyphBuffer& glyphBuffer, const FloatR
unsigned count = i - start;
const SkTextBlobBuilder::RunBuffer& buffer = hasVerticalOffsets
- ? builder.allocRunPos(paint, count, skBoundsPtr)
- : builder.allocRunPosH(paint, count, 0, skBoundsPtr);
+ ? builder.allocRunPos(paint, count)
+ : builder.allocRunPosH(paint, count, 0);
const uint16_t* glyphs = glyphBuffer.glyphs(start);
const float* offsets = glyphBuffer.offsets(start);
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698