| 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/avda_codec_image.h" | 5 #include "media/gpu/avda_codec_image.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // Make sure that we have the right image in the front buffer. Note that the | 82 // Make sure that we have the right image in the front buffer. Note that the |
| 83 // bound_service_id is guaranteed to be equal to the surface texture's client | 83 // bound_service_id is guaranteed to be equal to the surface texture's client |
| 84 // texture id, so we can skip preserving it if the right context is current. | 84 // texture id, so we can skip preserving it if the right context is current. |
| 85 UpdateSurfaceInternal(UpdateMode::RENDER_TO_FRONT_BUFFER, | 85 UpdateSurfaceInternal(UpdateMode::RENDER_TO_FRONT_BUFFER, |
| 86 kDontRestoreBindings); | 86 kDontRestoreBindings); |
| 87 | 87 |
| 88 // By setting image state to UNBOUND instead of COPIED we ensure that | 88 // By setting image state to UNBOUND instead of COPIED we ensure that |
| 89 // CopyTexImage() is called each time the surface texture is used for drawing. | 89 // CopyTexImage() is called each time the surface texture is used for drawing. |
| 90 // It would be nice if we could do this via asking for the currently bound | 90 // It would be nice if we could do this via asking for the currently bound |
| 91 // Texture, but the active unit never seems to change. | 91 // Texture, but the active unit never seems to change. |
| 92 texture_->SetLevelStreamTextureImage(GL_TEXTURE_EXTERNAL_OES, 0, this, | 92 texture_->SetLevelImageState(GL_TEXTURE_EXTERNAL_OES, 0, |
| 93 gpu::gles2::Texture::UNBOUND); | 93 gpu::gles2::Texture::UNBOUND); |
| 94 | 94 |
| 95 return true; | 95 return true; |
| 96 } | 96 } |
| 97 | 97 |
| 98 bool AVDACodecImage::CopyTexSubImage(unsigned target, | 98 bool AVDACodecImage::CopyTexSubImage(unsigned target, |
| 99 const gfx::Point& offset, | 99 const gfx::Point& offset, |
| 100 const gfx::Rect& rect) { | 100 const gfx::Rect& rect) { |
| 101 return false; | 101 return false; |
| 102 } | 102 } |
| 103 | 103 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 } | 277 } |
| 278 | 278 |
| 279 bool AVDACodecImage::IsCodecBufferOutstanding() const { | 279 bool AVDACodecImage::IsCodecBufferOutstanding() const { |
| 280 static_assert(kUpdateOnly < 0 && kUpdateOnly > kRendered && | 280 static_assert(kUpdateOnly < 0 && kUpdateOnly > kRendered && |
| 281 kRendered > kInvalidCodecBufferIndex, | 281 kRendered > kInvalidCodecBufferIndex, |
| 282 "Codec buffer index enum values are not ordered correctly."); | 282 "Codec buffer index enum values are not ordered correctly."); |
| 283 return codec_buffer_index_ > kRendered && media_codec_; | 283 return codec_buffer_index_ > kRendered && media_codec_; |
| 284 } | 284 } |
| 285 | 285 |
| 286 } // namespace media | 286 } // namespace media |
| OLD | NEW |