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

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

Issue 415283002: ui: Add ScheduleOverlayPlane API to GLImage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add gfx::AcceleratedWidget argument to GLImage::ScheduleOverlayPlane Created 6 years, 4 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 | Annotate | Revision Log
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"
(...skipping 13 matching lines...) Expand all
24 24
25 // implement gfx::GLImage 25 // implement gfx::GLImage
26 virtual void Destroy() OVERRIDE; 26 virtual void Destroy() 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 void WillUseTexImage() OVERRIDE; 30 virtual void WillUseTexImage() OVERRIDE;
31 virtual void DidUseTexImage() OVERRIDE {} 31 virtual void DidUseTexImage() OVERRIDE {}
32 virtual void WillModifyTexImage() OVERRIDE {} 32 virtual void WillModifyTexImage() OVERRIDE {}
33 virtual void DidModifyTexImage() OVERRIDE {} 33 virtual void DidModifyTexImage() OVERRIDE {}
34 virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
35 int z_order,
36 gfx::OverlayTransform transform,
37 const gfx::Rect& bounds_rect,
38 const gfx::RectF& crop_rect) OVERRIDE;
34 39
35 private: 40 private:
36 virtual ~GLImageImpl(); 41 virtual ~GLImageImpl();
37 42
38 scoped_refptr<gfx::SurfaceTexture> surface_texture_; 43 scoped_refptr<gfx::SurfaceTexture> surface_texture_;
39 base::Closure release_callback_; 44 base::Closure release_callback_;
40 45
41 DISALLOW_COPY_AND_ASSIGN(GLImageImpl); 46 DISALLOW_COPY_AND_ASSIGN(GLImageImpl);
42 }; 47 };
43 48
44 GLImageImpl::GLImageImpl( 49 GLImageImpl::GLImageImpl(
45 const scoped_refptr<gfx::SurfaceTexture>& surface_texture, 50 const scoped_refptr<gfx::SurfaceTexture>& surface_texture,
46 const base::Closure& release_callback) 51 const base::Closure& release_callback)
47 : surface_texture_(surface_texture), release_callback_(release_callback) {} 52 : surface_texture_(surface_texture), release_callback_(release_callback) {}
48 53
49 GLImageImpl::~GLImageImpl() { 54 GLImageImpl::~GLImageImpl() {
50 release_callback_.Run(); 55 release_callback_.Run();
51 } 56 }
52 57
53 void GLImageImpl::Destroy() { 58 void GLImageImpl::Destroy() {
54 NOTREACHED(); 59 NOTREACHED();
55 } 60 }
56 61
57 void GLImageImpl::WillUseTexImage() { 62 gfx::Size GLImageImpl::GetSize() {
58 surface_texture_->UpdateTexImage(); 63 return gfx::Size();
59 } 64 }
60 65
61 bool GLImageImpl::BindTexImage(unsigned target) { 66 bool GLImageImpl::BindTexImage(unsigned target) {
62 NOTREACHED(); 67 NOTREACHED();
63 return false; 68 return false;
64 } 69 }
65 70
66 void GLImageImpl::ReleaseTexImage(unsigned target) { 71 void GLImageImpl::ReleaseTexImage(unsigned target) {
67 NOTREACHED(); 72 NOTREACHED();
68 } 73 }
69 74
70 gfx::Size GLImageImpl::GetSize() { 75 void GLImageImpl::WillUseTexImage() {
71 return gfx::Size(); 76 surface_texture_->UpdateTexImage();
77 }
78
79 bool GLImageImpl::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
80 int z_order,
81 gfx::OverlayTransform transform,
82 const gfx::Rect& bounds_rect,
83 const gfx::RectF& crop_rect) {
84 NOTREACHED();
85 return false;
72 } 86 }
73 87
74 } // anonymous namespace 88 } // anonymous namespace
75 89
76 StreamTextureManagerInProcess::StreamTextureManagerInProcess() 90 StreamTextureManagerInProcess::StreamTextureManagerInProcess()
77 : next_id_(1), weak_factory_(this) {} 91 : next_id_(1), weak_factory_(this) {}
78 92
79 StreamTextureManagerInProcess::~StreamTextureManagerInProcess() { 93 StreamTextureManagerInProcess::~StreamTextureManagerInProcess() {
80 if (!textures_.empty()) { 94 if (!textures_.empty()) {
81 LOG(WARNING) << "Undestroyed surface textures while tearing down " 95 LOG(WARNING) << "Undestroyed surface textures while tearing down "
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 StreamTextureManagerInProcess::GetSurfaceTexture(uint32 stream_id) { 156 StreamTextureManagerInProcess::GetSurfaceTexture(uint32 stream_id) {
143 base::AutoLock lock(map_lock_); 157 base::AutoLock lock(map_lock_);
144 TextureMap::const_iterator it = textures_.find(stream_id); 158 TextureMap::const_iterator it = textures_.find(stream_id);
145 if (it != textures_.end()) 159 if (it != textures_.end())
146 return it->second; 160 return it->second;
147 161
148 return NULL; 162 return NULL;
149 } 163 }
150 164
151 } // namespace gpu 165 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698