diff options
| author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-06-20 16:03:48 +0200 |
|---|---|---|
| committer | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-07-03 15:04:47 +0200 |
| commit | 82d8a5c81d79e0c38e4f593c1424f8b212cb750f (patch) | |
| tree | 991b25487e30f0f33002bc08502836cec890dc11 /Source/WebKit/qt/WidgetSupport | |
| parent | f57e518842e3b134fb7cf6fa145b219aed3ed465 (diff) | |
| download | qtwebkit-82d8a5c81d79e0c38e4f593c1424f8b212cb750f.tar.gz | |
Implement Accelerated 2D Canvas
Implements accelered 2d canvas and makes it an setting. Accelerated 2D
canvas can especially speed up image blitting and complex transforms on
embedded devices when using a QGLWidget viewport.
Change-Id: I98a03f3c76d4e87799830171c6df101ed9908de3
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'Source/WebKit/qt/WidgetSupport')
| -rw-r--r-- | Source/WebKit/qt/WidgetSupport/PageClientQt.cpp | 13 | ||||
| -rw-r--r-- | Source/WebKit/qt/WidgetSupport/PageClientQt.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Source/WebKit/qt/WidgetSupport/PageClientQt.cpp b/Source/WebKit/qt/WidgetSupport/PageClientQt.cpp index 792613676..411bd65f0 100644 --- a/Source/WebKit/qt/WidgetSupport/PageClientQt.cpp +++ b/Source/WebKit/qt/WidgetSupport/PageClientQt.cpp @@ -195,6 +195,19 @@ bool PageClientQGraphicsWidget::makeOpenGLContextCurrentIfAvailable() return false; } +QOpenGLContext* PageClientQGraphicsWidget::openGLContextIfAvailable() +{ +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER_GL) && defined(QT_OPENGL_LIB) + QGraphicsView* graphicsView = firstGraphicsView(); + if (graphicsView && graphicsView->viewport()) { + QGLWidget* glWidget = qobject_cast<QGLWidget*>(graphicsView->viewport()); + if (glWidget) + return glWidget->context()->contextHandle(); + } +#endif + return 0; +} + void PageClientQGraphicsWidget::setInputMethodEnabled(bool enable) { view->setFlag(QGraphicsItem::ItemAcceptsInputMethod, enable); diff --git a/Source/WebKit/qt/WidgetSupport/PageClientQt.h b/Source/WebKit/qt/WidgetSupport/PageClientQt.h index e9da360bc..5db890eb5 100644 --- a/Source/WebKit/qt/WidgetSupport/PageClientQt.h +++ b/Source/WebKit/qt/WidgetSupport/PageClientQt.h @@ -174,6 +174,7 @@ public: #endif virtual bool makeOpenGLContextCurrentIfAvailable(); + virtual QOpenGLContext* openGLContextIfAvailable(); virtual QRectF windowRect() const; |
