Commit aeaa0987 authored by barraclough@apple.com's avatar barraclough@apple.com

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.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a6d6d235
2013-12-13 Gavin Barraclough <barraclough@apple.com>
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-16 Sam Weinig <sam@webkit.org>
[Cocoa] Remove unused contentAnchor SPI from WKView
......
......@@ -34,13 +34,14 @@ struct ViewState {
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
......
......@@ -62,7 +62,6 @@ void WebPageCreationParameters::encode(CoreIPC::ArgumentEncoder& encoder) const
encoder << backgroundExtendsBeyondPage;
#if PLATFORM(MAC)
encoder.encodeEnum(layerHostingMode);
encoder << colorSpace;
#endif
}
......@@ -125,8 +124,6 @@ bool WebPageCreationParameters::decode(CoreIPC::ArgumentDecoder& decoder, WebPag
return false;
#if PLATFORM(MAC)
if (!decoder.decodeEnum(parameters.layerHostingMode))
return false;
if (!decoder.decode(parameters.colorSpace))
return false;
#endif
......
......@@ -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 @@ struct WebPageCreationParameters {
bool backgroundExtendsBeyondPage;
#if PLATFORM(MAC)
LayerHostingMode layerHostingMode;
ColorSpaceData colorSpace;
#endif
};
......
......@@ -27,6 +27,7 @@
#define PageClientImpl_h
#include "CorrectionPanel.h"
#include "LayerTreeContext.h"
#include "PageClient.h"
#include "WebFullScreenManagerProxy.h"
#include <wtf/RetainPtr.h>
......@@ -66,7 +67,7 @@ private:
virtual bool isViewVisible();
virtual bool isWindowVisible();
virtual bool isViewInWindow();
virtual LayerHostingMode viewLayerHostingMode() OVERRIDE;
virtual bool isLayerWindowServerHosted();
virtual ColorSpaceData colorSpace() OVERRIDE;
virtual void setAcceleratedCompositingRootLayer(CALayer *) OVERRIDE;
......@@ -163,6 +164,8 @@ private:
#if USE(DICTATION_ALTERNATIVES)
OwnPtr<WebCore::AlternativeTextUIController> m_alternativeTextUIController;
#endif
LayerHostingMode m_layerHostingMode;
};
} // namespace WebKit
......
......@@ -127,6 +127,11 @@ PageClientImpl::PageClientImpl(WKView* wkView)
#if USE(DICTATION_ALTERNATIVES)
, m_alternativeTextUIController(adoptPtr(new AlternativeTextUIController))
#endif
#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
, m_layerHostingMode(LayerHostingModeInWindowServer)
#else
, m_layerHostingMode(LayerHostingModeDefault)
#endif
{
}
......@@ -215,21 +220,20 @@ bool PageClientImpl::isViewInWindow()
return [m_wkView window];
}
void PageClientImpl::viewWillMoveToAnotherWindow()
bool PageClientImpl::isLayerWindowServerHosted()
{
clearAllEditCommands();
#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
// Only update m_layerHostingMode when the view is in a window - otherwise just report the last value.
if ([m_wkView window])
m_layerHostingMode = [[m_wkView window] _hostsLayersInWindowServer] ? LayerHostingModeInWindowServer : LayerHostingModeDefault;
#endif
return m_layerHostingMode == LayerHostingModeInWindowServer;
}
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()
......
......@@ -53,8 +53,6 @@ public:
virtual void deviceScaleFactorDidChange() = 0;
// FIXME: These should be pure virtual.
virtual void layerHostingModeDidChange() { }
virtual void setBackingStoreIsDiscardable(bool) { }
virtual void waitForBackingStoreUpdateOnNextPaint() { }
......
......@@ -111,8 +111,8 @@ public:
// 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; }
// Return whether the layer is window server hosted.
virtual bool isLayerWindowServerHosted() = 0;
virtual void processDidCrash() = 0;
virtual void didRelaunchProcess() = 0;
......
......@@ -92,6 +92,9 @@
#include <WebCore/WindowFeatures.h>
#include <stdio.h>
#import "DrawingAreaMessages.h"
#import "DrawingAreaProxyMessages.h"
#if USE(COORDINATED_GRAPHICS)
#include "CoordinatedLayerTreeHostProxyMessages.h"
#endif
......@@ -243,11 +246,6 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, Web
, 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)
......@@ -315,6 +313,10 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, Web
#endif
, m_scrollPinningBehavior(DoNotPin)
{
#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
// By default assume we'll be window server hosted.
m_viewState |= ViewState::IsLayerWindowServerHosted;
#endif
updateViewState();
platformInitialize();
......@@ -950,6 +952,8 @@ void WebPageProxy::updateViewState(ViewState::Flags flagsToUpdate)
m_viewState |= ViewState::IsVisible;
if (flagsToUpdate & ViewState::IsInWindow && m_pageClient.isViewInWindow())
m_viewState |= ViewState::IsInWindow;
if (flagsToUpdate & ViewState::IsLayerWindowServerHosted && m_pageClient.isLayerWindowServerHosted())
m_viewState |= ViewState::IsLayerWindowServerHosted;
}
void WebPageProxy::viewStateDidChange(ViewState::Flags mayHaveChanged, WantsReplyOrNot wantsReply)
......@@ -957,6 +961,10 @@ void WebPageProxy::viewStateDidChange(ViewState::Flags mayHaveChanged, WantsRepl
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;
......@@ -985,22 +993,15 @@ void WebPageProxy::viewStateDidChange(ViewState::Flags mayHaveChanged, WantsRepl
#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 {
if (mayHaveChanged & ViewState::IsInWindow) {
if (!(m_viewState & ViewState::IsInWindow)) {
// When leaving the current page, close the popover color well.
if (m_colorPicker)
endColorPicker();
}
#endif
}
#endif
updateBackingStoreDiscardableState();
}
......@@ -3916,11 +3917,8 @@ void WebPageProxy::initializeCreationParameters()
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
}
......
......@@ -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"
......@@ -552,8 +551,6 @@ public:
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; };
......@@ -1237,8 +1234,6 @@ private:
float m_intrinsicDeviceScaleFactor;
float m_customDeviceScaleFactor;
LayerHostingMode m_layerHostingMode;
bool m_drawsBackground;
bool m_drawsTransparentBackground;
......
......@@ -40,7 +40,6 @@ public:
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;
......
......@@ -54,11 +54,6 @@ void TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange()
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())
......
......@@ -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 @@ public:
virtual void suspendPainting() { }
virtual void resumePainting() { }
virtual void setLayerHostingMode(LayerHostingMode) { }
protected:
DrawingArea(DrawingAreaType, WebPage*);
......@@ -119,7 +121,6 @@ private:
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.
......
......@@ -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.
......
......@@ -243,7 +243,6 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
#if PLATFORM(MAC)
, m_pdfPluginEnabled(false)
, m_hasCachedWindowFrame(false)
, m_layerHostingMode(parameters.layerHostingMode)
, m_keyboardEventBeingInterpreted(0)
#elif PLATFORM(GTK)
, m_accessibilityObject(0)
......@@ -442,8 +441,8 @@ WebPage::~WebPage()
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)
......@@ -1233,8 +1232,8 @@ void WebPage::scalePage(double scale, const IntPoint& origin)
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();
......@@ -1260,8 +1259,8 @@ void WebPage::setDeviceScaleFactor(float scaleFactor)
// 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
......@@ -1912,8 +1911,8 @@ void WebPage::setActive(bool isActive)
#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
}
......@@ -2095,6 +2094,8 @@ void WebPage::setViewState(ViewState::Flags viewState, bool wantsDidUpdateViewSt
setActive(viewState & ViewState::WindowIsActive);
if (changed & ViewState::IsInWindow)
setIsInWindow(viewState & ViewState::IsInWindow);
if (changed & ViewState::IsLayerWindowServerHosted)
setLayerHostingMode(viewState & ViewState::IsLayerWindowServerHosted ? LayerHostingModeInWindowServer : LayerHostingModeDefault);
m_viewState = viewState;
......@@ -3058,11 +3059,22 @@ void WebPage::setWindowIsVisible(bool windowIsVisible)
#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
}
void WebPage::setLayerHostingMode(LayerHostingMode layerHostingMode)
{
#if PLATFORM(MAC)
// Tell all our plug-in views that the layer hosting mode changed.
for (auto* pluginView : m_pluginViews)
pluginView->setLayerHostingMode(layerHostingMode);
#endif
m_drawingArea->setLayerHostingMode(layerHostingMode);
}
#if PLATFORM(MAC)
void WebPage::windowAndViewFramesChanged(const FloatRect& windowFrameInScreenCoordinates, const FloatRect& windowFrameInUnflippedScreenCoordinates, const FloatRect& viewFrameInWindowCoordinates, const FloatPoint& accessibilityViewCoordinates)
{
......@@ -3072,8 +3084,8 @@ void WebPage::windowAndViewFramesChanged(const FloatRect& windowFrameInScreenCoo
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();
}
......
......@@ -348,7 +348,11 @@ public:
bool windowIsVisible() const { return m_windowIsVisible; }
#if PLATFORM(MAC)
LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
LayerHostingMode layerHostingMode() const
{
return m_viewState & ViewState::IsLayerWindowServerHosted ? LayerHostingModeInWindowServer : LayerHostingModeDefault;
}
void setLayerHostingMode(LayerHostingMode);
void updatePluginsActiveAndFocusedState();
......@@ -925,9 +929,6 @@ private:
// 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;
......
......@@ -268,11 +268,6 @@ void WebPage::acceptsFirstMouse(int, const WebKit::WebMouseEvent&, bool&)
notImplemented();
}
void WebPage::setLayerHostingMode(LayerHostingMode)
{
notImplemented();
}
void WebPage::computePagesForPrintingPDFDocument(uint64_t, const PrintInfo&, Vector<IntRect>&)
{
notImplemented();
......
......@@ -101,7 +101,7 @@ private:
// 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 beginTransientZoom() OVERRIDE;
......
......@@ -504,14 +504,8 @@ void TiledCoreAnimationDrawingArea::setDeviceScaleFactor(float deviceScaleFactor
it->value->noteDeviceOrPageScaleFactorChangedIncludingDescendants();
}
void TiledCoreAnimationDrawingArea::setLayerHostingMode(uint32_t opaqueLayerHostingMode)
void TiledCoreAnimationDrawingArea::setLayerHostingMode(LayerHostingMode 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.
......
......@@ -249,8 +249,8 @@ bool WebPage::handleEditingKeyboardEvent(KeyboardEvent* event, bool saveCommands
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 @@ void WebPage::acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent& ev
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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment