[GTK] Add accelerated 2D canvas support using cairo-gl
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Apr 2013 23:39:44 +0000 (23:39 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Apr 2013 23:39:44 +0000 (23:39 +0000)
commit5e869d566de8bd3bea76cd8e9f5c6d3e77dc82ec
tree1174a729352f515f6abed3f1165b8ed81fca8c44
parentb3bfee9f8ba68c5a610ecab423b763d8d35d0ccd
[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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/ImageBuffer.cpp
Source/WebCore/platform/graphics/cairo/GLContext.h
Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h
Source/WebCore/platform/graphics/egl/GLContextEGL.cpp
Source/WebCore/platform/graphics/egl/GLContextEGL.h
Source/WebCore/platform/graphics/glx/GLContextGLX.cpp
Source/WebCore/platform/graphics/glx/GLContextGLX.h
Source/autotools/FindDependencies.m4
Source/autotools/PrintBuildConfiguration.m4
Source/autotools/SetupWebKitFeatures.m4
Tools/ChangeLog
Tools/Scripts/webkitdirs.pm
Tools/gtk/jhbuild.modules