blob: e6b59e6511f9be88c89297ad5b1cd17c33996df2 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
reed@android.com671cd652009-05-22 20:44:12 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2006 The Android Open Source Project
reed@android.com671cd652009-05-22 20:44:12 +00004 *
epoger@google.comec3ed6a2011-07-28 14:26:00 +00005 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
reed@android.com671cd652009-05-22 20:44:12 +00007 */
8
epoger@google.comec3ed6a2011-07-28 14:26:00 +00009
reed@android.com671cd652009-05-22 20:44:12 +000010#ifndef SkOSWindow_SDL_DEFINED
11#define SkOSWindow_SDL_DEFINED
12
13#include "SDL.h"
14#include "SkWindow.h"
15
reed@android.com25fc5b92009-05-29 03:40:05 +000016class SkGLCanvas;
17
reed@android.com671cd652009-05-22 20:44:12 +000018class SkOSWindow : public SkWindow {
19public:
reed@android.comc3a8c5f2009-05-26 13:27:48 +000020 SkOSWindow(void* screen);
21 virtual ~SkOSWindow();
reed@android.com671cd652009-05-22 20:44:12 +000022
23 static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay);
24
25 void handleSDLEvent(const SDL_Event& event);
26
27protected:
28 // overrides from SkWindow
29 virtual void onHandleInval(const SkIRect&);
30 // overrides from SkView
31 virtual void onAddMenu(const SkOSMenu*);
32 virtual void onSetTitle(const char[]);
33
34private:
reed@android.comc3a8c5f2009-05-26 13:27:48 +000035 SDL_Surface* fScreen;
reed@android.com671cd652009-05-22 20:44:12 +000036 SDL_Surface* fSurface;
reed@android.com25fc5b92009-05-29 03:40:05 +000037 SkGLCanvas* fGLCanvas;
reed@android.com671cd652009-05-22 20:44:12 +000038
39 void doDraw();
40
41 typedef SkWindow INHERITED;
42};
43
44#endif