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; | 36 GLSurface::Format GetFormat() override; |
37 | 37 |
38 protected: | 38 protected: |
39 ~GLSurfaceOSMesa() override; | 39 ~GLSurfaceOSMesa() override; |
40 | 40 |
41 private: | 41 private: |
42 unsigned format_; | |
43 gfx::Size size_; | 42 gfx::Size size_; |
44 scoped_ptr<int32_t[]> buffer_; | 43 scoped_ptr<int32_t[]> buffer_; |
45 | 44 |
46 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOSMesa); | 45 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOSMesa); |
47 }; | 46 }; |
48 | 47 |
49 // A thin subclass of |GLSurfaceOSMesa| that can be used in place | 48 // A thin subclass of |GLSurfaceOSMesa| that can be used in place |
50 // of a native hardware-provided surface when a native surface | 49 // of a native hardware-provided surface when a native surface |
51 // provider is not available. | 50 // provider is not available. |
52 class GLSurfaceOSMesaHeadless : public GLSurfaceOSMesa { | 51 class GLSurfaceOSMesaHeadless : public GLSurfaceOSMesa { |
53 public: | 52 public: |
54 explicit GLSurfaceOSMesaHeadless(); | 53 explicit GLSurfaceOSMesaHeadless(); |
55 | 54 |
56 bool IsOffscreen() override; | 55 bool IsOffscreen() override; |
57 gfx::SwapResult SwapBuffers() override; | 56 gfx::SwapResult SwapBuffers() override; |
58 | 57 |
59 protected: | 58 protected: |
60 ~GLSurfaceOSMesaHeadless() override; | 59 ~GLSurfaceOSMesaHeadless() override; |
61 | 60 |
62 private: | 61 private: |
63 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOSMesaHeadless); | 62 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOSMesaHeadless); |
64 }; | 63 }; |
65 | 64 |
66 } // namespace gfx | 65 } // namespace gfx |
67 | 66 |
68 #endif // UI_GL_GL_SURFACE_OSMESA_H_ | 67 #endif // UI_GL_GL_SURFACE_OSMESA_H_ |
OLD | NEW |