| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 has_surface_texture_ = has_surface_texture; | 141 has_surface_texture_ = has_surface_texture; |
| 142 codec_buffer_index_ = buffer_index; | 142 codec_buffer_index_ = buffer_index; |
| 143 size_ = size; | 143 size_ = size; |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool AVDACodecImage::SetSharedState( | 146 bool AVDACodecImage::SetSharedState( |
| 147 scoped_refptr<AVDASharedState> shared_state) { | 147 scoped_refptr<AVDASharedState> shared_state) { |
| 148 if (shared_state == shared_state_) | 148 if (shared_state == shared_state_) |
| 149 return false; | 149 return false; |
| 150 shared_state_ = shared_state; | 150 shared_state_ = shared_state; |
| 151 most_recent_bounds_ = gfx::Rect(); |
| 151 return true; | 152 return true; |
| 152 } | 153 } |
| 153 | 154 |
| 154 void AVDACodecImage::UpdateSurfaceInternal( | 155 void AVDACodecImage::UpdateSurfaceInternal( |
| 155 UpdateMode update_mode, | 156 UpdateMode update_mode, |
| 156 RestoreBindingsMode attached_bindings_mode) { | 157 RestoreBindingsMode attached_bindings_mode) { |
| 157 if (!IsCodecBufferOutstanding()) | 158 if (!IsCodecBufferOutstanding()) |
| 158 return; | 159 return; |
| 159 | 160 |
| 160 ReleaseOutputBuffer(update_mode); | 161 ReleaseOutputBuffer(update_mode); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 } | 233 } |
| 233 | 234 |
| 234 bool AVDACodecImage::IsCodecBufferOutstanding() const { | 235 bool AVDACodecImage::IsCodecBufferOutstanding() const { |
| 235 static_assert(kUpdateOnly < 0 && kUpdateOnly > kRendered && | 236 static_assert(kUpdateOnly < 0 && kUpdateOnly > kRendered && |
| 236 kRendered > kInvalidCodecBufferIndex, | 237 kRendered > kInvalidCodecBufferIndex, |
| 237 "Codec buffer index enum values are not ordered correctly."); | 238 "Codec buffer index enum values are not ordered correctly."); |
| 238 return codec_buffer_index_ > kRendered && media_codec_; | 239 return codec_buffer_index_ > kRendered && media_codec_; |
| 239 } | 240 } |
| 240 | 241 |
| 241 } // namespace media | 242 } // namespace media |
| OLD | NEW |