diff options
author | Derek Sollenberger <djsollen@google.com> | 2011-06-06 17:02:24 -0400 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2011-06-07 14:00:04 -0400 |
commit | 0b15698a8c76bb8abc1b555c1d91892669b4118f (patch) | |
tree | 08732d5fbb7484ce7e10c65c96fb56294053073a /include/views/SkOSWindow_Unix.h | |
parent | 9770b0f3d2b5d512daac50c2c9561d2c073cd8d2 (diff) | |
download | external_skia-0b15698a8c76bb8abc1b555c1d91892669b4118f.zip external_skia-0b15698a8c76bb8abc1b555c1d91892669b4118f.tar.gz external_skia-0b15698a8c76bb8abc1b555c1d91892669b4118f.tar.bz2 |
Skia Merge (revision 1510)
This CL includes bug fixes and closely mirrors the version of
Skia used in Chrome M13, which is likely to be our baseline for
ICS.
The CL also adds source files for the SampleApp which will allow
us to execute basic skia tests. The SampleApp requires the
utils/views directory in order to run.
Finally, we have included the PDF backend for Skia in order to
experiment with using it to generate PDF files for certain
applications.
Note: The SampleApp and PDF code are not built as part of libskia.
Change-Id: I1895ccfbd8074e25f19148cc7bd1b4af571fb307
Diffstat (limited to 'include/views/SkOSWindow_Unix.h')
-rw-r--r-- | include/views/SkOSWindow_Unix.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/include/views/SkOSWindow_Unix.h b/include/views/SkOSWindow_Unix.h new file mode 100644 index 0000000..803ca13 --- /dev/null +++ b/include/views/SkOSWindow_Unix.h @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2006 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SkOSWindow_Unix_DEFINED +#define SkOSWindow_Unix_DEFINED + +#include "SkWindow.h" +#include <X11/Xlib.h> +#include <GL/glx.h> + +class SkBitmap; +class SkEvent; + +struct SkUnixWindow { + Display* fDisplay; + Window fWin; + size_t fOSWin; + GC fGc; + GLXContext fGLContext; + bool fGLCreated; +}; + +class SkOSWindow : public SkWindow { +public: + SkOSWindow(void*); + ~SkOSWindow(); + + void* getHWND() const { return (void*)fUnixWindow.fWin; } + void* getDisplay() const { return (void*)fUnixWindow.fDisplay; } + void* getUnixWindow() const { return (void*)&fUnixWindow; } + void loop(); + void post_linuxevent(); + bool attachGL(); + void detachGL(); + void presentGL(); + + //static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay); + + //static bool WndProc(SkUnixWindow* w, XEvent &e); + +protected: + // overrides from SkWindow + virtual bool onEvent(const SkEvent&); + virtual void onHandleInval(const SkIRect&); + virtual bool onHandleChar(SkUnichar); + virtual bool onHandleKey(SkKey); + virtual bool onHandleKeyUp(SkKey); + virtual void onSetTitle(const char title[]); + +private: + SkUnixWindow fUnixWindow; + bool fGLAttached; + bool fRestart; + + // Needed for GL + XVisualInfo* fVi; + + void doPaint(); + void restartLoop(); + void mapWindowAndWait(); + + typedef SkWindow INHERITED; +}; + +#endif + |