Index: experimental/iOSSampleApp/SkSampleUIView.mm |
=================================================================== |
--- experimental/iOSSampleApp/SkSampleUIView.mm (revision 7991) |
+++ experimental/iOSSampleApp/SkSampleUIView.mm (working copy) |
@@ -61,8 +61,8 @@ |
SkASSERT(false); |
break; |
} |
- |
- bool result = win->attach(fBackend, msaaSampleCount); |
+ SkOSWindow::AttachmentInfo info; |
+ bool result = win->attach(fBackend, msaaSampleCount, &info); |
if (!result) { |
SkDebugf("Failed to initialize GL"); |
return; |
@@ -165,7 +165,9 @@ |
virtual void windowSizeChanged(SampleWindow* win) SK_OVERRIDE { |
#if SK_SUPPORT_GPU |
if (NULL != fCurContext) { |
- win->attach(fBackend, fMSAASampleCount); |
+ SkOSWindow::AttachmentInfo info; |
+ |
+ win->attach(fBackend, fMSAASampleCount, &info); |
glBindFramebuffer(GL_FRAMEBUFFER, fLayerFBO); |
GrBackendRenderTargetDesc desc; |
@@ -173,9 +175,9 @@ |
desc.fHeight = SkScalarRound(win->height()); |
desc.fConfig = kSkia8888_GrPixelConfig; |
desc.fRenderTargetHandle = fLayerFBO; |
- glGetIntegerv(GL_SAMPLES, &desc.fSampleCnt); |
- glGetIntegerv(GL_STENCIL_BITS, &desc.fStencilBits); |
- |
+ desc.fSampleCnt = info.fSampleCount; |
+ desc.fStencilBits = info.fStencilBits; |
+ |
SkSafeUnref(fCurRenderTarget); |
fCurRenderTarget = fCurContext->wrapBackendRenderTarget(desc); |
} |
@@ -480,4 +482,14 @@ |
} |
} |
+- (void)getAttachmentInfo:(SkOSWindow::AttachmentInfo*)info { |
+ glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer); |
+ glGetRenderbufferParameteriv(GL_RENDERBUFFER, |
+ GL_RENDERBUFFER_STENCIL_SIZE, |
+ &info->fStencilBits); |
+ glGetRenderbufferParameteriv(GL_RENDERBUFFER, |
+ GL_RENDERBUFFER_SAMPLES_APPLE, |
+ &info->fSampleCount); |
+} |
+ |
@end |