| 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/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 bool should_draw = have_copy_requests || (have_damage && size_matches); | 281 bool should_draw = have_copy_requests || (have_damage && size_matches); |
| 282 | 282 |
| 283 // If the surface is suspended then the resources to be used by the draw are | 283 // If the surface is suspended then the resources to be used by the draw are |
| 284 // likely destroyed. | 284 // likely destroyed. |
| 285 if (output_surface_->SurfaceIsSuspendForRecycle()) { | 285 if (output_surface_->SurfaceIsSuspendForRecycle()) { |
| 286 TRACE_EVENT_INSTANT0("cc", "Surface is suspended for recycle.", | 286 TRACE_EVENT_INSTANT0("cc", "Surface is suspended for recycle.", |
| 287 TRACE_EVENT_SCOPE_THREAD); | 287 TRACE_EVENT_SCOPE_THREAD); |
| 288 should_draw = false; | 288 should_draw = false; |
| 289 } | 289 } |
| 290 | 290 |
| 291 client_->DisplayWillDrawAndSwap(should_draw, frame_data->render_pass_list); |
| 292 |
| 291 if (should_draw) { | 293 if (should_draw) { |
| 292 gfx::Rect device_viewport_rect = external_viewport_.IsEmpty() | 294 gfx::Rect device_viewport_rect = external_viewport_.IsEmpty() |
| 293 ? gfx::Rect(current_surface_size_) | 295 ? gfx::Rect(current_surface_size_) |
| 294 : external_viewport_; | 296 : external_viewport_; |
| 295 gfx::Rect device_clip_rect = | 297 gfx::Rect device_clip_rect = |
| 296 external_clip_.IsEmpty() ? device_viewport_rect : external_clip_; | 298 external_clip_.IsEmpty() ? device_viewport_rect : external_clip_; |
| 297 | 299 |
| 298 bool disable_image_filtering = | 300 bool disable_image_filtering = |
| 299 frame.metadata.is_resourceless_software_draw_with_scroll_or_animation; | 301 frame.metadata.is_resourceless_software_draw_with_scroll_or_animation; |
| 300 if (software_renderer_) { | 302 if (software_renderer_) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 aggregator_->SetFullDamageForSurface(current_surface_id_); | 334 aggregator_->SetFullDamageForSurface(current_surface_id_); |
| 333 TRACE_EVENT_INSTANT0("cc", "Swap skipped.", TRACE_EVENT_SCOPE_THREAD); | 335 TRACE_EVENT_INSTANT0("cc", "Swap skipped.", TRACE_EVENT_SCOPE_THREAD); |
| 334 stored_latency_info_.insert(stored_latency_info_.end(), | 336 stored_latency_info_.insert(stored_latency_info_.end(), |
| 335 frame.metadata.latency_info.begin(), | 337 frame.metadata.latency_info.begin(), |
| 336 frame.metadata.latency_info.end()); | 338 frame.metadata.latency_info.end()); |
| 337 if (scheduler_) | 339 if (scheduler_) |
| 338 scheduler_->DidSwapBuffers(); | 340 scheduler_->DidSwapBuffers(); |
| 339 DidSwapBuffersComplete(); | 341 DidSwapBuffersComplete(); |
| 340 } | 342 } |
| 341 | 343 |
| 344 client_->DisplayDidDrawAndSwap(); |
| 342 return true; | 345 return true; |
| 343 } | 346 } |
| 344 | 347 |
| 345 void Display::DidSwapBuffersComplete() { | 348 void Display::DidSwapBuffersComplete() { |
| 346 if (scheduler_) | 349 if (scheduler_) |
| 347 scheduler_->DidSwapBuffersComplete(); | 350 scheduler_->DidSwapBuffersComplete(); |
| 348 if (renderer_) | 351 if (renderer_) |
| 349 renderer_->SwapBuffersComplete(); | 352 renderer_->SwapBuffersComplete(); |
| 350 } | 353 } |
| 351 | 354 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 | 427 |
| 425 if (surface_id == current_surface_id_) | 428 if (surface_id == current_surface_id_) |
| 426 UpdateRootSurfaceResourcesLocked(); | 429 UpdateRootSurfaceResourcesLocked(); |
| 427 } | 430 } |
| 428 | 431 |
| 429 const SurfaceId& Display::CurrentSurfaceId() { | 432 const SurfaceId& Display::CurrentSurfaceId() { |
| 430 return current_surface_id_; | 433 return current_surface_id_; |
| 431 } | 434 } |
| 432 | 435 |
| 433 } // namespace cc | 436 } // namespace cc |
| OLD | NEW |