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 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 !command_line.HasSwitch(switches::kDisableDelegatedRenderer)) { | 923 !command_line.HasSwitch(switches::kDisableDelegatedRenderer)) { |
924 DCHECK(is_threaded_compositing_enabled_); | 924 DCHECK(is_threaded_compositing_enabled_); |
925 return scoped_ptr<cc::OutputSurface>( | 925 return scoped_ptr<cc::OutputSurface>( |
926 new DelegatedCompositorOutputSurface( | 926 new DelegatedCompositorOutputSurface( |
927 routing_id(), | 927 routing_id(), |
928 output_surface_id, | 928 output_surface_id, |
929 context_provider, | 929 context_provider, |
930 scoped_ptr<cc::SoftwareOutputDevice>())); | 930 scoped_ptr<cc::SoftwareOutputDevice>())); |
931 } | 931 } |
932 if (command_line.HasSwitch(cc::switches::kCompositeToMailbox)) { | 932 if (command_line.HasSwitch(cc::switches::kCompositeToMailbox)) { |
933 DCHECK(is_threaded_compositing_enabled_); | 933 // Composite-to-mailbox is currently used for layout tests in order to cause |
| 934 // them to draw inside in the renderer to do the readback there. This should |
| 935 // no longer be the case when crbug.com/311404 is fixed. |
| 936 DCHECK(is_threaded_compositing_enabled_ || |
| 937 RenderThreadImpl::current()->layout_test_mode()); |
934 cc::ResourceFormat format = cc::RGBA_8888; | 938 cc::ResourceFormat format = cc::RGBA_8888; |
935 #if defined(OS_ANDROID) | 939 #if defined(OS_ANDROID) |
936 if (base::android::SysUtils::IsLowEndDevice()) | 940 if (base::android::SysUtils::IsLowEndDevice()) |
937 format = cc::RGB_565; | 941 format = cc::RGB_565; |
938 #endif | 942 #endif |
939 return scoped_ptr<cc::OutputSurface>( | 943 return scoped_ptr<cc::OutputSurface>( |
940 new MailboxOutputSurface( | 944 new MailboxOutputSurface( |
941 routing_id(), | 945 routing_id(), |
942 output_surface_id, | 946 output_surface_id, |
943 context_provider, | 947 context_provider, |
(...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2833 | 2837 |
2834 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2838 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2835 swapped_out_frames_.AddObserver(frame); | 2839 swapped_out_frames_.AddObserver(frame); |
2836 } | 2840 } |
2837 | 2841 |
2838 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2842 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2839 swapped_out_frames_.RemoveObserver(frame); | 2843 swapped_out_frames_.RemoveObserver(frame); |
2840 } | 2844 } |
2841 | 2845 |
2842 } // namespace content | 2846 } // namespace content |
OLD | NEW |