Changeset 177075 in webkit
- Timestamp:
- Dec 10, 2014 9:42:55 AM (9 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r177073 r177075 1 2014-12-10 Julien Isorce <j.isorce@samsung.com> 2 3 [GTK] Enable depth 32 for the RedirectedXCompositeWindow 4 https://bugs.webkit.org/show_bug.cgi?id=139028 5 6 On gtk/X11, the layout compositing is done in the web process. 7 If one needs to handle alpha with the rest of the application 8 then it is not enough to make to browser's window as RGBA. 9 The shared redirected window needs to be RGBA as well. 10 (The shared X composite window between UIProcess and WebProcess). 11 12 This allows an end-to-end RGBA solution when the application 13 wants to interact with the alpha channel at compositing time. 14 For example for transparent Web UI. 15 16 Reviewed by Martin Robinson. 17 18 * UIProcess/API/gtk/WebKitWebViewBase.cpp: 19 (webkitWebViewBaseRealize): 20 (webkitWebViewBaseConstructed): 21 (webkitWebViewRenderAcceleratedCompositingResults): 22 (webkitWebViewBaseUpdatePreferences): 23 (webkitWebViewBaseCreateWebPage): 24 * UIProcess/gtk/RedirectedXCompositeWindow.cpp: 25 (WebKit::RedirectedXCompositeWindow::create): 26 (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow): 27 * UIProcess/gtk/RedirectedXCompositeWindow.h: 28 1 29 2014-12-09 Claudio Saavedra <csaavedra@igalia.com> and Gustavo Noronha Silva <gustavo.noronha@collabora.com> 2 30 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
r176954 r177075 256 256 static void webkitWebViewBaseRealize(GtkWidget* widget) 257 257 { 258 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11) 259 GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get()); 260 if (GDK_IS_X11_DISPLAY(display)) { 261 WebKitWebViewBasePrivate* priv = WEBKIT_WEB_VIEW_BASE(widget)->priv; 262 GdkWindow* parentWindow = gtk_widget_get_parent_window(widget); 263 priv->redirectedWindow = RedirectedXCompositeWindow::create( 264 GDK_DISPLAY_XDISPLAY(display), 265 parentWindow ? GDK_WINDOW_XID(parentWindow) : 0, 266 IntSize(1, 1), 267 [widget] { 268 gtk_widget_queue_draw(widget); 269 }); 270 if (priv->redirectedWindow) { 271 DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea()); 272 drawingArea->setNativeSurfaceHandleForCompositing(priv->redirectedWindow->windowID()); 273 } 274 webkitWebViewBaseUpdatePreferences(WEBKIT_WEB_VIEW_BASE(widget)); 275 } 276 #endif 277 258 278 gtk_widget_set_realized(widget, TRUE); 259 279 … … 428 448 WebKitWebViewBasePrivate* priv = WEBKIT_WEB_VIEW_BASE(object)->priv; 429 449 priv->pageClient = PageClientImpl::create(viewWidget); 430 431 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11)432 GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());433 if (GDK_IS_X11_DISPLAY(display))434 priv->redirectedWindow = RedirectedXCompositeWindow::create(GDK_DISPLAY_XDISPLAY(display), IntSize(1, 1), [viewWidget] { gtk_widget_queue_draw(viewWidget); });435 #endif436 437 450 priv->authenticationDialog = 0; 438 451 } … … 454 467 cairo_rectangle(cr, clipRect->x, clipRect->y, clipRect->width, clipRect->height); 455 468 cairo_set_source_surface(cr, surface, 0, 0); 469 cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); 456 470 cairo_fill(cr); 457 471 } … … 1028 1042 1029 1043 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11) 1030 if (priv->redirectedWindow) 1031 return; 1032 #endif 1033 1034 priv->pageProxy->preferences().setAcceleratedCompositingEnabled(false); 1044 bool acceleratedCompositingEnabled = priv->redirectedWindow ? true : false; 1045 #else 1046 bool acceleratedCompositingEnabled = false; 1047 #endif 1048 1049 priv->pageProxy->preferences().setAcceleratedCompositingEnabled(acceleratedCompositingEnabled); 1035 1050 } 1036 1051 … … 1055 1070 1056 1071 priv->inputMethodFilter.setPage(priv->pageProxy.get()); 1057 1058 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11)1059 if (priv->redirectedWindow) {1060 DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea());1061 drawingArea->setNativeSurfaceHandleForCompositing(priv->redirectedWindow->windowID());1062 }1063 #endif1064 1072 1065 1073 #if HAVE(GTK_SCALE_FACTOR) -
trunk/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp
r176016 r177075 127 127 } 128 128 129 std::unique_ptr<RedirectedXCompositeWindow> RedirectedXCompositeWindow::create(Display* display, const IntSize& size, std::function<void()> damageNotify)130 { 131 return supportsXDamageAndXComposite(display) ? std::unique_ptr<RedirectedXCompositeWindow>(new RedirectedXCompositeWindow(display, size, damageNotify)) : nullptr;132 } 133 134 RedirectedXCompositeWindow::RedirectedXCompositeWindow(Display* display, const IntSize& size, std::function<void()> damageNotify)129 std::unique_ptr<RedirectedXCompositeWindow> RedirectedXCompositeWindow::create(Display* display, Window parent, const IntSize& size, std::function<void()> damageNotify) 130 { 131 return supportsXDamageAndXComposite(display) ? std::unique_ptr<RedirectedXCompositeWindow>(new RedirectedXCompositeWindow(display, parent, size, damageNotify)) : nullptr; 132 } 133 134 RedirectedXCompositeWindow::RedirectedXCompositeWindow(Display* display, Window parent, const IntSize& size, std::function<void()> damageNotify) 135 135 : m_display(display) 136 136 , m_size(size) … … 147 147 windowAttributes.override_redirect = True; 148 148 m_parentWindow = XCreateWindow(display, 149 RootWindowOfScreen(screen),149 parent ? parent : RootWindowOfScreen(screen), 150 150 WidthOfScreen(screen) + 1, 0, 1, 1, 151 151 0, … … 156 156 &windowAttributes); 157 157 XMapWindow(display, m_parentWindow); 158 159 // The top parent is only necessary to copy from parent the visual and depth at creation time. 160 if (parent) 161 XReparentWindow(display, m_parentWindow, RootWindowOfScreen(screen), WidthOfScreen(screen) + 1, 0); 158 162 159 163 windowAttributes.event_mask = StructureNotifyMask; -
trunk/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.h
r176118 r177075 43 43 class RedirectedXCompositeWindow { 44 44 public: 45 static std::unique_ptr<RedirectedXCompositeWindow> create(Display*, const WebCore::IntSize&, std::function<void()> damageNotify);45 static std::unique_ptr<RedirectedXCompositeWindow> create(Display*, Window parent, const WebCore::IntSize&, std::function<void()> damageNotify); 46 46 ~RedirectedXCompositeWindow(); 47 47 … … 51 51 52 52 private: 53 RedirectedXCompositeWindow(Display*, const WebCore::IntSize&, std::function<void()> damageNotify);53 RedirectedXCompositeWindow(Display*, Window parent, const WebCore::IntSize&, std::function<void()> damageNotify); 54 54 void cleanupPixmapAndPixmapSurface(); 55 55
Note: See TracChangeset
for help on using the changeset viewer.