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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 context_provider = ContextProviderCommandBuffer::Create( | 935 context_provider = ContextProviderCommandBuffer::Create( |
936 CreateGraphicsContext3D(attributes), | 936 CreateGraphicsContext3D(attributes), |
937 "RenderCompositor"); | 937 "RenderCompositor"); |
938 if (!context_provider.get()) { | 938 if (!context_provider.get()) { |
939 // Cause the compositor to wait and try again. | 939 // Cause the compositor to wait and try again. |
940 return scoped_ptr<cc::OutputSurface>(); | 940 return scoped_ptr<cc::OutputSurface>(); |
941 } | 941 } |
942 } | 942 } |
943 | 943 |
944 uint32 output_surface_id = next_output_surface_id_++; | 944 uint32 output_surface_id = next_output_surface_id_++; |
945 if (command_line.HasSwitch(switches::kEnableDelegatedRenderer) && | 945 if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) { |
946 !command_line.HasSwitch(switches::kDisableDelegatedRenderer)) { | |
947 DCHECK(is_threaded_compositing_enabled_); | 946 DCHECK(is_threaded_compositing_enabled_); |
948 return scoped_ptr<cc::OutputSurface>( | 947 return scoped_ptr<cc::OutputSurface>( |
949 new DelegatedCompositorOutputSurface( | 948 new DelegatedCompositorOutputSurface( |
950 routing_id(), | 949 routing_id(), |
951 output_surface_id, | 950 output_surface_id, |
952 context_provider)); | 951 context_provider)); |
953 } | 952 } |
954 if (!context_provider.get()) { | 953 if (!context_provider.get()) { |
955 if (!command_line.HasSwitch(switches::kEnableSoftwareCompositing)) | 954 if (!command_line.HasSwitch(switches::kEnableSoftwareCompositing)) |
956 return scoped_ptr<cc::OutputSurface>(); | 955 return scoped_ptr<cc::OutputSurface>(); |
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2889 | 2888 |
2890 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2889 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2891 swapped_out_frames_.AddObserver(frame); | 2890 swapped_out_frames_.AddObserver(frame); |
2892 } | 2891 } |
2893 | 2892 |
2894 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2893 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2895 swapped_out_frames_.RemoveObserver(frame); | 2894 swapped_out_frames_.RemoveObserver(frame); |
2896 } | 2895 } |
2897 | 2896 |
2898 } // namespace content | 2897 } // namespace content |
OLD | NEW |