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 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 const base::CommandLine& command_line = | 1004 const base::CommandLine& command_line = |
1005 *base::CommandLine::ForCurrentProcess(); | 1005 *base::CommandLine::ForCurrentProcess(); |
1006 bool use_software = fallback; | 1006 bool use_software = fallback; |
1007 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) | 1007 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) |
1008 use_software = true; | 1008 use_software = true; |
1009 | 1009 |
1010 scoped_refptr<ContextProviderCommandBuffer> context_provider; | 1010 scoped_refptr<ContextProviderCommandBuffer> context_provider; |
1011 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider; | 1011 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider; |
1012 if (!use_software) { | 1012 if (!use_software) { |
1013 context_provider = ContextProviderCommandBuffer::Create( | 1013 context_provider = ContextProviderCommandBuffer::Create( |
1014 CreateGraphicsContext3D(), "RenderCompositor"); | 1014 CreateGraphicsContext3D(), RENDER_COMPOSITOR_CONTEXT); |
1015 if (!context_provider.get()) { | 1015 if (!context_provider.get()) { |
1016 // Cause the compositor to wait and try again. | 1016 // Cause the compositor to wait and try again. |
1017 return scoped_ptr<cc::OutputSurface>(); | 1017 return scoped_ptr<cc::OutputSurface>(); |
1018 } | 1018 } |
1019 | 1019 |
1020 worker_context_provider = ContextProviderCommandBuffer::Create( | 1020 worker_context_provider = ContextProviderCommandBuffer::Create( |
1021 CreateGraphicsContext3D(), "RenderWorker"); | 1021 CreateGraphicsContext3D(), RENDER_WORKER_CONTEXT); |
1022 if (!worker_context_provider.get()) { | 1022 if (!worker_context_provider.get()) { |
1023 // Cause the compositor to wait and try again. | 1023 // Cause the compositor to wait and try again. |
1024 return scoped_ptr<cc::OutputSurface>(); | 1024 return scoped_ptr<cc::OutputSurface>(); |
1025 } | 1025 } |
1026 } | 1026 } |
1027 | 1027 |
1028 uint32 output_surface_id = next_output_surface_id_++; | 1028 uint32 output_surface_id = next_output_surface_id_++; |
1029 if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) { | 1029 if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) { |
1030 DCHECK(compositor_deps_->GetCompositorImplThreadTaskRunner()); | 1030 DCHECK(compositor_deps_->GetCompositorImplThreadTaskRunner()); |
1031 return scoped_ptr<cc::OutputSurface>(new DelegatedCompositorOutputSurface( | 1031 return scoped_ptr<cc::OutputSurface>(new DelegatedCompositorOutputSurface( |
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2438 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2438 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2439 video_hole_frames_.AddObserver(frame); | 2439 video_hole_frames_.AddObserver(frame); |
2440 } | 2440 } |
2441 | 2441 |
2442 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2442 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2443 video_hole_frames_.RemoveObserver(frame); | 2443 video_hole_frames_.RemoveObserver(frame); |
2444 } | 2444 } |
2445 #endif // defined(VIDEO_HOLE) | 2445 #endif // defined(VIDEO_HOLE) |
2446 | 2446 |
2447 } // namespace content | 2447 } // namespace content |
OLD | NEW |