2 Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef LayerTreeHostProxy_h
21 #define LayerTreeHostProxy_h
23 #if USE(UI_SIDE_COMPOSITING)
25 #include "BackingStore.h"
26 #include "DrawingAreaProxy.h"
28 #include "SurfaceUpdateInfo.h"
29 #include "WebLayerTreeInfo.h"
30 #include <WebCore/GraphicsContext.h>
31 #include <WebCore/GraphicsLayer.h>
32 #include <WebCore/IntRect.h>
33 #include <WebCore/IntSize.h>
34 #include <WebCore/RunLoop.h>
35 #include <WebCore/Timer.h>
36 #include <wtf/Functional.h>
37 #include <wtf/HashSet.h>
39 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
41 typedef struct _Evas_GL_API Evas_GL_API;
47 class WebLayerTreeRenderer;
48 class WebLayerUpdateInfo;
50 class LayerTreeHostProxy {
52 LayerTreeHostProxy(DrawingAreaProxy*);
53 virtual ~LayerTreeHostProxy();
55 void setCompositingLayerState(WebLayerID, const WebLayerInfo&);
56 void setCompositingLayerChildren(WebLayerID, const Vector<WebLayerID>&);
57 #if ENABLE(CSS_FILTERS)
58 void setCompositingLayerFilters(WebLayerID, const WebCore::FilterOperations&);
60 void deleteCompositingLayer(WebLayerID);
61 void setRootCompositingLayer(WebLayerID);
62 void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
63 void purgeGLResources();
64 void setContentsSize(const WebCore::FloatSize&);
65 void setVisibleContentsRect(const WebCore::IntRect&, float scale, const WebCore::FloatPoint& trajectory, const WebCore::FloatPoint& accurateVisibleContentsPosition);
66 void didRenderFrame();
67 void createTileForLayer(int layerID, int tileID, const WebCore::IntRect&, const SurfaceUpdateInfo&);
68 void updateTileForLayer(int layerID, int tileID, const WebCore::IntRect&, const SurfaceUpdateInfo&);
69 void removeTileForLayer(int layerID, int tileID);
70 void createDirectlyCompositedImage(int64_t, const WebKit::ShareableBitmap::Handle&);
71 void destroyDirectlyCompositedImage(int64_t);
72 void didReceiveLayerTreeHostProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
73 void updateViewport();
74 void renderNextFrame();
75 void didChangeScrollPosition(const WebCore::IntPoint& position);
76 void purgeBackingStores();
77 WebLayerTreeRenderer* layerTreeRenderer() const { return m_renderer.get(); }
79 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
80 void clearBackingStores();
81 void restoreBackingStores();
84 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
85 bool hasOverflowLayer() const;
86 virtual void platformLayerChanged(WebCore::GraphicsLayer*, WebCore::PlatformLayer* oldPlatformLayer, WebCore::PlatformLayer* newPlatformLayer) { ASSERT_NOT_REACHED(); }
88 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION_ON_UI_SIDE)
89 bool setOffsetForFocusedScrollingContentsLayer(const WebCore::FloatPoint&);
90 void setVisibleContentsRectForScrollingContentsLayers(const WebCore::IntRect&);
94 void dispatchUpdate(const Function<void()>&);
96 #if ENABLE(TIZEN_ONESHOT_DRAWING_SYNCHRONIZATION)
97 void setNeedsOneShotDrawingSynchronization();
98 void doOneShotDrawingSynchronization();
101 DrawingAreaProxy* m_drawingAreaProxy;
102 RefPtr<WebLayerTreeRenderer> m_renderer;
103 #if USE(GRAPHICS_SURFACE)
104 HashMap<uint32_t, RefPtr<ShareableSurface> > m_surfaces;
112 #endif // LayerTreeHostProxy_h