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_output_surface.h" | 5 #include "content/renderer/android/synchronous_compositor_output_surface.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface( | 63 SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface( |
64 const scoped_refptr<cc::ContextProvider>& context_provider, | 64 const scoped_refptr<cc::ContextProvider>& context_provider, |
65 const scoped_refptr<cc::ContextProvider>& worker_context_provider, | 65 const scoped_refptr<cc::ContextProvider>& worker_context_provider, |
66 int routing_id, | 66 int routing_id, |
67 uint32_t output_surface_id, | 67 uint32_t output_surface_id, |
68 SynchronousCompositorRegistry* registry, | 68 SynchronousCompositorRegistry* registry, |
69 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue) | 69 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue) |
70 : cc::OutputSurface( | 70 : cc::OutputSurface( |
71 context_provider, | 71 context_provider, |
72 worker_context_provider, | 72 worker_context_provider, |
73 scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareDevice(this))), | 73 std::unique_ptr<cc::SoftwareOutputDevice>(new SoftwareDevice(this))), |
74 routing_id_(routing_id), | 74 routing_id_(routing_id), |
75 output_surface_id_(output_surface_id), | 75 output_surface_id_(output_surface_id), |
76 registry_(registry), | 76 registry_(registry), |
77 registered_(false), | 77 registered_(false), |
78 sync_client_(nullptr), | 78 sync_client_(nullptr), |
79 current_sw_canvas_(nullptr), | 79 current_sw_canvas_(nullptr), |
80 memory_policy_(0u), | 80 memory_policy_(0u), |
81 did_swap_(false), | 81 did_swap_(false), |
82 frame_swap_message_queue_(frame_swap_message_queue), | 82 frame_swap_message_queue_(frame_swap_message_queue), |
83 fallback_tick_pending_(false), | 83 fallback_tick_pending_(false), |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 } | 252 } |
253 } | 253 } |
254 | 254 |
255 void SynchronousCompositorOutputSurface::SetTreeActivationCallback( | 255 void SynchronousCompositorOutputSurface::SetTreeActivationCallback( |
256 const base::Closure& callback) { | 256 const base::Closure& callback) { |
257 DCHECK(client_); | 257 DCHECK(client_); |
258 client_->SetTreeActivationCallback(callback); | 258 client_->SetTreeActivationCallback(callback); |
259 } | 259 } |
260 | 260 |
261 void SynchronousCompositorOutputSurface::GetMessagesToDeliver( | 261 void SynchronousCompositorOutputSurface::GetMessagesToDeliver( |
262 std::vector<scoped_ptr<IPC::Message>>* messages) { | 262 std::vector<std::unique_ptr<IPC::Message>>* messages) { |
263 DCHECK(CalledOnValidThread()); | 263 DCHECK(CalledOnValidThread()); |
264 scoped_ptr<FrameSwapMessageQueue::SendMessageScope> send_message_scope = | 264 std::unique_ptr<FrameSwapMessageQueue::SendMessageScope> send_message_scope = |
265 frame_swap_message_queue_->AcquireSendMessageScope(); | 265 frame_swap_message_queue_->AcquireSendMessageScope(); |
266 frame_swap_message_queue_->DrainMessages(messages); | 266 frame_swap_message_queue_->DrainMessages(messages); |
267 } | 267 } |
268 | 268 |
269 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 269 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
270 return thread_checker_.CalledOnValidThread(); | 270 return thread_checker_.CalledOnValidThread(); |
271 } | 271 } |
272 | 272 |
273 } // namespace content | 273 } // namespace content |
OLD | NEW |