Changeset 120262 in webkit
- Timestamp:
- Jun 13, 2012 5:13:48 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 14 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r120261 r120262 1 2012-06-13 Martin Robinson <mrobinson@igalia.com> 2 3 [GTK] Add an accelerated compositing implementation for WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=86037 5 6 Reviewed by Alejandro G. Castro. 7 8 No new tests. These changes are covered by the compositing tests, which 9 we will gradually try to turn on for the bots. 10 11 Add a new GLContext method for getting to current default framebuffer size, which 12 is quite useful for preventing composited content quivering while resizing. 13 14 * platform/graphics/cairo/GLContext.h: 15 * platform/graphics/glx/GLContextGLX.cpp: 16 (WebCore::GLContextGLX::defaultFrameBufferSize): Added this implementation for X11 17 which asks the X server for the window size. 18 * platform/graphics/glx/GLContextGLX.h: 19 1 20 2012-06-13 Shawn Singh <shawnsingh@chromium.org> 2 21 -
trunk/Source/WebCore/platform/graphics/cairo/GLContext.h
r117612 r120262 41 41 virtual void swapBuffers() = 0; 42 42 virtual bool canRenderToDefaultFramebuffer() = 0; 43 virtual IntSize defaultFrameBufferSize() = 0; 43 44 44 45 #if ENABLE(WEBGL) -
trunk/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp
r117612 r120262 263 263 } 264 264 265 IntSize GLContextGLX::defaultFrameBufferSize() 266 { 267 if (!canRenderToDefaultFramebuffer() || !m_window) 268 return IntSize(); 269 270 int x, y; 271 Window rootWindow; 272 unsigned int width, height, borderWidth, depth; 273 if (!XGetGeometry(sharedDisplay(), m_window, &rootWindow, &x, &y, &width, &height, &borderWidth, &depth)) 274 return IntSize(); 275 276 return IntSize(width, height); 277 } 278 265 279 bool GLContextGLX::makeContextCurrent() 266 280 { -
trunk/Source/WebCore/platform/graphics/glx/GLContextGLX.h
r117612 r120262 47 47 virtual void swapBuffers(); 48 48 virtual bool canRenderToDefaultFramebuffer(); 49 virtual IntSize defaultFrameBufferSize(); 49 50 50 51 #if ENABLE(WEBGL) -
trunk/Source/WebKit2/ChangeLog
r120233 r120262 1 2012-06-13 Martin Robinson <mrobinson@igalia.com> 2 3 [GTK] Add an accelerated compositing implementation for WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=86037 5 6 Reviewed by Alejandro G. Castro. 7 8 Add an implementation of LayerTreeHost for GTK+ that uses TextureMapperGL. 9 Later this implementation will fall back to using the ImageBuffer TextureMapper. 10 11 * GNUmakefile.am: Add new files to the compilation. 12 * Shared/LayerTreeContext.h: 13 (LayerTreeContext): The GTK+ version of the LayerTreeContext just holds window handle. 14 * Shared/gtk/LayerTreeContextGtk.cpp: Copied from Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp. 15 * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: Added. 16 * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: Added. 17 Add this LayerTreeHost implementation that just creates a GL context from the widget X11 window ID. 18 Later implementations might find a more cross-platform solution. 19 * WebProcess/WebPage/gtk/WebPageGtk.cpp: 20 (WebKit::WebPage::platformInitialize): Initialize the native window handle to be zero. 21 (WebKit::WebPage::widgetMapped): When mapping the widget, try to get the native window 22 handle and send it to the WebProcess. 23 1 24 2012-06-13 Andras Becsi <andras.becsi@nokia.com> 2 25 -
trunk/Source/WebKit2/GNUmakefile.list.am
r120215 r120262 345 345 Source/WebKit2/Shared/FontSmoothingLevel.h \ 346 346 Source/WebKit2/Shared/ProcessExecutablePath.h \ 347 Source/WebKit2/Shared/cairo/LayerTreeContextCairo.cpp \348 347 Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp \ 349 348 Source/WebKit2/Shared/gtk/ArgumentCodersGtk.h \ 350 349 Source/WebKit2/Shared/gtk/ArgumentCodersGtk.cpp \ 350 Source/WebKit2/Shared/gtk/LayerTreeContextGtk.cpp \ 351 351 Source/WebKit2/Shared/gtk/NativeWebKeyboardEventGtk.cpp \ 352 352 Source/WebKit2/Shared/gtk/NativeWebMouseEventGtk.cpp \ … … 1060 1060 Source/WebKit2/WebProcess/WebProcess.h 1061 1061 1062 if USE_TEXTURE_MAPPER_GL 1063 webkit2_sources += \ 1064 Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp \ 1065 Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h 1066 endif # END USE_TEXTURE_MAPPER_GL 1067 1062 1068 if ENABLE_PLUGIN_PROCESS 1063 1069 -
trunk/Source/WebKit2/Shared/LayerTreeContext.h
r109804 r120262 57 57 #elif PLATFORM(QT) 58 58 uint32_t webLayerID; 59 #elif PLATFORM(GTK) 60 uint64_t windowHandle; 59 61 #endif 60 62 }; -
trunk/Source/WebKit2/Shared/gtk/LayerTreeContextGtk.cpp
r120261 r120262 25 25 26 26 #include "config.h" 27 #include "LayerTree Host.h"27 #include "LayerTreeContext.h" 28 28 29 #if USE(CA) 30 #if PLATFORM(MAC) 31 #include "LayerTreeHostCAMac.h" 32 #elif PLATFORM(WIN) 33 #include "LayerTreeHostCAWin.h" 34 #endif 35 #endif 36 37 #if PLATFORM(QT) 38 #include "qt/LayerTreeHostQt.h" 39 #endif 40 41 using namespace WebCore; 29 #include "ArgumentDecoder.h" 30 #include "ArgumentEncoder.h" 42 31 43 32 namespace WebKit { 44 33 45 PassRefPtr<LayerTreeHost> LayerTreeHost::create(WebPage* webPage) 46 { 47 #if PLATFORM(MAC) 48 return LayerTreeHostCAMac::create(webPage); 49 #elif PLATFORM(WIN) && HAVE(WKQCA) 50 return LayerTreeHostCAWin::create(webPage); 51 #elif PLATFORM(QT) 52 return LayerTreeHostQt::create(webPage); 53 #else 54 return 0; 55 #endif 56 } 57 58 LayerTreeHost::LayerTreeHost(WebPage* webPage) 59 : m_webPage(webPage) 34 LayerTreeContext::LayerTreeContext() 35 : windowHandle(0) 60 36 { 61 37 } 62 38 63 LayerTree Host::~LayerTreeHost()39 LayerTreeContext::~LayerTreeContext() 64 40 { 65 41 } 66 42 43 void LayerTreeContext::encode(CoreIPC::ArgumentEncoder* encoder) const 44 { 45 encoder->encode(windowHandle); 46 } 47 48 bool LayerTreeContext::decode(CoreIPC::ArgumentDecoder* decoder, LayerTreeContext& context) 49 { 50 return decoder->decode(context.windowHandle); 51 } 52 53 bool LayerTreeContext::isEmpty() const 54 { 55 return !windowHandle; 56 } 57 58 bool operator==(const LayerTreeContext& a, const LayerTreeContext& b) 59 { 60 return a.windowHandle == b.windowHandle; 61 } 62 67 63 } // namespace WebKit 64 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
r119063 r120262 66 66 #endif 67 67 68 #if USE(TEXTURE_MAPPER_GL) && defined(GDK_WINDOWING_X11) 69 #include <gdk/gdkx.h> 70 #endif 71 68 72 using namespace WebKit; 69 73 using namespace WebCore; … … 155 159 156 160 GdkWindow* window = gdk_window_new(gtk_widget_get_parent_window(widget), &attributes, attributesMask); 161 #if USE(TEXTURE_MAPPER_GL) 162 gdk_window_ensure_native(window); 163 #endif 157 164 gtk_widget_set_window(widget, window); 158 165 gdk_window_set_user_data(window, widget); … … 340 347 341 348 WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(widget); 349 #if USE(TEXTURE_MAPPER_GL) && defined(GDK_WINDOWING_X11) 350 GdkWindow* gdkWindow = gtk_widget_get_window(widget); 351 ASSERT(gdkWindow); 352 if (gdk_window_has_native(gdkWindow)) 353 webViewBase->priv->pageProxy->widgetMapped(GDK_WINDOW_XID(gdkWindow)); 354 #endif 355 342 356 if (!webViewBase->priv->needsResizeOnMap) 343 357 return; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r120215 r120262 668 668 // WebPopupMenuProxy::Client 669 669 virtual NativeWebMouseEvent* currentlyProcessedMouseDownEvent(); 670 671 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL) 672 void widgetMapped(uint64_t nativeWindowId); 673 #endif 670 674 671 675 private: -
trunk/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp
r115300 r120262 32 32 #include "PageClientImpl.h" 33 33 #include "WebKitWebViewBasePrivate.h" 34 #include "WebPageMessages.h" 35 #include "WebProcessProxy.h" 34 36 #include <gtk/gtkx.h> 35 37 … … 108 110 } 109 111 112 #if USE(TEXTURE_MAPPER_GL) 113 void WebPageProxy::widgetMapped(uint64_t nativeWindowId) 114 { 115 process()->send(Messages::WebPage::WidgetMapped(nativeWindowId), m_pageID); 116 } 117 #endif 118 110 119 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
r109302 r120262 39 39 #endif 40 40 41 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL) 42 #include "LayerTreeHostGtk.h" 43 #endif 44 41 45 using namespace WebCore; 42 46 … … 51 55 #elif PLATFORM(QT) 52 56 return LayerTreeHostQt::create(webPage); 57 #elif PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL) 58 return LayerTreeHostGtk::create(webPage); 53 59 #else 54 60 return 0; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r119687 r120262 433 433 #elif PLATFORM(GTK) 434 434 void updateAccessibilityTree(); 435 #if USE(TEXTURE_MAPPER_GL) 436 void widgetMapped(int64_t nativeWindowHandle); 437 #endif 435 438 #endif 436 439 … … 538 541 #if ENABLE(PAGE_VISIBILITY_API) 539 542 void setVisibilityState(int visibilityState, bool isInitialState); 543 #endif 544 545 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL) 546 uint64_t nativeWindowHandle() { return m_nativeWindowHandle; } 540 547 #endif 541 548 … … 754 761 #elif PLATFORM(GTK) 755 762 WebPageAccessibilityObject* m_accessibilityObject; 763 764 #if USE(TEXTURE_MAPPER_GL) 765 // Our view's window in the UI process. 766 uint64_t m_nativeWindowHandle; 767 #endif 756 768 #endif 757 769 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r119687 r120262 274 274 SetVisibilityState(int visibilityState, bool isInitialState); 275 275 #endif 276 277 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL) 278 WidgetMapped(int64_t id) 279 #endif 276 280 } -
trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp
r105503 r120262 55 55 GOwnPtr<gchar> plugID(atk_plug_get_id(ATK_PLUG(m_accessibilityObject))); 56 56 send(Messages::WebPageProxy::BindAccessibilityTree(String(plugID.get()))); 57 58 m_nativeWindowHandle = 0; 57 59 } 58 60 … … 151 153 } 152 154 155 #if USE(TEXTURE_MAPPER_GL) 156 void WebPage::widgetMapped(int64_t nativeWindowHandle) 157 { 158 m_nativeWindowHandle = nativeWindowHandle; 159 } 160 161 #endif 162 153 163 } // namespace WebKit
Note: See TracChangeset
for help on using the changeset viewer.