OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_GFX_SURFACE_ACCELERATED_SURFACE_LINUX_H_ | 5 #ifndef UI_GFX_SURFACE_ACCELERATED_SURFACE_LINUX_H_ |
6 #define UI_GFX_SURFACE_ACCELERATED_SURFACE_LINUX_H_ | 6 #define UI_GFX_SURFACE_ACCELERATED_SURFACE_LINUX_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
11 #include "ui/gfx/surface/surface_export.h" | |
12 | 11 |
13 struct wl_egl_pixmap; | 12 struct wl_egl_pixmap; |
14 | 13 |
15 // The GL context associated with the surface must be current when | 14 // The GL context associated with the surface must be current when |
16 // an instance is created or destroyed. | 15 // an instance is created or destroyed. |
17 class SURFACE_EXPORT AcceleratedSurface | 16 class AcceleratedSurface : public base::RefCounted<AcceleratedSurface> { |
18 : public base::RefCounted<AcceleratedSurface> { | |
19 public: | 17 public: |
20 AcceleratedSurface(const gfx::Size& size); | 18 AcceleratedSurface(const gfx::Size& size); |
21 const gfx::Size& size() const { return size_; } | 19 const gfx::Size& size() const { return size_; } |
22 // The pointer returned is owned by this object | 20 // The pointer returned is owned by this object |
23 wl_egl_pixmap* pixmap() const { return pixmap_; } | 21 wl_egl_pixmap* pixmap() const { return pixmap_; } |
24 uint32 texture() const { return texture_; } | 22 uint32 texture() const { return texture_; } |
25 | 23 |
26 private: | 24 private: |
27 friend class base::RefCounted<AcceleratedSurface>; | 25 friend class base::RefCounted<AcceleratedSurface>; |
28 | 26 |
29 ~AcceleratedSurface(); | 27 ~AcceleratedSurface(); |
30 | 28 |
31 gfx::Size size_; | 29 gfx::Size size_; |
32 void* image_; | 30 void* image_; |
33 wl_egl_pixmap* pixmap_; | 31 wl_egl_pixmap* pixmap_; |
34 uint32 texture_; | 32 uint32 texture_; |
35 | 33 |
36 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurface); | 34 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurface); |
37 }; | 35 }; |
38 | 36 |
39 #endif // UI_GFX_SURFACE_ACCELERATED_SURFACE_LINUX_H_ | 37 #endif // UI_GFX_SURFACE_ACCELERATED_SURFACE_LINUX_H_ |
OLD | NEW |