blob: 234e65c256093ca86a2df1c63a164f659e6893f7 [file] [log] [blame]
rmistry7bde5652016-06-24 05:24:16 -07001/*
2 * Copyright 2011 Skia
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkOSWindow_Android_DEFINED
9#define SkOSWindow_Android_DEFINED
10
11#include "SkWindow.h"
12
13#include <EGL/egl.h>
14
15struct SkAndroidWindow {
16 EGLDisplay fDisplay;
17 EGLSurface fSurface;
18 EGLContext fContext;
19};
20
21class SkOSWindow : public SkWindow {
22public:
23 SkOSWindow(void*);
24 ~SkOSWindow();
25
26 enum SkBackEndTypes {
27 kNone_BackEndType,
28 kNativeGL_BackEndType,
29 };
30
31 bool attach(SkBackEndTypes attachType, int msaaSampleCount, bool deepColor,
32 AttachmentInfo* info);
33 void release();
34 void present();
35 bool makeFullscreen() { return true; }
36 void closeWindow();
37 void setVsync(bool);
38 bool destroyRequested() { return fDestroyRequested; }
39
40protected:
41 // overrides from SkWindow
42 virtual void onHandleInval(const SkIRect&);
43 virtual void onSetTitle(const char title[]);
44
45private:
46 SkAndroidWindow fWindow;
47 ANativeWindow* fNativeWindow;
48 bool fDestroyRequested;
49
50 typedef SkWindow INHERITED;
51};
52
53#endif