Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Unified Diff: src/views/unix/SkOSWindow_Unix.cpp

Issue 12437010: Make SkOSWindow return the sample count and stencil bit count for its GL context. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/views/mac/SkOSWindow_Mac.mm ('k') | src/views/win/SkOSWindow_win.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/views/mac/SkOSWindow_Mac.mm ('k') | src/views/win/SkOSWindow_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698