Changeset 87832 in webkit
- Timestamp:
- Jun 1, 2011 11:41:23 AM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r87831 r87832 1 2011-06-01 Adam Roben <aroben@apple.com> 2 3 Delete a bunch of dead code in DrawingAreaImpl 4 5 LayerTreeHost::participatesInDisplay always returns false now, which means a bunch of code 6 in DrawingAreaImpl no longer runs. 7 8 Cleanup after fixing <http://webkit.org/b/58054> 9 <rdar://problem/9249839> REGRESSION (WebKit2): Accelerated CSS animations have a lower 10 framerate than in WebKit1 11 12 Reviewed by Anders Carlsson. 13 14 * WebProcess/WebPage/DrawingAreaImpl.cpp: 15 (WebKit::DrawingAreaImpl::forceRepaint): 16 (WebKit::DrawingAreaImpl::layerHostDidFlushLayers): 17 (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): 18 (WebKit::DrawingAreaImpl::didUpdate): 19 (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): 20 (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): 21 (WebKit::DrawingAreaImpl::scheduleDisplay): 22 (WebKit::DrawingAreaImpl::displayTimerFired): 23 (WebKit::DrawingAreaImpl::display): 24 * WebProcess/WebPage/DrawingAreaImpl.h: 25 * WebProcess/WebPage/LayerTreeHost.h: 26 Reverted r82959. 27 1 28 2011-06-01 Adam Roben <aroben@apple.com> 2 29 -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
r87755 r87832 186 186 layerHostDidFlushLayers(); 187 187 } 188 if (!m_layerTreeHost->participatesInDisplay()) 189 return; 188 return; 190 189 } 191 190 … … 218 217 } 219 218 220 void DrawingAreaImpl::setLayerHostNeedsDisplay()221 {222 ASSERT(m_layerTreeHost);223 ASSERT(m_layerTreeHost->participatesInDisplay());224 scheduleDisplay();225 }226 227 219 void DrawingAreaImpl::layerHostDidFlushLayers() 228 220 { … … 236 228 } 237 229 238 if (!m_layerTreeHost || m_layerTreeHost->participatesInDisplay()) { 239 // When the layer tree host participates in display, we never tell the UI process about 240 // accelerated compositing. From the UI process's point of view, we're still just sending 241 // it a series of bitmaps in Update messages. 242 return; 243 } 230 if (!m_layerTreeHost) 231 return; 244 232 245 233 #if USE(ACCELERATED_COMPOSITING) … … 356 344 UpdateInfo updateInfo; 357 345 358 if (!m_isPaintingSuspended && (!m_layerTreeHost || m_layerTreeHost->participatesInDisplay()))346 if (!m_isPaintingSuspended && !m_layerTreeHost) 359 347 display(updateInfo); 360 348 361 349 LayerTreeContext layerTreeContext; 362 350 363 if (m_isPaintingSuspended || (m_layerTreeHost && !m_layerTreeHost->participatesInDisplay())) {351 if (m_isPaintingSuspended || m_layerTreeHost) { 364 352 updateInfo.viewSize = m_webPage->size(); 365 353 … … 384 372 // We might get didUpdate messages from the UI process even after we've 385 373 // entered accelerated compositing mode. Ignore them. 386 if (m_layerTreeHost && !m_layerTreeHost->participatesInDisplay())374 if (m_layerTreeHost) 387 375 return; 388 376 … … 438 426 m_scrollRect = IntRect(); 439 427 m_scrollOffset = IntSize(); 440 441 if (!m_layerTreeHost->participatesInDisplay()) { 442 m_displayTimer.stop(); 443 m_isWaitingForDidUpdate = false; 444 } 428 m_displayTimer.stop(); 429 m_isWaitingForDidUpdate = false; 445 430 } 446 431 … … 456 441 457 442 ASSERT(m_layerTreeHost); 458 459 bool wasParticipatingInDisplay = m_layerTreeHost->participatesInDisplay();460 443 461 444 m_layerTreeHost->invalidate(); … … 478 461 479 462 #if USE(ACCELERATED_COMPOSITING) 480 if (wasParticipatingInDisplay) { 481 // When the layer tree host participates in display, we never tell the UI process about 482 // accelerated compositing. From the UI process's point of view, we're still just sending 483 // it a series of bitmaps in Update messages. 463 // Send along a complete update of the page so we can paint the contents right after we exit the 464 // accelerated compositing mode, eliminiating flicker. 465 if (m_compositingAccordingToProxyMessages) { 466 m_webPage->send(Messages::DrawingAreaProxy::ExitAcceleratedCompositingMode(m_backingStoreStateID, updateInfo)); 467 m_compositingAccordingToProxyMessages = false; 468 } else { 469 // If we left accelerated compositing mode before we sent an EnterAcceleratedCompositingMode message to the 470 // UI process, we still need to let it know about the new contents, so send an Update message. 484 471 m_webPage->send(Messages::DrawingAreaProxy::Update(m_backingStoreStateID, updateInfo)); 485 } else {486 // Send along a complete update of the page so we can paint the contents right after we exit the487 // accelerated compositing mode, eliminiating flicker.488 if (m_compositingAccordingToProxyMessages) {489 m_webPage->send(Messages::DrawingAreaProxy::ExitAcceleratedCompositingMode(m_backingStoreStateID, updateInfo));490 m_compositingAccordingToProxyMessages = false;491 } else {492 // If we left accelerated compositing mode before we sent an EnterAcceleratedCompositingMode message to the493 // UI process, we still need to let it know about the new contents, so send an Update message.494 m_webPage->send(Messages::DrawingAreaProxy::Update(m_backingStoreStateID, updateInfo));495 }496 472 } 497 473 #endif … … 513 489 void DrawingAreaImpl::scheduleDisplay() 514 490 { 515 ASSERT(!m_layerTreeHost || m_layerTreeHost->participatesInDisplay());491 ASSERT(!m_layerTreeHost); 516 492 517 493 if (m_isWaitingForDidUpdate) … … 521 497 return; 522 498 523 if (m_layerTreeHost) { 524 if (!m_layerTreeHost->needsDisplay()) 525 return; 526 } else if (m_dirtyRegion.isEmpty()) 527 return; 499 if (m_dirtyRegion.isEmpty()) 500 return; 528 501 529 502 if (m_displayTimer.isActive()) … … 543 516 544 517 double timeSinceLastDisplay = currentTime() - m_lastDisplayTime; 545 double timeUntilLayerTreeHostNeedsDisplay = m_layerTreeHost && m_layerTreeHost->participatesInDisplay() ? m_layerTreeHost->timeUntilNextDisplay() : 0; 546 double timeUntilNextDisplay = max(minimumFrameInterval - timeSinceLastDisplay, timeUntilLayerTreeHostNeedsDisplay); 518 double timeUntilNextDisplay = minimumFrameInterval - timeSinceLastDisplay; 547 519 548 520 if (timeUntilNextDisplay > 0) { … … 556 528 void DrawingAreaImpl::display() 557 529 { 558 ASSERT(!m_layerTreeHost || m_layerTreeHost->participatesInDisplay());530 ASSERT(!m_layerTreeHost); 559 531 ASSERT(!m_isWaitingForDidUpdate); 560 532 ASSERT(!m_inUpdateBackingStoreState); … … 563 535 return; 564 536 565 if (m_layerTreeHost) { 566 if (!m_layerTreeHost->needsDisplay()) 567 return; 568 } else if (m_dirtyRegion.isEmpty()) 537 if (m_dirtyRegion.isEmpty()) 569 538 return; 570 539 … … 577 546 display(updateInfo); 578 547 579 if (m_layerTreeHost && !m_layerTreeHost->participatesInDisplay()) {548 if (m_layerTreeHost) { 580 549 // The call to update caused layout which turned on accelerated compositing. 581 550 // Don't send an Update message in this case. … … 611 580 { 612 581 ASSERT(!m_isPaintingSuspended); 613 ASSERT(!m_layerTreeHost || m_layerTreeHost->participatesInDisplay());582 ASSERT(!m_layerTreeHost); 614 583 ASSERT(!m_webPage->size().isEmpty()); 615 584 … … 625 594 // The layout may have put the page into accelerated compositing mode. If the LayerTreeHost is 626 595 // in charge of displaying, we have nothing more to do. 627 if (m_layerTreeHost && !m_layerTreeHost->participatesInDisplay())596 if (m_layerTreeHost) 628 597 return; 629 598 630 599 updateInfo.viewSize = m_webPage->size(); 631 600 632 if (m_layerTreeHost) 633 m_layerTreeHost->display(updateInfo); 634 else { 635 IntRect bounds = m_dirtyRegion.bounds(); 636 ASSERT(m_webPage->bounds().contains(bounds)); 637 638 RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(bounds.size(), ShareableBitmap::SupportsAlpha); 639 if (!bitmap) 640 return; 641 642 if (!bitmap->createHandle(updateInfo.bitmapHandle)) 643 return; 644 645 Vector<IntRect> rects = m_dirtyRegion.rects(); 646 647 if (shouldPaintBoundsRect(bounds, rects)) { 648 rects.clear(); 649 rects.append(bounds); 650 } 651 652 updateInfo.scrollRect = m_scrollRect; 653 updateInfo.scrollOffset = m_scrollOffset; 654 655 m_dirtyRegion = Region(); 656 m_scrollRect = IntRect(); 657 m_scrollOffset = IntSize(); 658 659 OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext(); 660 661 updateInfo.updateRectBounds = bounds; 662 663 graphicsContext->translate(-bounds.x(), -bounds.y()); 664 665 for (size_t i = 0; i < rects.size(); ++i) { 666 m_webPage->drawRect(*graphicsContext, rects[i]); 667 if (m_webPage->hasPageOverlay()) 668 m_webPage->drawPageOverlay(*graphicsContext, rects[i]); 669 updateInfo.updateRects.append(rects[i]); 670 } 601 IntRect bounds = m_dirtyRegion.bounds(); 602 ASSERT(m_webPage->bounds().contains(bounds)); 603 604 RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(bounds.size(), ShareableBitmap::SupportsAlpha); 605 if (!bitmap) 606 return; 607 608 if (!bitmap->createHandle(updateInfo.bitmapHandle)) 609 return; 610 611 Vector<IntRect> rects = m_dirtyRegion.rects(); 612 613 if (shouldPaintBoundsRect(bounds, rects)) { 614 rects.clear(); 615 rects.append(bounds); 616 } 617 618 updateInfo.scrollRect = m_scrollRect; 619 updateInfo.scrollOffset = m_scrollOffset; 620 621 m_dirtyRegion = Region(); 622 m_scrollRect = IntRect(); 623 m_scrollOffset = IntSize(); 624 625 OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext(); 626 627 updateInfo.updateRectBounds = bounds; 628 629 graphicsContext->translate(-bounds.x(), -bounds.y()); 630 631 for (size_t i = 0; i < rects.size(); ++i) { 632 m_webPage->drawRect(*graphicsContext, rects[i]); 633 if (m_webPage->hasPageOverlay()) 634 m_webPage->drawPageOverlay(*graphicsContext, rects[i]); 635 updateInfo.updateRects.append(rects[i]); 671 636 } 672 637 -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
r87806 r87832 41 41 virtual ~DrawingAreaImpl(); 42 42 43 void setLayerHostNeedsDisplay();44 43 void layerHostDidFlushLayers(); 45 44 -
trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
r87831 r87832 72 72 virtual void resumeRendering() { } 73 73 74 // If a derived class overrides this function to return true, the derived class must also75 // override the functions beneath it.76 virtual bool participatesInDisplay() { return false; }77 virtual bool needsDisplay() { ASSERT_NOT_REACHED(); return false; }78 virtual double timeUntilNextDisplay() { ASSERT_NOT_REACHED(); return 0; }79 virtual void display(UpdateInfo&) { ASSERT_NOT_REACHED(); }80 81 74 #if PLATFORM(WIN) 82 75 virtual void scheduleChildWindowGeometryUpdate(const WindowGeometry&) = 0;
Note: See TracChangeset
for help on using the changeset viewer.