diff options
Diffstat (limited to 'Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp index 1678c49fa..69aa86591 100644 --- a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp +++ b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp @@ -69,7 +69,7 @@ public: #endif #if USE(GRAPHICS_SURFACE) virtual uint32_t copyToGraphicsSurface(); - virtual uint64_t graphicsSurfaceToken() const; + virtual GraphicsSurfaceToken graphicsSurfaceToken() const; #endif QRectF boundingRect() const; @@ -100,13 +100,6 @@ bool GraphicsContext3D::isGLES2Compliant() const #endif } -#if !USE(OPENGL_ES_2) -void GraphicsContext3D::releaseShaderCompiler() -{ - notImplemented(); -} -#endif - GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle) : m_context(context) , m_hostWindow(hostWindow) @@ -206,6 +199,11 @@ void GraphicsContext3DPrivate::initializeANGLE() // Always set to 1 for OpenGL ES. ANGLEResources.MaxDrawBuffers = 1; + + Extensions3D* extensions = m_context->getExtensions(); + if (extensions->supports("GL_ARB_texture_rectangle")) + ANGLEResources.ARB_texture_rectangle = 1; + m_context->m_compiler.setResources(ANGLEResources); } @@ -291,7 +289,7 @@ uint32_t GraphicsContext3DPrivate::copyToGraphicsSurface() return frontBuffer; } -uint64_t GraphicsContext3DPrivate::graphicsSurfaceToken() const +GraphicsSurfaceToken GraphicsContext3DPrivate::graphicsSurfaceToken() const { return m_graphicsSurface->exportToken(); } @@ -492,16 +490,18 @@ bool GraphicsContext3D::getImageData(Image* image, if (!image) return false; - QImage nativeImage; + QImage qtImage; // Is image already loaded? If not, load it. if (image->data()) - nativeImage = QImage::fromData(reinterpret_cast<const uchar*>(image->data()->data()), image->data()->size()); - else - nativeImage = *image->nativeImageForCurrentFrame(); - + qtImage = QImage::fromData(reinterpret_cast<const uchar*>(image->data()->data()), image->data()->size()); + else { + QPixmap* nativePixmap = image->nativeImageForCurrentFrame(); + // With QPA, we can avoid a deep copy. + qtImage = *nativePixmap->handle()->buffer(); + } AlphaOp alphaOp = AlphaDoNothing; - switch (nativeImage.format()) { + switch (qtImage.format()) { case QImage::Format_RGB32: // For opaque images, we should not premultiply or unmultiply alpha. break; @@ -515,7 +515,7 @@ bool GraphicsContext3D::getImageData(Image* image, break; default: // The image has a format that is not supported in packPixels. We have to convert it here. - nativeImage = nativeImage.convertToFormat(premultiplyAlpha ? QImage::Format_ARGB32_Premultiplied : QImage::Format_ARGB32); + qtImage = qtImage.convertToFormat(premultiplyAlpha ? QImage::Format_ARGB32_Premultiplied : QImage::Format_ARGB32); break; } @@ -526,7 +526,7 @@ bool GraphicsContext3D::getImageData(Image* image, outputVector.resize(packedSize); - return packPixels(nativeImage.constBits(), SourceFormatBGRA8, image->width(), image->height(), 0, format, type, alphaOp, outputVector.data()); + return packPixels(qtImage.constBits(), SourceFormatBGRA8, image->width(), image->height(), 0, format, type, alphaOp, outputVector.data()); } void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback>) |