1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/include/views/SkOSWindow_Mac.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,58 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2006 The Android Open Source Project 1.7 + * 1.8 + * Use of this source code is governed by a BSD-style license that can be 1.9 + * found in the LICENSE file. 1.10 + */ 1.11 + 1.12 +#ifndef SkOSWindow_MacCocoa_DEFINED 1.13 +#define SkOSWindow_MacCocoa_DEFINED 1.14 + 1.15 +#include "SkWindow.h" 1.16 + 1.17 +class SkOSWindow : public SkWindow { 1.18 +public: 1.19 + SkOSWindow(void* hwnd); 1.20 + ~SkOSWindow(); 1.21 + void* getHWND() const { return fHWND; } 1.22 + 1.23 + virtual bool onDispatchClick(int x, int y, Click::State state, 1.24 + void* owner, unsigned modi); 1.25 + enum SkBackEndTypes { 1.26 + kNone_BackEndType, 1.27 +#if SK_SUPPORT_GPU 1.28 + kNativeGL_BackEndType, 1.29 +#endif 1.30 + }; 1.31 + 1.32 + struct AttachmentInfo { 1.33 + int fSampleCount; 1.34 + int fStencilBits; 1.35 + }; 1.36 + 1.37 + void detach(); 1.38 + bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*); 1.39 + void present(); 1.40 + 1.41 +protected: 1.42 + // overrides from SkEventSink 1.43 + virtual bool onEvent(const SkEvent& evt); 1.44 + // overrides from SkWindow 1.45 + virtual void onHandleInval(const SkIRect&); 1.46 + // overrides from SkView 1.47 + virtual void onAddMenu(const SkOSMenu*); 1.48 + virtual void onUpdateMenu(const SkOSMenu*); 1.49 + virtual void onSetTitle(const char[]); 1.50 + 1.51 +private: 1.52 + void* fHWND; 1.53 + bool fInvalEventIsPending; 1.54 + void* fNotifier; 1.55 +#if SK_SUPPORT_GPU 1.56 + void* fGLContext; 1.57 +#endif 1.58 + typedef SkWindow INHERITED; 1.59 +}; 1.60 + 1.61 +#endif