OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_GL_GL_SURFACE_OSMESA_X11_H_ |
| 6 #define UI_GL_GL_SURFACE_OSMESA_X11_H_ |
| 7 |
| 8 #include <X11/Xlib.h> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "ui/gfx/native_widget_types.h" |
| 12 #include "ui/gl/gl_export.h" |
| 13 #include "ui/gl/gl_surface.h" |
| 14 #include "ui/gl/gl_surface_osmesa.h" |
| 15 |
| 16 namespace gl { |
| 17 |
| 18 // This OSMesa GL surface can use XLib to swap the contents of the buffer to a |
| 19 // view. |
| 20 class GL_EXPORT GLSurfaceOSMesaX11 : public GLSurfaceOSMesa { |
| 21 public: |
| 22 explicit GLSurfaceOSMesaX11(gfx::AcceleratedWidget window); |
| 23 |
| 24 static bool InitializeOneOff(); |
| 25 |
| 26 // Implement a subset of GLSurface. |
| 27 bool Initialize(GLSurface::Format format) override; |
| 28 void Destroy() override; |
| 29 bool Resize(const gfx::Size& new_size, |
| 30 float scale_factor, |
| 31 bool alpha) override; |
| 32 bool IsOffscreen() override; |
| 33 gfx::SwapResult SwapBuffers() override; |
| 34 bool SupportsPostSubBuffer() override; |
| 35 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; |
| 36 |
| 37 protected: |
| 38 ~GLSurfaceOSMesaX11() override; |
| 39 |
| 40 private: |
| 41 Display* xdisplay_; |
| 42 GC window_graphics_context_; |
| 43 gfx::AcceleratedWidget window_; |
| 44 GC pixmap_graphics_context_; |
| 45 Pixmap pixmap_; |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOSMesaX11); |
| 48 }; |
| 49 |
| 50 } // namespace gl |
| 51 |
| 52 #endif // UI_GL_GL_SURFACE_OSMESA_X11_H_ |
OLD | NEW |