aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/views
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-02 19:24:21 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-02 19:24:21 +0000
commitb442a6d5726569364e15c3056bbfb59b9b6e38ce (patch)
treebd1224ecf823d4ac53831ae85ef34b2c523cd505 /include/views
parentf3df5254ca21ff07c0b60d7b7cbb3a50f89a22b4 (diff)
Redelivering r3555 to re-add run-time switching between ANGLE and native opengl
Diffstat (limited to 'include/views')
-rw-r--r--include/views/SkOSWindow_Android.h12
-rw-r--r--include/views/SkOSWindow_Mac.h12
-rw-r--r--include/views/SkOSWindow_Unix.h12
-rw-r--r--include/views/SkOSWindow_Win.h38
-rwxr-xr-xinclude/views/SkOSWindow_iOS.h12
5 files changed, 61 insertions, 25 deletions
diff --git a/include/views/SkOSWindow_Android.h b/include/views/SkOSWindow_Android.h
index bdce5d0d4f..5818a0af69 100644
--- a/include/views/SkOSWindow_Android.h
+++ b/include/views/SkOSWindow_Android.h
@@ -18,9 +18,15 @@ class SkOSWindow : public SkWindow {
public:
SkOSWindow(void*) {}
~SkOSWindow() {}
- bool attachGL() { return true; }
- void detachGL() {}
- void presentGL() {}
+
+ enum SkBackEndTypes {
+ kNone_BackEndType,
+ kNativeGL_BackEndType,
+ };
+
+ bool attach(SkBackEndTypes /* attachType */) { return true; }
+ void detach() {}
+ void present() {}
virtual void onPDFSaved(const char title[], const char desc[],
const char path[]);
diff --git a/include/views/SkOSWindow_Mac.h b/include/views/SkOSWindow_Mac.h
index b09f1dd5e4..01fa29f334 100644
--- a/include/views/SkOSWindow_Mac.h
+++ b/include/views/SkOSWindow_Mac.h
@@ -19,9 +19,15 @@ public:
virtual bool onDispatchClick(int x, int y, Click::State state,
void* owner);
- void detachGL();
- bool attachGL();
- void presentGL();
+
+ enum SkBackEndTypes {
+ kNone_BackEndType,
+ kNativeGL_BackEndType,
+ };
+
+ void detach();
+ bool attach(SkBackEndTypes attachType);
+ void present();
protected:
// overrides from SkEventSink
diff --git a/include/views/SkOSWindow_Unix.h b/include/views/SkOSWindow_Unix.h
index 3b71af8330..40059bf8d4 100644
--- a/include/views/SkOSWindow_Unix.h
+++ b/include/views/SkOSWindow_Unix.h
@@ -34,9 +34,15 @@ public:
void* getUnixWindow() const { return (void*)&fUnixWindow; }
void loop();
void post_linuxevent();
- bool attachGL();
- void detachGL();
- void presentGL();
+
+ enum SkBackEndTypes {
+ kNone_BackEndType,
+ kNativeGL_BackEndType,
+ };
+
+ bool attach(SkBackEndTypes attachType);
+ void detach();
+ void present();
//static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay);
diff --git a/include/views/SkOSWindow_Win.h b/include/views/SkOSWindow_Win.h
index c857e7a6cd..2663c8c75d 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:
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;
};
diff --git a/include/views/SkOSWindow_iOS.h b/include/views/SkOSWindow_iOS.h
index ff284843bb..34ce421778 100755
--- a/include/views/SkOSWindow_iOS.h
+++ b/include/views/SkOSWindow_iOS.h
@@ -18,9 +18,15 @@ public:
virtual bool onDispatchClick(int x, int y, Click::State state,
void* owner);
- void detachGL();
- bool attachGL();
- void presentGL();
+
+ enum SkBackEndTypes {
+ kNone_BackEndType,
+ kNativeGL_BackEndType,
+ };
+
+ void detach();
+ bool attach(SkBackEndTypes attachType);
+ void present();
protected:
// overrides from SkEventSink