| 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/size.h" | 10 #include "ui/gfx/size.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 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(int z_order, |
| 35 gfx::OverlayTransform transform, |
| 36 const gfx::Rect& bounds_rect, |
| 37 const gfx::RectF& crop_rect) OVERRIDE; |
| 34 | 38 |
| 35 private: | 39 private: |
| 36 virtual ~GLImageImpl(); | 40 virtual ~GLImageImpl(); |
| 37 | 41 |
| 38 scoped_refptr<gfx::SurfaceTexture> surface_texture_; | 42 scoped_refptr<gfx::SurfaceTexture> surface_texture_; |
| 39 base::Closure release_callback_; | 43 base::Closure release_callback_; |
| 40 | 44 |
| 41 DISALLOW_COPY_AND_ASSIGN(GLImageImpl); | 45 DISALLOW_COPY_AND_ASSIGN(GLImageImpl); |
| 42 }; | 46 }; |
| 43 | 47 |
| 44 GLImageImpl::GLImageImpl( | 48 GLImageImpl::GLImageImpl( |
| 45 const scoped_refptr<gfx::SurfaceTexture>& surface_texture, | 49 const scoped_refptr<gfx::SurfaceTexture>& surface_texture, |
| 46 const base::Closure& release_callback) | 50 const base::Closure& release_callback) |
| 47 : surface_texture_(surface_texture), release_callback_(release_callback) {} | 51 : surface_texture_(surface_texture), release_callback_(release_callback) {} |
| 48 | 52 |
| 49 GLImageImpl::~GLImageImpl() { | 53 GLImageImpl::~GLImageImpl() { |
| 50 release_callback_.Run(); | 54 release_callback_.Run(); |
| 51 } | 55 } |
| 52 | 56 |
| 53 void GLImageImpl::Destroy() { | 57 void GLImageImpl::Destroy() { |
| 54 NOTREACHED(); | 58 NOTREACHED(); |
| 55 } | 59 } |
| 56 | 60 |
| 57 void GLImageImpl::WillUseTexImage() { | 61 gfx::Size GLImageImpl::GetSize() { |
| 58 surface_texture_->UpdateTexImage(); | 62 return gfx::Size(); |
| 59 } | 63 } |
| 60 | 64 |
| 61 bool GLImageImpl::BindTexImage(unsigned target) { | 65 bool GLImageImpl::BindTexImage(unsigned target) { |
| 62 NOTREACHED(); | 66 NOTREACHED(); |
| 63 return false; | 67 return false; |
| 64 } | 68 } |
| 65 | 69 |
| 66 void GLImageImpl::ReleaseTexImage(unsigned target) { | 70 void GLImageImpl::ReleaseTexImage(unsigned target) { |
| 67 NOTREACHED(); | 71 NOTREACHED(); |
| 68 } | 72 } |
| 69 | 73 |
| 70 gfx::Size GLImageImpl::GetSize() { | 74 void GLImageImpl::WillUseTexImage() { |
| 71 return gfx::Size(); | 75 surface_texture_->UpdateTexImage(); |
| 76 } |
| 77 |
| 78 bool GLImageImpl::ScheduleOverlayPlane(int z_order, |
| 79 gfx::OverlayTransform transform, |
| 80 const gfx::Rect& bounds_rect, |
| 81 const gfx::RectF& crop_rect) { |
| 82 NOTREACHED(); |
| 83 return false; |
| 72 } | 84 } |
| 73 | 85 |
| 74 } // anonymous namespace | 86 } // anonymous namespace |
| 75 | 87 |
| 76 StreamTextureManagerInProcess::StreamTextureManagerInProcess() | 88 StreamTextureManagerInProcess::StreamTextureManagerInProcess() |
| 77 : next_id_(1), weak_factory_(this) {} | 89 : next_id_(1), weak_factory_(this) {} |
| 78 | 90 |
| 79 StreamTextureManagerInProcess::~StreamTextureManagerInProcess() { | 91 StreamTextureManagerInProcess::~StreamTextureManagerInProcess() { |
| 80 if (!textures_.empty()) { | 92 if (!textures_.empty()) { |
| 81 LOG(WARNING) << "Undestroyed surface textures while tearing down " | 93 LOG(WARNING) << "Undestroyed surface textures while tearing down " |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 StreamTextureManagerInProcess::GetSurfaceTexture(uint32 stream_id) { | 154 StreamTextureManagerInProcess::GetSurfaceTexture(uint32 stream_id) { |
| 143 base::AutoLock lock(map_lock_); | 155 base::AutoLock lock(map_lock_); |
| 144 TextureMap::const_iterator it = textures_.find(stream_id); | 156 TextureMap::const_iterator it = textures_.find(stream_id); |
| 145 if (it != textures_.end()) | 157 if (it != textures_.end()) |
| 146 return it->second; | 158 return it->second; |
| 147 | 159 |
| 148 return NULL; | 160 return NULL; |
| 149 } | 161 } |
| 150 | 162 |
| 151 } // namespace gpu | 163 } // namespace gpu |
| OLD | NEW |