OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_GL_GL_SURFACE_OSMESA_H_ | 5 #ifndef UI_GL_GL_SURFACE_OSMESA_H_ |
6 #define UI_GL_GL_SURFACE_OSMESA_H_ | 6 #define UI_GL_GL_SURFACE_OSMESA_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // Implement GLSurface. | 26 // Implement GLSurface. |
27 bool Initialize(GLSurface::Format format) override; | 27 bool Initialize(GLSurface::Format format) override; |
28 void Destroy() override; | 28 void Destroy() override; |
29 bool Resize(const gfx::Size& new_size, | 29 bool Resize(const gfx::Size& new_size, |
30 float scale_factor, | 30 float scale_factor, |
31 bool has_alpha) override; | 31 bool has_alpha) override; |
32 bool IsOffscreen() override; | 32 bool IsOffscreen() override; |
33 gfx::SwapResult SwapBuffers() override; | 33 gfx::SwapResult SwapBuffers() override; |
34 gfx::Size GetSize() override; | 34 gfx::Size GetSize() override; |
35 void* GetHandle() override; | 35 void* GetHandle() override; |
36 unsigned GetFormat() override; | |
37 | 36 |
38 protected: | 37 protected: |
39 ~GLSurfaceOSMesa() override; | 38 ~GLSurfaceOSMesa() override; |
40 | 39 |
41 private: | 40 private: |
42 unsigned format_; | |
43 gfx::Size size_; | 41 gfx::Size size_; |
44 scoped_ptr<int32_t[]> buffer_; | 42 scoped_ptr<int32_t[]> buffer_; |
45 | 43 |
46 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOSMesa); | 44 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOSMesa); |
47 }; | 45 }; |
48 | 46 |
49 // A thin subclass of |GLSurfaceOSMesa| that can be used in place | 47 // A thin subclass of |GLSurfaceOSMesa| that can be used in place |
50 // of a native hardware-provided surface when a native surface | 48 // of a native hardware-provided surface when a native surface |
51 // provider is not available. | 49 // provider is not available. |
52 class GLSurfaceOSMesaHeadless : public GLSurfaceOSMesa { | 50 class GLSurfaceOSMesaHeadless : public GLSurfaceOSMesa { |
53 public: | 51 public: |
54 explicit GLSurfaceOSMesaHeadless(); | 52 explicit GLSurfaceOSMesaHeadless(); |
55 | 53 |
56 bool IsOffscreen() override; | 54 bool IsOffscreen() override; |
57 gfx::SwapResult SwapBuffers() override; | 55 gfx::SwapResult SwapBuffers() override; |
58 | 56 |
59 protected: | 57 protected: |
60 ~GLSurfaceOSMesaHeadless() override; | 58 ~GLSurfaceOSMesaHeadless() override; |
61 | 59 |
62 private: | 60 private: |
63 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOSMesaHeadless); | 61 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOSMesaHeadless); |
64 }; | 62 }; |
65 | 63 |
66 } // namespace gfx | 64 } // namespace gfx |
67 | 65 |
68 #endif // UI_GL_GL_SURFACE_OSMESA_H_ | 66 #endif // UI_GL_GL_SURFACE_OSMESA_H_ |
OLD | NEW |