OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/common/gpu/media/android_copying_backing_strategy.h" | 5 #include "content/common/gpu/media/android_copying_backing_strategy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "content/common/gpu/media/avda_return_on_failure.h" | 10 #include "content/common/gpu/media/avda_return_on_failure.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 state_provider_->GetGlDecoder()->RestoreTextureUnitBindings(0); | 49 state_provider_->GetGlDecoder()->RestoreTextureUnitBindings(0); |
50 state_provider_->GetGlDecoder()->RestoreActiveTexture(); | 50 state_provider_->GetGlDecoder()->RestoreActiveTexture(); |
51 | 51 |
52 surface_texture_ = gfx::SurfaceTexture::Create(surface_texture_id_); | 52 surface_texture_ = gfx::SurfaceTexture::Create(surface_texture_id_); |
53 | 53 |
54 return gfx::ScopedJavaSurface(surface_texture_.get()); | 54 return gfx::ScopedJavaSurface(surface_texture_.get()); |
55 } | 55 } |
56 | 56 |
57 void AndroidCopyingBackingStrategy::Cleanup( | 57 void AndroidCopyingBackingStrategy::Cleanup( |
58 bool have_context, | 58 bool have_context, |
59 const AndroidVideoDecodeAccelerator::OutputBufferMap&) { | 59 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) { |
60 DCHECK(state_provider_->ThreadChecker().CalledOnValidThread()); | 60 DCHECK(state_provider_->ThreadChecker().CalledOnValidThread()); |
61 | 61 |
62 if (copier_) | 62 if (copier_) |
63 copier_->Destroy(); | 63 copier_->Destroy(); |
64 | 64 |
65 if (surface_texture_id_ && have_context) | 65 if (surface_texture_id_ && have_context) |
66 glDeleteTextures(1, &surface_texture_id_); | 66 glDeleteTextures(1, &surface_texture_id_); |
67 } | 67 } |
68 | 68 |
69 scoped_refptr<gfx::SurfaceTexture> | 69 scoped_refptr<gfx::SurfaceTexture> |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 RETURN_IF_NULL(texture_ref); | 182 RETURN_IF_NULL(texture_ref); |
183 gpu::gles2::TextureManager* texture_manager = | 183 gpu::gles2::TextureManager* texture_manager = |
184 state_provider_->GetGlDecoder()->GetContextGroup()->texture_manager(); | 184 state_provider_->GetGlDecoder()->GetContextGroup()->texture_manager(); |
185 RETURN_IF_NULL(texture_manager); | 185 RETURN_IF_NULL(texture_manager); |
186 texture_manager->SetLevelInfo(texture_ref, GetTextureTarget(), 0, GL_RGBA, | 186 texture_manager->SetLevelInfo(texture_ref, GetTextureTarget(), 0, GL_RGBA, |
187 new_size.width(), new_size.height(), 1, 0, | 187 new_size.width(), new_size.height(), 1, 0, |
188 GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect(new_size)); | 188 GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect(new_size)); |
189 } | 189 } |
190 | 190 |
191 } // namespace content | 191 } // namespace content |
OLD | NEW |