• mrobinson@webkit.org's avatar
    [GTK] Add accelerated 2D canvas support using cairo-gl · 6d6f5915
    mrobinson@webkit.org authored
    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.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    6d6f5915
SetupWebKitFeatures.m4 6.6 KB