Changeset 51668 in webkit
- Timestamp:
- Dec 3, 2009, 4:16:50 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r51660 r51668 1 2009-12-03 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Fixed <rdar://problem/7401617> Selection painting issue in hardware- 6 accelerated layers 7 which is another part of https://bugs.webkit.org/show_bug.cgi?id=23628 8 Fix selection painting to do container-relative repaints 9 10 Test: fast/repaint/block-selection-gap-in-composited-layer.html 11 12 * rendering/RenderBlock.cpp: 13 (WebCore::RenderBlock::selectionGapRectsForRepaint): Compute and paint 14 gap rects in the coordinate space of the repaint container. 15 * rendering/RenderLayerCompositor.cpp: 16 (WebCore::RenderLayerCompositor::recursiveRepaintLayerRect): Added a 17 FIXME. 18 * rendering/RenderView.cpp: 19 (WebCore::RenderView::setSelection): Map block selection gap rects from 20 the repaint container’s coordinate space to the view’s coordinate space 21 before adding them to the cached selection bounds. 22 (WebCore::RenderView::clearSelection): Changed to use 23 repaintRectangleInViewAndCompositedLayers() so that the selection rect 24 is invalidated in composited layers as well. 25 1 26 2009-12-03 Jonathan Dixon <joth@chromium.org> 2 27 -
trunk/WebCore/rendering/RenderBlock.cpp
r51527 r51668 45 45 #include "SelectionController.h" 46 46 #include "Settings.h" 47 #include "TransformState.h" 47 48 #include <wtf/StdLibExtras.h> 48 49 … … 1908 1909 } 1909 1910 1910 GapRects RenderBlock::selectionGapRectsForRepaint(RenderBoxModelObject* /*repaintContainer*/)1911 GapRects RenderBlock::selectionGapRectsForRepaint(RenderBoxModelObject* repaintContainer) 1911 1912 { 1912 1913 ASSERT(!needsLayout()); … … 1915 1916 return GapRects(); 1916 1917 1917 // FIXME: this is broken with transforms and a non-null repaintContainer1918 FloatPoint absContentPoint = localToAbsolute(FloatPoint());1919 if (hasOverflowClip())1920 absContentPoint -= layer()->scrolledContentOffset();1918 // FIXME: this is broken with transforms 1919 TransformState transformState(TransformState::ApplyTransformDirection, FloatPoint()); 1920 mapLocalToContainer(repaintContainer, false, false, transformState); 1921 FloatPoint offsetFromRepaintContainer = transformState.mappedPoint(); 1921 1922 1922 1923 int lastTop = 0; … … 1924 1925 int lastRight = rightSelectionOffset(this, lastTop); 1925 1926 1926 return fillSelectionGaps(this, absContentPoint.x(), absContentPoint.y(), absContentPoint.x(), absContentPoint.y(), lastTop, lastLeft, lastRight);1927 return fillSelectionGaps(this, offsetFromRepaintContainer.x(), offsetFromRepaintContainer.y(), offsetFromRepaintContainer.x(), offsetFromRepaintContainer.y(), lastTop, lastLeft, lastRight); 1927 1928 } 1928 1929 -
trunk/WebCore/rendering/RenderLayerCompositor.cpp
r51476 r51668 771 771 void RenderLayerCompositor::recursiveRepaintLayerRect(RenderLayer* layer, const IntRect& rect) 772 772 { 773 // FIXME: This method does not work correctly with transforms. 773 774 if (layer->isComposited()) 774 775 layer->setBackingNeedsRepaintInRect(rect); … … 779 780 for (size_t i = 0; i < listSize; ++i) { 780 781 RenderLayer* curLayer = negZOrderList->at(i); 781 int x = 0, y = 0; 782 int x = 0; 783 int y = 0; 782 784 curLayer->convertToLayerCoords(layer, x, y); 783 785 IntRect childRect(rect); … … 791 793 for (size_t i = 0; i < listSize; ++i) { 792 794 RenderLayer* curLayer = posZOrderList->at(i); 793 int x = 0, y = 0; 795 int x = 0; 796 int y = 0; 794 797 curLayer->convertToLayerCoords(layer, x, y); 795 798 IntRect childRect(rect); … … 803 806 for (size_t i = 0; i < listSize; ++i) { 804 807 RenderLayer* curLayer = normalFlowList->at(i); 805 int x = 0, y = 0; 808 int x = 0; 809 int y = 0; 806 810 curLayer->convertToLayerCoords(layer, x, y); 807 811 IntRect childRect(rect); -
trunk/WebCore/rendering/RenderView.cpp
r51324 r51668 447 447 blockInfo = new RenderBlockSelectionInfo(cb); 448 448 newSelectedBlocks.set(cb, blockInfo); 449 m_cachedSelectionBounds.unite(blockInfo->rects()); 449 IntRect rect = blockInfo->rects(); 450 if (blockInfo->repaintContainer()) 451 rect = blockInfo->repaintContainer()->localToAbsoluteQuad(FloatQuad(rect)).enclosingBoundingBox(); 452 m_cachedSelectionBounds.unite(rect); 450 453 cb = cb->containingBlock(); 451 454 } … … 524 527 void RenderView::clearSelection() 525 528 { 526 repaint ViewRectangle(m_cachedSelectionBounds);529 repaintRectangleInViewAndCompositedLayers(m_cachedSelectionBounds); 527 530 setSelection(0, -1, 0, -1, RepaintNewMinusOld); 528 531 }
Note:
See TracChangeset
for help on using the changeset viewer.