Skip to content
Permalink
Browse files
[Qt][WK2] Get rid of the #ifdef mess in LayerTreeHost[Proxy]
https://bugs.webkit.org/show_bug.cgi?id=79501

Source/JavaScriptCore:

Enable WTF_USE_UI_SIDE_COMPOSITING for Qt.

Reviewed by Kenneth Rohde Christiansen.

* wtf/Platform.h:

Source/WebKit2:

Use a new UI_SIDE_COMPOSITING flag instead of the several #ifdef flags we currently use.

Reviewed by Kenneth Rohde Christiansen.

* Shared/WebLayerTreeInfo.cpp:
* Shared/WebLayerTreeInfo.h:
* UIProcess/DrawingAreaProxy.cpp:
(WebKit):
* UIProcess/DrawingAreaProxy.h:
(DrawingAreaProxy):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
(WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
(WebKit):
* UIProcess/DrawingAreaProxyImpl.h:
(DrawingAreaProxyImpl):
* UIProcess/LayerTreeHostProxy.h:
(LayerTreeHostProxy):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveMessage):
* UIProcess/qt/LayerBackingStore.cpp:
* UIProcess/qt/LayerBackingStore.h:
* UIProcess/qt/LayerTreeHostProxyQt.cpp:
* WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
* WebProcess/WebCoreSupport/WebGraphicsLayer.h:
* WebProcess/WebPage/DrawingArea.h:
(DrawingArea):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit):
* WebProcess/WebPage/DrawingAreaImpl.h:
(DrawingAreaImpl):
* WebProcess/WebPage/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::create):
* WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
(WebKit::LayerTreeHostQt::purgeBackingStores):
* WebProcess/WebPage/qt/LayerTreeHostQt.h:
(LayerTreeHostQt):


Canonical link: https://commits.webkit.org/97055@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@109302 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
noamr committed Mar 1, 2012
1 parent c62ad07 commit 2606f1c94503e2294410efbe9254ff92fbc8c2f6
@@ -1,3 +1,14 @@
2012-02-29 No'am Rosenthal <noam.rosenthal@nokia.com>

[Qt][WK2] Get rid of the #ifdef mess in LayerTreeHost[Proxy]
https://bugs.webkit.org/show_bug.cgi?id=79501

Enable WTF_USE_UI_SIDE_COMPOSITING for Qt.

Reviewed by Kenneth Rohde Christiansen.

* wtf/Platform.h:

2012-02-29 Gavin Barraclough <barraclough@apple.com>

Rubber stamped by Oliver Hunt.
@@ -1074,6 +1074,11 @@
#define WTF_USE_ACCELERATED_COMPOSITING 1
#endif

/* Compositing on the UI-process in WebKit2 */
#if PLATFORM(QT)
#define WTF_USE_UI_SIDE_COMPOSITING 1
#endif

#if (PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)) || PLATFORM(IOS)
#define WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK 1
#endif
@@ -1,3 +1,46 @@
2012-02-29 No'am Rosenthal <noam.rosenthal@nokia.com>

[Qt][WK2] Get rid of the #ifdef mess in LayerTreeHost[Proxy]
https://bugs.webkit.org/show_bug.cgi?id=79501

Use a new UI_SIDE_COMPOSITING flag instead of the several #ifdef flags we currently use.

Reviewed by Kenneth Rohde Christiansen.

* Shared/WebLayerTreeInfo.cpp:
* Shared/WebLayerTreeInfo.h:
* UIProcess/DrawingAreaProxy.cpp:
(WebKit):
* UIProcess/DrawingAreaProxy.h:
(DrawingAreaProxy):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
(WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
(WebKit):
* UIProcess/DrawingAreaProxyImpl.h:
(DrawingAreaProxyImpl):
* UIProcess/LayerTreeHostProxy.h:
(LayerTreeHostProxy):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveMessage):
* UIProcess/qt/LayerBackingStore.cpp:
* UIProcess/qt/LayerBackingStore.h:
* UIProcess/qt/LayerTreeHostProxyQt.cpp:
* WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
* WebProcess/WebCoreSupport/WebGraphicsLayer.h:
* WebProcess/WebPage/DrawingArea.h:
(DrawingArea):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit):
* WebProcess/WebPage/DrawingAreaImpl.h:
(DrawingAreaImpl):
* WebProcess/WebPage/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::create):
* WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
(WebKit::LayerTreeHostQt::purgeBackingStores):
* WebProcess/WebPage/qt/LayerTreeHostQt.h:
(LayerTreeHostQt):

2012-02-28 Brian Weinstein <bweinstein@apple.com>

WebKit2: didNewFirstVisuallyNonEmptyLayout should be sent to injected bundle
@@ -19,8 +19,7 @@

#include "config.h"

#if USE(ACCELERATED_COMPOSITING)

#if USE(UI_SIDE_COMPOSITING)
#include "WebLayerTreeInfo.h"

#include "Arguments.h"
@@ -20,7 +20,7 @@
#ifndef WebLayerTreeInfo_h
#define WebLayerTreeInfo_h

#if USE(ACCELERATED_COMPOSITING)
#if USE(UI_SIDE_COMPOSITING)

#include "ArgumentDecoder.h"
#include "ArgumentEncoder.h"
@@ -28,7 +28,7 @@

#include "WebPageProxy.h"

#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
#if USE(UI_SIDE_COMPOSITING)
#include "LayerTreeHostProxy.h"
#include <CoreIPC/MessageID.h>
#endif
@@ -58,7 +58,7 @@ void DrawingAreaProxy::setSize(const IntSize& size, const IntSize& scrollOffset)
sizeDidChange();
}

#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
#if USE(UI_SIDE_COMPOSITING)
void DrawingAreaProxy::updateViewport()
{
m_webPageProxy->setViewNeedsDisplay(viewportVisibleRect());
@@ -69,12 +69,9 @@ WebCore::IntRect DrawingAreaProxy::contentsRect() const
return IntRect(IntPoint::zero(), m_webPageProxy->viewSize());
}

#if USE(TILED_BACKING_STORE)
void DrawingAreaProxy::didReceiveLayerTreeHostProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
}
#endif

#endif

} // namespace WebKit
@@ -83,16 +83,14 @@ class DrawingAreaProxy {

virtual void pageCustomRepresentationChanged() { }

#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
#if USE(UI_SIDE_COMPOSITING)
virtual void updateViewport();
virtual WebCore::IntRect viewportVisibleRect() const { return contentsRect(); }
virtual WebCore::IntRect contentsRect() const;
virtual bool isBackingStoreReady() const { return true; }
virtual void paintToCurrentGLContext(const WebCore::TransformationMatrix&, float, const WebCore::FloatRect&) { }
virtual void paintLayerTree(BackingStore::PlatformGraphicsContext) { }
LayerTreeHostProxy* layerTreeHostProxy() const { return m_layerTreeHostProxy.get(); }

#if USE(TILED_BACKING_STORE)
virtual void setVisibleContentsRectForScaling(const WebCore::IntRect& visibleContentsRect, float scale) { }
virtual void setVisibleContentsRectForPanning(const WebCore::IntRect& visibleContentsRect, const WebCore::FloatPoint& trajectoryVector) { }
virtual void createTileForLayer(int layerID, int tileID, const WebKit::UpdateInfo&) { }
@@ -102,7 +100,6 @@ class DrawingAreaProxy {

WebPageProxy* page() { return m_webPageProxy; }
#endif
#endif
protected:
explicit DrawingAreaProxy(DrawingAreaType, WebPageProxy*);

@@ -112,7 +109,7 @@ class DrawingAreaProxy {
WebCore::IntSize m_size;
WebCore::IntSize m_scrollOffset;

#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
#if USE(UI_SIDE_COMPOSITING)
OwnPtr<LayerTreeHostProxy> m_layerTreeHostProxy;
#endif

@@ -36,7 +36,7 @@
#include "WebProcessProxy.h"
#include <WebCore/Region.h>

#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
#if USE(UI_SIDE_COMPOSITING)
#include "LayerTreeHostProxy.h"
#endif

@@ -58,7 +58,7 @@ DrawingAreaProxyImpl::DrawingAreaProxyImpl(WebPageProxy* webPageProxy)
, m_isBackingStoreDiscardable(true)
, m_discardBackingStoreTimer(RunLoop::current(), this, &DrawingAreaProxyImpl::discardBackingStore)
{
#if USE(TEXTURE_MAPPER)
#if USE(UI_SIDE_COMPOSITING)
// Construct the proxy early to allow messages to be sent to the web process while AC is entered there.
if (webPageProxy->pageGroup()->preferences()->forceCompositingMode())
m_layerTreeHostProxy = adoptPtr(new LayerTreeHostProxy(this));
@@ -335,13 +335,13 @@ void DrawingAreaProxyImpl::enterAcceleratedCompositingMode(const LayerTreeContex
m_backingStore = nullptr;
m_layerTreeContext = layerTreeContext;
m_webPageProxy->enterAcceleratedCompositingMode(layerTreeContext);
#if USE(TEXTURE_MAPPER)
#if USE(UI_SIDE_COMPOSITING)
if (!m_layerTreeHostProxy)
m_layerTreeHostProxy = adoptPtr(new LayerTreeHostProxy(this));
#endif
}

#if USE(TILED_BACKING_STORE)
#if USE(UI_SIDE_COMPOSITING)
void DrawingAreaProxyImpl::didReceiveLayerTreeHostProxyMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
if (m_layerTreeHostProxy)
@@ -77,7 +77,7 @@ class DrawingAreaProxyImpl : public DrawingAreaProxy {

bool isInAcceleratedCompositingMode() const { return !m_layerTreeContext.isEmpty(); }

#if USE(TILED_BACKING_STORE)
#if USE(UI_SIDE_COMPOSITING)
virtual void setVisibleContentsRectForScaling(const WebCore::IntRect& visibleContentsRect, float scale);
virtual void setVisibleContentsRectForPanning(const WebCore::IntRect& visibleContentsRect, const WebCore::FloatPoint&);
virtual void paintToCurrentGLContext(const WebCore::TransformationMatrix&, float opacity, const WebCore::FloatRect&);
@@ -20,9 +20,13 @@
#ifndef LayerTreeHostProxy_h
#define LayerTreeHostProxy_h

#if USE(UI_SIDE_COMPOSITING)

#include "BackingStore.h"
#include "DrawingAreaProxy.h"
#include "Region.h"
#include "TextureMapper.h"
#include "TextureMapperBackingStore.h"
#include "WebLayerTreeInfo.h"
#include <WebCore/GraphicsContext.h>
#include <WebCore/GraphicsLayer.h>
@@ -33,10 +37,6 @@
#include <wtf/Functional.h>
#include <wtf/HashSet.h>

#if USE(TEXTURE_MAPPER)
#include "TextureMapper.h"
#include "TextureMapperBackingStore.h"
#endif

namespace WebKit {

@@ -57,7 +57,6 @@ class LayerTreeHostProxy : public WebCore::GraphicsLayerClient {
void purgeGLResources();
void setVisibleContentsRectForScaling(const WebCore::IntRect&, float);
void setVisibleContentsRectForPanning(const WebCore::IntRect&, const WebCore::FloatPoint&);
#if USE(TILED_BACKING_STORE)
void syncRemoteContent();
void swapContentBuffers();
void didRenderFrame();
@@ -68,7 +67,6 @@ class LayerTreeHostProxy : public WebCore::GraphicsLayerClient {
void destroyDirectlyCompositedImage(int64_t);
void didReceiveLayerTreeHostProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
void updateViewport();
#endif

protected:
PassOwnPtr<WebCore::GraphicsLayer> createLayer(WebLayerID);
@@ -94,9 +92,11 @@ class LayerTreeHostProxy : public WebCore::GraphicsLayerClient {

#if USE(TEXTURE_MAPPER)
OwnPtr<WebCore::TextureMapper> m_textureMapper;
PassRefPtr<LayerBackingStore> getBackingStore(WebLayerID);
HashMap<int64_t, RefPtr<WebCore::TextureMapperBackingStore> > m_directlyCompositedImages;
HashSet<RefPtr<LayerBackingStore> > m_backingStoresWithPendingBuffers;
#endif

#if PLATFORM(QT)
void scheduleWebViewUpdate();
void synchronizeViewport();
void deleteLayer(WebLayerID);
@@ -111,15 +111,11 @@ class LayerTreeHostProxy : public WebCore::GraphicsLayerClient {
void flushLayerChanges();
void ensureRootLayer();
void ensureLayer(WebLayerID);
PassRefPtr<LayerBackingStore> getBackingStore(WebLayerID);
void swapBuffers();
void syncAnimations();
#endif

OwnPtr<WebCore::GraphicsLayer> m_rootLayer;
Vector<WebLayerID> m_layersToDelete;
HashMap<int64_t, RefPtr<WebCore::TextureMapperBackingStore> > m_directlyCompositedImages;
HashSet<RefPtr<LayerBackingStore> > m_backingStoresWithPendingBuffers;

LayerMap m_layers;
WebLayerID m_rootLayerID;
@@ -128,4 +124,6 @@ class LayerTreeHostProxy : public WebCore::GraphicsLayerClient {

}

#endif

#endif // LayerTreeHostProxy_h
@@ -85,7 +85,7 @@
#include <WebCore/WindowFeatures.h>
#include <stdio.h>

#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
#if USE(UI_SIDE_COMPOSITING)
#include "LayerTreeHostProxyMessages.h"
#endif

@@ -1542,7 +1542,7 @@ void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::M
return;
}

#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) && USE(TILED_BACKING_STORE)
#if USE(UI_SIDE_COMPOSITING)
if (messageID.is<CoreIPC::MessageClassLayerTreeHostProxy>()) {
m_drawingArea->didReceiveLayerTreeHostProxyMessage(connection, messageID, arguments);
return;
@@ -20,6 +20,7 @@
#include "config.h"
#include "LayerBackingStore.h"

#if USE(UI_SIDE_COMPOSITING)
#include "GraphicsLayer.h"
#include "TextureMapper.h"

@@ -141,3 +142,4 @@ void LayerBackingStore::swapBuffers(TextureMapper* textureMapper)
}

}
#endif
@@ -20,6 +20,7 @@
#ifndef LayerBackingStore_h
#define LayerBackingStore_h

#if USE(UI_SIDE_COMPOSITING)
#include "HashMap.h"
#include "ShareableBitmap.h"
#include "TextureMapper.h"
@@ -65,4 +66,6 @@ class LayerBackingStore : public WebCore::TextureMapperBackingStore {
};

}
#endif

#endif // LayerBackingStore_h
@@ -19,7 +19,6 @@

#include "config.h"

#if USE(ACCELERATED_COMPOSITING)
#include "LayerTreeHostProxy.h"

#include "GraphicsLayerTextureMapper.h"
@@ -416,4 +415,3 @@ void LayerTreeHostProxy::purgeGLResources()
}

}
#endif
@@ -19,8 +19,7 @@

#include "config.h"

#if USE(ACCELERATED_COMPOSITING)

#if USE(UI_SIDE_COMPOSITING)
#include "WebGraphicsLayer.h"

#include "Animation.h"
@@ -37,8 +37,7 @@
#include <WebCore/RunLoop.h>
#include <wtf/text/StringHash.h>

#if USE(ACCELERATED_COMPOSITING)

#if USE(UI_SIDE_COMPOSITING)
namespace WebCore {
class WebGraphicsLayer;
}
@@ -65,10 +64,8 @@ class WebGraphicsLayerClient {
namespace WebCore {

class WebGraphicsLayer : public WebCore::GraphicsLayer
#if USE(TILED_BACKING_STORE)
, public TiledBackingStoreClient
, public WebKit::TiledBackingStoreRemoteTileClient
#endif
{
public:
WebGraphicsLayer(GraphicsLayerClient*);
@@ -79,9 +79,10 @@ class DrawingArea {
#if USE(ACCELERATED_COMPOSITING)
virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) = 0;
virtual void scheduleCompositingLayerSync() = 0;
#if USE(TEXTURE_MAPPER) && USE(TILED_BACKING_STORE)
virtual void didReceiveLayerTreeHostMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) = 0;
#endif

#if USE(UI_SIDE_COMPOSITING)
virtual void didReceiveLayerTreeHostMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) = 0;
#endif

#if PLATFORM(WIN)
@@ -667,7 +667,7 @@ void DrawingAreaImpl::display(UpdateInfo& updateInfo)
m_displayTimer.stop();
}

#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) && USE(TILED_BACKING_STORE)
#if USE(UI_SIDE_COMPOSITING)
void DrawingAreaImpl::didReceiveLayerTreeHostMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
if (m_layerTreeHost)
@@ -70,7 +70,7 @@ class DrawingAreaImpl : public DrawingArea {
virtual void scheduleChildWindowGeometryUpdate(const WindowGeometry&);
#endif

#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) && USE(TILED_BACKING_STORE)
#if USE(UI_SIDE_COMPOSITING)
virtual void didReceiveLayerTreeHostMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
#endif

0 comments on commit 2606f1c

Please sign in to comment.