| 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 "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
| 10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 | 84 |
| 85 SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() {} | 85 SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() {} |
| 86 | 86 |
| 87 void SynchronousCompositorOutputSurface::SetSyncClient( | 87 void SynchronousCompositorOutputSurface::SetSyncClient( |
| 88 SynchronousCompositorOutputSurfaceClient* compositor) { | 88 SynchronousCompositorOutputSurfaceClient* compositor) { |
| 89 DCHECK(CalledOnValidThread()); | 89 DCHECK(CalledOnValidThread()); |
| 90 sync_client_ = compositor; | 90 sync_client_ = compositor; |
| 91 } | 91 } |
| 92 | 92 |
| 93 void SynchronousCompositorOutputSurface::DidLoseOutputSurface() { |
| 94 // Android WebView does not handle context loss. |
| 95 LOG(FATAL) << "Renderer compositor context loss"; |
| 96 } |
| 97 |
| 93 bool SynchronousCompositorOutputSurface::BindToClient( | 98 bool SynchronousCompositorOutputSurface::BindToClient( |
| 94 cc::OutputSurfaceClient* surface_client) { | 99 cc::OutputSurfaceClient* surface_client) { |
| 95 DCHECK(CalledOnValidThread()); | 100 DCHECK(CalledOnValidThread()); |
| 96 if (!cc::OutputSurface::BindToClient(surface_client)) | 101 if (!cc::OutputSurface::BindToClient(surface_client)) |
| 97 return false; | 102 return false; |
| 98 | 103 |
| 99 client_->SetMemoryPolicy(memory_policy_); | 104 client_->SetMemoryPolicy(memory_policy_); |
| 100 registry_->RegisterOutputSurface(routing_id_, this); | 105 registry_->RegisterOutputSurface(routing_id_, this); |
| 101 registered_ = true; | 106 registered_ = true; |
| 102 return true; | 107 return true; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 scoped_ptr<FrameSwapMessageQueue::SendMessageScope> send_message_scope = | 233 scoped_ptr<FrameSwapMessageQueue::SendMessageScope> send_message_scope = |
| 229 frame_swap_message_queue_->AcquireSendMessageScope(); | 234 frame_swap_message_queue_->AcquireSendMessageScope(); |
| 230 frame_swap_message_queue_->DrainMessages(messages); | 235 frame_swap_message_queue_->DrainMessages(messages); |
| 231 } | 236 } |
| 232 | 237 |
| 233 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 238 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
| 234 return thread_checker_.CalledOnValidThread(); | 239 return thread_checker_.CalledOnValidThread(); |
| 235 } | 240 } |
| 236 | 241 |
| 237 } // namespace content | 242 } // namespace content |
| OLD | NEW |