Title: [96211] trunk/Source/WebCore
Revision
96211
Author
[email protected]
Date
2011-09-28 02:45:13 -0700 (Wed, 28 Sep 2011)

Log Message

[Texmap] Allow TextureMapperGL to work without a GraphicsContext
https://bugs.webkit.org/show_bug.cgi?id=68980

Reviewed by Andreas Kling.

Perform a null-check for m_context and initialize that variable.
If a graphics-context doesn't exist, we don't need to reset it.

No new functionality so no new tests.

* platform/graphics/opengl/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::TextureMapperGL):
(WebCore::TextureMapperGL::beginPainting):
(WebCore::TextureMapperGL::endPainting):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (96210 => 96211)


--- trunk/Source/WebCore/ChangeLog	2011-09-28 09:42:14 UTC (rev 96210)
+++ trunk/Source/WebCore/ChangeLog	2011-09-28 09:45:13 UTC (rev 96211)
@@ -1,3 +1,20 @@
+2011-09-28  No'am Rosenthal  <[email protected]>
+
+        [Texmap] Allow TextureMapperGL to work without a GraphicsContext
+        https://bugs.webkit.org/show_bug.cgi?id=68980
+
+        Reviewed by Andreas Kling.
+
+        Perform a null-check for m_context and initialize that variable.
+        If a graphics-context doesn't exist, we don't need to reset it.
+
+        No new functionality so no new tests.
+
+        * platform/graphics/opengl/TextureMapperGL.cpp:
+        (WebCore::TextureMapperGL::TextureMapperGL):
+        (WebCore::TextureMapperGL::beginPainting):
+        (WebCore::TextureMapperGL::endPainting):
+
 2011-09-28  Kentaro Hara  <[email protected]>
 
         Implement an ErrorEvent constructor for V8

Modified: trunk/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp (96210 => 96211)


--- trunk/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp	2011-09-28 09:42:14 UTC (rev 96210)
+++ trunk/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp	2011-09-28 09:45:13 UTC (rev 96211)
@@ -297,6 +297,7 @@
 
 TextureMapperGL::TextureMapperGL()
     : m_data(new TextureMapperGLData)
+    , m_context(0)
 {
 }
 
@@ -395,9 +396,11 @@
         return;
 
     glGetIntegerv(GL_CURRENT_PROGRAM, &m_data->previousProgram);
-    QPainter* painter = m_context->platformContext();
-    painter->save();
-    painter->beginNativePainting();
+    if (m_context) {
+        QPainter* painter = m_context->platformContext();
+        painter->save();
+        painter->beginNativePainting();
+    }
     glClearStencil(0);
     glClear(GL_STENCIL_BUFFER_BIT);
     bindSurface(0);
@@ -410,8 +413,10 @@
 #if PLATFORM(QT)
     glClearStencil(1);
     glClear(GL_STENCIL_BUFFER_BIT);
+    glUseProgram(m_data->previousProgram);
+    if (!m_context)
+        return;
     QPainter* painter = m_context->platformContext();
-    glUseProgram(m_data->previousProgram);
     painter->endNativePainting();
     painter->restore();
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to