OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_IMAGE_SURFACE_TEXTURE_H_ | 5 #ifndef UI_GL_GL_IMAGE_SURFACE_TEXTURE_H_ |
6 #define UI_GL_GL_IMAGE_SURFACE_TEXTURE_H_ | 6 #define UI_GL_GL_IMAGE_SURFACE_TEXTURE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
13 #include "ui/gl/gl_bindings.h" | 13 #include "ui/gl/gl_bindings.h" |
14 #include "ui/gl/gl_export.h" | 14 #include "ui/gl/gl_export.h" |
15 #include "ui/gl/gl_image.h" | 15 #include "ui/gl/gl_image.h" |
16 | 16 |
17 namespace gfx { | 17 namespace gl { |
| 18 |
18 class SurfaceTexture; | 19 class SurfaceTexture; |
19 } | |
20 | |
21 namespace gl { | |
22 | 20 |
23 class GL_EXPORT GLImageSurfaceTexture : public GLImage { | 21 class GL_EXPORT GLImageSurfaceTexture : public GLImage { |
24 public: | 22 public: |
25 explicit GLImageSurfaceTexture(const gfx::Size& size); | 23 explicit GLImageSurfaceTexture(const gfx::Size& size); |
26 | 24 |
27 bool Initialize(gfx::SurfaceTexture* surface_texture); | 25 bool Initialize(gl::SurfaceTexture* surface_texture); |
28 | 26 |
29 // Overridden from GLImage: | 27 // Overridden from GLImage: |
30 void Destroy(bool have_context) override; | 28 void Destroy(bool have_context) override; |
31 gfx::Size GetSize() override; | 29 gfx::Size GetSize() override; |
32 unsigned GetInternalFormat() override; | 30 unsigned GetInternalFormat() override; |
33 bool BindTexImage(unsigned target) override; | 31 bool BindTexImage(unsigned target) override; |
34 void ReleaseTexImage(unsigned target) override {} | 32 void ReleaseTexImage(unsigned target) override {} |
35 bool CopyTexImage(unsigned target) override; | 33 bool CopyTexImage(unsigned target) override; |
36 bool CopyTexSubImage(unsigned target, | 34 bool CopyTexSubImage(unsigned target, |
37 const gfx::Point& offset, | 35 const gfx::Point& offset, |
38 const gfx::Rect& rect) override; | 36 const gfx::Rect& rect) override; |
39 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 37 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
40 int z_order, | 38 int z_order, |
41 gfx::OverlayTransform transform, | 39 gfx::OverlayTransform transform, |
42 const gfx::Rect& bounds_rect, | 40 const gfx::Rect& bounds_rect, |
43 const gfx::RectF& crop_rect) override; | 41 const gfx::RectF& crop_rect) override; |
44 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, | 42 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, |
45 uint64_t process_tracing_id, | 43 uint64_t process_tracing_id, |
46 const std::string& dump_name) override; | 44 const std::string& dump_name) override; |
47 | 45 |
48 protected: | 46 protected: |
49 ~GLImageSurfaceTexture() override; | 47 ~GLImageSurfaceTexture() override; |
50 | 48 |
51 private: | 49 private: |
52 scoped_refptr<gfx::SurfaceTexture> surface_texture_; | 50 scoped_refptr<gl::SurfaceTexture> surface_texture_; |
53 const gfx::Size size_; | 51 const gfx::Size size_; |
54 GLint texture_id_; | 52 GLint texture_id_; |
55 base::ThreadChecker thread_checker_; | 53 base::ThreadChecker thread_checker_; |
56 | 54 |
57 DISALLOW_COPY_AND_ASSIGN(GLImageSurfaceTexture); | 55 DISALLOW_COPY_AND_ASSIGN(GLImageSurfaceTexture); |
58 }; | 56 }; |
59 | 57 |
60 } // namespace gl | 58 } // namespace gl |
61 | 59 |
62 #endif // UI_GL_GL_IMAGE_SURFACE_TEXTURE_H_ | 60 #endif // UI_GL_GL_IMAGE_SURFACE_TEXTURE_H_ |
OLD | NEW |