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

Unified Diff: Source/core/paint/BlockPainter.cpp

Issue 669803002: Optimize for horizontal writing mode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Moved logic to RenderBlock as suggested by pdr Created 6 years, 2 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: Source/core/paint/BlockPainter.cpp
diff --git a/Source/core/paint/BlockPainter.cpp b/Source/core/paint/BlockPainter.cpp
index b92e7b3e5549a8e0a76197024be600725dcff16c..1e599981110b9cbbe25a0b57a19458a7ceeb04b9 100644
--- a/Source/core/paint/BlockPainter.cpp
+++ b/Source/core/paint/BlockPainter.cpp
@@ -109,8 +109,11 @@ void BlockPainter::paintInlineBox(InlineBox& inlineBox, PaintInfo& paintInfo, co
return;
LayoutPoint childPoint = paintOffset;
- if (inlineBox.parent()->renderer().style()->isFlippedBlocksWritingMode()) // Faster than calling containingBlock().
+ const RenderObject& renderer = inlineBox.parent()->renderer();
+ if (!UNLIKELY(renderer.document().containsAnyVerticalWritingModes())
+ && renderer.style()->slowIsFlippedBlocksWritingMode()) { // Faster than calling containingBlock().
pdr. 2014/10/21 23:35:34 I think this comment belongs with the parent() cal
childPoint = inlineBox.renderer().containingBlock()->flipForWritingModeForChild(&toRenderBox(inlineBox.renderer()), childPoint);
+ }
paintAsInlineBlock(&inlineBox.renderer(), paintInfo, childPoint);
}
@@ -331,7 +334,7 @@ void BlockPainter::paintColumnRules(PaintInfo& paintInfo, const LayoutPoint& pai
ruleLogicalLeft = currLogicalLeftOffset;
}
} else {
- bool topToBottom = !m_renderBlock.style()->isFlippedBlocksWritingMode();
+ bool topToBottom = !m_renderBlock.style()->slowIsFlippedBlocksWritingMode();
LayoutUnit ruleLeft = m_renderBlock.isHorizontalWritingMode()
? m_renderBlock.borderLeft() + m_renderBlock.paddingLeft()
: colGap / 2 - colGap - ruleThickness / 2 + m_renderBlock.borderBefore() + m_renderBlock.paddingBefore();
@@ -418,7 +421,7 @@ void BlockPainter::paintColumnContents(PaintInfo& paintInfo, const LayoutPoint&
}
LayoutUnit blockDelta = (m_renderBlock.isHorizontalWritingMode() ? colRect.height() : colRect.width());
- if (m_renderBlock.style()->isFlippedBlocksWritingMode())
+ if (m_renderBlock.style()->slowIsFlippedBlocksWritingMode())
currLogicalTopOffset += blockDelta;
else
currLogicalTopOffset -= blockDelta;

Powered by Google App Engine
This is Rietveld 408576698