aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/views/SkOSWindow_Android.h
blob: 4fc32ce19db08fb1fde23975212309eaa3a39c10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * Copyright 2011 Skia
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkOSWindow_Android_DEFINED
#define SkOSWindow_Android_DEFINED

#include "SkWindow.h"

#include <EGL/egl.h>

struct SkAndroidWindow {
    EGLDisplay fDisplay;
    EGLSurface fSurface;
    EGLContext fContext;
};

class SkOSWindow : public SkWindow {
public:
    SkOSWindow(void*);
    ~SkOSWindow();

    enum SkBackEndTypes {
        kNone_BackEndType,
        kNativeGL_BackEndType,
    };

    bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo* info);
    void detach();
    void present();
    bool makeFullscreen() { return true; }
    void closeWindow();
    void setVsync(bool);
    bool destroyRequested() { return fDestroyRequested; }

protected:
    // overrides from SkWindow
    virtual void onHandleInval(const SkIRect&);
    virtual void onSetTitle(const char title[]);

private:
    SkAndroidWindow fWindow;
    ANativeWindow* fNativeWindow;
    bool fDestroyRequested;

    typedef SkWindow INHERITED;
};

#endif