summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics')
-rw-r--r--Source/WebCore/platform/graphics/ImageBuffer.h4
-rw-r--r--Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp11
-rw-r--r--Source/WebCore/platform/graphics/qt/ImageBufferDataQt.h7
-rw-r--r--Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp4
4 files changed, 17 insertions, 9 deletions
diff --git a/Source/WebCore/platform/graphics/ImageBuffer.h b/Source/WebCore/platform/graphics/ImageBuffer.h
index 7addde9d5..a30d0523c 100644
--- a/Source/WebCore/platform/graphics/ImageBuffer.h
+++ b/Source/WebCore/platform/graphics/ImageBuffer.h
@@ -95,7 +95,7 @@ namespace WebCore {
}
static PassOwnPtr<ImageBuffer> createCompatibleBuffer(const IntSize&, float resolutionScale, ColorSpace, const GraphicsContext*, bool hasAlpha);
-#if PLATFORM(QT)
+#if PLATFORM(QT) && ENABLE(ACCELERATED_2D_CANVAS)
static PassOwnPtr<ImageBuffer> createCompatibleBuffer(const IntSize&, float resolutionScale, ColorSpace, QOpenGLContext*);
#endif
@@ -165,7 +165,7 @@ namespace WebCore {
// This constructor will place its success into the given out-variable
// so that create() knows when it should return failure.
ImageBuffer(const IntSize&, float resolutionScale, ColorSpace, RenderingMode, bool& success);
-#if PLATFORM(QT)
+#if PLATFORM(QT) && ENABLE(ACCELERATED_2D_CANVAS)
ImageBuffer(const IntSize&, float resolutionScale, ColorSpace, QOpenGLContext*, bool& success);
#endif
};
diff --git a/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp b/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp
index 4a1651548..1235ce690 100644
--- a/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp
@@ -34,7 +34,6 @@
#include "GraphicsSurface.h"
#include "ImageData.h"
#include "StillImageQt.h"
-#include "QFramebufferPaintDevice.h"
#include <QImage>
#include <QPaintEngine>
@@ -42,6 +41,7 @@
#include <QPixmap>
#if ENABLE(ACCELERATED_2D_CANVAS)
+#include "QFramebufferPaintDevice.h"
#include "TextureMapper.h"
#include "TextureMapperPlatformLayer.h"
#include "TextureMapperGL.h"
@@ -483,16 +483,12 @@ ImageBufferData::ImageBufferData(const IntSize& size)
initPainter();
}
+#if ENABLE(ACCELERATED_2D_CANVAS)
ImageBufferData::ImageBufferData(const IntSize& size, QOpenGLContext* compatibleContext)
{
m_painter = new QPainter;
-#if ENABLE(ACCELERATED_2D_CANVAS)
m_impl = new ImageBufferDataPrivateAccelerated(size, compatibleContext);
-#else
- Q_UNUSED(compatibleContext);
- m_impl = new ImageBufferDataPrivateUnaccelerated(size);
-#endif
if (!m_impl->paintDevice())
return;
@@ -501,11 +497,14 @@ ImageBufferData::ImageBufferData(const IntSize& size, QOpenGLContext* compatible
initPainter();
}
+#endif
ImageBufferData::~ImageBufferData()
{
+#if ENABLE(ACCELERATED_2D_CANVAS)
if (m_impl->isAccelerated())
static_cast<QFramebufferPaintDevice*>(m_impl->paintDevice())->ensureActiveTarget();
+#endif
m_painter->end();
delete m_painter;
delete m_impl;
diff --git a/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.h b/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.h
index 486b0d576..fcad887d3 100644
--- a/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.h
+++ b/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.h
@@ -29,10 +29,13 @@
#include "Image.h"
#include <QImage>
-#include <QOpenGLContext>
#include <QPainter>
#include <QPaintDevice>
+#if ENABLE(ACCELERATED_2D_CANVAS)
+#include <QOpenGLContext>
+#endif
+
#include <wtf/RefPtr.h>
namespace WebCore {
@@ -61,7 +64,9 @@ class ImageBufferData
{
public:
ImageBufferData(const IntSize&);
+#if ENABLE(ACCELERATED_2D_CANVAS)
ImageBufferData(const IntSize&, QOpenGLContext*);
+#endif
~ImageBufferData();
QPainter* m_painter;
ImageBufferDataPrivate* m_impl;
diff --git a/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp
index 400743df2..09c90a6a0 100644
--- a/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp
@@ -47,6 +47,7 @@
namespace WebCore {
+#if ENABLE(ACCELERATED_2D_CANVAS)
ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, ColorSpace, QOpenGLContext* compatibleContext, bool& success)
: m_data(size, compatibleContext)
, m_size(size)
@@ -58,6 +59,7 @@ ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, Color
m_context = adoptPtr(new GraphicsContext(m_data.m_painter));
}
+#endif
ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, ColorSpace, RenderingMode /*renderingMode*/, bool& success)
: m_data(size)
@@ -75,6 +77,7 @@ ImageBuffer::~ImageBuffer()
{
}
+#if ENABLE(ACCELERATED_2D_CANVAS)
PassOwnPtr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const IntSize& size, float resolutionScale, ColorSpace colorSpace, QOpenGLContext* context)
{
bool success = false;
@@ -83,6 +86,7 @@ PassOwnPtr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const IntSize& size,
return nullptr;
return buf.release();
}
+#endif
GraphicsContext* ImageBuffer::context() const
{