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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/debug/trace_event_synthetic_delay.h" | 10 #include "base/debug/trace_event_synthetic_delay.h" |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 | 899 |
900 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 900 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
901 scoped_refptr<ContextProviderCommandBuffer> context_provider; | 901 scoped_refptr<ContextProviderCommandBuffer> context_provider; |
902 if (!fallback) { | 902 if (!fallback) { |
903 context_provider = ContextProviderCommandBuffer::Create( | 903 context_provider = ContextProviderCommandBuffer::Create( |
904 CreateGraphicsContext3D(attributes), | 904 CreateGraphicsContext3D(attributes), |
905 "RenderCompositor"); | 905 "RenderCompositor"); |
906 } | 906 } |
907 | 907 |
908 uint32 output_surface_id = next_output_surface_id_++; | 908 uint32 output_surface_id = next_output_surface_id_++; |
909 if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) { | 909 if (command_line.HasSwitch(switches::kEnableDelegatedRenderer) && |
| 910 !command_line.HasSwitch(switches::kDisableDelegatedRenderer)) { |
910 DCHECK(is_threaded_compositing_enabled_); | 911 DCHECK(is_threaded_compositing_enabled_); |
911 return scoped_ptr<cc::OutputSurface>( | 912 return scoped_ptr<cc::OutputSurface>( |
912 new DelegatedCompositorOutputSurface( | 913 new DelegatedCompositorOutputSurface( |
913 routing_id(), | 914 routing_id(), |
914 output_surface_id, | 915 output_surface_id, |
915 context_provider)); | 916 context_provider)); |
916 } | 917 } |
917 if (!context_provider.get()) { | 918 if (!context_provider.get()) { |
918 if (!command_line.HasSwitch(switches::kEnableSoftwareCompositing)) | 919 if (!command_line.HasSwitch(switches::kEnableSoftwareCompositing)) |
919 return scoped_ptr<cc::OutputSurface>(); | 920 return scoped_ptr<cc::OutputSurface>(); |
(...skipping 1913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2833 | 2834 |
2834 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2835 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2835 swapped_out_frames_.AddObserver(frame); | 2836 swapped_out_frames_.AddObserver(frame); |
2836 } | 2837 } |
2837 | 2838 |
2838 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2839 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2839 swapped_out_frames_.RemoveObserver(frame); | 2840 swapped_out_frames_.RemoveObserver(frame); |
2840 } | 2841 } |
2841 | 2842 |
2842 } // namespace content | 2843 } // namespace content |
OLD | NEW |