| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/android/synchronous_compositor_frame_sink.h" | 5 #include "content/renderer/android/synchronous_compositor_frame_sink.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "cc/output/renderer_settings.h" | 21 #include "cc/output/renderer_settings.h" |
| 22 #include "cc/output/software_output_device.h" | 22 #include "cc/output/software_output_device.h" |
| 23 #include "cc/output/texture_mailbox_deleter.h" | 23 #include "cc/output/texture_mailbox_deleter.h" |
| 24 #include "cc/quads/render_pass.h" | 24 #include "cc/quads/render_pass.h" |
| 25 #include "cc/quads/surface_draw_quad.h" | 25 #include "cc/quads/surface_draw_quad.h" |
| 26 #include "cc/surfaces/compositor_frame_sink_support.h" | 26 #include "cc/surfaces/compositor_frame_sink_support.h" |
| 27 #include "cc/surfaces/display.h" | 27 #include "cc/surfaces/display.h" |
| 28 #include "cc/surfaces/local_surface_id_allocator.h" | 28 #include "cc/surfaces/local_surface_id_allocator.h" |
| 29 #include "cc/surfaces/surface_manager.h" | 29 #include "cc/surfaces/surface_manager.h" |
| 30 #include "content/common/android/sync_compositor_messages.h" | 30 #include "content/common/android/sync_compositor_messages.h" |
| 31 #include "content/common/view_messages.h" |
| 31 #include "content/renderer/android/synchronous_compositor_filter.h" | 32 #include "content/renderer/android/synchronous_compositor_filter.h" |
| 32 #include "content/renderer/android/synchronous_compositor_registry.h" | 33 #include "content/renderer/android/synchronous_compositor_registry.h" |
| 33 #include "content/renderer/gpu/frame_swap_message_queue.h" | 34 #include "content/renderer/gpu/frame_swap_message_queue.h" |
| 34 #include "content/renderer/render_thread_impl.h" | 35 #include "content/renderer/render_thread_impl.h" |
| 35 #include "gpu/command_buffer/client/context_support.h" | 36 #include "gpu/command_buffer/client/context_support.h" |
| 36 #include "gpu/command_buffer/client/gles2_interface.h" | 37 #include "gpu/command_buffer/client/gles2_interface.h" |
| 37 #include "gpu/command_buffer/common/gpu_memory_allocation.h" | 38 #include "gpu/command_buffer/common/gpu_memory_allocation.h" |
| 38 #include "ipc/ipc_message.h" | 39 #include "ipc/ipc_message.h" |
| 39 #include "ipc/ipc_message_macros.h" | 40 #include "ipc/ipc_message_macros.h" |
| 40 #include "ipc/ipc_sender.h" | 41 #include "ipc/ipc_sender.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 // the content in it. | 307 // the content in it. |
| 307 submit_frame = std::move(frame); | 308 submit_frame = std::move(frame); |
| 308 } | 309 } |
| 309 | 310 |
| 310 sync_client_->SubmitCompositorFrame(compositor_frame_sink_id_, | 311 sync_client_->SubmitCompositorFrame(compositor_frame_sink_id_, |
| 311 std::move(submit_frame)); | 312 std::move(submit_frame)); |
| 312 DeliverMessages(); | 313 DeliverMessages(); |
| 313 did_submit_frame_ = true; | 314 did_submit_frame_ = true; |
| 314 } | 315 } |
| 315 | 316 |
| 317 void SynchronousCompositorFrameSink::BeginFrameDidNotProduceFrame( |
| 318 const cc::BeginFrameAck& ack) { |
| 319 DCHECK(!ack.has_damage); |
| 320 DCHECK_LE(cc::BeginFrameArgs::kStartingFrameNumber, ack.sequence_number); |
| 321 Send(new ViewHostMsg_BeginFrameDidNotProduceFrame(routing_id_, ack)); |
| 322 } |
| 323 |
| 316 void SynchronousCompositorFrameSink::CancelFallbackTick() { | 324 void SynchronousCompositorFrameSink::CancelFallbackTick() { |
| 317 fallback_tick_.Cancel(); | 325 fallback_tick_.Cancel(); |
| 318 fallback_tick_pending_ = false; | 326 fallback_tick_pending_ = false; |
| 319 } | 327 } |
| 320 | 328 |
| 321 void SynchronousCompositorFrameSink::FallbackTickFired() { | 329 void SynchronousCompositorFrameSink::FallbackTickFired() { |
| 322 DCHECK(CalledOnValidThread()); | 330 DCHECK(CalledOnValidThread()); |
| 323 TRACE_EVENT0("renderer", "SynchronousCompositorFrameSink::FallbackTickFired"); | 331 TRACE_EVENT0("renderer", "SynchronousCompositorFrameSink::FallbackTickFired"); |
| 324 base::AutoReset<bool> in_fallback_tick(&fallback_tick_running_, true); | 332 base::AutoReset<bool> in_fallback_tick(&fallback_tick_running_, true); |
| 325 SkBitmap bitmap; | 333 SkBitmap bitmap; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 const cc::ReturnedResourceArray& resources) { | 482 const cc::ReturnedResourceArray& resources) { |
| 475 DCHECK(resources.empty()); | 483 DCHECK(resources.empty()); |
| 476 client_->ReclaimResources(resources); | 484 client_->ReclaimResources(resources); |
| 477 } | 485 } |
| 478 | 486 |
| 479 void SynchronousCompositorFrameSink::WillDrawSurface( | 487 void SynchronousCompositorFrameSink::WillDrawSurface( |
| 480 const cc::LocalSurfaceId& local_surface_id, | 488 const cc::LocalSurfaceId& local_surface_id, |
| 481 const gfx::Rect& damage_rect) {} | 489 const gfx::Rect& damage_rect) {} |
| 482 | 490 |
| 483 } // namespace content | 491 } // namespace content |
| OLD | NEW |