Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp (87831 => 87832)
--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp 2011-06-01 18:39:19 UTC (rev 87831)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp 2011-06-01 18:41:23 UTC (rev 87832)
@@ -185,8 +185,7 @@
m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(false);
layerHostDidFlushLayers();
}
- if (!m_layerTreeHost->participatesInDisplay())
- return;
+ return;
}
m_isWaitingForDidUpdate = false;
@@ -217,13 +216,6 @@
setNeedsDisplay(rect);
}
-void DrawingAreaImpl::setLayerHostNeedsDisplay()
-{
- ASSERT(m_layerTreeHost);
- ASSERT(m_layerTreeHost->participatesInDisplay());
- scheduleDisplay();
-}
-
void DrawingAreaImpl::layerHostDidFlushLayers()
{
ASSERT(m_layerTreeHost);
@@ -235,12 +227,8 @@
return;
}
- if (!m_layerTreeHost || m_layerTreeHost->participatesInDisplay()) {
- // When the layer tree host participates in display, we never tell the UI process about
- // accelerated compositing. From the UI process's point of view, we're still just sending
- // it a series of bitmaps in Update messages.
+ if (!m_layerTreeHost)
return;
- }
#if USE(ACCELERATED_COMPOSITING)
ASSERT(!m_compositingAccordingToProxyMessages);
@@ -355,12 +343,12 @@
UpdateInfo updateInfo;
- if (!m_isPaintingSuspended && (!m_layerTreeHost || m_layerTreeHost->participatesInDisplay()))
+ if (!m_isPaintingSuspended && !m_layerTreeHost)
display(updateInfo);
LayerTreeContext layerTreeContext;
- if (m_isPaintingSuspended || (m_layerTreeHost && !m_layerTreeHost->participatesInDisplay())) {
+ if (m_isPaintingSuspended || m_layerTreeHost) {
updateInfo.viewSize = m_webPage->size();
if (m_layerTreeHost) {
@@ -383,7 +371,7 @@
{
// We might get didUpdate messages from the UI process even after we've
// entered accelerated compositing mode. Ignore them.
- if (m_layerTreeHost && !m_layerTreeHost->participatesInDisplay())
+ if (m_layerTreeHost)
return;
m_isWaitingForDidUpdate = false;
@@ -437,11 +425,8 @@
m_dirtyRegion = Region();
m_scrollRect = IntRect();
m_scrollOffset = IntSize();
-
- if (!m_layerTreeHost->participatesInDisplay()) {
- m_displayTimer.stop();
- m_isWaitingForDidUpdate = false;
- }
+ m_displayTimer.stop();
+ m_isWaitingForDidUpdate = false;
}
void DrawingAreaImpl::exitAcceleratedCompositingMode()
@@ -456,8 +441,6 @@
ASSERT(m_layerTreeHost);
- bool wasParticipatingInDisplay = m_layerTreeHost->participatesInDisplay();
-
m_layerTreeHost->invalidate();
m_layerTreeHost = nullptr;
m_dirtyRegion = m_webPage->bounds();
@@ -477,22 +460,15 @@
display(updateInfo);
#if USE(ACCELERATED_COMPOSITING)
- if (wasParticipatingInDisplay) {
- // When the layer tree host participates in display, we never tell the UI process about
- // accelerated compositing. From the UI process's point of view, we're still just sending
- // it a series of bitmaps in Update messages.
- m_webPage->send(Messages::DrawingAreaProxy::Update(m_backingStoreStateID, updateInfo));
+ // Send along a complete update of the page so we can paint the contents right after we exit the
+ // accelerated compositing mode, eliminiating flicker.
+ if (m_compositingAccordingToProxyMessages) {
+ m_webPage->send(Messages::DrawingAreaProxy::ExitAcceleratedCompositingMode(m_backingStoreStateID, updateInfo));
+ m_compositingAccordingToProxyMessages = false;
} else {
- // Send along a complete update of the page so we can paint the contents right after we exit the
- // accelerated compositing mode, eliminiating flicker.
- if (m_compositingAccordingToProxyMessages) {
- m_webPage->send(Messages::DrawingAreaProxy::ExitAcceleratedCompositingMode(m_backingStoreStateID, updateInfo));
- m_compositingAccordingToProxyMessages = false;
- } else {
- // If we left accelerated compositing mode before we sent an EnterAcceleratedCompositingMode message to the
- // UI process, we still need to let it know about the new contents, so send an Update message.
- m_webPage->send(Messages::DrawingAreaProxy::Update(m_backingStoreStateID, updateInfo));
- }
+ // If we left accelerated compositing mode before we sent an EnterAcceleratedCompositingMode message to the
+ // UI process, we still need to let it know about the new contents, so send an Update message.
+ m_webPage->send(Messages::DrawingAreaProxy::Update(m_backingStoreStateID, updateInfo));
}
#endif
}
@@ -512,7 +488,7 @@
void DrawingAreaImpl::scheduleDisplay()
{
- ASSERT(!m_layerTreeHost || m_layerTreeHost->participatesInDisplay());
+ ASSERT(!m_layerTreeHost);
if (m_isWaitingForDidUpdate)
return;
@@ -520,11 +496,8 @@
if (m_isPaintingSuspended)
return;
- if (m_layerTreeHost) {
- if (!m_layerTreeHost->needsDisplay())
- return;
- } else if (m_dirtyRegion.isEmpty())
- return;
+ if (m_dirtyRegion.isEmpty())
+ return;
if (m_displayTimer.isActive())
return;
@@ -542,8 +515,7 @@
#endif
double timeSinceLastDisplay = currentTime() - m_lastDisplayTime;
- double timeUntilLayerTreeHostNeedsDisplay = m_layerTreeHost && m_layerTreeHost->participatesInDisplay() ? m_layerTreeHost->timeUntilNextDisplay() : 0;
- double timeUntilNextDisplay = max(minimumFrameInterval - timeSinceLastDisplay, timeUntilLayerTreeHostNeedsDisplay);
+ double timeUntilNextDisplay = minimumFrameInterval - timeSinceLastDisplay;
if (timeUntilNextDisplay > 0) {
m_displayTimer.startOneShot(timeUntilNextDisplay);
@@ -555,17 +527,14 @@
void DrawingAreaImpl::display()
{
- ASSERT(!m_layerTreeHost || m_layerTreeHost->participatesInDisplay());
+ ASSERT(!m_layerTreeHost);
ASSERT(!m_isWaitingForDidUpdate);
ASSERT(!m_inUpdateBackingStoreState);
if (m_isPaintingSuspended)
return;
- if (m_layerTreeHost) {
- if (!m_layerTreeHost->needsDisplay())
- return;
- } else if (m_dirtyRegion.isEmpty())
+ if (m_dirtyRegion.isEmpty())
return;
if (m_shouldSendDidUpdateBackingStoreState) {
@@ -576,7 +545,7 @@
UpdateInfo updateInfo;
display(updateInfo);
- if (m_layerTreeHost && !m_layerTreeHost->participatesInDisplay()) {
+ if (m_layerTreeHost) {
// The call to update caused layout which turned on accelerated compositing.
// Don't send an Update message in this case.
return;
@@ -610,7 +579,7 @@
void DrawingAreaImpl::display(UpdateInfo& updateInfo)
{
ASSERT(!m_isPaintingSuspended);
- ASSERT(!m_layerTreeHost || m_layerTreeHost->participatesInDisplay());
+ ASSERT(!m_layerTreeHost);
ASSERT(!m_webPage->size().isEmpty());
// FIXME: It would be better if we could avoid painting altogether when there is a custom representation.
@@ -624,50 +593,46 @@
// The layout may have put the page into accelerated compositing mode. If the LayerTreeHost is
// in charge of displaying, we have nothing more to do.
- if (m_layerTreeHost && !m_layerTreeHost->participatesInDisplay())
+ if (m_layerTreeHost)
return;
updateInfo.viewSize = m_webPage->size();
- if (m_layerTreeHost)
- m_layerTreeHost->display(updateInfo);
- else {
- IntRect bounds = m_dirtyRegion.bounds();
- ASSERT(m_webPage->bounds().contains(bounds));
+ IntRect bounds = m_dirtyRegion.bounds();
+ ASSERT(m_webPage->bounds().contains(bounds));
- RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(bounds.size(), ShareableBitmap::SupportsAlpha);
- if (!bitmap)
- return;
+ RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(bounds.size(), ShareableBitmap::SupportsAlpha);
+ if (!bitmap)
+ return;
- if (!bitmap->createHandle(updateInfo.bitmapHandle))
- return;
+ if (!bitmap->createHandle(updateInfo.bitmapHandle))
+ return;
- Vector<IntRect> rects = m_dirtyRegion.rects();
+ Vector<IntRect> rects = m_dirtyRegion.rects();
- if (shouldPaintBoundsRect(bounds, rects)) {
- rects.clear();
- rects.append(bounds);
- }
+ if (shouldPaintBoundsRect(bounds, rects)) {
+ rects.clear();
+ rects.append(bounds);
+ }
- updateInfo.scrollRect = m_scrollRect;
- updateInfo.scrollOffset = m_scrollOffset;
+ updateInfo.scrollRect = m_scrollRect;
+ updateInfo.scrollOffset = m_scrollOffset;
- m_dirtyRegion = Region();
- m_scrollRect = IntRect();
- m_scrollOffset = IntSize();
+ m_dirtyRegion = Region();
+ m_scrollRect = IntRect();
+ m_scrollOffset = IntSize();
- OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext();
-
- updateInfo.updateRectBounds = bounds;
+ OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext();
+
+ updateInfo.updateRectBounds = bounds;
- graphicsContext->translate(-bounds.x(), -bounds.y());
+ graphicsContext->translate(-bounds.x(), -bounds.y());
- for (size_t i = 0; i < rects.size(); ++i) {
- m_webPage->drawRect(*graphicsContext, rects[i]);
- if (m_webPage->hasPageOverlay())
- m_webPage->drawPageOverlay(*graphicsContext, rects[i]);
- updateInfo.updateRects.append(rects[i]);
- }
+ for (size_t i = 0; i < rects.size(); ++i) {
+ m_webPage->drawRect(*graphicsContext, rects[i]);
+ if (m_webPage->hasPageOverlay())
+ m_webPage->drawPageOverlay(*graphicsContext, rects[i]);
+ updateInfo.updateRects.append(rects[i]);
}
// Layout can trigger more calls to setNeedsDisplay and we don't want to process them