| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/surfaces/display.h" | 5 #include "cc/surfaces/display.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 Surface* surface = surface_manager_->GetSurfaceForId(id_entry.first); | 270 Surface* surface = surface_manager_->GetSurfaceForId(id_entry.first); |
| 271 if (surface) | 271 if (surface) |
| 272 surface->RunDrawCallback(); | 272 surface->RunDrawCallback(); |
| 273 } | 273 } |
| 274 | 274 |
| 275 frame.metadata.latency_info.insert(frame.metadata.latency_info.end(), | 275 frame.metadata.latency_info.insert(frame.metadata.latency_info.end(), |
| 276 stored_latency_info_.begin(), | 276 stored_latency_info_.begin(), |
| 277 stored_latency_info_.end()); | 277 stored_latency_info_.end()); |
| 278 stored_latency_info_.clear(); | 278 stored_latency_info_.clear(); |
| 279 bool have_copy_requests = false; | 279 bool have_copy_requests = false; |
| 280 for (const auto& pass : frame.render_pass_list) { | 280 for (const auto& pass : frame.render_pass_list) |
| 281 have_copy_requests |= !pass->copy_requests.empty(); | 281 have_copy_requests |= !pass->copy_requests.empty(); |
| 282 } | |
| 283 | 282 |
| 284 gfx::Size surface_size; | 283 gfx::Size surface_size; |
| 285 bool have_damage = false; | 284 bool have_damage = false; |
| 286 RenderPass& last_render_pass = *frame.render_pass_list.back(); | 285 RenderPass& last_render_pass = *frame.render_pass_list.back(); |
| 287 if (last_render_pass.output_rect.size() != current_surface_size_ && | 286 if (last_render_pass.output_rect.size() != current_surface_size_ && |
| 288 last_render_pass.damage_rect == last_render_pass.output_rect && | 287 last_render_pass.damage_rect == last_render_pass.output_rect && |
| 289 !current_surface_size_.IsEmpty()) { | 288 !current_surface_size_.IsEmpty()) { |
| 290 // Resize the output rect to the current surface size so that we won't | 289 // Resize the output rect to the current surface size so that we won't |
| 291 // skip the draw and so that the GL swap won't stretch the output. | 290 // skip the draw and so that the GL swap won't stretch the output. |
| 292 last_render_pass.output_rect.set_size(current_surface_size_); | 291 last_render_pass.output_rect.set_size(current_surface_size_); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 const SurfaceId& Display::CurrentSurfaceId() { | 414 const SurfaceId& Display::CurrentSurfaceId() { |
| 416 return current_surface_id_; | 415 return current_surface_id_; |
| 417 } | 416 } |
| 418 | 417 |
| 419 void Display::ForceImmediateDrawAndSwapIfPossible() { | 418 void Display::ForceImmediateDrawAndSwapIfPossible() { |
| 420 if (scheduler_) | 419 if (scheduler_) |
| 421 scheduler_->ForceImmediateSwapIfPossible(); | 420 scheduler_->ForceImmediateSwapIfPossible(); |
| 422 } | 421 } |
| 423 | 422 |
| 424 } // namespace cc | 423 } // namespace cc |
| OLD | NEW |