Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1015 if (!use_software) { | 1015 if (!use_software) { |
| 1016 context_provider = ContextProviderCommandBuffer::Create( | 1016 context_provider = ContextProviderCommandBuffer::Create( |
| 1017 CreateGraphicsContext3D(true), RENDER_COMPOSITOR_CONTEXT); | 1017 CreateGraphicsContext3D(true), RENDER_COMPOSITOR_CONTEXT); |
| 1018 if (!context_provider.get()) { | 1018 if (!context_provider.get()) { |
| 1019 // Cause the compositor to wait and try again. | 1019 // Cause the compositor to wait and try again. |
| 1020 return scoped_ptr<cc::OutputSurface>(); | 1020 return scoped_ptr<cc::OutputSurface>(); |
| 1021 } | 1021 } |
| 1022 | 1022 |
| 1023 worker_context_provider = ContextProviderCommandBuffer::Create( | 1023 worker_context_provider = ContextProviderCommandBuffer::Create( |
| 1024 CreateGraphicsContext3D(false), RENDER_WORKER_CONTEXT); | 1024 CreateGraphicsContext3D(false), RENDER_WORKER_CONTEXT); |
| 1025 if (!worker_context_provider.get()) { | 1025 if (!worker_context_provider.get() || |
| 1026 !worker_context_provider->BindToCurrentThread()) { | |
|
jbauman
2015/08/26 20:59:25
I think we want this to happen on the compositor t
reveman
2015/08/26 22:02:11
The idea is that worker context callbacks are inst
| |
| 1026 // Cause the compositor to wait and try again. | 1027 // Cause the compositor to wait and try again. |
| 1027 return scoped_ptr<cc::OutputSurface>(); | 1028 return scoped_ptr<cc::OutputSurface>(); |
| 1028 } | 1029 } |
| 1030 worker_context_provider->SetupLock(); | |
| 1031 worker_context_provider->DetachFromThread(); | |
|
danakj
2015/08/26 18:48:50
ditto
reveman
2015/08/26 22:02:11
Done.
| |
| 1029 } | 1032 } |
| 1030 | 1033 |
| 1031 uint32 output_surface_id = next_output_surface_id_++; | 1034 uint32 output_surface_id = next_output_surface_id_++; |
| 1032 if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) { | 1035 if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) { |
| 1033 DCHECK(compositor_deps_->GetCompositorImplThreadTaskRunner()); | 1036 DCHECK(compositor_deps_->GetCompositorImplThreadTaskRunner()); |
| 1034 return scoped_ptr<cc::OutputSurface>(new DelegatedCompositorOutputSurface( | 1037 return scoped_ptr<cc::OutputSurface>(new DelegatedCompositorOutputSurface( |
| 1035 routing_id(), output_surface_id, context_provider, | 1038 routing_id(), output_surface_id, context_provider, |
| 1036 worker_context_provider, frame_swap_message_queue_)); | 1039 worker_context_provider, frame_swap_message_queue_)); |
| 1037 } | 1040 } |
| 1038 if (!context_provider.get()) { | 1041 if (!context_provider.get()) { |
| (...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2442 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2445 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2443 video_hole_frames_.AddObserver(frame); | 2446 video_hole_frames_.AddObserver(frame); |
| 2444 } | 2447 } |
| 2445 | 2448 |
| 2446 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2449 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2447 video_hole_frames_.RemoveObserver(frame); | 2450 video_hole_frames_.RemoveObserver(frame); |
| 2448 } | 2451 } |
| 2449 #endif // defined(VIDEO_HOLE) | 2452 #endif // defined(VIDEO_HOLE) |
| 2450 | 2453 |
| 2451 } // namespace content | 2454 } // namespace content |
| OLD | NEW |