aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/views
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-30 14:47:53 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-30 14:47:53 +0000
commit53e96a14cac520c1fd071ad65d80b5bacc5c4e28 (patch)
tree291ffdaec5d66fdbcad78c5159f2ac71f24fbe99 /include/views
parent10e04bf1c5025389d999f22467405782e9f9ffcc (diff)
Added run-time switching between OpenGL & ANGLE in SampleApp
Diffstat (limited to 'include/views')
-rw-r--r--include/views/SkOSWindow_Win.h38
1 files changed, 25 insertions, 13 deletions
diff --git a/include/views/SkOSWindow_Win.h b/include/views/SkOSWindow_Win.h
index c17807a2d9..0592818ad0 100644
--- a/include/views/SkOSWindow_Win.h
+++ b/include/views/SkOSWindow_Win.h
@@ -26,20 +26,19 @@ public:
void updateSize();
static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay);
-
- bool attachGL();
- void detachGL();
- void presentGL();
+ enum SkBackEndTypes {
+ kNone_BackEndType,
+ kNativeGL_BackEndType,
#if SK_ANGLE
- bool attachANGLE();
- void detachANGLE();
- void presentANGLE();
+ kANGLE_BackEndType,
#endif
+ kD3D9_BackEndType
+ };
- bool attachD3D9();
- void detachD3D9();
- void presentD3D9();
+ bool attach(SkBackEndTypes attachType);
+ void detach();
+ void present();
void* d3d9Device() { return fD3D9Device; }
@@ -73,13 +72,26 @@ private:
angle::EGLSurface fSurface;
#endif
- bool fGLAttached;
-
void* fD3D9Device;
- bool fD3D9Attached;
HMENU fMBar;
+ SkBackEndTypes fAttached;
+
+ bool attachGL();
+ void detachGL();
+ void presentGL();
+
+#if SK_ANGLE
+ bool attachANGLE();
+ void detachANGLE();
+ void presentANGLE();
+#endif
+
+ bool attachD3D9();
+ void detachD3D9();
+ void presentD3D9();
+
typedef SkWindow INHERITED;
};