Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: gpu/command_buffer/service/stream_texture_manager_in_process_android.cc

Issue 536353002: gpu: Add CopyTexImage function to GLImage API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: keep support for binding images to multiple textures Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/size.h" 10 #include "ui/gfx/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 virtual void Destroy(bool have_context) OVERRIDE; 26 virtual void Destroy(bool have_context) OVERRIDE;
27 virtual gfx::Size GetSize() OVERRIDE; 27 virtual gfx::Size GetSize() OVERRIDE;
28 virtual bool BindTexImage(unsigned target) OVERRIDE; 28 virtual bool BindTexImage(unsigned target) OVERRIDE;
29 virtual void ReleaseTexImage(unsigned target) OVERRIDE; 29 virtual void ReleaseTexImage(unsigned target) OVERRIDE;
30 virtual bool CopyTexImage(unsigned target) OVERRIDE;
30 virtual void WillUseTexImage() OVERRIDE; 31 virtual void WillUseTexImage() OVERRIDE;
31 virtual void DidUseTexImage() OVERRIDE {} 32 virtual void DidUseTexImage() OVERRIDE {}
32 virtual void WillModifyTexImage() OVERRIDE {} 33 virtual void WillModifyTexImage() OVERRIDE {}
33 virtual void DidModifyTexImage() OVERRIDE {} 34 virtual void DidModifyTexImage() OVERRIDE {}
34 virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, 35 virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
35 int z_order, 36 int z_order,
36 gfx::OverlayTransform transform, 37 gfx::OverlayTransform transform,
37 const gfx::Rect& bounds_rect, 38 const gfx::Rect& bounds_rect,
38 const gfx::RectF& crop_rect) OVERRIDE; 39 const gfx::RectF& crop_rect) OVERRIDE;
39 40
(...skipping 25 matching lines...) Expand all
65 66
66 bool GLImageImpl::BindTexImage(unsigned target) { 67 bool GLImageImpl::BindTexImage(unsigned target) {
67 NOTREACHED(); 68 NOTREACHED();
68 return false; 69 return false;
69 } 70 }
70 71
71 void GLImageImpl::ReleaseTexImage(unsigned target) { 72 void GLImageImpl::ReleaseTexImage(unsigned target) {
72 NOTREACHED(); 73 NOTREACHED();
73 } 74 }
74 75
76 bool GLImageImpl::CopyTexImage(unsigned target) {
77 NOTREACHED();
no sievers 2014/09/05 21:06:09 same here for webview
78 return false;
79 }
80
75 void GLImageImpl::WillUseTexImage() { 81 void GLImageImpl::WillUseTexImage() {
76 surface_texture_->UpdateTexImage(); 82 surface_texture_->UpdateTexImage();
77 } 83 }
78 84
79 bool GLImageImpl::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, 85 bool GLImageImpl::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
80 int z_order, 86 int z_order,
81 gfx::OverlayTransform transform, 87 gfx::OverlayTransform transform,
82 const gfx::Rect& bounds_rect, 88 const gfx::Rect& bounds_rect,
83 const gfx::RectF& crop_rect) { 89 const gfx::RectF& crop_rect) {
84 NOTREACHED(); 90 NOTREACHED();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 StreamTextureManagerInProcess::GetSurfaceTexture(uint32 stream_id) { 162 StreamTextureManagerInProcess::GetSurfaceTexture(uint32 stream_id) {
157 base::AutoLock lock(map_lock_); 163 base::AutoLock lock(map_lock_);
158 TextureMap::const_iterator it = textures_.find(stream_id); 164 TextureMap::const_iterator it = textures_.find(stream_id);
159 if (it != textures_.end()) 165 if (it != textures_.end())
160 return it->second; 166 return it->second;
161 167
162 return NULL; 168 return NULL;
163 } 169 }
164 170
165 } // namespace gpu 171 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698