Changeset 104194 in webkit
- Timestamp:
- Jan 5, 2012 12:18:59 PM (12 years ago)
- Location:
- trunk/Source/WebKit/gtk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/gtk/ChangeLog
r103929 r104194 1 2012-01-05 Martin Robinson <mrobinson@igalia.com> 2 3 [GTK] [AC] Introduce AcceleratedCompositingContext to isolate different accelerated compositing implementations 4 https://bugs.webkit.org/show_bug.cgi?id=75519 5 6 Reviewed by Alejandro G. Castro. 7 8 Add an AcceleratedCompositingContext which will isolate all the different accelerated compositing 9 implementations from one another. For right now this just includes the Clutter version. 10 11 * GNUmakefile.am: Add the new files to the source list. 12 * WebCoreSupport/AcceleratedCompositingContext.h: Added. 13 * WebCoreSupport/AcceleratedCompositingContextClutter.cpp: Added. Existing 14 clutter AC code has moved here. 15 * WebCoreSupport/ChromeClientGtk.cpp: 16 (WebKit::ChromeClient::attachRootGraphicsLayer): Use the new AccleratedCompositingContext now 17 instead of calling into the WebView. 18 (WebKit::ChromeClient::setNeedsOneShotDrawingSynchronization):Ditto. 19 (WebKit::ChromeClient::scheduleCompositingLayerSync): Ditto. 20 * webkit/webkitwebview.cpp: 21 (webkit_web_view_size_allocate): Call in the ACContext. 22 (webkit_web_view_init): Initialize the ACContext. 23 * webkit/webkitwebviewprivate.h: Add the ACContext as a private member. 24 1 25 2012-01-03 Carlos Garcia Campos <cgarcia@igalia.com> 2 26 -
trunk/Source/WebKit/gtk/GNUmakefile.am
r103929 r104194 185 185 Source/WebCore/bindings/gobject/WebKitHTMLElementWrapperFactory.cpp \ 186 186 Source/WebCore/bindings/gobject/WebKitHTMLElementWrapperFactory.h \ 187 Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h \ 188 Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContextClutter.cpp \ 187 189 Source/WebKit/gtk/WebCoreSupport/AssertMatchingEnums.cpp \ 188 190 Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \ -
trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
r102874 r104194 928 928 void ChromeClient::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* rootLayer) 929 929 { 930 if (rootLayer) 931 webViewSetRootGraphicsLayer(m_webView, rootLayer); 932 else 933 webViewDetachRootGraphicsLayer(m_webView); 930 m_webView->priv->acceleratedCompositingContext->attachRootGraphicsLayer(rootLayer); 934 931 } 935 932 936 933 void ChromeClient::setNeedsOneShotDrawingSynchronization() 937 934 { 938 webViewMarkForSync(m_webView, FALSE);935 m_webView->priv->acceleratedCompositingContext->markForSync(); 939 936 } 940 937 941 938 void ChromeClient::scheduleCompositingLayerSync() 942 939 { 943 webViewMarkForSync(m_webView, TRUE);940 m_webView->priv->acceleratedCompositingContext->markForSync(); 944 941 } 945 942 -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r103321 r104194 8 8 * Copyright (C) 2008 Nuanti Ltd. 9 9 * Copyright (C) 2008, 2009, 2010 Collabora Ltd. 10 * Copyright (C) 2009, 2010 Igalia S.L.10 * Copyright (C) 2009, 2010, 2012 Igalia S.L. 11 11 * Copyright (C) 2009 Movial Creative Technologies Inc. 12 12 * Copyright (C) 2009 Bobby Powers … … 873 873 chromeClient->adjustmentWatcher()->updateAdjustmentsFromScrollbars(); 874 874 875 #if USE(ACCELERATED_COMPOSITING) && USE(CLUTTER) 876 if (webView->priv->rootLayerEmbedder) { 877 allocation->x = 0; 878 allocation->y = 0; 879 gtk_widget_size_allocate(GTK_WIDGET(webView->priv->rootLayerEmbedder), allocation); 880 } 875 #if USE(ACCELERATED_COMPOSITING) 876 WEBKIT_WEB_VIEW(widget)->priv->acceleratedCompositingContext->resizeRootLayer(IntSize(allocation->width, allocation->height)); 881 877 #endif 882 878 } … … 3338 3334 3339 3335 priv->selfScrolling = false; 3336 3337 #if USE(ACCELERATED_COMPOSITING) 3338 priv->acceleratedCompositingContext = AcceleratedCompositingContext::create(webView); 3339 #endif 3340 3340 } 3341 3341 … … 4910 4910 } 4911 4911 4912 #if USE(ACCELERATED_COMPOSITING)4913 void webViewSetRootGraphicsLayer(WebKitWebView* webView, GraphicsLayer* graphicsLayer)4914 {4915 #if USE(CLUTTER)4916 WebKitWebViewPrivate* priv = webView->priv;4917 4918 // Create an instance of GtkClutterEmbed to host actors as web layers.4919 if (!priv->rootLayerEmbedder) {4920 priv->rootLayerEmbedder = gtk_clutter_embed_new();4921 gtk_container_add(GTK_CONTAINER(webView), priv->rootLayerEmbedder);4922 gtk_widget_show(priv->rootLayerEmbedder);4923 }4924 4925 // Add a root layer to the stage.4926 if (graphicsLayer) {4927 priv->rootGraphicsLayer = graphicsLayer;4928 // set white background4929 ClutterColor stageColor = { 0xFF, 0xFF, 0xFF, 0xFF };4930 ClutterActor* stage = gtk_clutter_embed_get_stage(GTK_CLUTTER_EMBED(priv->rootLayerEmbedder));4931 clutter_stage_set_color(CLUTTER_STAGE (stage), &stageColor);4932 clutter_container_add_actor(CLUTTER_CONTAINER(stage), priv->rootGraphicsLayer->platformLayer());4933 clutter_actor_show_all(stage);4934 }4935 #else4936 notImplemented();4937 #endif4938 }4939 4940 void webViewDetachRootGraphicsLayer(WebKitWebView* webView)4941 {4942 #if USE(CLUTTER)4943 WebKitWebViewPrivate* priv = webView->priv;4944 // Detach the root layer from the hosting view.4945 gtk_container_remove(GTK_CONTAINER(webView), priv->rootLayerEmbedder);4946 priv->rootLayerEmbedder = 0;4947 priv->rootGraphicsLayer = 0;4948 #else4949 notImplemented();4950 #endif4951 }4952 4953 #if USE(CLUTTER)4954 static gboolean webViewSyncLayers(gpointer data)4955 {4956 WebKitWebView* webView = WEBKIT_WEB_VIEW(data);4957 core(webView)->mainFrame()->view()->syncCompositingStateIncludingSubframes();4958 4959 return FALSE;4960 }4961 #endif4962 4963 void webViewMarkForSync(WebKitWebView* webView, gboolean scheduleSync)4964 {4965 #if USE(CLUTTER)4966 g_timeout_add(0, webViewSyncLayers, webView);4967 #else4968 notImplemented();4969 #endif4970 }4971 4972 #endif4973 4974 4912 namespace WebKit { 4975 4913 -
trunk/Source/WebKit/gtk/webkit/webkitwebviewprivate.h
r102448 r104194 24 24 #define webkitwebviewprivate_h 25 25 26 #include "AcceleratedCompositingContext.h" 26 27 #include "FullscreenVideoController.h" 27 28 #include "GtkClickCounter.h" … … 32 33 #include "WidgetBackingStore.h" 33 34 #include <webkit/webkitwebview.h> 34 35 #if USE(ACCELERATED_COMPOSITING) && USE(CLUTTER)36 #include <clutter-gtk/clutter-gtk.h>37 #include <clutter/clutter.h>38 #endif39 35 40 36 namespace WebKit { … … 98 94 WebCore::GtkDragAndDropHelper dragAndDropHelper; 99 95 bool selfScrolling; 100 #if USE(ACCELERATED_COMPOSITING) && USE(CLUTTER) 101 WebCore::GraphicsLayer* rootGraphicsLayer; 102 GtkWidget* rootLayerEmbedder;96 97 #if USE(ACCELERATED_COMPOSITING) 98 OwnPtr<WebKit::AcceleratedCompositingContext> acceleratedCompositingContext; 103 99 #endif 104 100 }; … … 121 117 void webViewEnterFullscreen(WebKitWebView* webView, WebCore::Node*); 122 118 void webViewExitFullscreen(WebKitWebView* webView); 123 124 #if USE(ACCELERATED_COMPOSITING)125 void webViewSetRootGraphicsLayer(WebKitWebView*, WebCore::GraphicsLayer*);126 void webViewDetachRootGraphicsLayer(WebKitWebView*);127 void webViewMarkForSync(WebKitWebView*, gboolean);128 #endif129 119 } 130 120
Note: See TracChangeset
for help on using the changeset viewer.