OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "gpu/command_buffer/service/stream_texture_manager_in_process_android.h
" | 5 #include "gpu/command_buffer/service/stream_texture_manager_in_process_android.h
" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "gpu/command_buffer/service/texture_manager.h" | 9 #include "gpu/command_buffer/service/texture_manager.h" |
10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
11 #include "ui/gl/android/surface_texture.h" | 11 #include "ui/gl/android/surface_texture.h" |
12 #include "ui/gl/gl_bindings.h" | 12 #include "ui/gl/gl_bindings.h" |
13 #include "ui/gl/gl_image.h" | 13 #include "ui/gl/gl_image.h" |
14 | 14 |
15 namespace gpu { | 15 namespace gpu { |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 // Simply wraps a SurfaceTexture reference as a GLImage. | 19 // Simply wraps a SurfaceTexture reference as a GLImage. |
20 class GLImageImpl : public gfx::GLImage { | 20 class GLImageImpl : public gfx::GLImage { |
21 public: | 21 public: |
22 GLImageImpl(const scoped_refptr<gfx::SurfaceTexture>& surface_texture, | 22 GLImageImpl(const scoped_refptr<gfx::SurfaceTexture>& surface_texture, |
23 const base::Closure& release_callback); | 23 const base::Closure& release_callback); |
24 | 24 |
25 // implement gfx::GLImage | 25 // implement gfx::GLImage |
26 void Destroy(bool have_context) override; | 26 void Destroy(bool have_context) override; |
27 gfx::Size GetSize() override; | 27 gfx::Size GetSize() override; |
| 28 unsigned GetInternalFormat() override; |
28 bool BindTexImage(unsigned target) override; | 29 bool BindTexImage(unsigned target) override; |
29 void ReleaseTexImage(unsigned target) override; | 30 void ReleaseTexImage(unsigned target) override; |
30 bool CopyTexImage(unsigned target) override; | 31 bool CopyTexImage(unsigned target) override; |
31 void WillUseTexImage() override; | 32 void WillUseTexImage() override; |
32 void DidUseTexImage() override {} | 33 void DidUseTexImage() override {} |
33 void WillModifyTexImage() override {} | 34 void WillModifyTexImage() override {} |
34 void DidModifyTexImage() override {} | 35 void DidModifyTexImage() override {} |
35 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 36 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
36 int z_order, | 37 int z_order, |
37 gfx::OverlayTransform transform, | 38 gfx::OverlayTransform transform, |
(...skipping 19 matching lines...) Expand all Loading... |
57 } | 58 } |
58 | 59 |
59 void GLImageImpl::Destroy(bool have_context) { | 60 void GLImageImpl::Destroy(bool have_context) { |
60 NOTREACHED(); | 61 NOTREACHED(); |
61 } | 62 } |
62 | 63 |
63 gfx::Size GLImageImpl::GetSize() { | 64 gfx::Size GLImageImpl::GetSize() { |
64 return gfx::Size(); | 65 return gfx::Size(); |
65 } | 66 } |
66 | 67 |
| 68 unsigned GLImageImpl::GetInternalFormat() { |
| 69 return GL_RGBA; |
| 70 } |
| 71 |
67 bool GLImageImpl::BindTexImage(unsigned target) { | 72 bool GLImageImpl::BindTexImage(unsigned target) { |
68 NOTREACHED(); | 73 NOTREACHED(); |
69 return false; | 74 return false; |
70 } | 75 } |
71 | 76 |
72 void GLImageImpl::ReleaseTexImage(unsigned target) { | 77 void GLImageImpl::ReleaseTexImage(unsigned target) { |
73 NOTREACHED(); | 78 NOTREACHED(); |
74 } | 79 } |
75 | 80 |
76 bool GLImageImpl::CopyTexImage(unsigned target) { | 81 bool GLImageImpl::CopyTexImage(unsigned target) { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 StreamTextureManagerInProcess::GetSurfaceTexture(uint32 stream_id) { | 167 StreamTextureManagerInProcess::GetSurfaceTexture(uint32 stream_id) { |
163 base::AutoLock lock(map_lock_); | 168 base::AutoLock lock(map_lock_); |
164 TextureMap::const_iterator it = textures_.find(stream_id); | 169 TextureMap::const_iterator it = textures_.find(stream_id); |
165 if (it != textures_.end()) | 170 if (it != textures_.end()) |
166 return it->second; | 171 return it->second; |
167 | 172 |
168 return NULL; | 173 return NULL; |
169 } | 174 } |
170 | 175 |
171 } // namespace gpu | 176 } // namespace gpu |
OLD | NEW |