| 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 "media/gpu/android_deferred_rendering_backing_strategy.h" | 5 #include "media/gpu/android_deferred_rendering_backing_strategy.h" |
| 6 | 6 |
| 7 #include <EGL/egl.h> | 7 #include <EGL/egl.h> |
| 8 #include <EGL/eglext.h> | 8 #include <EGL/eglext.h> |
| 9 | 9 |
| 10 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // implementation will call CopyTexImage, which is where AVDACodecImage | 144 // implementation will call CopyTexImage, which is where AVDACodecImage |
| 145 // updates the SurfaceTexture to the right frame. | 145 // updates the SurfaceTexture to the right frame. |
| 146 auto image_state = gpu::gles2::Texture::UNBOUND; | 146 auto image_state = gpu::gles2::Texture::UNBOUND; |
| 147 // For SurfaceView we set the state to BOUND because ScheduleOverlayPlane | 147 // For SurfaceView we set the state to BOUND because ScheduleOverlayPlane |
| 148 // requires it. If something tries to sample from this texture it won't work, | 148 // requires it. If something tries to sample from this texture it won't work, |
| 149 // but there's no way to sample from a SurfaceView anyway, so it doesn't | 149 // but there's no way to sample from a SurfaceView anyway, so it doesn't |
| 150 // matter. | 150 // matter. |
| 151 if (image && !surface_texture_) | 151 if (image && !surface_texture_) |
| 152 image_state = gpu::gles2::Texture::BOUND; | 152 image_state = gpu::gles2::Texture::BOUND; |
| 153 texture_manager->SetLevelStreamTextureImage(texture_ref, GetTextureTarget(), | 153 texture_manager->SetLevelStreamTextureImage(texture_ref, GetTextureTarget(), |
| 154 0, image.get(), image_state, | 154 0, 0, image.get(), image_state, |
| 155 stream_texture_service_id); | 155 stream_texture_service_id); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void AndroidDeferredRenderingBackingStrategy::UseCodecBufferForPictureBuffer( | 158 void AndroidDeferredRenderingBackingStrategy::UseCodecBufferForPictureBuffer( |
| 159 int32_t codec_buf_index, | 159 int32_t codec_buf_index, |
| 160 const PictureBuffer& picture_buffer) { | 160 const PictureBuffer& picture_buffer) { |
| 161 // Make sure that the decoder is available. | 161 // Make sure that the decoder is available. |
| 162 RETURN_IF_NULL(state_provider_->GetGlDecoder()); | 162 RETURN_IF_NULL(state_provider_->GetGlDecoder()); |
| 163 | 163 |
| 164 // Notify the AVDACodecImage for picture_buffer that it should use the | 164 // Notify the AVDACodecImage for picture_buffer that it should use the |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 | 305 |
| 306 void AndroidDeferredRenderingBackingStrategy::UpdatePictureBufferSize( | 306 void AndroidDeferredRenderingBackingStrategy::UpdatePictureBufferSize( |
| 307 PictureBuffer* picture_buffer, | 307 PictureBuffer* picture_buffer, |
| 308 const gfx::Size& new_size) { | 308 const gfx::Size& new_size) { |
| 309 // This strategy uses EGL images which manage the texture size for us. We | 309 // This strategy uses EGL images which manage the texture size for us. We |
| 310 // simply update the PictureBuffer meta-data and leave the texture as-is. | 310 // simply update the PictureBuffer meta-data and leave the texture as-is. |
| 311 picture_buffer->set_size(new_size); | 311 picture_buffer->set_size(new_size); |
| 312 } | 312 } |
| 313 | 313 |
| 314 } // namespace media | 314 } // namespace media |
| OLD | NEW |