Changeset 137447 in webkit


Ignore:
Timestamp:
Dec 12, 2012 3:34:46 AM (5 years ago)
Author:
joone.hur@intel.com
Message:

[GTK][AC] GraphicsLayers are not shown on the viewport
https://bugs.webkit.org/show_bug.cgi?id=104670

Reviewed by Gustavo Noronha Silva.

GraphicsLayers are not shown on the viewport because the container(GtkClutterEmbed)
is not resized and shown, so this patch allows it to fit to the viewport.

  • WebCoreSupport/AcceleratedCompositingContext.h:
  • WebCoreSupport/AcceleratedCompositingContextClutter.cpp:

(WebKit::AcceleratedCompositingContext::renderLayersToWindow):
(WebKit::AcceleratedCompositingContext::setRootCompositingLayer):
(WebKit::AcceleratedCompositingContext::resizeRootLayer):
(WebKit::AcceleratedCompositingContext::layerFlushTimerFiredCallback):
(WebKit::AcceleratedCompositingContext::scheduleLayerFlush):

Location:
trunk/Source/WebKit/gtk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/gtk/ChangeLog

    r137329 r137447  
     12012-12-12  Joone Hur  <joone.hur@intel.com>
     2
     3        [GTK][AC] GraphicsLayers are not shown on the viewport
     4        https://bugs.webkit.org/show_bug.cgi?id=104670
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        GraphicsLayers are not shown on the viewport because the container(GtkClutterEmbed)
     9        is not resized and shown, so this patch allows it to fit to the viewport.
     10
     11        * WebCoreSupport/AcceleratedCompositingContext.h:
     12        * WebCoreSupport/AcceleratedCompositingContextClutter.cpp:
     13        (WebKit::AcceleratedCompositingContext::renderLayersToWindow):
     14        (WebKit::AcceleratedCompositingContext::setRootCompositingLayer):
     15        (WebKit::AcceleratedCompositingContext::resizeRootLayer):
     16        (WebKit::AcceleratedCompositingContext::layerFlushTimerFiredCallback):
     17        (WebKit::AcceleratedCompositingContext::scheduleLayerFlush):
     18
    1192012-12-11  Carlos Garcia Campos  <cgarcia@igalia.com>
    220
  • trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h

    r133517 r137447  
    7878    WebCore::GraphicsLayer* m_rootGraphicsLayer;
    7979    GtkWidget* m_rootLayerEmbedder;
     80    static gboolean layerFlushTimerFiredCallback(AcceleratedCompositingContext*);
    8081#elif USE(TEXTURE_MAPPER_GL)
    8182    OwnPtr<WebCore::RedirectedXCompositeWindow> m_redirectedWindow;
  • trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContextClutter.cpp

    r133517 r137447  
    5757{
    5858    notImplemented();
    59     return false;
     59    return true;
    6060}
    6161
     
    6969    }
    7070
    71     // Create an instance of GtkClutterEmbed to host actors as web layers.
     71    // Create an instance of GtkClutterEmbed to embed actors as GraphicsLayers.
    7272    if (!m_rootLayerEmbedder) {
    7373        m_rootLayerEmbedder = gtk_clutter_embed_new();
    7474        gtk_container_add(GTK_CONTAINER(m_webView), m_rootLayerEmbedder);
     75
     76        GtkAllocation allocation;
     77        gtk_widget_get_allocation(GTK_WIDGET(m_webView), &allocation);
     78        gtk_widget_size_allocate(GTK_WIDGET(m_rootLayerEmbedder), &allocation);
    7579        gtk_widget_show(m_rootLayerEmbedder);
    7680    }
    7781
    78     // Add a root layer to the stage.
     82    // Add a root GraphicsLayer to the stage.
    7983    if (graphicsLayer) {
    8084        m_rootGraphicsLayer = graphicsLayer;
     
    8589        clutter_actor_show_all(stage);
    8690    }
     91
     92    scheduleLayerFlush();
    8793}
    8894
     
    111117    allocation.height = size.height();
    112118    gtk_widget_size_allocate(GTK_WIDGET(m_rootLayerEmbedder), &allocation);
     119
     120    scheduleLayerFlush();
    113121}
    114122
     
    118126}
    119127
    120 static gboolean flushAndRenderLayersCallback(AcceleratedCompositingContext* context)
     128gboolean AcceleratedCompositingContext::layerFlushTimerFiredCallback(AcceleratedCompositingContext* context)
    121129{
    122130    context->flushAndRenderLayers();
     
    131139    // We use a GLib timer because otherwise GTK+ event handling during
    132140    // dragging can starve WebCore timers, which have a lower priority.
    133     m_layerFlushTimerCallbackId = g_timeout_add_full(GDK_PRIORITY_EVENTS, 0, reinterpret_cast<GSourceFunc>(flushAndRenderLayersCallback), this, 0);
     141    m_layerFlushTimerCallbackId = g_timeout_add_full(GDK_PRIORITY_EVENTS, 0, reinterpret_cast<GSourceFunc>(layerFlushTimerFiredCallback), this, 0);
    134142}
    135143
Note: See TracChangeset for help on using the changeset viewer.