Index: src/views/unix/SkOSWindow_Unix.cpp |
=================================================================== |
--- src/views/unix/SkOSWindow_Unix.cpp (revision 7991) |
+++ src/views/unix/SkOSWindow_Unix.cpp (working copy) |
@@ -37,7 +37,7 @@ |
, fMSAASampleCount(0) { |
fUnixWindow.fDisplay = NULL; |
fUnixWindow.fGLContext = NULL; |
- this->initWindow(0); |
+ this->initWindow(0, NULL); |
this->resize(WIDTH, HEIGHT); |
} |
@@ -59,12 +59,21 @@ |
} |
} |
-void SkOSWindow::initWindow(int requestedMSAASampleCount) { |
+void SkOSWindow::initWindow(int requestedMSAASampleCount, AttachmentInfo* info) { |
if (fMSAASampleCount != requestedMSAASampleCount) { |
this->closeWindow(); |
} |
// presence of fDisplay means we already have a window |
if (NULL != fUnixWindow.fDisplay) { |
+ if (NULL != info) { |
+ if (NULL != fVi) { |
+ glXGetConfig(fUnixWindow.fDisplay, fVi, GLX_SAMPLES_ARB, &info->fSampleCount); |
+ glXGetConfig(fUnixWindow.fDisplay, fVi, GLX_STENCIL_SIZE, &info->fStencilBits); |
+ } else { |
+ info->fSampleCount = 0; |
+ info->fStencilBits = 0; |
+ } |
+ } |
return; |
} |
fUnixWindow.fDisplay = XOpenDisplay(NULL); |
@@ -101,6 +110,10 @@ |
} |
if (fVi) { |
+ if (NULL != info) { |
+ glXGetConfig(dsp, fVi, GLX_SAMPLES_ARB, &info->fSampleCount); |
+ glXGetConfig(dsp, fVi, GLX_STENCIL_SIZE, &info->fStencilBits); |
+ } |
Colormap colorMap = XCreateColormap(dsp, |
RootWindow(dsp, fVi->screen), |
fVi->visual, |
@@ -119,6 +132,10 @@ |
CWEventMask | CWColormap, |
&swa); |
} else { |
+ if (NULL != info) { |
+ info->fSampleCount = 0; |
+ info->fStencilBits = 0; |
+ } |
// Create a simple window instead. We will not be able to show GL |
fUnixWindow.fWin = XCreateSimpleWindow(dsp, |
DefaultRootWindow(dsp), |
@@ -250,8 +267,9 @@ |
} |
-bool SkOSWindow::attach(SkBackEndTypes /* attachType */, int msaaSampleCount) { |
- this->initWindow(msaaSampleCount); |
+bool SkOSWindow::attach(SkBackEndTypes, int msaaSampleCount, AttachmentInfo* info) { |
+ this->initWindow(msaaSampleCount, info); |
+ |
if (NULL == fUnixWindow.fDisplay) { |
return false; |
} |