Changeset 69162 in webkit
- Timestamp:
- Oct 5, 2010 4:55:49 PM (13 years ago)
- Location:
- trunk/WebKit/chromium
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/chromium/ChangeLog
r69157 r69162 1 2010-10-05 Nat Duca <nduca@chromium.org> 2 3 Reviewed by James Robinson. 4 5 [chromium] Handle composited root layer invalidations in screenspace, 6 fixing the disappearing scrollbar problem. 7 https://bugs.webkit.org/show_bug.cgi?id=46864 8 9 * src/WebViewImpl.cpp: 10 (WebKit::WebViewImpl::composite): 11 (WebKit::WebViewImpl::scrollRootLayerRect): 12 (WebKit::WebViewImpl::invalidateRootLayerRect): 13 (WebKit::WebViewImpl::doComposite): 14 1 15 2010-10-05 Kenneth Russell <kbr@google.com> 2 16 -
trunk/WebKit/chromium/src/WebViewImpl.cpp
r69053 r69162 2258 2258 2259 2259 IntRect contentRect = view->visibleContentRect(false); 2260 IntRect screenRect = view->contentsToWindow(contentRect); 2260 2261 2261 2262 // We support fast scrolling in one direction at a time. 2262 2263 if (scrollDelta.width() && scrollDelta.height()) { 2263 invalidateRootLayerRect(WebRect( contentRect));2264 invalidateRootLayerRect(WebRect(screenRect)); 2264 2265 return; 2265 2266 } … … 2271 2272 if (scrollDelta.width()) { 2272 2273 int dx = scrollDelta.width(); 2273 damagedContentsRect.setY( contentRect.y());2274 damagedContentsRect.setHeight( contentRect.height());2274 damagedContentsRect.setY(screenRect.y()); 2275 damagedContentsRect.setHeight(screenRect.height()); 2275 2276 if (dx > 0) { 2276 damagedContentsRect.setX( contentRect.x());2277 damagedContentsRect.setX(screenRect.x()); 2277 2278 damagedContentsRect.setWidth(dx); 2278 2279 } else { 2279 damagedContentsRect.setX( contentRect.right() + dx);2280 damagedContentsRect.setX(screenRect.right() + dx); 2280 2281 damagedContentsRect.setWidth(-dx); 2281 2282 } 2282 2283 } else { 2283 2284 int dy = scrollDelta.height(); 2284 damagedContentsRect.setX( contentRect.x());2285 damagedContentsRect.setWidth( contentRect.width());2285 damagedContentsRect.setX(screenRect.x()); 2286 damagedContentsRect.setWidth(screenRect.width()); 2286 2287 if (dy > 0) { 2287 damagedContentsRect.setY( contentRect.y());2288 damagedContentsRect.setY(screenRect.y()); 2288 2289 damagedContentsRect.setHeight(dy); 2289 2290 } else { 2290 damagedContentsRect.setY( contentRect.bottom() + dy);2291 damagedContentsRect.setY(screenRect.bottom() + dy); 2291 2292 damagedContentsRect.setHeight(-dy); 2292 2293 } … … 2294 2295 2295 2296 m_rootLayerScrollDamage.unite(damagedContentsRect); 2297 2298 // Scroll any existing damage that intersects with clip rect 2299 if (clipRect.intersects(m_rootLayerDirtyRect)) { 2300 // Find the inner damage 2301 IntRect innerDamage(clipRect); 2302 innerDamage.intersect(m_rootLayerDirtyRect); 2303 2304 // Move the damage 2305 innerDamage.move(scrollDelta.width(), scrollDelta.height()); 2306 2307 // Merge it back into the damaged rect 2308 m_rootLayerDirtyRect.unite(innerDamage); 2309 } 2310 2296 2311 setRootLayerNeedsDisplay(); 2297 2312 } … … 2308 2323 if (!page()) 2309 2324 return; 2310 FrameView* view = page()->mainFrame()->view();2311 2312 // rect is in viewport space. Convert to content space2313 // so that invalidations and scroll invalidations play well with one-another.2314 IntRect contentRect = view->windowToContents(rect);2315 2325 2316 2326 // FIXME: add a smarter damage aggregation logic and/or unify with 2317 2327 // LayerChromium's damage logic 2318 m_rootLayerDirtyRect.unite( contentRect);2328 m_rootLayerDirtyRect.unite(rect); 2319 2329 setRootLayerNeedsDisplay(); 2320 2330 } … … 2426 2436 damageRects.append(m_rootLayerDirtyRect); 2427 2437 for (size_t i = 0; i < damageRects.size(); ++i) { 2428 // The damage rect for the root layer is in content space [e.g. unscrolled]. 2429 // Convert from content space to viewPort space. 2430 const IntRect damagedContentRect = damageRects[i]; 2431 IntRect damagedRect = view->contentsToWindow(damagedContentRect); 2438 IntRect damagedRect = damageRects[i]; 2432 2439 2433 2440 // Intersect this rectangle with the viewPort.
Note: See TracChangeset
for help on using the changeset viewer.