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 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 !command_line.HasSwitch(switches::kDisableDelegatedRenderer)) { | 930 !command_line.HasSwitch(switches::kDisableDelegatedRenderer)) { |
931 DCHECK(is_threaded_compositing_enabled_); | 931 DCHECK(is_threaded_compositing_enabled_); |
932 return scoped_ptr<cc::OutputSurface>( | 932 return scoped_ptr<cc::OutputSurface>( |
933 new DelegatedCompositorOutputSurface( | 933 new DelegatedCompositorOutputSurface( |
934 routing_id(), | 934 routing_id(), |
935 output_surface_id, | 935 output_surface_id, |
936 context_provider, | 936 context_provider, |
937 scoped_ptr<cc::SoftwareOutputDevice>())); | 937 scoped_ptr<cc::SoftwareOutputDevice>())); |
938 } | 938 } |
939 if (command_line.HasSwitch(cc::switches::kCompositeToMailbox)) { | 939 if (command_line.HasSwitch(cc::switches::kCompositeToMailbox)) { |
940 DCHECK(is_threaded_compositing_enabled_); | 940 // Composite-to-mailbox is currently used for layout tests in order to cause |
| 941 // them to draw inside in the renderer to do the readback there. This should |
| 942 // no longer be the case when crbug.com/311404 is fixed. |
| 943 DCHECK(is_threaded_compositing_enabled_ || |
| 944 RenderThreadImpl::current()->layout_test_mode()); |
941 cc::ResourceFormat format = cc::RGBA_8888; | 945 cc::ResourceFormat format = cc::RGBA_8888; |
942 #if defined(OS_ANDROID) | 946 #if defined(OS_ANDROID) |
943 if (base::android::SysUtils::IsLowEndDevice()) | 947 if (base::android::SysUtils::IsLowEndDevice()) |
944 format = cc::RGB_565; | 948 format = cc::RGB_565; |
945 #endif | 949 #endif |
946 return scoped_ptr<cc::OutputSurface>( | 950 return scoped_ptr<cc::OutputSurface>( |
947 new MailboxOutputSurface( | 951 new MailboxOutputSurface( |
948 routing_id(), | 952 routing_id(), |
949 output_surface_id, | 953 output_surface_id, |
950 context_provider, | 954 context_provider, |
(...skipping 1917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2868 | 2872 |
2869 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2873 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2870 swapped_out_frames_.AddObserver(frame); | 2874 swapped_out_frames_.AddObserver(frame); |
2871 } | 2875 } |
2872 | 2876 |
2873 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2877 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2874 swapped_out_frames_.RemoveObserver(frame); | 2878 swapped_out_frames_.RemoveObserver(frame); |
2875 } | 2879 } |
2876 | 2880 |
2877 } // namespace content | 2881 } // namespace content |
OLD | NEW |