Make SkOSWindow return the sample count and stencil bit count for its GL context.
Review URL: https://codereview.chromium.org/12437010
git-svn-id: http://skia.googlecode.com/svn/trunk@7995 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 6266085..badc7c0 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -188,8 +188,8 @@
SkASSERT(false);
break;
}
-
- bool result = win->attach(fBackend, msaaSampleCount);
+ AttachmentInfo attachmentInfo;
+ bool result = win->attach(fBackend, msaaSampleCount, &attachmentInfo);
if (!result) {
SkDebugf("Failed to initialize GL");
return;
@@ -289,15 +289,16 @@
virtual void windowSizeChanged(SampleWindow* win) {
#if SK_SUPPORT_GPU
if (fCurContext) {
- win->attach(fBackend, fMSAASampleCount);
+ AttachmentInfo attachmentInfo;
+ win->attach(fBackend, fMSAASampleCount, &attachmentInfo);
GrBackendRenderTargetDesc desc;
desc.fWidth = SkScalarRound(win->width());
desc.fHeight = SkScalarRound(win->height());
desc.fConfig = kSkia8888_GrPixelConfig;
desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
- GR_GL_GetIntegerv(fCurIntf, GR_GL_SAMPLES, &desc.fSampleCnt);
- GR_GL_GetIntegerv(fCurIntf, GR_GL_STENCIL_BITS, &desc.fStencilBits);
+ desc.fSampleCnt = attachmentInfo.fSampleCount;
+ desc.fStencilBits = attachmentInfo.fStencilBits;
GrGLint buffer;
GR_GL_GetIntegerv(fCurIntf, GR_GL_FRAMEBUFFER_BINDING, &buffer);
desc.fRenderTargetHandle = buffer;