diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-05 20:06:05 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-05 20:06:05 +0000 |
commit | 64cc810ad165724f9c666a75bd52e41c67f13564 (patch) | |
tree | dc05e9b5db78f18c9dcf75f9c62d2d05ea84a66f /samplecode | |
parent | acf3ecc7f70567a26f1435b5d3de45b316338b3e (diff) |
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
Diffstat (limited to 'samplecode')
-rw-r--r-- | samplecode/SampleApp.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index 6266085d78..badc7c01e8 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -188,8 +188,8 @@ public: 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 @@ public: 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; |