2011-07-28 14:26:00 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
/*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Copyright 2006 The Android Open Source Project
|
2008-12-17 15:59:43 +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.
|
2008-12-17 15:59:43 +00:00
|
|
|
*/
|
|
|
|
|
2011-08-30 14:40:49 +00:00
|
|
|
#ifndef SkOSWindow_MacCocoa_DEFINED
|
|
|
|
#define SkOSWindow_MacCocoa_DEFINED
|
2011-07-28 14:26:00 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
#include "SkWindow.h"
|
|
|
|
|
|
|
|
class SkOSWindow : public SkWindow {
|
|
|
|
public:
|
|
|
|
SkOSWindow(void* hwnd);
|
2011-08-30 14:40:49 +00:00
|
|
|
~SkOSWindow();
|
2008-12-17 15:59:43 +00:00
|
|
|
void* getHWND() const { return fHWND; }
|
2012-04-06 20:13:38 +00:00
|
|
|
|
2012-08-23 18:09:54 +00:00
|
|
|
virtual bool onDispatchClick(int x, int y, Click::State state,
|
2013-01-08 16:17:50 +00:00
|
|
|
void* owner, unsigned modi);
|
2012-04-02 19:24:21 +00:00
|
|
|
enum SkBackEndTypes {
|
|
|
|
kNone_BackEndType,
|
2012-08-02 14:03:32 +00:00
|
|
|
#if SK_SUPPORT_GPU
|
2012-04-02 19:24:21 +00:00
|
|
|
kNativeGL_BackEndType,
|
2012-08-02 14:03:32 +00:00
|
|
|
#endif
|
2015-10-28 15:42:29 +00:00
|
|
|
#if SK_ANGLE
|
|
|
|
kANGLE_BackEndType,
|
|
|
|
#endif // SK_ANGLE
|
2012-04-02 19:24:21 +00:00
|
|
|
};
|
|
|
|
|
2016-03-16 20:53:35 +00:00
|
|
|
void release();
|
2016-05-05 19:24:31 +00:00
|
|
|
bool attach(SkBackEndTypes attachType, int msaaSampleCount, bool deepColor,
|
|
|
|
AttachmentInfo*);
|
2012-04-02 19:24:21 +00:00
|
|
|
void present();
|
2012-04-06 20:13:38 +00:00
|
|
|
|
2015-06-18 18:49:42 +00:00
|
|
|
bool makeFullscreen();
|
|
|
|
void closeWindow();
|
|
|
|
void setVsync(bool);
|
2008-12-17 15:59:43 +00:00
|
|
|
protected:
|
2008-12-19 18:24:35 +00:00
|
|
|
// overrides from SkEventSink
|
|
|
|
virtual bool onEvent(const SkEvent& evt);
|
2008-12-17 15:59:43 +00:00
|
|
|
// overrides from SkWindow
|
|
|
|
virtual void onHandleInval(const SkIRect&);
|
|
|
|
// overrides from SkView
|
|
|
|
virtual void onAddMenu(const SkOSMenu*);
|
2011-08-30 14:40:49 +00:00
|
|
|
virtual void onUpdateMenu(const SkOSMenu*);
|
2008-12-17 15:59:43 +00:00
|
|
|
virtual void onSetTitle(const char[]);
|
2012-08-23 18:09:54 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
private:
|
|
|
|
void* fHWND;
|
2011-08-30 14:40:49 +00:00
|
|
|
bool fInvalEventIsPending;
|
|
|
|
void* fNotifier;
|
2012-08-02 14:03:32 +00:00
|
|
|
#if SK_SUPPORT_GPU
|
2011-08-30 14:40:49 +00:00
|
|
|
void* fGLContext;
|
2012-08-02 14:03:32 +00:00
|
|
|
#endif
|
2008-12-17 15:59:43 +00:00
|
|
|
typedef SkWindow INHERITED;
|
|
|
|
};
|
|
|
|
|
2011-11-23 14:54:19 +00:00
|
|
|
#endif
|