Minor fixes to get SampleApp's OpenGL path not to crash on Linux. Initialize
SkOSWindow::fGLAttched (and fVi while we're at it), since it was being checked
uninitialized. Don't call has_gl_extension() while initializing the
GrGLDefaultInterface, since it derefs the default interface (which is still
NULL); use has_gl_extension_from_string() instead.
Review URL: http://codereview.appspot.com/4480041/
git-svn-id: http://skia.googlecode.com/svn/trunk@1242 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/unix/GrGLDefaultInterface_unix.cpp b/gpu/src/unix/GrGLDefaultInterface_unix.cpp
index 4c1e89e..ba67065 100644
--- a/gpu/src/unix/GrGLDefaultInterface_unix.cpp
+++ b/gpu/src/unix/GrGLDefaultInterface_unix.cpp
@@ -136,7 +136,8 @@
// First look for GL3.0 FBO or GL_ARB_framebuffer_object (same since
// GL_ARB_framebuffer_object doesn't use ARB suffix.)
- if (major >= 3 || has_gl_extension("GL_ARB_framebuffer_object")) {
+ if (major >= 3 || has_gl_extension_from_string(
+ "GL_ARB_framebuffer_object", extString)) {
GR_GL_GET_PROC(GenFramebuffers);
GR_GL_GET_PROC(BindFramebuffer);
GR_GL_GET_PROC(FramebufferTexture2D);
diff --git a/src/utils/unix/SkOSWindow_Unix.cpp b/src/utils/unix/SkOSWindow_Unix.cpp
index 99d4221..5f63b53 100644
--- a/src/utils/unix/SkOSWindow_Unix.cpp
+++ b/src/utils/unix/SkOSWindow_Unix.cpp
@@ -25,7 +25,7 @@
const long EVENT_MASK = StructureNotifyMask|ButtonPressMask|ButtonReleaseMask
|ExposureMask|PointerMotionMask|KeyPressMask|KeyReleaseMask;
-SkOSWindow::SkOSWindow(void* unused)
+SkOSWindow::SkOSWindow(void* unused) : fGLAttached(false), fVi(0)
{
fUnixWindow.fDisplay = XOpenDisplay(NULL);
Display* dsp = fUnixWindow.fDisplay;