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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 #include "content/renderer/disambiguation_popup_helper.h" | 76 #include "content/renderer/disambiguation_popup_helper.h" |
77 #include "content/renderer/do_not_track_bindings.h" | 77 #include "content/renderer/do_not_track_bindings.h" |
78 #include "content/renderer/dom_automation_controller.h" | 78 #include "content/renderer/dom_automation_controller.h" |
79 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 79 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
80 #include "content/renderer/external_popup_menu.h" | 80 #include "content/renderer/external_popup_menu.h" |
81 #include "content/renderer/favicon_helper.h" | 81 #include "content/renderer/favicon_helper.h" |
82 #include "content/renderer/geolocation_dispatcher.h" | 82 #include "content/renderer/geolocation_dispatcher.h" |
83 #include "content/renderer/gpu/compositor_output_surface.h" | 83 #include "content/renderer/gpu/compositor_output_surface.h" |
84 #include "content/renderer/gpu/compositor_software_output_device_gl_adapter.h" | 84 #include "content/renderer/gpu/compositor_software_output_device_gl_adapter.h" |
85 #include "content/renderer/gpu/compositor_thread.h" | 85 #include "content/renderer/gpu/compositor_thread.h" |
| 86 #include "content/renderer/gpu/mailbox_output_surface.h" |
86 #include "content/renderer/gpu/render_widget_compositor.h" | 87 #include "content/renderer/gpu/render_widget_compositor.h" |
87 #include "content/renderer/idle_user_detector.h" | 88 #include "content/renderer/idle_user_detector.h" |
88 #include "content/renderer/input_tag_speech_dispatcher.h" | 89 #include "content/renderer/input_tag_speech_dispatcher.h" |
89 #include "content/renderer/java/java_bridge_dispatcher.h" | 90 #include "content/renderer/java/java_bridge_dispatcher.h" |
90 #include "content/renderer/load_progress_tracker.h" | 91 #include "content/renderer/load_progress_tracker.h" |
91 #include "content/renderer/media/audio_device_factory.h" | 92 #include "content/renderer/media/audio_device_factory.h" |
92 #include "content/renderer/media/audio_renderer_mixer_manager.h" | 93 #include "content/renderer/media/audio_renderer_mixer_manager.h" |
93 #include "content/renderer/media/media_stream_dependency_factory.h" | 94 #include "content/renderer/media/media_stream_dependency_factory.h" |
94 #include "content/renderer/media/media_stream_dispatcher.h" | 95 #include "content/renderer/media/media_stream_dispatcher.h" |
95 #include "content/renderer/media/media_stream_impl.h" | 96 #include "content/renderer/media/media_stream_impl.h" |
(...skipping 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2036 | 2037 |
2037 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 2038 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
2038 if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) { | 2039 if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) { |
2039 // In the absence of a software-based delegating renderer, use this | 2040 // In the absence of a software-based delegating renderer, use this |
2040 // stopgap adapter class to present the software renderer output using a | 2041 // stopgap adapter class to present the software renderer output using a |
2041 // 3d context. | 2042 // 3d context. |
2042 return scoped_ptr<cc::OutputSurface>( | 2043 return scoped_ptr<cc::OutputSurface>( |
2043 new CompositorOutputSurface(routing_id(), NULL, | 2044 new CompositorOutputSurface(routing_id(), NULL, |
2044 new CompositorSoftwareOutputDeviceGLAdapter(context))); | 2045 new CompositorSoftwareOutputDeviceGLAdapter(context))); |
2045 } else { | 2046 } else { |
2046 return scoped_ptr<cc::OutputSurface>( | 2047 bool composite_to_mailbox = |
2047 new CompositorOutputSurface(routing_id(), context, NULL)); | 2048 command_line.HasSwitch(cc::switches::kCompositeToMailbox); |
| 2049 DCHECK(!composite_to_mailbox || command_line.HasSwitch( |
| 2050 cc::switches::kEnableCompositorFrameMessage)); |
| 2051 // No swap throttling yet when compositing on the main thread. |
| 2052 DCHECK(!composite_to_mailbox || is_threaded_compositing_enabled_); |
| 2053 return scoped_ptr<cc::OutputSurface>(composite_to_mailbox ? |
| 2054 new MailboxOutputSurface(routing_id(), context, NULL) : |
| 2055 new CompositorOutputSurface(routing_id(), context, NULL)); |
2048 } | 2056 } |
2049 } | 2057 } |
2050 | 2058 |
2051 void RenderViewImpl::didAddMessageToConsole( | 2059 void RenderViewImpl::didAddMessageToConsole( |
2052 const WebConsoleMessage& message, const WebString& source_name, | 2060 const WebConsoleMessage& message, const WebString& source_name, |
2053 unsigned source_line) { | 2061 unsigned source_line) { |
2054 logging::LogSeverity log_severity = logging::LOG_VERBOSE; | 2062 logging::LogSeverity log_severity = logging::LOG_VERBOSE; |
2055 switch (message.level) { | 2063 switch (message.level) { |
2056 case WebConsoleMessage::LevelDebug: | 2064 case WebConsoleMessage::LevelDebug: |
2057 log_severity = logging::LOG_VERBOSE; | 2065 log_severity = logging::LOG_VERBOSE; |
(...skipping 4665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6723 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6731 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6724 RenderProcess::current()->ReleaseTransportDIB(dib); | 6732 RenderProcess::current()->ReleaseTransportDIB(dib); |
6725 } | 6733 } |
6726 | 6734 |
6727 void RenderViewImpl::DidCommitCompositorFrame() { | 6735 void RenderViewImpl::DidCommitCompositorFrame() { |
6728 RenderWidget::DidCommitCompositorFrame(); | 6736 RenderWidget::DidCommitCompositorFrame(); |
6729 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); | 6737 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); |
6730 } | 6738 } |
6731 | 6739 |
6732 } // namespace content | 6740 } // namespace content |
OLD | NEW |