| 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 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 | 1011 |
| 1012 scoped_refptr<ContextProviderCommandBuffer> context_provider; | 1012 scoped_refptr<ContextProviderCommandBuffer> context_provider; |
| 1013 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider; | 1013 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider; |
| 1014 if (!use_software) { | 1014 if (!use_software) { |
| 1015 context_provider = ContextProviderCommandBuffer::Create( | 1015 context_provider = ContextProviderCommandBuffer::Create( |
| 1016 CreateGraphicsContext3D(true), RENDER_COMPOSITOR_CONTEXT); | 1016 CreateGraphicsContext3D(true), RENDER_COMPOSITOR_CONTEXT); |
| 1017 if (!context_provider.get()) { | 1017 if (!context_provider.get()) { |
| 1018 // Cause the compositor to wait and try again. | 1018 // Cause the compositor to wait and try again. |
| 1019 return scoped_ptr<cc::OutputSurface>(); | 1019 return scoped_ptr<cc::OutputSurface>(); |
| 1020 } | 1020 } |
| 1021 worker_context_provider = | 1021 |
| 1022 RenderThreadImpl::current()->SharedWorkerContextProvider(); | 1022 worker_context_provider = ContextProviderCommandBuffer::Create( |
| 1023 if (!worker_context_provider) { | 1023 CreateGraphicsContext3D(false), RENDER_WORKER_CONTEXT); |
| 1024 if (!worker_context_provider.get()) { |
| 1024 // Cause the compositor to wait and try again. | 1025 // Cause the compositor to wait and try again. |
| 1025 return scoped_ptr<cc::OutputSurface>(); | 1026 return scoped_ptr<cc::OutputSurface>(); |
| 1026 } | 1027 } |
| 1027 } | 1028 } |
| 1028 | 1029 |
| 1029 uint32 output_surface_id = next_output_surface_id_++; | 1030 uint32 output_surface_id = next_output_surface_id_++; |
| 1030 if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) { | 1031 if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) { |
| 1031 DCHECK(compositor_deps_->GetCompositorImplThreadTaskRunner()); | 1032 DCHECK(compositor_deps_->GetCompositorImplThreadTaskRunner()); |
| 1032 return scoped_ptr<cc::OutputSurface>(new DelegatedCompositorOutputSurface( | 1033 return scoped_ptr<cc::OutputSurface>(new DelegatedCompositorOutputSurface( |
| 1033 routing_id(), output_surface_id, context_provider, | 1034 routing_id(), output_surface_id, context_provider, |
| (...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2429 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2430 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2430 video_hole_frames_.AddObserver(frame); | 2431 video_hole_frames_.AddObserver(frame); |
| 2431 } | 2432 } |
| 2432 | 2433 |
| 2433 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2434 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2434 video_hole_frames_.RemoveObserver(frame); | 2435 video_hole_frames_.RemoveObserver(frame); |
| 2435 } | 2436 } |
| 2436 #endif // defined(VIDEO_HOLE) | 2437 #endif // defined(VIDEO_HOLE) |
| 2437 | 2438 |
| 2438 } // namespace content | 2439 } // namespace content |
| OLD | NEW |