Diff
Modified: trunk/Source/WebKit2/ChangeLog (160976 => 160977)
--- trunk/Source/WebKit2/ChangeLog 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/ChangeLog 2013-12-22 16:45:31 UTC (rev 160977)
@@ -701,6 +701,83 @@
2013-12-18 Gavin Barraclough <[email protected]>
+ Add layer hosting mode to ViewState
+ https://bugs.webkit.org/show_bug.cgi?id=125803
+
+ Reviewed by Anders Carlsson.
+
+ When the view state of the page is updated the layer mode may also
+ change. Currently this is passed by a separate message, remove this
+ and fold it into ViewState.
+
+ Previously the setLayerHostingMode message would be passed to the
+ DrawingArea, which would inform the WebPage. Since the WebPage is
+ passed the SetVisibilityState messgae reverse this.
+
+ WebPageProxy had a policy of only updating the hosting mode when
+ visible - the value is sticky whilst the view is not visible. Make
+ this policy explicit in the PageClientImpl, rather then implicit
+ from the flow control.
+
+ * Shared/ViewState.h:
+ - Added ViewState::IsLayerWindowServerHosted.
+ * Shared/WebPageCreationParameters.cpp:
+ (WebKit::WebPageCreationParameters::encode):
+ (WebKit::WebPageCreationParameters::decode):
+ * Shared/WebPageCreationParameters.h:
+ - removed layerHostingMode.
+ * UIProcess/API/mac/PageClientImpl.h:
+ * UIProcess/API/mac/PageClientImpl.mm:
+ (WebKit::PageClientImpl::PageClientImpl):
+ (WebKit::PageClientImpl::isLayerWindowServerHosted):
+ (WebKit::PageClientImpl::viewWillMoveToAnotherWindow):
+ - viewLayerHostingMode -> isLayerWindowServerHosted, added m_layerHostingMode.
+ * UIProcess/DrawingAreaProxy.h:
+ - removed layerHostingModeDidChange.
+ * UIProcess/PageClient.h:
+ - viewLayerHostingMode -> isLayerWindowServerHosted.
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::WebPageProxy):
+ - removed m_layerHostingMode.
+ (WebKit::WebPageProxy::updateViewState):
+ - added IsLayerWindowServerHosted.
+ (WebKit::WebPageProxy::viewStateDidChange):
+ - changes to ViewState::IsInWindow implies ViewState::IsLayerWindowServerHosted may change too.
+ - remove special handling (separate message) for LayerHostingMode.
+ (WebKit::WebPageProxy::initializeCreationParameters):
+ - removed m_layerHostingMode.
+ * UIProcess/WebPageProxy.h:
+ - removed m_layerHostingMode.
+ * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
+ * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
+ - removed layerHostingModeDidChange.
+ * WebProcess/WebPage/DrawingArea.h:
+ (WebKit::DrawingArea::setLayerHostingMode):
+ (WebKit::DrawingArea::didUpdate):
+ - setLayerHostingMode takes a LayerHostingMode.
+ * WebProcess/WebPage/DrawingArea.messages.in:
+ - SetLayerHostingMode is no longer a message.
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::WebPage):
+ - removed m_layerHostingMode.
+ (WebKit::WebPage::setViewState):
+ - handle ViewState::IsLayerWindowServerHosted.
+ (WebKit::WebPage::setLayerHostingMode):
+ - moved from ~Mac.mm (matching other ViewState setters), calls to DrawingArea.
+ * WebProcess/WebPage/WebPage.h:
+ (WebKit::WebPage::layerHostingMode):
+ - layerHostingMode queries m_viewState, removed m_layerHostingMode.
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ - removed setLayerHostingMode.
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::setLayerHostingMode):
+ - setLayerHostingMode takes a LayerHostingMode, WebPage now calls to DrawingArea.
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+ - removed setLayerHostingMode.
+
+2013-12-18 Gavin Barraclough <[email protected]>
+
Fix page visibility api test, initialization in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=125933
Modified: trunk/Source/WebKit2/Shared/ViewState.h (160976 => 160977)
--- trunk/Source/WebKit2/Shared/ViewState.h 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/Shared/ViewState.h 2013-12-22 16:45:31 UTC (rev 160977)
@@ -34,13 +34,14 @@
IsFocused = 1 << 1,
IsVisible = 1 << 2,
IsInWindow = 1 << 3,
- WindowIsVisible = 1 << 4
+ WindowIsVisible = 1 << 4,
+ IsLayerWindowServerHosted = 1 << 5
};
typedef unsigned Flags;
static const Flags NoFlags = 0;
- static const Flags AllFlags = WindowIsActive | IsFocused | IsVisible | IsInWindow | WindowIsVisible;
+ static const Flags AllFlags = WindowIsActive | IsFocused | IsVisible | IsInWindow | WindowIsVisible | IsLayerWindowServerHosted;
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp (160976 => 160977)
--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2013-12-22 16:45:31 UTC (rev 160977)
@@ -62,7 +62,6 @@
encoder << backgroundExtendsBeyondPage;
#if PLATFORM(MAC)
- encoder.encodeEnum(layerHostingMode);
encoder << colorSpace;
#endif
}
@@ -125,8 +124,6 @@
return false;
#if PLATFORM(MAC)
- if (!decoder.decodeEnum(parameters.layerHostingMode))
- return false;
if (!decoder.decode(parameters.colorSpace))
return false;
#endif
Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.h (160976 => 160977)
--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.h 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.h 2013-12-22 16:45:31 UTC (rev 160977)
@@ -27,7 +27,6 @@
#define WebPageCreationParameters_h
#include "DrawingAreaInfo.h"
-#include "LayerTreeContext.h"
#include "SessionState.h"
#include "ViewState.h"
#include "WebCoreArgumentCoders.h"
@@ -100,7 +99,6 @@
bool backgroundExtendsBeyondPage;
#if PLATFORM(MAC)
- LayerHostingMode layerHostingMode;
ColorSpaceData colorSpace;
#endif
};
Modified: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h (160976 => 160977)
--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h 2013-12-22 16:45:31 UTC (rev 160977)
@@ -66,7 +66,9 @@
virtual bool isViewVisible();
virtual bool isWindowVisible();
virtual bool isViewInWindow();
- virtual LayerHostingMode viewLayerHostingMode() OVERRIDE;
+#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
+ virtual bool isLayerWindowServerHosted();
+#endif
virtual ColorSpaceData colorSpace() OVERRIDE;
virtual void setAcceleratedCompositingRootLayer(CALayer *) OVERRIDE;
@@ -163,6 +165,9 @@
#if USE(DICTATION_ALTERNATIVES)
OwnPtr<WebCore::AlternativeTextUIController> m_alternativeTextUIController;
#endif
+#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
+ bool m_isLayerWindowServerHosted;
+#endif
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm (160976 => 160977)
--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm 2013-12-22 16:45:31 UTC (rev 160977)
@@ -31,6 +31,7 @@
#import "DataReference.h"
#import "DictionaryPopupInfo.h"
#import "FindIndicator.h"
+#import "LayerTreeContext.h"
#import "NativeWebKeyboardEvent.h"
#import "StringUtilities.h"
#import "WKAPICast.h"
@@ -127,6 +128,9 @@
#if USE(DICTATION_ALTERNATIVES)
, m_alternativeTextUIController(adoptPtr(new AlternativeTextUIController))
#endif
+#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
+ , m_isLayerWindowServerHosted(true)
+#endif
{
}
@@ -215,21 +219,20 @@
return [m_wkView window];
}
-void PageClientImpl::viewWillMoveToAnotherWindow()
+#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
+bool PageClientImpl::isLayerWindowServerHosted()
{
- clearAllEditCommands();
+ // Only update m_isLayerWindowServerHosted when the view is in a window - otherwise just report the last value.
+ if ([m_wkView window])
+ m_isLayerWindowServerHosted = [[m_wkView window] _hostsLayersInWindowServer];
+
+ return m_isLayerWindowServerHosted;
}
+#endif
-LayerHostingMode PageClientImpl::viewLayerHostingMode()
+void PageClientImpl::viewWillMoveToAnotherWindow()
{
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
- if (![m_wkView window])
- return LayerHostingModeDefault;
-
- return [[m_wkView window] _hostsLayersInWindowServer] ? LayerHostingModeInWindowServer : LayerHostingModeDefault;
-#else
- return LayerHostingModeDefault;
-#endif
+ clearAllEditCommands();
}
ColorSpaceData PageClientImpl::colorSpace()
Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp (160976 => 160977)
--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp 2013-12-22 16:45:31 UTC (rev 160977)
@@ -130,11 +130,6 @@
backingStoreStateDidChange(RespondImmediately);
}
-void CoordinatedDrawingAreaProxy::layerHostingModeDidChange()
-{
- m_webPageProxy->process().send(Messages::DrawingArea::SetLayerHostingMode(m_webPageProxy->layerHostingMode()), m_webPageProxy->pageID());
-}
-
#if USE(ACCELERATED_COMPOSITING)
void CoordinatedDrawingAreaProxy::visibilityDidChange()
{
Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.h (160976 => 160977)
--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.h 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.h 2013-12-22 16:45:31 UTC (rev 160977)
@@ -70,7 +70,6 @@
// DrawingAreaProxy
virtual void sizeDidChange();
virtual void deviceScaleFactorDidChange();
- virtual void layerHostingModeDidChange() OVERRIDE;
virtual void setBackingStoreIsDiscardable(bool);
virtual void waitForBackingStoreUpdateOnNextPaint();
Modified: trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h (160976 => 160977)
--- trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h 2013-12-22 16:45:31 UTC (rev 160977)
@@ -53,8 +53,6 @@
virtual void deviceScaleFactorDidChange() = 0;
// FIXME: These should be pure virtual.
- virtual void layerHostingModeDidChange() { }
-
virtual void setBackingStoreIsDiscardable(bool) { }
virtual void waitForBackingStoreUpdateOnNextPaint() { }
Modified: trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp (160976 => 160977)
--- trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp 2013-12-22 16:45:31 UTC (rev 160977)
@@ -113,11 +113,6 @@
backingStoreStateDidChange(RespondImmediately);
}
-void DrawingAreaProxyImpl::layerHostingModeDidChange()
-{
- m_webPageProxy->process().send(Messages::DrawingArea::SetLayerHostingMode(m_webPageProxy->layerHostingMode()), m_webPageProxy->pageID());
-}
-
void DrawingAreaProxyImpl::setBackingStoreIsDiscardable(bool isBackingStoreDiscardable)
{
if (m_isBackingStoreDiscardable == isBackingStoreDiscardable)
Modified: trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h (160976 => 160977)
--- trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h 2013-12-22 16:45:31 UTC (rev 160977)
@@ -55,7 +55,6 @@
// DrawingAreaProxy
virtual void sizeDidChange();
virtual void deviceScaleFactorDidChange();
- virtual void layerHostingModeDidChange() OVERRIDE;
virtual void setBackingStoreIsDiscardable(bool);
virtual void waitForBackingStoreUpdateOnNextPaint();
Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (160976 => 160977)
--- trunk/Source/WebKit2/UIProcess/PageClient.h 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h 2013-12-22 16:45:31 UTC (rev 160977)
@@ -111,8 +111,10 @@
// Return whether the view is in a window.
virtual bool isViewInWindow() = 0;
- // Return the layer hosting mode for the view.
- virtual LayerHostingMode viewLayerHostingMode() { return LayerHostingModeDefault; }
+#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
+ // Return whether the layer is window server hosted.
+ virtual bool isLayerWindowServerHosted() = 0;
+#endif
virtual void processDidCrash() = 0;
virtual void didRelaunchProcess() = 0;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (160976 => 160977)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-12-22 16:45:31 UTC (rev 160977)
@@ -243,11 +243,6 @@
, m_pageScaleFactor(1)
, m_intrinsicDeviceScaleFactor(1)
, m_customDeviceScaleFactor(0)
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
- , m_layerHostingMode(LayerHostingModeInWindowServer)
-#else
- , m_layerHostingMode(LayerHostingModeDefault)
-#endif
, m_drawsBackground(true)
, m_drawsTransparentBackground(false)
, m_areMemoryCacheClientCallsEnabled(true)
@@ -947,6 +942,10 @@
m_viewState |= ViewState::IsVisible;
if (flagsToUpdate & ViewState::IsInWindow && m_pageClient.isViewInWindow())
m_viewState |= ViewState::IsInWindow;
+#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
+ if (flagsToUpdate & ViewState::IsLayerWindowServerHosted && m_pageClient.isLayerWindowServerHosted())
+ m_viewState |= ViewState::IsLayerWindowServerHosted;
+#endif
}
void WebPageProxy::viewStateDidChange(ViewState::Flags mayHaveChanged, WantsReplyOrNot wantsReply)
@@ -954,6 +953,10 @@
if (!isValid())
return;
+ // If the in-window state may have changed, then so may the layer hosting.
+ if (mayHaveChanged & ViewState::IsInWindow)
+ mayHaveChanged |= ViewState::IsLayerWindowServerHosted;
+
// Record the prior view state, update the flags that may have changed,
// and check which flags have actually changed.
ViewState::Flags previousViewState = m_viewState;
@@ -982,22 +985,13 @@
#endif
}
- if (mayHaveChanged & ViewState::IsInWindow) {
- if (m_viewState & ViewState::IsInWindow) {
- LayerHostingMode layerHostingMode = m_pageClient.viewLayerHostingMode();
- if (m_layerHostingMode != layerHostingMode) {
- m_layerHostingMode = layerHostingMode;
- m_drawingArea->layerHostingModeDidChange();
- }
- }
#if ENABLE(INPUT_TYPE_COLOR_POPOVER)
- else {
- // When leaving the current page, close the popover color well.
- if (m_colorPicker)
- endColorPicker();
- }
-#endif
+ if (mayHaveChanged & ViewState::IsInWindow && !(m_viewState & ViewState::IsInWindow)) {
+ // When leaving the current page, close the popover color well.
+ if (m_colorPicker)
+ endColorPicker();
}
+#endif
updateBackingStoreDiscardableState();
}
@@ -3913,11 +3907,8 @@
m_creationParameters.scrollPinningBehavior = m_scrollPinningBehavior;
m_creationParameters.backgroundExtendsBeyondPage = m_backgroundExtendsBeyondPage;
-#if PLATFORM(MAC)
- m_creationParameters.layerHostingMode = m_layerHostingMode;
-#if !PLATFORM(IOS)
+#if PLATFORM(MAC) && !PLATFORM(IOS)
m_creationParameters.colorSpace = m_pageClient.colorSpace();
-#endif // !PLATFORM(IOS)
#endif
}
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (160976 => 160977)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-12-22 16:45:31 UTC (rev 160977)
@@ -33,7 +33,6 @@
#include "DrawingAreaProxy.h"
#include "EditorState.h"
#include "GeolocationPermissionRequestManagerProxy.h"
-#include "LayerTreeContext.h"
#include "MessageSender.h"
#include "NotificationPermissionRequestManagerProxy.h"
#include "PageLoadState.h"
@@ -555,8 +554,6 @@
void setCustomDeviceScaleFactor(float);
void windowScreenDidChange(PlatformDisplayID);
- LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
-
void setUseFixedLayout(bool);
void setFixedLayoutSize(const WebCore::IntSize&);
bool useFixedLayout() const { return m_useFixedLayout; };
@@ -1240,8 +1237,6 @@
float m_intrinsicDeviceScaleFactor;
float m_customDeviceScaleFactor;
- LayerHostingMode m_layerHostingMode;
-
bool m_drawsBackground;
bool m_drawsTransparentBackground;
Modified: trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h (160976 => 160977)
--- trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h 2013-12-22 16:45:31 UTC (rev 160977)
@@ -40,7 +40,6 @@
private:
// DrawingAreaProxy
virtual void deviceScaleFactorDidChange() OVERRIDE;
- virtual void layerHostingModeDidChange() OVERRIDE;
virtual void sizeDidChange() OVERRIDE;
virtual void waitForPossibleGeometryUpdate(double timeout = didUpdateBackingStoreStateTimeout) OVERRIDE;
virtual void colorSpaceDidChange() OVERRIDE;
Modified: trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm (160976 => 160977)
--- trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm 2013-12-22 16:45:31 UTC (rev 160977)
@@ -54,11 +54,6 @@
m_webPageProxy->process().send(Messages::DrawingArea::SetDeviceScaleFactor(m_webPageProxy->deviceScaleFactor()), m_webPageProxy->pageID());
}
-void TiledCoreAnimationDrawingAreaProxy::layerHostingModeDidChange()
-{
- m_webPageProxy->process().send(Messages::DrawingArea::SetLayerHostingMode(m_webPageProxy->layerHostingMode()), m_webPageProxy->pageID());
-}
-
void TiledCoreAnimationDrawingAreaProxy::sizeDidChange()
{
if (!m_webPageProxy->isValid())
Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h (160976 => 160977)
--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h 2013-12-22 16:45:31 UTC (rev 160977)
@@ -27,6 +27,7 @@
#define DrawingArea_h
#include "DrawingAreaInfo.h"
+#include "LayerTreeContext.h"
#include <WebCore/FloatPoint.h>
#include <WebCore/IntRect.h>
#include <wtf/Forward.h>
@@ -106,6 +107,7 @@
virtual void suspendPainting() { }
virtual void resumePainting() { }
+ virtual void setLayerHostingMode(LayerHostingMode) { }
protected:
DrawingArea(DrawingAreaType, WebPage*);
@@ -119,7 +121,6 @@
virtual void updateBackingStoreState(uint64_t /*backingStoreStateID*/, bool /*respondImmediately*/, float /*deviceScaleFactor*/, const WebCore::IntSize& /*size*/,
const WebCore::IntSize& /*scrollOffset*/) { }
virtual void didUpdate() { }
- virtual void setLayerHostingMode(uint32_t) { }
#if PLATFORM(MAC)
// Used by TiledCoreAnimationDrawingArea.
Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in (160976 => 160977)
--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in 2013-12-22 16:45:31 UTC (rev 160977)
@@ -23,7 +23,6 @@
messages -> DrawingArea LegacyReceiver {
UpdateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, float deviceScaleFactor, WebCore::IntSize size, WebCore::IntSize scrollOffset)
DidUpdate()
- SetLayerHostingMode(uint32_t layerHostingMode)
#if PLATFORM(MAC)
// Used by TiledCoreAnimationDrawingArea.
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (160976 => 160977)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-12-22 16:45:31 UTC (rev 160977)
@@ -244,7 +244,6 @@
#if PLATFORM(MAC)
, m_pdfPluginEnabled(false)
, m_hasCachedWindowFrame(false)
- , m_layerHostingMode(parameters.layerHostingMode)
, m_keyboardEventBeingInterpreted(0)
, m_viewGestureGeometryCollector(*this)
#elif PLATFORM(GTK)
@@ -443,8 +442,8 @@
m_sandboxExtensionTracker.invalidate();
- for (HashSet<PluginView*>::const_iterator it = m_pluginViews.begin(), end = m_pluginViews.end(); it != end; ++it)
- (*it)->webPageDestroyed();
+ for (auto* pluginView : m_pluginViews)
+ pluginView->webPageDestroyed();
#if !PLATFORM(IOS)
if (m_headerBanner)
@@ -1234,8 +1233,8 @@
m_page->setPageScaleFactor(scale, origin);
- for (HashSet<PluginView*>::const_iterator it = m_pluginViews.begin(), end = m_pluginViews.end(); it != end; ++it)
- (*it)->pageScaleFactorDidChange();
+ for (auto* pluginView : m_pluginViews)
+ pluginView->pageScaleFactorDidChange();
if (m_drawingArea->layerTreeHost())
m_drawingArea->layerTreeHost()->deviceOrPageScaleFactorChanged();
@@ -1261,8 +1260,8 @@
// Tell all our plug-in views that the device scale factor changed.
#if PLATFORM(MAC) && !PLATFORM(IOS)
- for (HashSet<PluginView*>::const_iterator it = m_pluginViews.begin(), end = m_pluginViews.end(); it != end; ++it)
- (*it)->setDeviceScaleFactor(scaleFactor);
+ for (auto* pluginView : m_pluginViews)
+ pluginView->setDeviceScaleFactor(scaleFactor);
updateHeaderAndFooterLayersForDeviceScaleChange(scaleFactor);
#endif
@@ -1916,8 +1915,8 @@
#if PLATFORM(MAC)
// Tell all our plug-in views that the window focus changed.
- for (HashSet<PluginView*>::const_iterator it = m_pluginViews.begin(), end = m_pluginViews.end(); it != end; ++it)
- (*it)->setWindowIsFocused(isActive);
+ for (auto* pluginView : m_pluginViews)
+ pluginView->setWindowIsFocused(isActive);
#endif
}
@@ -2084,6 +2083,7 @@
void WebPage::setViewState(ViewState::Flags viewState, bool wantsDidUpdateViewState)
{
ViewState::Flags changed = m_viewState ^ viewState;
+ m_viewState = viewState;
// We want to make sure to update the active state while hidden, so if the view is hidden then update the active state
// early (in case it becomes visible), and if the view was visible then update active state later (in case it hides).
@@ -2099,9 +2099,11 @@
setActive(viewState & ViewState::WindowIsActive);
if (changed & ViewState::IsInWindow)
setIsInWindow(viewState & ViewState::IsInWindow);
+#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
+ if (changed & ViewState::IsLayerWindowServerHosted)
+ setLayerHostingMode(layerHostingMode());
+#endif
- m_viewState = viewState;
-
if (wantsDidUpdateViewState)
m_sendDidUpdateViewStateTimer.startOneShot(0);
}
@@ -3062,12 +3064,20 @@
#if PLATFORM(MAC)
// Tell all our plug-in views that the window visibility changed.
- for (HashSet<PluginView*>::const_iterator it = m_pluginViews.begin(), end = m_pluginViews.end(); it != end; ++it)
- (*it)->setWindowIsVisible(windowIsVisible);
+ for (auto* pluginView : m_pluginViews)
+ pluginView->setWindowIsVisible(windowIsVisible);
#endif
}
#if PLATFORM(MAC)
+void WebPage::setLayerHostingMode(LayerHostingMode layerHostingMode)
+{
+ for (auto* pluginView : m_pluginViews)
+ pluginView->setLayerHostingMode(layerHostingMode);
+
+ m_drawingArea->setLayerHostingMode(layerHostingMode);
+}
+
void WebPage::windowAndViewFramesChanged(const FloatRect& windowFrameInScreenCoordinates, const FloatRect& windowFrameInUnflippedScreenCoordinates, const FloatRect& viewFrameInWindowCoordinates, const FloatPoint& accessibilityViewCoordinates)
{
m_windowFrameInScreenCoordinates = windowFrameInScreenCoordinates;
@@ -3076,8 +3086,8 @@
m_accessibilityPosition = accessibilityViewCoordinates;
// Tell all our plug-in views that the window and view frames have changed.
- for (HashSet<PluginView*>::const_iterator it = m_pluginViews.begin(), end = m_pluginViews.end(); it != end; ++it)
- (*it)->windowAndViewFramesChanged(enclosingIntRect(windowFrameInScreenCoordinates), enclosingIntRect(viewFrameInWindowCoordinates));
+ for (auto* pluginView : m_pluginViews)
+ pluginView->windowAndViewFramesChanged(enclosingIntRect(windowFrameInScreenCoordinates), enclosingIntRect(viewFrameInWindowCoordinates));
m_hasCachedWindowFrame = !m_windowFrameInUnflippedScreenCoordinates.isEmpty();
}
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (160976 => 160977)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2013-12-22 16:45:31 UTC (rev 160977)
@@ -349,7 +349,14 @@
bool windowIsVisible() const { return m_windowIsVisible; }
#if PLATFORM(MAC)
- LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
+ LayerHostingMode layerHostingMode() const
+ {
+#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
+ return m_viewState & ViewState::IsLayerWindowServerHosted ? LayerHostingModeInWindowServer : LayerHostingModeDefault;
+#else
+ return LayerHostingModeDefault;
+#endif
+ }
void setLayerHostingMode(LayerHostingMode);
void updatePluginsActiveAndFocusedState();
@@ -928,9 +935,6 @@
// The accessibility position of the view.
WebCore::FloatPoint m_accessibilityPosition;
- // The layer hosting mode.
- LayerHostingMode m_layerHostingMode;
-
RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
WebCore::KeyboardEvent* m_keyboardEventBeingInterpreted;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (160976 => 160977)
--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2013-12-22 16:45:31 UTC (rev 160977)
@@ -268,11 +268,6 @@
notImplemented();
}
-void WebPage::setLayerHostingMode(LayerHostingMode)
-{
- notImplemented();
-}
-
void WebPage::computePagesForPrintingPDFDocument(uint64_t, const PrintInfo&, Vector<IntRect>&)
{
notImplemented();
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (160976 => 160977)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h 2013-12-22 16:45:31 UTC (rev 160977)
@@ -101,7 +101,7 @@
// Message handlers.
virtual void updateGeometry(const WebCore::IntSize& viewSize, const WebCore::IntSize& layerPosition) OVERRIDE;
virtual void setDeviceScaleFactor(float) OVERRIDE;
- virtual void setLayerHostingMode(uint32_t) OVERRIDE;
+ virtual void setLayerHostingMode(LayerHostingMode) OVERRIDE;
virtual void setColorSpace(const ColorSpaceData&) OVERRIDE;
virtual void adjustTransientZoom(double scale, WebCore::FloatPoint origin) OVERRIDE;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (160976 => 160977)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2013-12-22 16:45:31 UTC (rev 160977)
@@ -505,14 +505,8 @@
it->value->noteDeviceOrPageScaleFactorChangedIncludingDescendants();
}
-void TiledCoreAnimationDrawingArea::setLayerHostingMode(uint32_t opaqueLayerHostingMode)
+void TiledCoreAnimationDrawingArea::setLayerHostingMode(LayerHostingMode)
{
- LayerHostingMode layerHostingMode = static_cast<LayerHostingMode>(opaqueLayerHostingMode);
- if (layerHostingMode == m_webPage->layerHostingMode())
- return;
-
- m_webPage->setLayerHostingMode(layerHostingMode);
-
updateLayerHostingContext();
// Finally, inform the UIProcess that the context has changed.
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (160976 => 160977)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm 2013-12-22 16:33:41 UTC (rev 160976)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm 2013-12-22 16:45:31 UTC (rev 160977)
@@ -249,8 +249,8 @@
void WebPage::sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput)
{
- for (HashSet<PluginView*>::const_iterator it = m_pluginViews.begin(), end = m_pluginViews.end(); it != end; ++it) {
- if ((*it)->sendComplexTextInput(pluginComplexTextInputIdentifier, textInput))
+ for (auto* pluginView : m_pluginViews) {
+ if (pluginView->sendComplexTextInput(pluginComplexTextInputIdentifier, textInput))
break;
}
}
@@ -792,14 +792,6 @@
result = !!hitResult.scrollbar();
}
-void WebPage::setLayerHostingMode(LayerHostingMode layerHostingMode)
-{
- m_layerHostingMode = layerHostingMode;
-
- for (HashSet<PluginView*>::const_iterator it = m_pluginViews.begin(), end = m_pluginViews.end(); it != end; ++it)
- (*it)->setLayerHostingMode(layerHostingMode);
-}
-
void WebPage::setTopOverhangImage(PassRefPtr<WebImage> image)
{
FrameView* frameView = m_mainFrame->coreFrame()->view();