Commit 6d6f5915 authored by mrobinson@webkit.org's avatar mrobinson@webkit.org

[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: http://svn.webkit.org/repository/webkit/trunk@148247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a5647674
2013-04-11 Martin Robinson <mrobinson@igalia.com>
[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.
2013-04-11 Zan Dobersek <zdobersek@igalia.com>
Unreviewed.
......
2013-04-11 Martin Robinson <mrobinson@igalia.com>
[GTK] Add accelerated 2D canvas support using cairo-gl
https://bugs.webkit.org/show_bug.cgi?id=104672
Reviewed by Alejandro G. Castro.
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.
2013-04-11 Anders Carlsson <andersca@apple.com>
Implement removing storage area items
......@@ -757,7 +757,7 @@ void GraphicsContext::setPlatformShouldSmoothFonts(bool)
}
#endif
#if !USE(SKIA) && !USE(CG)
#if !USE(SKIA) && !USE(CG) && !USE(CAIRO)
bool GraphicsContext::isAcceleratedContext() const
{
return false;
......
......@@ -99,7 +99,7 @@ void ImageBuffer::convertToLuminanceMask()
genericConvertToLuminanceMask();
}
#if USE(ACCELERATED_COMPOSITING) && !USE(SKIA)
#if USE(ACCELERATED_COMPOSITING) && !USE(SKIA) && !USE(CAIRO)
PlatformLayer* ImageBuffer::platformLayer() const
{
return 0;
......
......@@ -25,6 +25,8 @@
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
typedef struct _cairo_device cairo_device_t;
#if PLATFORM(X11)
typedef struct _XDisplay Display;
#endif
......@@ -46,6 +48,7 @@ public:
virtual void waitNative() = 0;
virtual bool canRenderToDefaultFramebuffer() = 0;
virtual IntSize defaultFrameBufferSize() = 0;
virtual cairo_device_t* cairoDevice() = 0;
#if PLATFORM(X11)
static Display* sharedX11Display();
......
......@@ -1142,6 +1142,11 @@ InterpolationQuality GraphicsContext::imageInterpolationQuality() const
return platformContext()->imageInterpolationQuality();
}
bool GraphicsContext::isAcceleratedContext() const
{
return cairo_surface_get_type(cairo_get_target(platformContext()->cr())) == CAIRO_SURFACE_TYPE_GL;
}
#if ENABLE(3D_RENDERING) && USE(TEXTURE_MAPPER)
TransformationMatrix GraphicsContext::get3DTransform() const
{
......
......@@ -44,22 +44,68 @@
#include <wtf/text/Base64.h>
#include <wtf/text/WTFString.h>
#if ENABLE(ACCELERATED_2D_CANVAS)
#include "GLContext.h"
#include "OpenGLShims.h"
#include "TextureMapperGL.h"
#include <cairo-gl.h>
#endif
using namespace std;
namespace WebCore {
ImageBufferData::ImageBufferData(const IntSize&)
ImageBufferData::ImageBufferData(const IntSize& size)
: m_platformContext(0)
, m_size(size)
#if ENABLE(ACCELERATED_2D_CANVAS)
, m_texture(0)
#endif
{
}
ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, ColorSpace, RenderingMode, bool& success)
#if ENABLE(ACCELERATED_2D_CANVAS)
PassRefPtr<cairo_surface_t> createCairoGLSurface(const IntSize& size, uint32_t& texture)
{
GLContext::sharingContext()->makeContextCurrent();
// We must generate the texture ourselves, because there is no Cairo API for extracting it
// from a pre-existing surface.
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexImage2D(GL_TEXTURE_2D, 0 /* level */, GL_RGBA8, size.width(), size.height(), 0 /* border */, GL_RGBA, GL_UNSIGNED_BYTE, 0);
GLContext* context = GLContext::sharingContext();
cairo_device_t* device = context->cairoDevice();
// Thread-awareness is a huge performance hit on non-Intel drivers.
cairo_gl_device_set_thread_aware(device, FALSE);
return adoptRef(cairo_gl_surface_create_for_texture(device, CAIRO_CONTENT_COLOR_ALPHA, texture, size.width(), size.height()));
}
#endif
ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, ColorSpace, RenderingMode renderingMode, bool& success)
: m_data(size)
, m_size(size)
, m_logicalSize(size)
{
success = false; // Make early return mean error.
m_data.m_surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, size.width(), size.height()));
#if ENABLE(ACCELERATED_2D_CANVAS)
if (renderingMode == Accelerated)
m_data.m_surface = createCairoGLSurface(size, m_data.m_texture);
else
#endif
m_data.m_surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, size.width(), size.height()));
if (cairo_surface_status(m_data.m_surface.get()) != CAIRO_STATUS_SUCCESS)
return; // create will notice we didn't set m_initialized and fail.
......@@ -114,7 +160,9 @@ void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect
void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
{
ASSERT(cairo_surface_get_type(m_data.m_surface.get()) == CAIRO_SURFACE_TYPE_IMAGE);
// FIXME: Enable color space conversions on accelerated canvases.
if (cairo_surface_get_type(m_data.m_surface.get()) != CAIRO_SURFACE_TYPE_IMAGE)
return;
unsigned char* dataSrc = cairo_image_surface_get_data(m_data.m_surface.get());
int stride = cairo_image_surface_get_stride(m_data.m_surface.get());
......@@ -133,13 +181,46 @@ void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
cairo_surface_mark_dirty_rectangle(m_data.m_surface.get(), 0, 0, m_size.width(), m_size.height());
}
static cairo_surface_t* mapSurfaceToImage(cairo_surface_t* surface, const IntSize& size)
{
if (cairo_surface_get_type(surface) == CAIRO_SURFACE_TYPE_IMAGE)
return surface;
cairo_surface_t* imageSurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, size.width(), size.height());
RefPtr<cairo_t> cr = adoptRef(cairo_create(imageSurface));
cairo_set_source_surface(cr.get(), surface, 0, 0);
cairo_paint(cr.get());
return imageSurface;
}
static void unmapSurfaceFromImage(cairo_surface_t* surface, cairo_surface_t* imageSurface, const IntRect& dirtyRectangle = IntRect())
{
if (surface == imageSurface && dirtyRectangle.isEmpty())
return;
if (dirtyRectangle.isEmpty()) {
cairo_surface_destroy(imageSurface);
return;
}
if (surface == imageSurface) {
cairo_surface_mark_dirty_rectangle(surface, dirtyRectangle.x(), dirtyRectangle.y(), dirtyRectangle.width(), dirtyRectangle.height());
return;
}
RefPtr<cairo_t> cr = adoptRef(cairo_create(surface));
cairo_set_source_surface(cr.get(), imageSurface, 0, 0);
cairo_rectangle(cr.get(), dirtyRectangle.x(), dirtyRectangle.y(), dirtyRectangle.width(), dirtyRectangle.height());
cairo_fill(cr.get());
cairo_surface_destroy(imageSurface);
}
template <Multiply multiplied>
PassRefPtr<Uint8ClampedArray> getImageData(const IntRect& rect, const ImageBufferData& data, const IntSize& size)
{
ASSERT(cairo_surface_get_type(data.m_surface.get()) == CAIRO_SURFACE_TYPE_IMAGE);
RefPtr<Uint8ClampedArray> result = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
unsigned char* dataSrc = cairo_image_surface_get_data(data.m_surface.get());
cairo_surface_t* imageSurface = mapSurfaceToImage(data.m_surface.get(), size);
unsigned char* dataSrc = cairo_image_surface_get_data(imageSurface);
unsigned char* dataDst = result->data();
if (rect.x() < 0 || rect.y() < 0 || (rect.x() + rect.width()) > size.width() || (rect.y() + rect.height()) > size.height())
......@@ -167,7 +248,7 @@ PassRefPtr<Uint8ClampedArray> getImageData(const IntRect& rect, const ImageBuffe
endy = size.height();
int numRows = endy - originy;
int stride = cairo_image_surface_get_stride(data.m_surface.get());
int stride = cairo_image_surface_get_stride(imageSurface);
unsigned destBytesPerRow = 4 * rect.width();
unsigned char* destRows = dataDst + desty * destBytesPerRow + destx * 4;
......@@ -200,6 +281,7 @@ PassRefPtr<Uint8ClampedArray> getImageData(const IntRect& rect, const ImageBuffe
destRows += destBytesPerRow;
}
unmapSurfaceFromImage(data.m_surface.get(), imageSurface);
return result.release();
}
......@@ -215,9 +297,8 @@ PassRefPtr<Uint8ClampedArray> ImageBuffer::getPremultipliedImageData(const IntRe
void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
{
ASSERT(cairo_surface_get_type(m_data.m_surface.get()) == CAIRO_SURFACE_TYPE_IMAGE);
unsigned char* dataDst = cairo_image_surface_get_data(m_data.m_surface.get());
cairo_surface_t* imageSurface = mapSurfaceToImage(m_data.m_surface.get(), sourceSize);
unsigned char* dataDst = cairo_image_surface_get_data(imageSurface);
ASSERT(sourceRect.width() > 0);
ASSERT(sourceRect.height() > 0);
......@@ -246,7 +327,7 @@ void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, c
int numRows = endy - desty;
unsigned srcBytesPerRow = 4 * sourceSize.width();
int stride = cairo_image_surface_get_stride(m_data.m_surface.get());
int stride = cairo_image_surface_get_stride(imageSurface);
unsigned char* srcRows = source->data() + originy * srcBytesPerRow + originx * 4;
for (int y = 0; y < numRows; ++y) {
......@@ -274,7 +355,8 @@ void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, c
}
srcRows += srcBytesPerRow;
}
cairo_surface_mark_dirty_rectangle(m_data.m_surface.get(), destx, desty, numColumns, numRows);
unmapSurfaceFromImage(m_data.m_surface.get(), imageSurface, IntRect(destx, desty, numColumns, numRows));
}
#if !PLATFORM(GTK)
......@@ -309,4 +391,32 @@ String ImageBuffer::toDataURL(const String& mimeType, const double*, CoordinateS
}
#endif
#if ENABLE(ACCELERATED_2D_CANVAS)
void ImageBufferData::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
{
if (textureMapper->accelerationMode() != TextureMapper::OpenGLMode) {
notImplemented();
return;
}
ASSERT(m_texture);
// Cairo may change the active context, so we make sure to change it back after flushing.
GLContext* previousActiveContext = GLContext::getCurrent();
cairo_surface_flush(m_surface.get());
previousActiveContext->makeContextCurrent();
static_cast<TextureMapperGL*>(textureMapper)->drawTexture(m_texture, TextureMapperGL::ShouldBlend, m_size, targetRect, matrix, opacity);
}
#endif
PlatformLayer* ImageBuffer::platformLayer() const
{
#if ENABLE(ACCELERATED_2D_CANVAS)
if (m_data.m_texture)
return const_cast<ImageBufferData*>(&m_data);
#endif
return 0;
}
} // namespace WebCore
......@@ -26,16 +26,31 @@
#include "PlatformContextCairo.h"
#include "RefPtrCairo.h"
#if ENABLE(ACCELERATED_2D_CANVAS)
#include "TextureMapper.h"
#include "TextureMapperPlatformLayer.h"
#endif
namespace WebCore {
class IntSize;
class ImageBufferData {
class ImageBufferData
#if ENABLE(ACCELERATED_2D_CANVAS)
: public TextureMapperPlatformLayer
#endif
{
public:
ImageBufferData(const IntSize&);
RefPtr<cairo_surface_t> m_surface;
PlatformContextCairo m_platformContext;
IntSize m_size;
#if ENABLE(ACCELERATED_2D_CANVAS)
virtual void paintToTextureMapper(TextureMapper*, const FloatRect& target, const TransformationMatrix&, float opacity);
uint32_t m_texture;
#endif
};
} // namespace WebCore
......@@ -22,6 +22,7 @@
#if USE(EGL)
#include "GraphicsContext3D.h"
#include <cairo.h>
#include <wtf/OwnPtr.h>
#if USE(OPENGL_ES_2)
......@@ -31,6 +32,10 @@
#include "OpenGLShims.h"
#endif
#if ENABLE(ACCELERATED_2D_CANVAS)
#include <cairo-gl.h>
#endif
namespace WebCore {
static EGLDisplay gSharedEGLDisplay = EGL_NO_DISPLAY;
......@@ -208,11 +213,15 @@ GLContextEGL::GLContextEGL(EGLContext context, EGLSurface surface, EGLSurfaceTyp
: m_context(context)
, m_surface(surface)
, m_type(type)
, m_cairoDevice(0)
{
}
GLContextEGL::~GLContextEGL()
{
if (m_cairoDevice)
cairo_device_destroy(m_cairoDevice);
EGLDisplay display = sharedEGLDisplay();
if (m_context) {
glBindFramebuffer(GL_FRAMEBUFFER, 0);
......@@ -264,6 +273,18 @@ void GLContextEGL::waitNative()
eglWaitNative(EGL_CORE_NATIVE_ENGINE);
}
cairo_device_t* GLContextEGL::cairoDevice()
{
if (m_cairoDevice)
return m_cairoDevice;
#if ENABLE(ACCELERATED_2D_CANVAS)
m_cairoDevice = cairo_egl_device_create(sharedEGLDisplay(), m_context);
#endif
return m_cairoDevice;
}
#if ENABLE(WEBGL)
PlatformGraphicsContext3D GLContextEGL::platformContext()
{
......
......@@ -41,7 +41,7 @@ public:
virtual void waitNative();
virtual bool canRenderToDefaultFramebuffer();
virtual IntSize defaultFrameBufferSize();
virtual cairo_device_t* cairoDevice();
#if ENABLE(WEBGL)
virtual PlatformGraphicsContext3D platformContext();
......@@ -59,6 +59,7 @@ private:
EGLContext m_context;
EGLSurface m_surface;
EGLSurfaceType m_type;
cairo_device_t* m_cairoDevice;
};
} // namespace WebCore
......
......@@ -23,8 +23,13 @@
#include "GraphicsContext3D.h"
#include "OpenGLShims.h"
#include <GL/glx.h>
#include <cairo.h>
#include <wtf/OwnPtr.h>
#if ENABLE(ACCELERATED_2D_CANVAS)
#include <cairo-gl.h>
#endif
namespace WebCore {
PassOwnPtr<GLContextGLX> GLContextGLX::createWindowContext(XID window, GLContext* sharingContext)
......@@ -168,6 +173,7 @@ GLContextGLX::GLContextGLX(GLXContext context)
, m_pbuffer(0)
, m_pixmap(0)
, m_glxPixmap(0)
, m_cairoDevice(0)
{
}
......@@ -177,11 +183,15 @@ GLContextGLX::GLContextGLX(GLXContext context, Pixmap pixmap, GLXPixmap glxPixma
, m_pbuffer(0)
, m_pixmap(pixmap)
, m_glxPixmap(glxPixmap)
, m_cairoDevice(0)
{
}
GLContextGLX::~GLContextGLX()
{
if (m_cairoDevice)
cairo_device_destroy(m_cairoDevice);
if (m_context) {
// This may be necessary to prevent crashes with NVidia's closed source drivers. Originally
// from Mozilla's 3D canvas implementation at: http://bitbucket.org/ilmari/canvas3d/
......@@ -251,6 +261,18 @@ void GLContextGLX::waitNative()
glXWaitX();
}
cairo_device_t* GLContextGLX::cairoDevice()
{
if (m_cairoDevice)
return m_cairoDevice;
#if ENABLE(ACCELERATED_2D_CANVAS)
m_cairoDevice = cairo_glx_device_create(sharedX11Display(), m_context);
#endif
return m_cairoDevice;
}
#if USE(3D_GRAPHICS)
PlatformGraphicsContext3D GLContextGLX::platformContext()
{
......
......@@ -46,6 +46,7 @@ public:
virtual void waitNative();
virtual bool canRenderToDefaultFramebuffer();
virtual IntSize defaultFrameBufferSize();
virtual cairo_device_t* cairoDevice();
#if USE(3D_GRAPHICS)
virtual PlatformGraphicsContext3D platformContext();
......@@ -63,6 +64,7 @@ private:
GLXPbuffer m_pbuffer;
Pixmap m_pixmap;
GLXPixmap m_glxPixmap;
cairo_device_t* m_cairoDevice;
};
} // namespace WebCore
......
......@@ -298,6 +298,7 @@ if test "$enable_accelerated_compositing" = "auto"; then
enable_accelerated_compositing="no";
fi
fi
if test "$enable_gamepad" = "yes" && test "$os_linux" = no; then
AC_MSG_WARN([Gamepad support is only available on Linux. Disabling Gamepad support.])
enable_gamepad=no;
......@@ -465,6 +466,21 @@ if test "$with_acceleration_backend" = "opengl"; then
fi
AC_SUBST([OPENGL_LIBS])
enable_accelerated_canvas=no
if test "$enable_accelerated_compositing" = "yes" && test "$with_acceleration_backend" = "opengl"; then
CAIRO_GL_LIBS="cairo-gl"
if test "$enable_glx" = "yes"; then
CAIRO_GL_LIBS+=" cairo-glx"
fi
if test "$enable_egl" = "yes"; then
CAIRO_GL_LIBS+=" cairo-egl"
fi
# At the moment CairoGL does not add any extra cflags and libraries, so we can
# safely ignore CAIRO_GL_LIBS and CAIRO_GL_CFLAGS for the moment.
PKG_CHECK_MODULES(CAIRO_GL, $CAIRO_GL_LIBS, [enable_accelerated_canvas=yes], [enable_accelerated_canvas=no])
fi
if test "$enable_gamepad" = "yes"; then
PKG_CHECK_MODULES([GAMEPAD], [gio-unix-2.0 gudev-1.0])
......
......@@ -16,6 +16,7 @@ Features:
WebKit1 support : $enable_webkit1
WebKit2 support : $enable_webkit2
Accelerated Compositing : $enable_accelerated_compositing
Accelerated 2D canvas : $enable_accelerated_canvas
Gamepad support : $enable_gamepad
Geolocation support : $enable_geolocation
HTML5 video element support : $enable_video
......
......@@ -71,6 +71,12 @@ else
CONFIGURABLE_FEATURE_DEFINES="$CONFIGURABLE_FEATURE_DEFINES ENABLE_3D_RENDERING=0"
fi
if test "$enable_accelerated_canvas" = "yes"; then
CONFIGURABLE_FEATURE_DEFINES="$CONFIGURABLE_FEATURE_DEFINES ENABLE_ACCELERATED_2D_CANVAS=1"
else
CONFIGURABLE_FEATURE_DEFINES="$CONFIGURABLE_FEATURE_DEFINES ENABLE_ACCELERATED_2D_CANVAS=0"
fi
if test "$enable_web_audio" = "yes"; then
CONFIGURABLE_FEATURE_DEFINES="$CONFIGURABLE_FEATURE_DEFINES ENABLE_WEB_AUDIO=1"
else
......@@ -82,7 +88,6 @@ fi
# this command now rather than use AC_CONFIG_COMMANDS because automake rules depend
# on the output file (WebKitFeatures.txt).
$srcdir/Tools/gtk/generate-feature-defines-files $CONFIGURABLE_FEATURE_DEFINES \
ENABLE_ACCELERATED_2D_CANVAS=0 \
ENABLE_BATTERY_STATUS=0 \
ENABLE_BLOB=1 \
ENABLE_CANVAS_PATH=0 \
......
2013-04-11 Martin Robinson <mrobinson@igalia.com>
[GTK] Add accelerated 2D canvas support using cairo-gl
https://bugs.webkit.org/show_bug.cgi?id=104672
Reviewed by Alejandro G. Castro.
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.
2013-04-11 Ryosuke Niwa <rniwa@webkit.org>
build.webkit.org should link to webkit-queues instead of webkit-commit-queue
......@@ -2119,11 +2119,18 @@ sub buildAutotoolsProject($@)
"web-audio" => 1,
"xslt" => 1,
);
# These features are ones which build-webkit cannot control, typically because
# they can only be active when we have the proper dependencies.
my %unsetFeatures = (
"accelerated-2d-canvas" => 1,
);
my @overridableFeatures = ();
foreach (@features) {
if ($configurableFeatures{$_->{option}}) {
push @buildArgs, autotoolsFlag(${$_->{value}}, $_->{option});;
} else {
} elsif (!$unsetFeatures{$_->{option}}) {
push @overridableFeatures, $_->{define} . "=" . (${$_->{value}} ? "1" : "0");
}
}
......
......@@ -61,7 +61,8 @@
</branch>
</autotools>
<autotools id="cairo" autogen-sh="configure">
<autotools id="cairo" autogen-sh="configure"
autogenargs="--enable-gl=yes --enable-egl=yes --enable-glx=yes">
<dependencies>
<dep package="fontconfig"/>
<dep package="pixman"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment