aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/views
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-05 20:06:05 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-05 20:06:05 +0000
commit64cc810ad165724f9c666a75bd52e41c67f13564 (patch)
treedc05e9b5db78f18c9dcf75f9c62d2d05ea84a66f /include/views
parentacf3ecc7f70567a26f1435b5d3de45b316338b3e (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 'include/views')
-rw-r--r--include/views/SkOSWindow_Android.h10
-rw-r--r--include/views/SkOSWindow_Mac.h7
-rw-r--r--include/views/SkOSWindow_NaCl.h9
-rw-r--r--include/views/SkOSWindow_Unix.h9
-rw-r--r--include/views/SkOSWindow_Win.h12
-rwxr-xr-xinclude/views/SkOSWindow_iOS.h7
6 files changed, 45 insertions, 9 deletions
diff --git a/include/views/SkOSWindow_Android.h b/include/views/SkOSWindow_Android.h
index ca9b7708f1..77c156cd23 100644
--- a/include/views/SkOSWindow_Android.h
+++ b/include/views/SkOSWindow_Android.h
@@ -24,7 +24,15 @@ public:
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 aa52021607..5dea2fc12e 100644
--- a/include/views/SkOSWindow_Mac.h
+++ b/include/views/SkOSWindow_Mac.h
@@ -26,8 +26,13 @@ public:
#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 52514cab71..22960236d3 100644
--- a/include/views/SkOSWindow_NaCl.h
+++ b/include/views/SkOSWindow_NaCl.h
@@ -24,7 +24,14 @@ public:
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 f1a4698668..89265a4367 100644
--- a/include/views/SkOSWindow_Unix.h
+++ b/include/views/SkOSWindow_Unix.h
@@ -39,7 +39,12 @@ public:
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 @@ private:
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 ff289bd6a6..6b5977ce3f 100644
--- a/include/views/SkOSWindow_Win.h
+++ b/include/views/SkOSWindow_Win.h
@@ -37,7 +37,12 @@ public:
#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 @@ private:
EGLDisplay fDisplay;
EGLContext fContext;
EGLSurface fSurface;
+ EGLConfig fConfig;
#endif // SK_ANGLE
#endif // SK_SUPPORT_GPU
@@ -78,12 +84,12 @@ private:
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 1dd3997dfe..1984900ded 100755
--- a/include/views/SkOSWindow_iOS.h
+++ b/include/views/SkOSWindow_iOS.h
@@ -21,8 +21,13 @@ public:
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: