| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 gfx::OverlayTransform transform, | 84 gfx::OverlayTransform transform, |
| 85 const gfx::Rect& bounds_rect, | 85 const gfx::Rect& bounds_rect, |
| 86 const gfx::RectF& crop_rect) { | 86 const gfx::RectF& crop_rect) { |
| 87 // This should only be called when we're rendering to a SurfaceView. | 87 // This should only be called when we're rendering to a SurfaceView. |
| 88 if (has_surface_texture_) { | 88 if (has_surface_texture_) { |
| 89 DVLOG(1) << "Invalid call to ScheduleOverlayPlane; this image is " | 89 DVLOG(1) << "Invalid call to ScheduleOverlayPlane; this image is " |
| 90 "SurfaceTexture backed."; | 90 "SurfaceTexture backed."; |
| 91 return false; | 91 return false; |
| 92 } | 92 } |
| 93 | 93 |
| 94 // Move the overlay if needed. |
| 95 if (shared_state_->overlay() && most_recent_bounds_ != bounds_rect) { |
| 96 most_recent_bounds_ = bounds_rect; |
| 97 shared_state_->overlay()->ScheduleLayout(bounds_rect); |
| 98 } |
| 99 |
| 94 UpdateSurface(UpdateMode::RENDER_TO_FRONT_BUFFER); | 100 UpdateSurface(UpdateMode::RENDER_TO_FRONT_BUFFER); |
| 95 return true; | 101 return true; |
| 96 } | 102 } |
| 97 | 103 |
| 98 void AVDACodecImage::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, | 104 void AVDACodecImage::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, |
| 99 uint64_t process_tracing_id, | 105 uint64_t process_tracing_id, |
| 100 const std::string& dump_name) {} | 106 const std::string& dump_name) {} |
| 101 | 107 |
| 102 void AVDACodecImage::UpdateSurfaceTexture(RestoreBindingsMode mode) { | 108 void AVDACodecImage::UpdateSurfaceTexture(RestoreBindingsMode mode) { |
| 103 DCHECK(has_surface_texture_); | 109 DCHECK(has_surface_texture_); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 } | 235 } |
| 230 | 236 |
| 231 bool AVDACodecImage::IsCodecBufferOutstanding() const { | 237 bool AVDACodecImage::IsCodecBufferOutstanding() const { |
| 232 static_assert(kUpdateOnly < 0 && kUpdateOnly > kRendered && | 238 static_assert(kUpdateOnly < 0 && kUpdateOnly > kRendered && |
| 233 kRendered > kInvalidCodecBufferIndex, | 239 kRendered > kInvalidCodecBufferIndex, |
| 234 "Codec buffer index enum values are not ordered correctly."); | 240 "Codec buffer index enum values are not ordered correctly."); |
| 235 return codec_buffer_index_ > kRendered && media_codec_; | 241 return codec_buffer_index_ > kRendered && media_codec_; |
| 236 } | 242 } |
| 237 | 243 |
| 238 } // namespace media | 244 } // namespace media |
| OLD | NEW |