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/include/views/SkOSWindow_Android.h b/include/views/SkOSWindow_Android.h
index ca9b770..77c156c 100644
--- a/include/views/SkOSWindow_Android.h
+++ b/include/views/SkOSWindow_Android.h
@@ -24,7 +24,15 @@
         kNativeGL_BackEndType,
     };
 
-    bool attach(SkBackEndTypes /* attachType */, int /* msaaSampleCount */) {
+    struct AttachmentInfo {
+        int fSampleCount;
+        int fStencilBits;
+    };
+
+    bool attach(SkBackEndTypes /* attachType */, int /* msaaSampleCount */, AttachmentInfo* info) {
+        // These are the values requested in SkiaSampleView.java
+        info->fSampleCount = 0;
+        info->fStencilBits = 8;
         return true;
     }
     void detach() {}
diff --git a/include/views/SkOSWindow_Mac.h b/include/views/SkOSWindow_Mac.h
index aa52021..5dea2fc 100644
--- a/include/views/SkOSWindow_Mac.h
+++ b/include/views/SkOSWindow_Mac.h
@@ -26,8 +26,13 @@
 #endif
     };
 
+    struct AttachmentInfo {
+        int fSampleCount;
+        int fStencilBits;
+    };
+
     void    detach();
-    bool    attach(SkBackEndTypes attachType, int msaaSampleCount);
+    bool    attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
     void    present();
 
 protected:
diff --git a/include/views/SkOSWindow_NaCl.h b/include/views/SkOSWindow_NaCl.h
index 52514ca..2296023 100644
--- a/include/views/SkOSWindow_NaCl.h
+++ b/include/views/SkOSWindow_NaCl.h
@@ -24,7 +24,14 @@
         kNativeGL_BackEndType,
     };
 
-    bool attach(SkBackEndTypes /* attachType */, int /* msaaSampleCount */) {
+    struct AttachmentInfo {
+        int fSampleCount;
+        int fStencilBits;
+    };
+
+    bool attach(SkBackEndTypes /* attachType */, int /* msaaSampleCount */, AttachmentInfo* info) {
+        info->fSampleCount = 0;
+        info->fStencilBits = 0;
         return true;
     }
     void detach() {}
diff --git a/include/views/SkOSWindow_Unix.h b/include/views/SkOSWindow_Unix.h
index f1a4698..89265a4 100644
--- a/include/views/SkOSWindow_Unix.h
+++ b/include/views/SkOSWindow_Unix.h
@@ -39,7 +39,12 @@
         kNativeGL_BackEndType,
     };
 
-    bool attach(SkBackEndTypes attachType, int msaaSampleCount);
+    struct AttachmentInfo {
+        int fSampleCount;
+        int fStencilBits;
+    };
+
+    bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
     void detach();
     void present();
 
@@ -61,7 +66,7 @@
     void mapWindowAndWait();
 
     void closeWindow();
-    void initWindow(int newMSAASampleCount);
+    void initWindow(int newMSAASampleCount, AttachmentInfo* info);
 
     SkUnixWindow fUnixWindow;
 
diff --git a/include/views/SkOSWindow_Win.h b/include/views/SkOSWindow_Win.h
index ff289bd..6b5977c 100644
--- a/include/views/SkOSWindow_Win.h
+++ b/include/views/SkOSWindow_Win.h
@@ -37,7 +37,12 @@
 #endif // SK_SUPPORT_GPU
     };
 
-    bool attach(SkBackEndTypes attachType, int msaaSampleCount);
+    struct AttachmentInfo {
+        int fSampleCount;
+        int fStencilBits;
+    };
+
+    bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
     void detach();
     void present();
 
@@ -70,6 +75,7 @@
     EGLDisplay          fDisplay;
     EGLContext          fContext;
     EGLSurface          fSurface;
+    EGLConfig           fConfig;
 #endif // SK_ANGLE
 #endif // SK_SUPPORT_GPU
 
@@ -78,12 +84,12 @@
     SkBackEndTypes      fAttached;
 
 #if SK_SUPPORT_GPU
-    bool attachGL(int msaaSampleCount);
+    bool attachGL(int msaaSampleCount, AttachmentInfo* info);
     void detachGL();
     void presentGL();
 
 #if SK_ANGLE
-    bool attachANGLE(int msaaSampleCount);
+    bool attachANGLE(int msaaSampleCount, AttachmentInfo* info);
     void detachANGLE();
     void presentANGLE();
 #endif // SK_ANGLE
diff --git a/include/views/SkOSWindow_iOS.h b/include/views/SkOSWindow_iOS.h
index 1dd3997..1984900 100755
--- a/include/views/SkOSWindow_iOS.h
+++ b/include/views/SkOSWindow_iOS.h
@@ -21,8 +21,13 @@
         kNativeGL_BackEndType,
     };
 
+    struct AttachmentInfo {
+        int fSampleCount;
+        int fStencilBits;
+    };
+
     void    detach();
-    bool    attach(SkBackEndTypes attachType, int msaaSampleCount);
+    bool    attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*);
     void    present();
 
 protected: