| 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_deferred_rendering_backing_strategy.h
" | 5 #include "content/common/gpu/media/android_deferred_rendering_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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 surface_texture_->DetachFromGLContext(); | 41 surface_texture_->DetachFromGLContext(); |
| 42 surface = gfx::ScopedJavaSurface(surface_texture_.get()); | 42 surface = gfx::ScopedJavaSurface(surface_texture_.get()); |
| 43 } | 43 } |
| 44 | 44 |
| 45 // Create a texture for the SurfaceTexture to use. We don't attach it here | 45 // Create a texture for the SurfaceTexture to use. We don't attach it here |
| 46 // so that it gets attached in the compositor gl context in the common case. | 46 // so that it gets attached in the compositor gl context in the common case. |
| 47 GLuint service_id = 0; | 47 GLuint service_id = 0; |
| 48 glGenTextures(1, &service_id); | 48 glGenTextures(1, &service_id); |
| 49 DCHECK(service_id); | 49 DCHECK(service_id); |
| 50 shared_state_->set_surface_texture_service_id(service_id); | 50 shared_state_->set_surface_texture_service_id(service_id); |
| 51 shared_state_->set_share_group(gfx::GLContext::GetCurrent()->share_group()); |
| 51 | 52 |
| 52 return surface; | 53 return surface; |
| 53 } | 54 } |
| 54 | 55 |
| 55 void AndroidDeferredRenderingBackingStrategy::Cleanup( | 56 void AndroidDeferredRenderingBackingStrategy::Cleanup( |
| 56 bool have_context, | 57 bool have_context, |
| 57 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) { | 58 const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) { |
| 58 // If we failed before Initialize, then do nothing. | 59 // If we failed before Initialize, then do nothing. |
| 59 if (!shared_state_) | 60 if (!shared_state_) |
| 60 return; | 61 return; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 shared_state_->SignalFrameAvailable(); | 229 shared_state_->SignalFrameAvailable(); |
| 229 } | 230 } |
| 230 | 231 |
| 231 bool AndroidDeferredRenderingBackingStrategy::ArePicturesOverlayable() { | 232 bool AndroidDeferredRenderingBackingStrategy::ArePicturesOverlayable() { |
| 232 // SurfaceView frames are always overlayable because that's the only way to | 233 // SurfaceView frames are always overlayable because that's the only way to |
| 233 // display them. | 234 // display them. |
| 234 return !surface_texture_; | 235 return !surface_texture_; |
| 235 } | 236 } |
| 236 | 237 |
| 237 } // namespace content | 238 } // namespace content |
| OLD | NEW |