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

Unified Diff: experimental/iOSSampleApp/SkSampleUIView.mm

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 | « experimental/iOSSampleApp/SkSampleUIView.h ('k') | include/views/SkOSWindow_Android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « experimental/iOSSampleApp/SkSampleUIView.h ('k') | include/views/SkOSWindow_Android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698