Changeset 148247 in webkit


Ignore:
Timestamp:
Apr 11, 2013 4:39:44 PM (11 years ago)
Author:
Martin Robinson
Message:

[GTK] Add accelerated 2D canvas support using cairo-gl
https://bugs.webkit.org/show_bug.cgi?id=104672

Reviewed by Alejandro G. Castro.

.:

Detect that we can activate accelerated canvas when CairoGL is present and
TextureMapperGL is enabled.

  • Source/autotools/FindDependencies.m4: Look for CairoGL.
  • Source/autotools/PrintBuildConfiguration.m4: Print the status of accelerated canvas activation.
  • Source/autotools/SetupWebKitFeatures.m4: Set the feature.

Source/WebCore:

No new tests. We do not yet have the ability to run tests against
accelerated content.

  • platform/graphics/GraphicsContext.cpp:

(WebCore): We don't use the stub implementation of isAcceleratedContext any longer.

  • platform/graphics/ImageBuffer.cpp:

(WebCore): Ditto for ImageBuffer::platformLayer.

  • platform/graphics/cairo/GLContext.h:

(GLContext): Added method to get a cairo_device_t from the context.

  • platform/graphics/cairo/GraphicsContextCairo.cpp:

(WebCore::GraphicsContext::isAcceleratedContext): Return true when we are a CairoGL surface.

  • platform/graphics/cairo/ImageBufferCairo.cpp:

(WebCore::ImageBufferData::ImageBufferData): Initialize the size and the texture to 0.
(WebCore::createCairoGLSurface): Added this helper.
(WebCore::ImageBuffer::ImageBuffer): When we are in accelerated rendering mode, create
a CairoGL surface.
(WebCore::ImageBuffer::platformTransformColorSpace): Do not implement this for accelerated
contexts yet.
(WebCore::mapSurfaceToImage): Added this helper, since we don't require Cairo 1.12 yet,
which provides an builtin implementation.
(WebCore::unmapSurfaceFromImage): Ditto.
(WebCore::getImageData): Map the surface to an image surface first.
(WebCore::ImageBuffer::putByteArray): Ditto.
(WebCore::ImageBufferData::paintToTextureMapper): Connect the accelerated canvas into the
TextureMapper infrastructure.
(WebCore::ImageBuffer::platformLayer): This lets the TextureMapper at the ImageBufferData.

  • platform/graphics/cairo/ImageBufferDataCairo.h:

(ImageBufferData): Subclass TexturMapperPlatformLayer where appropriate.

  • platform/graphics/egl/GLContextEGL.cpp: Added implementation of cairoDevice.
  • platform/graphics/egl/GLContextEGL.h: Ditto.
  • platform/graphics/glx/GLContextGLX.cpp: Ditto
  • platform/graphics/glx/GLContextGLX.h: Ditto.

Tools:

Since the value of ACCELERATED_2D_CANVAS relies on some somewhat unusual
dependencies, don't override value of the setting determined by configure.
This will make it easier for people using build-webkit, but not the
WebKit JHBuild.

  • Scripts/webkitdirs.pm:

(buildAutotoolsProject): Add a blacklist for settings to never override.

  • gtk/jhbuild.modules: Build CairoGL.
Location:
trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r148218 r148247  
     12013-04-11  Martin Robinson  <mrobinson@igalia.com>
     2
     3        [GTK] Add accelerated 2D canvas support using cairo-gl
     4        https://bugs.webkit.org/show_bug.cgi?id=104672
     5
     6        Reviewed by Alejandro G. Castro.
     7
     8        Detect that we can activate accelerated canvas when CairoGL is present and
     9        TextureMapperGL is enabled.
     10
     11        * Source/autotools/FindDependencies.m4: Look for CairoGL.
     12        * Source/autotools/PrintBuildConfiguration.m4: Print the status of accelerated canvas activation.
     13        * Source/autotools/SetupWebKitFeatures.m4: Set the feature.
     14
    1152013-04-11  Zan Dobersek  <zdobersek@igalia.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r148245 r148247  
     12013-04-11  Martin Robinson  <mrobinson@igalia.com>
     2
     3        [GTK] Add accelerated 2D canvas support using cairo-gl
     4        https://bugs.webkit.org/show_bug.cgi?id=104672
     5
     6        Reviewed by Alejandro G. Castro.
     7
     8        No new tests. We do not yet have the ability to run tests against
     9        accelerated content.
     10
     11        * platform/graphics/GraphicsContext.cpp:
     12        (WebCore): We don't use the stub implementation of isAcceleratedContext any longer.
     13        * platform/graphics/ImageBuffer.cpp:
     14        (WebCore): Ditto for ImageBuffer::platformLayer.
     15        * platform/graphics/cairo/GLContext.h:
     16        (GLContext): Added method to get a cairo_device_t from the context.
     17        * platform/graphics/cairo/GraphicsContextCairo.cpp:
     18        (WebCore::GraphicsContext::isAcceleratedContext): Return true when we are a CairoGL surface.
     19        * platform/graphics/cairo/ImageBufferCairo.cpp:
     20        (WebCore::ImageBufferData::ImageBufferData): Initialize the size and the texture to 0.
     21        (WebCore::createCairoGLSurface): Added this helper.
     22        (WebCore::ImageBuffer::ImageBuffer): When we are in accelerated rendering mode, create
     23        a CairoGL surface.
     24        (WebCore::ImageBuffer::platformTransformColorSpace): Do not implement this for accelerated
     25        contexts yet.
     26        (WebCore::mapSurfaceToImage): Added this helper, since we don't require Cairo 1.12 yet,
     27        which provides an builtin implementation.
     28        (WebCore::unmapSurfaceFromImage): Ditto.
     29        (WebCore::getImageData): Map the surface to an image surface first.
     30        (WebCore::ImageBuffer::putByteArray): Ditto.
     31        (WebCore::ImageBufferData::paintToTextureMapper): Connect the accelerated canvas into the
     32        TextureMapper infrastructure.
     33        (WebCore::ImageBuffer::platformLayer): This lets the TextureMapper at the ImageBufferData.
     34        * platform/graphics/cairo/ImageBufferDataCairo.h:
     35        (ImageBufferData): Subclass TexturMapperPlatformLayer where appropriate.
     36        * platform/graphics/egl/GLContextEGL.cpp: Added implementation of cairoDevice.
     37        * platform/graphics/egl/GLContextEGL.h: Ditto.
     38        * platform/graphics/glx/GLContextGLX.cpp: Ditto
     39        * platform/graphics/glx/GLContextGLX.h: Ditto.
     40
    1412013-04-11  Anders Carlsson  <andersca@apple.com>
    242
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp

    r147888 r148247  
    758758#endif
    759759
    760 #if !USE(SKIA) && !USE(CG)
     760#if !USE(SKIA) && !USE(CG) && !USE(CAIRO)
    761761bool GraphicsContext::isAcceleratedContext() const
    762762{
  • trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp

    r141570 r148247  
    100100}
    101101
    102 #if USE(ACCELERATED_COMPOSITING) && !USE(SKIA)
     102#if USE(ACCELERATED_COMPOSITING) && !USE(SKIA) && !USE(CAIRO)
    103103PlatformLayer* ImageBuffer::platformLayer() const
    104104{
  • trunk/Source/WebCore/platform/graphics/cairo/GLContext.h

    r130525 r148247  
    2626#include <wtf/PassOwnPtr.h>
    2727
     28typedef struct _cairo_device cairo_device_t;
     29
    2830#if PLATFORM(X11)
    2931typedef struct _XDisplay Display;
     
    4749    virtual bool canRenderToDefaultFramebuffer() = 0;
    4850    virtual IntSize defaultFrameBufferSize() = 0;
     51    virtual cairo_device_t* cairoDevice() = 0;
    4952
    5053#if PLATFORM(X11)
  • trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp

    r147940 r148247  
    11431143}
    11441144
     1145bool GraphicsContext::isAcceleratedContext() const
     1146{
     1147    return cairo_surface_get_type(cairo_get_target(platformContext()->cr())) == CAIRO_SURFACE_TYPE_GL;
     1148}
     1149
    11451150#if ENABLE(3D_RENDERING) && USE(TEXTURE_MAPPER)
    11461151TransformationMatrix GraphicsContext::get3DTransform() const
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp

    r147683 r148247  
    4545#include <wtf/text/WTFString.h>
    4646
     47#if ENABLE(ACCELERATED_2D_CANVAS)
     48#include "GLContext.h"
     49#include "OpenGLShims.h"
     50#include "TextureMapperGL.h"
     51#include <cairo-gl.h>
     52#endif
     53
    4754using namespace std;
    4855
    4956namespace WebCore {
    5057
    51 ImageBufferData::ImageBufferData(const IntSize&)
     58ImageBufferData::ImageBufferData(const IntSize& size)
    5259    : m_platformContext(0)
    53 {
    54 }
    55 
    56 ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, ColorSpace, RenderingMode, bool& success)
     60    , m_size(size)
     61#if ENABLE(ACCELERATED_2D_CANVAS)
     62    , m_texture(0)
     63#endif
     64{
     65}
     66
     67#if ENABLE(ACCELERATED_2D_CANVAS)
     68PassRefPtr<cairo_surface_t> createCairoGLSurface(const IntSize& size, uint32_t& texture)
     69{
     70    GLContext::sharingContext()->makeContextCurrent();
     71
     72    // We must generate the texture ourselves, because there is no Cairo API for extracting it
     73    // from a pre-existing surface.
     74    glGenTextures(1, &texture);
     75    glBindTexture(GL_TEXTURE_2D, texture);
     76    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
     77    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
     78    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     79    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     80
     81    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
     82
     83    glTexImage2D(GL_TEXTURE_2D, 0 /* level */, GL_RGBA8, size.width(), size.height(), 0 /* border */, GL_RGBA, GL_UNSIGNED_BYTE, 0);
     84
     85    GLContext* context = GLContext::sharingContext();
     86    cairo_device_t* device = context->cairoDevice();
     87
     88    // Thread-awareness is a huge performance hit on non-Intel drivers.
     89    cairo_gl_device_set_thread_aware(device, FALSE);
     90
     91    return adoptRef(cairo_gl_surface_create_for_texture(device, CAIRO_CONTENT_COLOR_ALPHA, texture, size.width(), size.height()));
     92}
     93#endif
     94
     95ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, ColorSpace, RenderingMode renderingMode, bool& success)
    5796    : m_data(size)
    5897    , m_size(size)
     
    6099{
    61100    success = false;  // Make early return mean error.
    62     m_data.m_surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, size.width(), size.height()));
     101
     102#if ENABLE(ACCELERATED_2D_CANVAS)
     103    if (renderingMode == Accelerated)
     104        m_data.m_surface = createCairoGLSurface(size, m_data.m_texture);
     105    else
     106#endif
     107        m_data.m_surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, size.width(), size.height()));
     108
    63109    if (cairo_surface_status(m_data.m_surface.get()) != CAIRO_STATUS_SUCCESS)
    64110        return;  // create will notice we didn't set m_initialized and fail.
     
    115161void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
    116162{
    117     ASSERT(cairo_surface_get_type(m_data.m_surface.get()) == CAIRO_SURFACE_TYPE_IMAGE);
     163    // FIXME: Enable color space conversions on accelerated canvases.
     164    if (cairo_surface_get_type(m_data.m_surface.get()) != CAIRO_SURFACE_TYPE_IMAGE)
     165        return;
    118166
    119167    unsigned char* dataSrc = cairo_image_surface_get_data(m_data.m_surface.get());
     
    134182}
    135183
     184static cairo_surface_t* mapSurfaceToImage(cairo_surface_t* surface, const IntSize& size)
     185{
     186    if (cairo_surface_get_type(surface) == CAIRO_SURFACE_TYPE_IMAGE)
     187        return surface;
     188
     189    cairo_surface_t* imageSurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, size.width(), size.height());
     190    RefPtr<cairo_t> cr = adoptRef(cairo_create(imageSurface));
     191    cairo_set_source_surface(cr.get(), surface, 0, 0);
     192    cairo_paint(cr.get());
     193    return imageSurface;
     194}
     195
     196static void unmapSurfaceFromImage(cairo_surface_t* surface, cairo_surface_t* imageSurface, const IntRect& dirtyRectangle = IntRect())
     197{
     198    if (surface == imageSurface && dirtyRectangle.isEmpty())
     199        return;
     200
     201    if (dirtyRectangle.isEmpty()) {
     202        cairo_surface_destroy(imageSurface);
     203        return;
     204    }
     205
     206    if (surface == imageSurface) {
     207        cairo_surface_mark_dirty_rectangle(surface, dirtyRectangle.x(), dirtyRectangle.y(), dirtyRectangle.width(), dirtyRectangle.height());
     208        return;
     209    }
     210
     211    RefPtr<cairo_t> cr = adoptRef(cairo_create(surface));
     212    cairo_set_source_surface(cr.get(), imageSurface, 0, 0);
     213    cairo_rectangle(cr.get(), dirtyRectangle.x(), dirtyRectangle.y(), dirtyRectangle.width(), dirtyRectangle.height());
     214    cairo_fill(cr.get());
     215    cairo_surface_destroy(imageSurface);
     216}
     217
    136218template <Multiply multiplied>
    137219PassRefPtr<Uint8ClampedArray> getImageData(const IntRect& rect, const ImageBufferData& data, const IntSize& size)
    138220{
    139     ASSERT(cairo_surface_get_type(data.m_surface.get()) == CAIRO_SURFACE_TYPE_IMAGE);
    140 
    141221    RefPtr<Uint8ClampedArray> result = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
    142     unsigned char* dataSrc = cairo_image_surface_get_data(data.m_surface.get());
     222    cairo_surface_t* imageSurface = mapSurfaceToImage(data.m_surface.get(), size);
     223    unsigned char* dataSrc = cairo_image_surface_get_data(imageSurface);
    143224    unsigned char* dataDst = result->data();
    144225
     
    168249    int numRows = endy - originy;
    169250
    170     int stride = cairo_image_surface_get_stride(data.m_surface.get());
     251    int stride = cairo_image_surface_get_stride(imageSurface);
    171252    unsigned destBytesPerRow = 4 * rect.width();
    172253
     
    201282    }
    202283
     284    unmapSurfaceFromImage(data.m_surface.get(), imageSurface);
    203285    return result.release();
    204286}
     
    216298void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
    217299{
    218     ASSERT(cairo_surface_get_type(m_data.m_surface.get()) == CAIRO_SURFACE_TYPE_IMAGE);
    219 
    220     unsigned char* dataDst = cairo_image_surface_get_data(m_data.m_surface.get());
     300    cairo_surface_t* imageSurface = mapSurfaceToImage(m_data.m_surface.get(), sourceSize);
     301    unsigned char* dataDst = cairo_image_surface_get_data(imageSurface);
    221302
    222303    ASSERT(sourceRect.width() > 0);
     
    247328
    248329    unsigned srcBytesPerRow = 4 * sourceSize.width();
    249     int stride = cairo_image_surface_get_stride(m_data.m_surface.get());
     330    int stride = cairo_image_surface_get_stride(imageSurface);
    250331
    251332    unsigned char* srcRows = source->data() + originy * srcBytesPerRow + originx * 4;
     
    275356        srcRows += srcBytesPerRow;
    276357    }
    277     cairo_surface_mark_dirty_rectangle(m_data.m_surface.get(), destx, desty, numColumns, numRows);
     358
     359    unmapSurfaceFromImage(m_data.m_surface.get(), imageSurface, IntRect(destx, desty, numColumns, numRows));
    278360}
    279361
     
    310392#endif
    311393
     394#if ENABLE(ACCELERATED_2D_CANVAS)
     395void ImageBufferData::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
     396{
     397    if (textureMapper->accelerationMode() != TextureMapper::OpenGLMode) {
     398        notImplemented();
     399        return;
     400    }
     401
     402    ASSERT(m_texture);
     403
     404    // Cairo may change the active context, so we make sure to change it back after flushing.
     405    GLContext* previousActiveContext = GLContext::getCurrent();
     406    cairo_surface_flush(m_surface.get());
     407    previousActiveContext->makeContextCurrent();
     408
     409    static_cast<TextureMapperGL*>(textureMapper)->drawTexture(m_texture, TextureMapperGL::ShouldBlend, m_size, targetRect, matrix, opacity);
     410}
     411#endif
     412
     413PlatformLayer* ImageBuffer::platformLayer() const
     414{
     415#if ENABLE(ACCELERATED_2D_CANVAS)
     416    if (m_data.m_texture)
     417        return const_cast<ImageBufferData*>(&m_data);
     418#endif
     419    return 0;
     420}
     421
    312422} // namespace WebCore
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h

    r147683 r148247  
    2727#include "RefPtrCairo.h"
    2828
     29#if ENABLE(ACCELERATED_2D_CANVAS)
     30#include "TextureMapper.h"
     31#include "TextureMapperPlatformLayer.h"
     32#endif
     33
    2934namespace WebCore {
    3035
    3136class IntSize;
    3237
    33 class ImageBufferData {
     38class ImageBufferData
     39#if ENABLE(ACCELERATED_2D_CANVAS)
     40    : public TextureMapperPlatformLayer
     41#endif
     42{
    3443public:
    3544    ImageBufferData(const IntSize&);
     
    3746    RefPtr<cairo_surface_t> m_surface;
    3847    PlatformContextCairo m_platformContext;
     48    IntSize m_size;
     49
     50#if ENABLE(ACCELERATED_2D_CANVAS)
     51    virtual void paintToTextureMapper(TextureMapper*, const FloatRect& target, const TransformationMatrix&, float opacity);
     52    uint32_t m_texture;
     53#endif
    3954};
    4055
  • trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp

    r130525 r148247  
    2323
    2424#include "GraphicsContext3D.h"
     25#include <cairo.h>
    2526#include <wtf/OwnPtr.h>
    2627
     
    3031#else
    3132#include "OpenGLShims.h"
     33#endif
     34
     35#if ENABLE(ACCELERATED_2D_CANVAS)
     36#include <cairo-gl.h>
    3237#endif
    3338
     
    209214    , m_surface(surface)
    210215    , m_type(type)
     216    , m_cairoDevice(0)
    211217{
    212218}
     
    214220GLContextEGL::~GLContextEGL()
    215221{
     222    if (m_cairoDevice)
     223        cairo_device_destroy(m_cairoDevice);
     224
    216225    EGLDisplay display = sharedEGLDisplay();
    217226    if (m_context) {
     
    265274}
    266275
     276cairo_device_t* GLContextEGL::cairoDevice()
     277{
     278    if (m_cairoDevice)
     279        return m_cairoDevice;
     280
     281#if ENABLE(ACCELERATED_2D_CANVAS)
     282    m_cairoDevice = cairo_egl_device_create(sharedEGLDisplay(), m_context);
     283#endif
     284
     285    return m_cairoDevice;
     286}
     287
    267288#if ENABLE(WEBGL)
    268289PlatformGraphicsContext3D GLContextEGL::platformContext()
  • trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.h

    r130525 r148247  
    4242    virtual bool canRenderToDefaultFramebuffer();
    4343    virtual IntSize defaultFrameBufferSize();
    44 
     44    virtual cairo_device_t* cairoDevice();
    4545
    4646#if ENABLE(WEBGL)
     
    6060    EGLSurface m_surface;
    6161    EGLSurfaceType m_type;
     62    cairo_device_t* m_cairoDevice;
    6263};
    6364
  • trunk/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp

    r130525 r148247  
    2424#include "OpenGLShims.h"
    2525#include <GL/glx.h>
     26#include <cairo.h>
    2627#include <wtf/OwnPtr.h>
     28
     29#if ENABLE(ACCELERATED_2D_CANVAS)
     30#include <cairo-gl.h>
     31#endif
    2732
    2833namespace WebCore {
     
    169174    , m_pixmap(0)
    170175    , m_glxPixmap(0)
     176    , m_cairoDevice(0)
    171177{
    172178}
     
    178184    , m_pixmap(pixmap)
    179185    , m_glxPixmap(glxPixmap)
     186    , m_cairoDevice(0)
    180187{
    181188}
     
    183190GLContextGLX::~GLContextGLX()
    184191{
     192    if (m_cairoDevice)
     193        cairo_device_destroy(m_cairoDevice);
     194
    185195    if (m_context) {
    186196        // This may be necessary to prevent crashes with NVidia's closed source drivers. Originally
     
    252262}
    253263
     264cairo_device_t* GLContextGLX::cairoDevice()
     265{
     266    if (m_cairoDevice)
     267        return m_cairoDevice;
     268
     269#if ENABLE(ACCELERATED_2D_CANVAS)
     270    m_cairoDevice = cairo_glx_device_create(sharedX11Display(), m_context);
     271#endif
     272
     273    return m_cairoDevice;
     274}
     275
    254276#if USE(3D_GRAPHICS)
    255277PlatformGraphicsContext3D GLContextGLX::platformContext()
  • trunk/Source/WebCore/platform/graphics/glx/GLContextGLX.h

    r136014 r148247  
    4747    virtual bool canRenderToDefaultFramebuffer();
    4848    virtual IntSize defaultFrameBufferSize();
     49    virtual cairo_device_t* cairoDevice();
    4950
    5051#if USE(3D_GRAPHICS)
     
    6465    Pixmap m_pixmap;
    6566    GLXPixmap m_glxPixmap;
     67    cairo_device_t* m_cairoDevice;
    6668};
    6769
  • trunk/Source/autotools/FindDependencies.m4

    r147951 r148247  
    299299    fi
    300300fi
     301
    301302if test "$enable_gamepad" = "yes" && test "$os_linux" = no; then
    302303    AC_MSG_WARN([Gamepad support is only available on Linux. Disabling Gamepad support.])
     
    466467AC_SUBST([OPENGL_LIBS])
    467468
     469enable_accelerated_canvas=no
     470if test "$enable_accelerated_compositing" = "yes" && test "$with_acceleration_backend" = "opengl"; then
     471    CAIRO_GL_LIBS="cairo-gl"
     472    if test "$enable_glx" = "yes"; then
     473        CAIRO_GL_LIBS+=" cairo-glx"
     474    fi
     475    if test "$enable_egl" = "yes"; then
     476        CAIRO_GL_LIBS+=" cairo-egl"
     477    fi
     478
     479    # At the moment CairoGL does not add any extra cflags and libraries, so we can
     480    # safely ignore CAIRO_GL_LIBS and CAIRO_GL_CFLAGS for the moment.
     481    PKG_CHECK_MODULES(CAIRO_GL, $CAIRO_GL_LIBS, [enable_accelerated_canvas=yes], [enable_accelerated_canvas=no])
     482fi
     483
    468484if test "$enable_gamepad" = "yes"; then
    469485    PKG_CHECK_MODULES([GAMEPAD], [gio-unix-2.0 gudev-1.0])
  • trunk/Source/autotools/PrintBuildConfiguration.m4

    r147499 r148247  
    1717 WebKit2 support                                          : $enable_webkit2
    1818 Accelerated Compositing                                  : $enable_accelerated_compositing
     19 Accelerated 2D canvas                                    : $enable_accelerated_canvas
    1920 Gamepad support                                          : $enable_gamepad
    2021 Geolocation support                                      : $enable_geolocation
  • trunk/Source/autotools/SetupWebKitFeatures.m4

    r148088 r148247  
    7272fi
    7373
     74if test "$enable_accelerated_canvas" = "yes"; then
     75    CONFIGURABLE_FEATURE_DEFINES="$CONFIGURABLE_FEATURE_DEFINES ENABLE_ACCELERATED_2D_CANVAS=1"
     76else
     77    CONFIGURABLE_FEATURE_DEFINES="$CONFIGURABLE_FEATURE_DEFINES ENABLE_ACCELERATED_2D_CANVAS=0"
     78fi
     79
    7480if test "$enable_web_audio" = "yes"; then
    7581    CONFIGURABLE_FEATURE_DEFINES="$CONFIGURABLE_FEATURE_DEFINES ENABLE_WEB_AUDIO=1"
     
    8389# on the output file (WebKitFeatures.txt).
    8490$srcdir/Tools/gtk/generate-feature-defines-files $CONFIGURABLE_FEATURE_DEFINES \
    85     ENABLE_ACCELERATED_2D_CANVAS=0 \
    8691    ENABLE_BATTERY_STATUS=0 \
    8792    ENABLE_BLOB=1 \
  • trunk/Tools/ChangeLog

    r148246 r148247  
     12013-04-11  Martin Robinson  <mrobinson@igalia.com>
     2
     3        [GTK] Add accelerated 2D canvas support using cairo-gl
     4        https://bugs.webkit.org/show_bug.cgi?id=104672
     5
     6        Reviewed by Alejandro G. Castro.
     7
     8        Since the value of ACCELERATED_2D_CANVAS relies on some somewhat unusual
     9        dependencies, don't override value of the setting determined by configure.
     10        This will make it easier for people using build-webkit, but not the
     11        WebKit JHBuild.
     12
     13        * Scripts/webkitdirs.pm:
     14        (buildAutotoolsProject): Add a blacklist for settings to never override.
     15        * gtk/jhbuild.modules: Build CairoGL.
     16
    1172013-04-11  Ryosuke Niwa  <rniwa@webkit.org>
    218
  • trunk/Tools/Scripts/webkitdirs.pm

    r147108 r148247  
    21202120        "xslt" => 1,
    21212121    );
     2122
     2123    # These features are ones which build-webkit cannot control, typically because
     2124    # they can only be active when we have the proper dependencies.
     2125    my %unsetFeatures = (
     2126        "accelerated-2d-canvas" => 1,
     2127    );
     2128
    21222129    my @overridableFeatures = ();
    21232130    foreach (@features) {
    21242131        if ($configurableFeatures{$_->{option}}) {
    21252132            push @buildArgs, autotoolsFlag(${$_->{value}}, $_->{option});;
    2126         } else {
     2133        } elsif (!$unsetFeatures{$_->{option}}) {
    21272134            push @overridableFeatures, $_->{define} . "=" . (${$_->{value}} ? "1" : "0");
    21282135        }
  • trunk/Tools/gtk/jhbuild.modules

    r148110 r148247  
    6262  </autotools>
    6363
    64   <autotools id="cairo" autogen-sh="configure">
     64  <autotools id="cairo" autogen-sh="configure"
     65             autogenargs="--enable-gl=yes --enable-egl=yes --enable-glx=yes">
    6566    <dependencies>
    6667      <dep package="fontconfig"/>
Note: See TracChangeset for help on using the changeset viewer.