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

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

Issue 995583002: [S.P.] Use a correct bounding box for outlines of LayoutInlines for cull rects. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 | « no previous file | Source/core/paint/ObjectPainter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/InlinePainter.cpp
diff --git a/Source/core/paint/InlinePainter.cpp b/Source/core/paint/InlinePainter.cpp
index f6a3cf3f1601a81c2a52905738da56fe30a6d8db..91de7f58d18abad0b395e43e5449f34bb7a87002 100644
--- a/Source/core/paint/InlinePainter.cpp
+++ b/Source/core/paint/InlinePainter.cpp
@@ -31,21 +31,20 @@ void InlinePainter::paintOutline(const PaintInfo& paintInfo, const LayoutPoint&
if (!styleToUse.hasOutline())
return;
- LayoutRect bounds;
- if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
- // FIXME: Use tighter bounds.
- LayoutBlock* cb = m_layoutInline.containingBlock();
- bounds = cb->visualOverflowRect();
- bounds.moveBy(paintOffset);
- }
- LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutInline, paintInfo.phase, bounds);
- if (recorder.canUseCachedDrawing())
- return;
-
if (styleToUse.outlineStyleIsAuto()) {
if (LayoutTheme::theme().shouldDrawDefaultFocusRing(&m_layoutInline)) {
+ Vector<LayoutRect> focusRingRects;
+ m_layoutInline.addFocusRingRects(focusRingRects, paintOffset);
+ LayoutRect focusRingBoundingRect;
+ for (const auto& rect : focusRingRects)
+ focusRingBoundingRect.unite(rect);
+
+ LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutInline, paintInfo.phase, focusRingBoundingRect);
+ if (recorder.canUseCachedDrawing())
+ return;
+
// Only paint the focus ring by hand if the theme isn't able to draw the focus ring.
- ObjectPainter(m_layoutInline).paintFocusRing(paintInfo, paintOffset, styleToUse);
+ ObjectPainter(m_layoutInline).paintFocusRing(paintInfo, styleToUse, focusRingRects);
}
return;
}
@@ -67,6 +66,15 @@ void InlinePainter::paintOutline(const PaintInfo& paintInfo, const LayoutPoint&
Color outlineColor = m_layoutInline.resolveColor(styleToUse, CSSPropertyOutlineColor);
bool useTransparencyLayer = outlineColor.hasAlpha();
+ LayoutRect bounds;
+ for (const auto& rect : rects)
+ bounds.unite(rect);
+ bounds.moveBy(paintOffset);
+
+ LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutInline, paintInfo.phase, bounds);
+ if (recorder.canUseCachedDrawing())
+ return;
+
GraphicsContext* graphicsContext = paintInfo.context;
if (useTransparencyLayer) {
graphicsContext->beginTransparencyLayer(static_cast<float>(outlineColor.alpha()) / 255);
« no previous file with comments | « no previous file | Source/core/paint/ObjectPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698