Changeset 112141 in webkit


Ignore:
Timestamp:
Mar 26, 2012 12:41:38 PM (12 years ago)
Author:
joone.hur@collabora.co.uk
Message:

[GTK] Build fix for Accelerated Compositing with Clutter
https://bugs.webkit.org/show_bug.cgi?id=81785

Reviewed by Martin Robinson.

Source/WebCore:

AcceleratedCompositingContext was introduced to isolate different accelerated
compositing implementations(r104194), but the Clutter implementation doesn't
build with it. This includes an initial implementation of GraphicsContext3D
and fixes the build error.

  • GNUmakefile.list.am:
  • platform/graphics/clutter/DrawingBufferClutter.cpp: Added.

(WebCore):
(WebCore::DrawingBuffer::DrawingBuffer):
(WebCore::DrawingBuffer::~DrawingBuffer):
(WebCore::DrawingBuffer::platformColorBuffer):
(WebCore::DrawingBuffer::paintCompositedResultsToCanvas):

  • platform/graphics/clutter/GraphicsContext3DClutter.cpp: Added.

(WebCore):
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::getImageData):
(WebCore::GraphicsContext3D::paintToCanvas):
(WebCore::GraphicsContext3D::setContextLostCallback):
(WebCore::GraphicsContext3D::setErrorMessageCallback):
(WebCore::GraphicsContext3D::makeContextCurrent):
(WebCore::GraphicsContext3D::platformGraphicsContext3D):
(WebCore::GraphicsContext3D::isGLES2Compliant):
(WebCore::GraphicsContext3D::platformLayer):

  • platform/graphics/clutter/GraphicsContext3DPrivate.cpp: Added.

(WebCore):
(WebCore::GraphicsContext3DPrivate::create):
(WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
(WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate):
(WebCore::GraphicsContext3DPrivate::makeContextCurrent):
(WebCore::GraphicsContext3DPrivate::platformContext):
(WebCore::GraphicsContext3DPrivate::paintToGraphicsLayerActor):

  • platform/graphics/clutter/GraphicsContext3DPrivate.h: Added.

(WebCore):
(GraphicsContext3DPrivate):
(WebCore::GraphicsContext3DPrivate::platformLayer):

Source/WebKit/gtk:

AcceleratedCompositingContext was introduced to isolate different accelerated
compositing implementations(r104194), but the Clutter implementation doesn't
build with it. This fixes the build error.

  • WebCoreSupport/AcceleratedCompositingContext.h:

(AcceleratedCompositingContext):

  • WebCoreSupport/AcceleratedCompositingContextClutter.cpp:

(WebKit::AcceleratedCompositingContext::AcceleratedCompositingContext):
(WebKit::AcceleratedCompositingContext::renderLayersToWindow):
(WebKit::AcceleratedCompositingContext::resizeRootLayer):
(WebKit::AcceleratedCompositingContext::syncLayersNow):
(WebKit::AcceleratedCompositingContext::syncLayersTimeout):
(WebKit):

Location:
trunk/Source
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112138 r112141  
     12012-03-26  Joone Hur  <joone.hur@collabora.co.uk>
     2
     3        [GTK] Build fix for Accelerated Compositing with Clutter
     4        https://bugs.webkit.org/show_bug.cgi?id=81785
     5
     6        Reviewed by Martin Robinson.
     7
     8        AcceleratedCompositingContext was introduced to isolate different accelerated
     9        compositing implementations(r104194), but the Clutter implementation doesn't
     10        build with it. This includes an initial implementation of GraphicsContext3D
     11        and fixes the build error.
     12
     13        * GNUmakefile.list.am:
     14        * platform/graphics/clutter/DrawingBufferClutter.cpp: Added.
     15        (WebCore):
     16        (WebCore::DrawingBuffer::DrawingBuffer):
     17        (WebCore::DrawingBuffer::~DrawingBuffer):
     18        (WebCore::DrawingBuffer::platformColorBuffer):
     19        (WebCore::DrawingBuffer::paintCompositedResultsToCanvas):
     20        * platform/graphics/clutter/GraphicsContext3DClutter.cpp: Added.
     21        (WebCore):
     22        (WebCore::GraphicsContext3D::create):
     23        (WebCore::GraphicsContext3D::GraphicsContext3D):
     24        (WebCore::GraphicsContext3D::~GraphicsContext3D):
     25        (WebCore::GraphicsContext3D::getImageData):
     26        (WebCore::GraphicsContext3D::paintToCanvas):
     27        (WebCore::GraphicsContext3D::setContextLostCallback):
     28        (WebCore::GraphicsContext3D::setErrorMessageCallback):
     29        (WebCore::GraphicsContext3D::makeContextCurrent):
     30        (WebCore::GraphicsContext3D::platformGraphicsContext3D):
     31        (WebCore::GraphicsContext3D::isGLES2Compliant):
     32        (WebCore::GraphicsContext3D::platformLayer):
     33        * platform/graphics/clutter/GraphicsContext3DPrivate.cpp: Added.
     34        (WebCore):
     35        (WebCore::GraphicsContext3DPrivate::create):
     36        (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
     37        (WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate):
     38        (WebCore::GraphicsContext3DPrivate::makeContextCurrent):
     39        (WebCore::GraphicsContext3DPrivate::platformContext):
     40        (WebCore::GraphicsContext3DPrivate::paintToGraphicsLayerActor):
     41        * platform/graphics/clutter/GraphicsContext3DPrivate.h: Added.
     42        (WebCore):
     43        (GraphicsContext3DPrivate):
     44        (WebCore::GraphicsContext3DPrivate::platformLayer):
     45
    1462012-03-26  Peter Rybin  <prybin@chromium.org>
    247
  • trunk/Source/WebCore/GNUmakefile.list.am

    r112082 r112141  
    58065806        Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp \
    58075807        Source/WebCore/platform/graphics/ANGLEWebKitBridge.h \
    5808         Source/WebCore/platform/graphics/cairo/DrawingBufferCairo.cpp \
    5809         Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp \
    5810         Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp \
    5811         Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.h \
    58125808        Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp \
    58135809        Source/WebCore/platform/graphics/gpu/DrawingBuffer.h \
     
    58205816        Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp \
    58215817        Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
     5818if USE_CLUTTER
     5819webcore_sources += \
     5820        Source/WebCore/platform/graphics/clutter/DrawingBufferClutter.cpp \
     5821        Source/WebCore/platform/graphics/clutter/GraphicsContext3DClutter.cpp \
     5822        Source/WebCore/platform/graphics/clutter/GraphicsContext3DPrivate.cpp \
     5823        Source/WebCore/platform/graphics/clutter/GraphicsContext3DPrivate.h
     5824else
     5825webcore_sources += \
     5826        Source/WebCore/platform/graphics/cairo/DrawingBufferCairo.cpp \
     5827        Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp \
     5828        Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp \
     5829        Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.h
     5830endif  # END USE_CLUTTER
     5831
    58225832endif  # END ENABLE_WEBGL
    58235833
  • trunk/Source/WebKit/gtk/ChangeLog

    r112111 r112141  
     12012-03-26  Joone Hur  <joone.hur@collabora.co.uk>
     2
     3        [GTK] Build fix for Accelerated Compositing with Clutter
     4        https://bugs.webkit.org/show_bug.cgi?id=81785
     5
     6        Reviewed by Martin Robinson.
     7
     8        AcceleratedCompositingContext was introduced to isolate different accelerated
     9        compositing implementations(r104194), but the Clutter implementation doesn't
     10        build with it. This fixes the build error.
     11
     12        * WebCoreSupport/AcceleratedCompositingContext.h:
     13        (AcceleratedCompositingContext):
     14        * WebCoreSupport/AcceleratedCompositingContextClutter.cpp:
     15        (WebKit::AcceleratedCompositingContext::AcceleratedCompositingContext):
     16        (WebKit::AcceleratedCompositingContext::renderLayersToWindow):
     17        (WebKit::AcceleratedCompositingContext::resizeRootLayer):
     18        (WebKit::AcceleratedCompositingContext::syncLayersNow):
     19        (WebKit::AcceleratedCompositingContext::syncLayersTimeout):
     20        (WebKit):
     21
    1222012-03-26  Gary Kramlich  <grim@reaperworld.com>
    223
  • trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h

    r109605 r112141  
    6464private:
    6565    WebKitWebView* m_webView;
    66     OwnPtr<WebCore::GraphicsLayer> m_rootGraphicsLayer;
    6766    unsigned int m_syncTimerCallbackId;
    6867
    6968#if USE(CLUTTER)
     69    WebCore::GraphicsLayer* m_rootGraphicsLayer;
    7070    GtkWidget* m_rootLayerEmbedder;
    7171#elif USE(TEXTURE_MAPPER_GL)
    7272    WebCore::GLContext* glContext();
    7373    WebCore::TextureMapperLayer* m_rootTextureMapperLayer;
     74    OwnPtr<WebCore::GraphicsLayer> m_rootGraphicsLayer;
    7475    OwnPtr<WebCore::TextureMapper> m_textureMapper;
    7576#endif
  • trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContextClutter.cpp

    r108104 r112141  
    2626#include "FrameView.h"
    2727#include "GraphicsLayer.h"
     28#include "NotImplemented.h"
    2829#include "webkitwebviewprivate.h"
    2930#include <clutter-gtk/clutter-gtk.h>
     
    3637AcceleratedCompositingContext::AcceleratedCompositingContext(WebKitWebView* webView)
    3738    : m_webView(webView)
     39    , m_syncTimerCallbackId(0)
    3840    , m_rootGraphicsLayer(0)
    39     , m_syncTimerCallbackId(0)
    4041    , m_rootLayerEmbedder(0)
    4142{
     
    5354}
    5455
    55 bool AcceleratedCompositingContext::renderLayersToWindow(cairo_t* widgetCr, const IntRect& clipRect)
     56bool AcceleratedCompositingContext::renderLayersToWindow(const IntRect& clipRect)
    5657{
    5758    notImplemented();
     
    109110    allocation.width = size.width();
    110111    allocation.height = size.height();
    111     gtk_widget_size_allocate(GTK_WIDGET(m_webView->priv->rootLayerEmbedder), &allocation);
     112    gtk_widget_size_allocate(GTK_WIDGET(m_rootLayerEmbedder), &allocation);
    112113}
    113114
     
    128129}
    129130
     131void AcceleratedCompositingContext::syncLayersNow()
     132{
     133    if (m_rootGraphicsLayer)
     134        m_rootGraphicsLayer->syncCompositingStateForThisLayerOnly();
     135
     136    core(m_webView)->mainFrame()->view()->syncCompositingStateIncludingSubframes();
     137}
     138
    130139void AcceleratedCompositingContext::syncLayersTimeout()
    131140{
    132     core(m_webView)->mainFrame()->view()->syncCompositingStateIncludingSubframes();
     141    m_syncTimerCallbackId = 0;
     142    syncLayersNow();
     143    if (!m_rootGraphicsLayer)
     144        return;
     145
     146    renderLayersToWindow(IntRect());
    133147}
    134148
Note: See TracChangeset for help on using the changeset viewer.