2011-05-31 17:10:21 +00:00
|
|
|
/*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Copyright 2011 Skia
|
2011-05-31 17:10:21 +00:00
|
|
|
*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
2011-05-31 17:10:21 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkOSWindow_Android_DEFINED
|
|
|
|
#define SkOSWindow_Android_DEFINED
|
|
|
|
|
|
|
|
#include "SkWindow.h"
|
|
|
|
|
2015-06-12 19:51:44 +00:00
|
|
|
#include <EGL/egl.h>
|
|
|
|
|
|
|
|
struct SkAndroidWindow {
|
|
|
|
EGLDisplay fDisplay;
|
|
|
|
EGLSurface fSurface;
|
|
|
|
EGLContext fContext;
|
|
|
|
};
|
|
|
|
|
2011-05-31 17:10:21 +00:00
|
|
|
class SkOSWindow : public SkWindow {
|
|
|
|
public:
|
2015-06-12 19:51:44 +00:00
|
|
|
SkOSWindow(void*);
|
|
|
|
~SkOSWindow();
|
2012-04-02 19:24:21 +00:00
|
|
|
|
|
|
|
enum SkBackEndTypes {
|
|
|
|
kNone_BackEndType,
|
|
|
|
kNativeGL_BackEndType,
|
|
|
|
};
|
|
|
|
|
2013-12-10 20:37:41 +00:00
|
|
|
bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo* info);
|
2015-06-12 19:51:44 +00:00
|
|
|
void detach();
|
|
|
|
void present();
|
2015-06-16 19:47:25 +00:00
|
|
|
bool makeFullscreen() { return true; }
|
|
|
|
void closeWindow();
|
|
|
|
void setVsync(bool);
|
2015-06-12 19:51:44 +00:00
|
|
|
bool destroyRequested() { return fDestroyRequested; }
|
2011-06-15 16:49:08 +00:00
|
|
|
|
2011-05-31 17:10:21 +00:00
|
|
|
protected:
|
|
|
|
// overrides from SkWindow
|
|
|
|
virtual void onHandleInval(const SkIRect&);
|
|
|
|
virtual void onSetTitle(const char title[]);
|
|
|
|
|
|
|
|
private:
|
2015-06-12 19:51:44 +00:00
|
|
|
SkAndroidWindow fWindow;
|
|
|
|
ANativeWindow* fNativeWindow;
|
|
|
|
bool fDestroyRequested;
|
|
|
|
|
2011-05-31 17:10:21 +00:00
|
|
|
typedef SkWindow INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|