Diff
Modified: trunk/Source/WebCore/ChangeLog (126634 => 126635)
--- trunk/Source/WebCore/ChangeLog 2012-08-24 22:24:03 UTC (rev 126634)
+++ trunk/Source/WebCore/ChangeLog 2012-08-24 22:30:16 UTC (rev 126635)
@@ -1,3 +1,29 @@
+2012-08-24 Helder Correia <helder.corr...@nokia.com>, Roland Takacs <rtak...@inf.u-szeged.hu>
+
+ [Texmap] Move TextureMapperGL to use GraphicsContext3D
+ https://bugs.webkit.org/show_bug.cgi?id=78672
+
+ Reviewed by Noam Rosenthal.
+
+ This is part of a several patch-refactoring.
+
+ Introduce additional logic in GraphicsContext3DQt to support a
+ new RenderToCurrentGLContext RenderStyle. This is necessary to
+ use GC3D for other things than WebGL, like TextureMapper.
+
+ The GC3D constructor now accepts a RenderStyle instead of the
+ boolean renderDirectlyToHostWindow and thus mimics create()'s
+ signature. This has been changed for all ports in this patch.
+
+ A new GC3D::createForCurrentGLContext() builder was
+ introduced to better abstract the goal of using GC3D with the
+ current context.
+
+ The patch was originally developed by Helder Correia and finished
+ by Roland Takacs.
+
+ No new tests, refactoring.
+
2012-08-24 Sheriff Bot <webkit.review....@gmail.com>
Unreviewed, rolling out r126620.
Modified: trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DChromium.cpp (126634 => 126635)
--- trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DChromium.cpp 2012-08-24 22:24:03 UTC (rev 126634)
+++ trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DChromium.cpp 2012-08-24 22:30:16 UTC (rev 126635)
@@ -43,7 +43,7 @@
namespace WebCore {
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes, HostWindow*, bool)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes, HostWindow*, GraphicsContext3D::RenderStyle)
{
}
Modified: trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.cpp (126634 => 126635)
--- trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.cpp 2012-08-24 22:24:03 UTC (rev 126634)
+++ trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.cpp 2012-08-24 22:30:16 UTC (rev 126635)
@@ -77,7 +77,7 @@
PassRefPtr<GraphicsContext3D> GraphicsContext3DPrivate::createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D> webContext, bool preserveDrawingBuffer)
{
- RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(GraphicsContext3D::Attributes(), 0, false /* onscreen */));
+ RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(GraphicsContext3D::Attributes(), 0));
OwnPtr<GraphicsContext3DPrivate> priv = adoptPtr(new GraphicsContext3DPrivate(webContext, preserveDrawingBuffer));
context->m_private = priv.release();
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h (126634 => 126635)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h 2012-08-24 22:24:03 UTC (rev 126634)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h 2012-08-24 22:30:16 UTC (rev 126635)
@@ -458,7 +458,8 @@
enum RenderStyle {
RenderOffscreen,
- RenderDirectlyToHostWindow
+ RenderDirectlyToHostWindow,
+ RenderToCurrentGLContext
};
class ContextLostCallback {
@@ -477,6 +478,7 @@
void setErrorMessageCallback(PassOwnPtr<ErrorMessageCallback>);
static PassRefPtr<GraphicsContext3D> create(Attributes, HostWindow*, RenderStyle = RenderOffscreen);
+ static PassRefPtr<GraphicsContext3D> createForCurrentGLContext();
~GraphicsContext3D();
#if PLATFORM(MAC)
@@ -867,7 +869,7 @@
static unsigned getChannelBitsByFormat(GC3Denum);
private:
- GraphicsContext3D(Attributes attrs, HostWindow* hostWindow, bool renderDirectlyToHostWindow);
+ GraphicsContext3D(Attributes, HostWindow*, RenderStyle = RenderOffscreen);
// Each platform must provide an implementation of this method.
//
@@ -982,6 +984,7 @@
friend class Extensions3DOpenGLCommon;
Attributes m_attrs;
+ RenderStyle m_renderStyle;
Vector<Vector<float> > m_vertexArray;
GC3Duint m_texture;
Modified: trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp (126634 => 126635)
--- trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp 2012-08-24 22:24:03 UTC (rev 126634)
+++ trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp 2012-08-24 22:30:16 UTC (rev 126635)
@@ -47,10 +47,10 @@
if (renderStyle == RenderDirectlyToHostWindow)
return 0;
- return adoptRef(new GraphicsContext3D(attribs, hostWindow, false));
+ return adoptRef(new GraphicsContext3D(attribs, hostWindow, renderStyle));
}
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow*, bool renderDirectlyToHostWindow)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow*, GraphicsContext3D::RenderStyle renderStyle)
: m_currentWidth(0)
, m_currentHeight(0)
, m_context(BlackBerry::Platform::Graphics::createWebGLContext())
@@ -67,7 +67,7 @@
, m_boundTexture0(0)
, m_isImaginationHardware(0)
{
- if (!renderDirectlyToHostWindow) {
+ if (renderStyle != RenderDirectlyToHostWindow) {
#if USE(ACCELERATED_COMPOSITING)
m_compositingLayer = WebGLLayerWebKitThread::create();
#endif
Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp (126634 => 126635)
--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp 2012-08-24 22:24:03 UTC (rev 126634)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp 2012-08-24 22:30:16 UTC (rev 126635)
@@ -61,11 +61,11 @@
if (!success)
return 0;
- RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attributes, hostWindow, false));
+ RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attributes, hostWindow, renderStyle));
return context.release();
}
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, HostWindow*, bool)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, HostWindow*, GraphicsContext3D::RenderStyle)
: m_currentWidth(0)
, m_currentHeight(0)
, m_attrs(attributes)
Modified: trunk/Source/WebCore/platform/graphics/clutter/GraphicsContext3DClutter.cpp (126634 => 126635)
--- trunk/Source/WebCore/platform/graphics/clutter/GraphicsContext3DClutter.cpp 2012-08-24 22:24:03 UTC (rev 126634)
+++ trunk/Source/WebCore/platform/graphics/clutter/GraphicsContext3DClutter.cpp 2012-08-24 22:30:16 UTC (rev 126635)
@@ -42,11 +42,11 @@
PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
{
- RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attributes, hostWindow, false));
+ RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attributes, hostWindow, renderStyle));
return context.release();
}
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, bool)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
{
notImplemented();
}
Modified: trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp (126634 => 126635)
--- trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp 2012-08-24 22:24:03 UTC (rev 126634)
+++ trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp 2012-08-24 22:30:16 UTC (rev 126635)
@@ -36,12 +36,12 @@
if (!internal)
return 0;
- RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attrs, hostWindow, renderDirectlyToEvasGLObject));
+ RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attrs, hostWindow, renderStyle));
context->m_private = internal.release();
return context.release();
}
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool renderDirectlyToHostWindow)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
: m_currentWidth(0)
, m_currentHeight(0)
{
Modified: trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm (126634 => 126635)
--- trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm 2012-08-24 22:24:03 UTC (rev 126634)
+++ trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm 2012-08-24 22:30:16 UTC (rev 126635)
@@ -92,11 +92,11 @@
// This implementation doesn't currently support rendering directly to the HostWindow.
if (renderStyle == RenderDirectlyToHostWindow)
return 0;
- RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attrs, hostWindow, false));
+ RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attrs, hostWindow, renderStyle));
return context->m_contextObj ? context.release() : 0;
}
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
: m_currentWidth(0)
, m_currentHeight(0)
, m_contextObj(0)
@@ -116,6 +116,7 @@
, m_private(adoptPtr(new GraphicsContext3DPrivate(this)))
{
UNUSED_PARAM(hostWindow);
+ UNUSED_PARAM(renderStyle);
Vector<CGLPixelFormatAttribute> attribs;
CGLPixelFormatObj pixelFormatObj = 0;
Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp (126634 => 126635)
--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp 2012-08-24 22:24:03 UTC (rev 126634)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp 2012-08-24 22:30:16 UTC (rev 126635)
@@ -70,6 +70,12 @@
namespace WebCore {
+PassRefPtr<GraphicsContext3D> GraphicsContext3D::createForCurrentGLContext()
+{
+ RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(Attributes(), 0, GraphicsContext3D::RenderToCurrentGLContext));
+ return context->m_private ? context.release() : 0;
+}
+
void GraphicsContext3D::validateDepthStencil(const char* packedDepthStencilExtension)
{
Extensions3D* extensions = getExtensions();
Modified: trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp (126634 => 126635)
--- trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp 2012-08-24 22:24:03 UTC (rev 126634)
+++ trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp 2012-08-24 22:30:16 UTC (rev 126635)
@@ -61,7 +61,7 @@
#endif
{
public:
- GraphicsContext3DPrivate(GraphicsContext3D*, HostWindow*);
+ GraphicsContext3DPrivate(GraphicsContext3D*, HostWindow*, GraphicsContext3D::RenderStyle);
~GraphicsContext3DPrivate();
#if USE(ACCELERATED_COMPOSITING)
@@ -76,6 +76,8 @@
void blitMultisampleFramebuffer() const;
void blitMultisampleFramebufferAndRestoreContext() const;
bool makeCurrentIfNeeded() const;
+ void createOffscreenBuffers();
+ void initializeANGLE();
void createGraphicsSurfaces(const IntSize&);
GraphicsContext3D* m_context;
@@ -104,7 +106,7 @@
}
#endif
-GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context, HostWindow* hostWindow)
+GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
: m_context(context)
, m_hostWindow(hostWindow)
, m_surface(0)
@@ -121,6 +123,12 @@
return;
}
+ if (renderStyle == GraphicsContext3D::RenderToCurrentGLContext) {
+ m_platformContext = QOpenGLContext::currentContext();
+ m_surface = m_platformContext->surface();
+ return;
+ }
+
#if USE(GRAPHICS_SURFACE)
// FIXME: Find a way to create a QOpenGLContext without creating a QWindow at all.
// We need to create a surface in order to create a QOpenGLContext and make it current.
@@ -145,12 +153,67 @@
#endif
}
+void GraphicsContext3DPrivate::createOffscreenBuffers()
+{
+ glGenFramebuffers(/* count */ 1, &m_context->m_fbo);
+
+ glGenTextures(1, &m_context->m_texture);
+ glBindTexture(GraphicsContext3D::TEXTURE_2D, m_context->m_texture);
+ glTexParameterf(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
+ glTexParameterf(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
+ glTexParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
+ glTexParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
+ glBindTexture(GraphicsContext3D::TEXTURE_2D, 0);
+
+ // Create a multisample FBO.
+ if (m_context->m_attrs.antialias) {
+ glGenFramebuffers(1, &m_context->m_multisampleFBO);
+ glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_context->m_multisampleFBO);
+ m_context->m_boundFBO = m_context->m_multisampleFBO;
+ glGenRenderbuffers(1, &m_context->m_multisampleColorBuffer);
+ if (m_context->m_attrs.stencil || m_context->m_attrs.depth)
+ glGenRenderbuffers(1, &m_context->m_multisampleDepthStencilBuffer);
+ } else {
+ // Bind canvas FBO.
+ glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_context->m_fbo);
+ m_context->m_boundFBO = m_context->m_fbo;
+#if USE(OPENGL_ES_2)
+ if (m_context->m_attrs.depth)
+ glGenRenderbuffers(1, &m_context->m_depthBuffer);
+ if (m_context->m_attrs.stencil)
+ glGenRenderbuffers(1, &m_context->m_stencilBuffer);
+#endif
+ if (m_context->m_attrs.stencil || m_context->m_attrs.depth)
+ glGenRenderbuffers(1, &m_context->m_depthStencilBuffer);
+ }
+}
+
+void GraphicsContext3DPrivate::initializeANGLE()
+{
+ ShBuiltInResources ANGLEResources;
+ ShInitBuiltInResources(&ANGLEResources);
+
+ m_context->getIntegerv(GraphicsContext3D::MAX_VERTEX_ATTRIBS, &ANGLEResources.MaxVertexAttribs);
+ m_context->getIntegerv(GraphicsContext3D::MAX_VERTEX_UNIFORM_VECTORS, &ANGLEResources.MaxVertexUniformVectors);
+ m_context->getIntegerv(GraphicsContext3D::MAX_VARYING_VECTORS, &ANGLEResources.MaxVaryingVectors);
+ m_context->getIntegerv(GraphicsContext3D::MAX_VERTEX_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxVertexTextureImageUnits);
+ m_context->getIntegerv(GraphicsContext3D::MAX_COMBINED_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxCombinedTextureImageUnits);
+ m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxTextureImageUnits);
+ m_context->getIntegerv(GraphicsContext3D::MAX_FRAGMENT_UNIFORM_VECTORS, &ANGLEResources.MaxFragmentUniformVectors);
+
+ // Always set to 1 for OpenGL ES.
+ ANGLEResources.MaxDrawBuffers = 1;
+ m_context->m_compiler.setResources(ANGLEResources);
+}
+
GraphicsContext3DPrivate::~GraphicsContext3DPrivate()
{
- delete m_surface;
- m_surface = 0;
- // Platform context is assumed to be owned by surface.
- m_platformContext = 0;
+ if (m_hostWindow) {
+ delete m_surface;
+ m_surface = 0;
+ // Platform context is assumed to be owned by surface.
+ m_platformContext = 0;
+ }
}
static inline quint32 swapBgrToRgb(quint32 pixel)
@@ -291,15 +354,16 @@
// This implementation doesn't currently support rendering directly to the HostWindow.
if (renderStyle == RenderDirectlyToHostWindow)
return 0;
- RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attrs, hostWindow, false));
+ RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attrs, hostWindow, renderStyle));
return context->m_private ? context.release() : 0;
}
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
: m_currentWidth(0)
, m_currentHeight(0)
, m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_OUTPUT)
, m_attrs(attrs)
+ , m_renderStyle(renderStyle)
, m_texture(0)
, m_compositorTexture(0)
, m_fbo(0)
@@ -316,7 +380,7 @@
, m_multisampleFBO(0)
, m_multisampleDepthStencilBuffer(0)
, m_multisampleColorBuffer(0)
- , m_private(adoptPtr(new GraphicsContext3DPrivate(this, hostWindow)))
+ , m_private(adoptPtr(new GraphicsContext3DPrivate(this, hostWindow, renderStyle)))
{
validateAttributes();
@@ -337,55 +401,11 @@
return;
}
- // Create buffers for the canvas FBO.
- glGenFramebuffers(/* count */ 1, &m_fbo);
+ if (renderStyle == RenderOffscreen)
+ m_private->createOffscreenBuffers();
- glGenTextures(1, &m_texture);
- glBindTexture(GraphicsContext3D::TEXTURE_2D, m_texture);
- glTexParameterf(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
- glTexParameterf(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
- glTexParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
- glTexParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
- glBindTexture(GraphicsContext3D::TEXTURE_2D, 0);
+ m_private->initializeANGLE();
- // Create a multisample FBO.
- if (m_attrs.antialias) {
- glGenFramebuffers(1, &m_multisampleFBO);
- glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
- m_boundFBO = m_multisampleFBO;
- glGenRenderbuffers(1, &m_multisampleColorBuffer);
- if (m_attrs.stencil || m_attrs.depth)
- glGenRenderbuffers(1, &m_multisampleDepthStencilBuffer);
- } else {
- // Bind canvas FBO.
- glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
- m_boundFBO = m_fbo;
-#if USE(OPENGL_ES_2)
- if (m_attrs.depth)
- glGenRenderbuffers(1, &m_depthBuffer);
- if (m_attrs.stencil)
- glGenRenderbuffers(1, &m_stencilBuffer);
-#endif
- if (m_attrs.stencil || m_attrs.depth)
- glGenRenderbuffers(1, &m_depthStencilBuffer);
- }
-
- // ANGLE initialization.
- ShBuiltInResources ANGLEResources;
- ShInitBuiltInResources(&ANGLEResources);
-
- getIntegerv(GraphicsContext3D::MAX_VERTEX_ATTRIBS, &ANGLEResources.MaxVertexAttribs);
- getIntegerv(GraphicsContext3D::MAX_VERTEX_UNIFORM_VECTORS, &ANGLEResources.MaxVertexUniformVectors);
- getIntegerv(GraphicsContext3D::MAX_VARYING_VECTORS, &ANGLEResources.MaxVaryingVectors);
- getIntegerv(GraphicsContext3D::MAX_VERTEX_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxVertexTextureImageUnits);
- getIntegerv(GraphicsContext3D::MAX_COMBINED_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxCombinedTextureImageUnits);
- getIntegerv(GraphicsContext3D::MAX_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxTextureImageUnits);
- getIntegerv(GraphicsContext3D::MAX_FRAGMENT_UNIFORM_VECTORS, &ANGLEResources.MaxFragmentUniformVectors);
-
- // Always set to 1 for OpenGL ES.
- ANGLEResources.MaxDrawBuffers = 1;
- m_compiler.setResources(ANGLEResources);
-
#if !USE(OPENGL_ES_2)
glEnable(GL_POINT_SPRITE);
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
@@ -438,7 +458,7 @@
bool GraphicsContext3D::makeContextCurrent()
{
- if (!m_private)
+ if (!m_private || m_renderStyle == RenderToCurrentGLContext)
return false;
return m_private->makeCurrentIfNeeded();
}