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

Unified Diff: Source/core/rendering/RenderSelectionInfo.h

Issue 337173003: Compute paint invalidation rects for selection in the space of the backing GraphicsLayer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added comment. Created 6 years, 6 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 | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderSelectionInfo.h
diff --git a/Source/core/rendering/RenderSelectionInfo.h b/Source/core/rendering/RenderSelectionInfo.h
index 7a1b158a988adb777997e5ae7fb3af1be91824f1..6cdb43649f49330d389df30677fd4d00983a9320 100644
--- a/Source/core/rendering/RenderSelectionInfo.h
+++ b/Source/core/rendering/RenderSelectionInfo.h
@@ -62,8 +62,15 @@ class RenderSelectionInfo : public RenderSelectionInfoBase {
public:
RenderSelectionInfo(RenderObject* o, bool clipToVisibleContent)
: RenderSelectionInfoBase(o)
- , m_rect(o->canUpdateSelectionOnRootLineBoxes() ? o->selectionRectForPaintInvalidation(m_repaintContainer, clipToVisibleContent) : LayoutRect())
{
+ if (o->canUpdateSelectionOnRootLineBoxes()) {
+ m_rect = o->selectionRectForPaintInvalidation(m_repaintContainer, clipToVisibleContent);
+ // FIXME: groupedMapping() leaks the squashing abstraction. See RenderBlockSelectionInfo for more details.
+ if (m_repaintContainer && m_repaintContainer->groupedMapping())
+ RenderLayer::mapRectToRepaintBacking(m_repaintContainer, m_repaintContainer, m_rect);
+ } else {
+ m_rect = LayoutRect();
+ }
}
void repaint()
@@ -83,13 +90,22 @@ class RenderBlockSelectionInfo : public RenderSelectionInfoBase {
public:
RenderBlockSelectionInfo(RenderBlock* b)
: RenderSelectionInfoBase(b)
- , m_rects(b->canUpdateSelectionOnRootLineBoxes() ? block()->selectionGapRectsForRepaint(m_repaintContainer) : GapRects())
{
+ if (b->canUpdateSelectionOnRootLineBoxes())
+ m_rects = block()->selectionGapRectsForRepaint(m_repaintContainer);
+ else
+ m_rects = GapRects();
}
void repaint()
{
- m_object->invalidatePaintUsingContainer(m_repaintContainer, enclosingIntRect(m_rects), InvalidationSelection);
+ LayoutRect repaintRect = enclosingIntRect(m_rects);
+ // FIXME: this is leaking the squashing abstraction. However, removing the groupedMapping() condiitional causes
+ // RenderBox::mapRectToRepaintBacking to get called, which makes rect adjustments even if you pass the same
+ // repaintContainer as the render object. Find out why it does that and fix.
+ if (m_repaintContainer && m_repaintContainer->groupedMapping())
+ RenderLayer::mapRectToRepaintBacking(m_repaintContainer, m_repaintContainer, repaintRect);
+ m_object->invalidatePaintUsingContainer(m_repaintContainer, enclosingIntRect(repaintRect), InvalidationSelection);
}
RenderBlock* block() const { return toRenderBlock(m_object); }
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698