Changeset 42849 in webkit
- Timestamp:
- Apr 24, 2009, 4:00:05 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r42846 r42849 1 2009-04-24 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 - fix https://bugs.webkit.org/show_bug.cgi?id=5909 6 <rdar://problem/5863349> overlapping element leaves trail when 7 scrolling iframe 8 9 * WebCore.xcodeproj/project.pbxproj: Added OverlapTestRequestClient.h. 10 11 * page/FrameView.cpp: 12 (WebCore::FrameView::reset): Initialize m_isOverlapped. 13 (WebCore::FrameView::useSlowRepaints): Also check m_isOverlapped. 14 (WebCore::FrameView::removeSlowRepaintObject): Use useSlowRepaints() 15 so overlapping is taken into account. 16 (WebCore::FrameView::setIsOverlapped): Added. Sets m_isOverlapped and 17 enables or disables copy-on-scroll accordingly. 18 19 * page/FrameView.h: 20 Added setIsOverlapped() and m_isOverlapped. 21 22 * rendering/OverlapTestRequestClient.h: Added. During foreground painting, 23 an OverlapTestRequestClient can make a request to test if any subsequently- 24 painted layers overlap a rect. The test result is delivered to the 25 requestClient via setOverlapTestResult(). 26 (WebCore::OverlapTestRequestClient::~OverlapTestRequestClient): 27 28 * rendering/RenderLayer.cpp: 29 (WebCore::RenderLayer::paint): Pass an OverlapTestRequestMap to 30 paintLayer(). When done painting, inform any remaining requestClients that 31 they are not overlapped. 32 33 (WebCore::RenderLayer::paintLayer): Take an OverlapTestRequestMap and 34 pass it down to child and reflection layers. Inform requestClients if this 35 layer overlaps their requested rects. 36 37 * rendering/RenderLayer.h: 38 39 * rendering/RenderObject.h: 40 (WebCore::RenderObject::PaintInfo::PaintInfo): Added an 41 OverlapTestRequestMap member. 42 43 * rendering/RenderReplica.cpp: 44 (WebCore::RenderReplica::paint): For now, pass a 0 OverlapTestRequestMap 45 to paintLayer(). 46 47 * rendering/RenderWidget.cpp: 48 (WebCore::RenderWidget::paint): For FrameViews, request an overlap test 49 with the frame. 50 (WebCore::RenderWidget::setOverlapTestResult): Call 51 FrameView::setIsOverlapped() with the result of the overlap test. 52 53 * rendering/RenderWidget.h: Made RenderWidget an OverlapTestRequestClient. 54 1 55 2009-04-24 David Hyatt <hyatt@apple.com> 2 56 -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r42846 r42849 611 611 3724CA7E0E68B20500DB4384 /* FontMacCoreText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3724CA7D0E68B20500DB4384 /* FontMacCoreText.cpp */; }; 612 612 3744570F0DB05FA500AE0992 /* SVGGlyphMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 3744570E0DB05FA500AE0992 /* SVGGlyphMap.h */; }; 613 3774ABA50FA21EB400AD7DE9 /* OverlapTestRequestClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 613 614 3784C34B0E11AA34007D8D48 /* FontTraitsMask.h in Headers */ = {isa = PBXBuildFile; fileRef = 3784C34A0E11AA34007D8D48 /* FontTraitsMask.h */; settings = {ATTRIBUTES = (Private, ); }; }; 614 615 37919C230B7D188600A56998 /* PositionIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37919C210B7D188600A56998 /* PositionIterator.cpp */; }; … … 5525 5526 3724CA7D0E68B20500DB4384 /* FontMacCoreText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontMacCoreText.cpp; sourceTree = "<group>"; }; 5526 5527 3744570E0DB05FA500AE0992 /* SVGGlyphMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGGlyphMap.h; sourceTree = "<group>"; }; 5528 3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverlapTestRequestClient.h; sourceTree = "<group>"; }; 5527 5529 3784C34A0E11AA34007D8D48 /* FontTraitsMask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontTraitsMask.h; sourceTree = "<group>"; }; 5528 5530 37919C210B7D188600A56998 /* PositionIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PositionIterator.cpp; sourceTree = "<group>"; }; … … 14354 14356 A8F5C0B60F9285AC0098E06B /* RenderSVGModelObject.h */, 14355 14357 A8F5C0B70F9285AC0098E06B /* RenderSVGModelObject.cpp */, 14358 3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */, 14356 14359 ); 14357 14360 path = rendering; … … 16848 16851 93B2D8160F9920D2006AE6B2 /* SuddenTermination.h in Headers */, 16849 16852 5D15E3AC0F9E6AC1009E0E3F /* XMLTokenizerScope.h in Headers */, 16853 3774ABA50FA21EB400AD7DE9 /* OverlapTestRequestClient.h in Headers */, 16850 16854 ); 16851 16855 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/page/FrameView.cpp
r42592 r42849 168 168 { 169 169 m_useSlowRepaints = false; 170 m_isOverlapped = false; 170 171 m_borderX = 30; 171 172 m_borderY = 30; … … 672 673 bool FrameView::useSlowRepaints() const 673 674 { 674 return m_useSlowRepaints || m_slowRepaintObjectCount > 0 ;675 return m_useSlowRepaints || m_slowRepaintObjectCount > 0 || m_isOverlapped; 675 676 } 676 677 … … 693 694 m_slowRepaintObjectCount--; 694 695 if (!m_slowRepaintObjectCount) 695 setCanBlitOnScroll(!m_useSlowRepaints); 696 setCanBlitOnScroll(!useSlowRepaints()); 697 } 698 699 void FrameView::setIsOverlapped(bool isOverlapped) 700 { 701 if (isOverlapped == m_isOverlapped) 702 return; 703 704 m_isOverlapped = isOverlapped; 705 setCanBlitOnScroll(!useSlowRepaints()); 696 706 } 697 707 -
trunk/WebCore/page/FrameView.h
r42464 r42849 144 144 145 145 void setUseSlowRepaints(); 146 void setIsOverlapped(bool); 146 147 147 148 void addSlowRepaintObject(); … … 194 195 virtual bool isFrameView() const; 195 196 197 friend class RenderWidget; 196 198 bool useSlowRepaints() const; 197 199 … … 231 233 ScrollbarMode m_hmode; 232 234 bool m_useSlowRepaints; 235 bool m_isOverlapped; 233 236 unsigned m_slowRepaintObjectCount; 234 237 -
trunk/WebCore/rendering/RenderLayer.cpp
r42291 r42849 64 64 #include "HitTestResult.h" 65 65 #include "OverflowEvent.h" 66 #include "OverlapTestRequestClient.h" 66 67 #include "Page.h" 67 68 #include "PlatformMouseEvent.h" … … 1887 1888 } 1888 1889 1889 void 1890 RenderLayer::paint(GraphicsContext* p, const IntRect& damageRect, PaintRestriction paintRestriction, RenderObject *paintingRoot) 1891 { 1892 paintLayer(this, p, damageRect, false, paintRestriction, paintingRoot); 1890 void RenderLayer::paint(GraphicsContext* p, const IntRect& damageRect, PaintRestriction paintRestriction, RenderObject *paintingRoot) 1891 { 1892 RenderObject::OverlapTestRequestMap overlapTestRequests; 1893 paintLayer(this, p, damageRect, false, paintRestriction, paintingRoot, &overlapTestRequests); 1894 RenderObject::OverlapTestRequestMap::iterator end = overlapTestRequests.end(); 1895 for (RenderObject::OverlapTestRequestMap::iterator it = overlapTestRequests.begin(); it != end; ++it) 1896 it->first->setOverlapTestResult(false); 1893 1897 } 1894 1898 … … 1911 1915 RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* p, 1912 1916 const IntRect& paintDirtyRect, bool haveTransparency, PaintRestriction paintRestriction, 1913 RenderObject* paintingRoot, bool appliedTransform, bool temporaryClipRects) 1917 RenderObject* paintingRoot, RenderObject::OverlapTestRequestMap* overlapTestRequests, 1918 bool appliedTransform, bool temporaryClipRects) 1914 1919 { 1915 1920 #if USE(ACCELERATED_COMPOSITING) … … 1969 1974 1970 1975 // Now do a paint with the root layer shifted to be us. 1971 paintLayer(this, p, transform.inverse().mapRect(paintDirtyRect), haveTransparency, paintRestriction, paintingRoot, true, temporaryClipRects);1976 paintLayer(this, p, transform.inverse().mapRect(paintDirtyRect), haveTransparency, paintRestriction, paintingRoot, overlapTestRequests, true, temporaryClipRects); 1972 1977 1973 1978 p->restore(); … … 1983 1988 // Mark that we are now inside replica painting. 1984 1989 m_paintingInsideReflection = true; 1985 reflectionLayer()->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, paintRestriction, paintingRoot, false, temporaryClipRects);1990 reflectionLayer()->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, paintRestriction, paintingRoot, overlapTestRequests, false, temporaryClipRects); 1986 1991 m_paintingInsideReflection = false; 1987 1992 } … … 2009 2014 paintingRootForRenderer = paintingRoot; 2010 2015 2016 if (overlapTestRequests) { 2017 Vector<OverlapTestRequestClient*> overlappedRequestClients; 2018 RenderObject::OverlapTestRequestMap::iterator end = overlapTestRequests->end(); 2019 for (RenderObject::OverlapTestRequestMap::iterator it = overlapTestRequests->begin(); it != end; ++it) { 2020 if (!layerBounds.intersects(it->second)) 2021 continue; 2022 2023 it->first->setOverlapTestResult(true); 2024 overlappedRequestClients.append(it->first); 2025 } 2026 for (size_t i = 0; i < overlappedRequestClients.size(); ++i) 2027 overlapTestRequests->remove(overlappedRequestClients[i]); 2028 } 2029 2011 2030 // We want to paint our layer, but only if we intersect the damage rect. 2012 2031 bool shouldPaint = intersectsDamageRect(layerBounds, damageRect, rootLayer) && m_hasVisibleContent; … … 2031 2050 if (m_negZOrderList) 2032 2051 for (Vector<RenderLayer*>::iterator it = m_negZOrderList->begin(); it != m_negZOrderList->end(); ++it) 2033 it[0]->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, paintRestriction, paintingRoot, false, temporaryClipRects);2052 it[0]->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, paintRestriction, paintingRoot, overlapTestRequests, false, temporaryClipRects); 2034 2053 2035 2054 // Now establish the appropriate clip and paint our child RenderObjects. … … 2049 2068 renderer()->paint(paintInfo, tx, ty); 2050 2069 paintInfo.phase = PaintPhaseForeground; 2070 paintInfo.overlapTestRequests = overlapTestRequests; 2051 2071 renderer()->paint(paintInfo, tx, ty); 2052 2072 paintInfo.phase = PaintPhaseChildOutlines; … … 2070 2090 for (Vector<RenderLayer*>::iterator it = m_normalFlowList->begin(); it != m_normalFlowList->end(); ++it) { 2071 2091 if (it[0]->isSelfPaintingLayer()) 2072 it[0]->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, paintRestriction, paintingRoot, false, temporaryClipRects);2092 it[0]->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, paintRestriction, paintingRoot, overlapTestRequests, false, temporaryClipRects); 2073 2093 } 2074 2094 … … 2076 2096 if (m_posZOrderList) 2077 2097 for (Vector<RenderLayer*>::iterator it = m_posZOrderList->begin(); it != m_posZOrderList->end(); ++it) 2078 it[0]->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, paintRestriction, paintingRoot, false, temporaryClipRects);2098 it[0]->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, paintRestriction, paintingRoot, overlapTestRequests, false, temporaryClipRects); 2079 2099 2080 2100 if (renderer()->hasMask() && shouldPaint && !selectionOnly && !damageRect.isEmpty()) { -
trunk/WebCore/rendering/RenderLayer.h
r42291 r42849 442 442 void paintLayer(RenderLayer* rootLayer, GraphicsContext*, const IntRect& paintDirtyRect, 443 443 bool haveTransparency, PaintRestriction, RenderObject* paintingRoot, 444 RenderObject::OverlapTestRequestMap* = 0, 444 445 bool appliedTransform = false, bool temporaryClipRects = false); 445 446 -
trunk/WebCore/rendering/RenderObject.h
r42840 r42849 42 42 class InlineBox; 43 43 class InlineFlowBox; 44 class OverlapTestRequestClient; 44 45 class Position; 45 46 class RenderBoxModelObject; … … 434 435 virtual int baselinePosition(bool firstLine, bool isRootLineBox = false) const; 435 436 437 typedef HashMap<OverlapTestRequestClient*, IntRect> OverlapTestRequestMap; 438 436 439 /* 437 440 * Paint the object and its children, clipped by (x|y|w|h). … … 440 443 struct PaintInfo { 441 444 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase newPhase, bool newForceBlackText, 442 RenderObject* newPaintingRoot, ListHashSet<RenderInline*>* newOutlineObjects) 445 RenderObject* newPaintingRoot, ListHashSet<RenderInline*>* newOutlineObjects, 446 OverlapTestRequestMap* overlapTestRequests = 0) 443 447 : context(newContext) 444 448 , rect(newRect) … … 447 451 , paintingRoot(newPaintingRoot) 448 452 , outlineObjects(newOutlineObjects) 453 , overlapTestRequests(overlapTestRequests) 449 454 { 450 455 } … … 456 461 RenderObject* paintingRoot; // used to draw just one element and its visual kids 457 462 ListHashSet<RenderInline*>* outlineObjects; // used to list outlines that should be painted by a block with inline children 463 OverlapTestRequestMap* overlapTestRequests; 458 464 }; 459 465 -
trunk/WebCore/rendering/RenderReplica.cpp
r40318 r42849 73 73 layer()->parent()->paintLayer(layer()->transform() ? layer()->parent() : layer()->enclosingTransformedAncestor(), 74 74 paintInfo.context, paintInfo.rect, 75 true, PaintRestrictionNone, 0, 75 true, PaintRestrictionNone, 0, 0, 76 76 true, // appliedTransform 77 77 true); // temporaryClipRects -
trunk/WebCore/rendering/RenderWidget.cpp
r41945 r42849 212 212 // to paint itself. That way it will composite properly with z-indexed layers. 213 213 m_widget->paint(paintInfo.context, paintInfo.rect); 214 215 if (m_widget->isFrameView() && paintInfo.overlapTestRequests && !static_cast<FrameView*>(m_widget)->useSlowRepaints()) { 216 ASSERT(!paintInfo.overlapTestRequests->contains(this)); 217 paintInfo.overlapTestRequests->set(this, m_widget->frameRect()); 218 } 214 219 } 215 220 … … 222 227 paintInfo.context->fillRect(selectionRect(), selectionBackgroundColor()); 223 228 } 229 } 230 231 void RenderWidget::setOverlapTestResult(bool isOverlapped) 232 { 233 ASSERT(m_widget); 234 ASSERT(m_widget->isFrameView()); 235 static_cast<FrameView*>(m_widget)->setIsOverlapped(isOverlapped); 224 236 } 225 237 -
trunk/WebCore/rendering/RenderWidget.h
r40987 r42849 25 25 #define RenderWidget_h 26 26 27 #include "OverlapTestRequestClient.h" 27 28 #include "RenderReplaced.h" 28 29 … … 31 32 class Widget; 32 33 33 class RenderWidget : public RenderReplaced {34 class RenderWidget : public RenderReplaced, private OverlapTestRequestClient { 34 35 public: 35 36 RenderWidget(Node*); … … 65 66 virtual void deleteWidget(); 66 67 68 // OverlapTestRequestClient 69 virtual void setOverlapTestResult(bool); 70 67 71 protected: 68 72 Widget* m_widget;
Note:
See TracChangeset
for help on using the changeset viewer.