| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 #include "content/renderer/device_orientation_dispatcher.h" | 74 #include "content/renderer/device_orientation_dispatcher.h" |
| 75 #include "content/renderer/devtools/devtools_agent.h" | 75 #include "content/renderer/devtools/devtools_agent.h" |
| 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.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/mailbox_output_surface.h" |
| 87 #include "content/renderer/gpu/render_widget_compositor.h" | 87 #include "content/renderer/gpu/render_widget_compositor.h" |
| 88 #include "content/renderer/idle_user_detector.h" | 88 #include "content/renderer/idle_user_detector.h" |
| 89 #include "content/renderer/input_tag_speech_dispatcher.h" | 89 #include "content/renderer/input_tag_speech_dispatcher.h" |
| 90 #include "content/renderer/java/java_bridge_dispatcher.h" | 90 #include "content/renderer/java/java_bridge_dispatcher.h" |
| 91 #include "content/renderer/load_progress_tracker.h" | 91 #include "content/renderer/load_progress_tracker.h" |
| 92 #include "content/renderer/media/audio_device_factory.h" | 92 #include "content/renderer/media/audio_device_factory.h" |
| 93 #include "content/renderer/media/audio_renderer_mixer_manager.h" | 93 #include "content/renderer/media/audio_renderer_mixer_manager.h" |
| 94 #include "content/renderer/media/media_stream_dependency_factory.h" | 94 #include "content/renderer/media/media_stream_dependency_factory.h" |
| (...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2033 WebKit::WebGraphicsContext3D::Attributes attributes; | 2033 WebKit::WebGraphicsContext3D::Attributes attributes; |
| 2034 attributes.antialias = false; | 2034 attributes.antialias = false; |
| 2035 attributes.shareResources = true; | 2035 attributes.shareResources = true; |
| 2036 attributes.noAutomaticFlushes = true; | 2036 attributes.noAutomaticFlushes = true; |
| 2037 WebGraphicsContext3D* context = CreateGraphicsContext3D(attributes); | 2037 WebGraphicsContext3D* context = CreateGraphicsContext3D(attributes); |
| 2038 if (!context) | 2038 if (!context) |
| 2039 return scoped_ptr<cc::OutputSurface>(); | 2039 return scoped_ptr<cc::OutputSurface>(); |
| 2040 | 2040 |
| 2041 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 2041 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 2042 if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) { | 2042 if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) { |
| 2043 // In the absence of a software-based delegating renderer, use this | |
| 2044 // stopgap adapter class to present the software renderer output using a | |
| 2045 // 3d context. | |
| 2046 return scoped_ptr<cc::OutputSurface>( | 2043 return scoped_ptr<cc::OutputSurface>( |
| 2047 new CompositorOutputSurface(routing_id(), NULL, | 2044 new CompositorOutputSurface(routing_id(), NULL, |
| 2048 new CompositorSoftwareOutputDeviceGLAdapter(context))); | 2045 new CompositorSoftwareOutputDevice)); |
| 2049 } else { | 2046 } else { |
| 2050 bool composite_to_mailbox = | 2047 bool composite_to_mailbox = |
| 2051 command_line.HasSwitch(cc::switches::kCompositeToMailbox); | 2048 command_line.HasSwitch(cc::switches::kCompositeToMailbox); |
| 2052 DCHECK(!composite_to_mailbox || command_line.HasSwitch( | 2049 DCHECK(!composite_to_mailbox || command_line.HasSwitch( |
| 2053 cc::switches::kEnableCompositorFrameMessage)); | 2050 cc::switches::kEnableCompositorFrameMessage)); |
| 2054 // No swap throttling yet when compositing on the main thread. | 2051 // No swap throttling yet when compositing on the main thread. |
| 2055 DCHECK(!composite_to_mailbox || is_threaded_compositing_enabled_); | 2052 DCHECK(!composite_to_mailbox || is_threaded_compositing_enabled_); |
| 2056 return scoped_ptr<cc::OutputSurface>(composite_to_mailbox ? | 2053 return scoped_ptr<cc::OutputSurface>(composite_to_mailbox ? |
| 2057 new MailboxOutputSurface(routing_id(), context, NULL) : | 2054 new MailboxOutputSurface(routing_id(), context, NULL) : |
| 2058 new CompositorOutputSurface(routing_id(), context, NULL)); | 2055 new CompositorOutputSurface(routing_id(), context, NULL)); |
| (...skipping 4692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6751 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6748 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
| 6752 RenderProcess::current()->ReleaseTransportDIB(dib); | 6749 RenderProcess::current()->ReleaseTransportDIB(dib); |
| 6753 } | 6750 } |
| 6754 | 6751 |
| 6755 void RenderViewImpl::DidCommitCompositorFrame() { | 6752 void RenderViewImpl::DidCommitCompositorFrame() { |
| 6756 RenderWidget::DidCommitCompositorFrame(); | 6753 RenderWidget::DidCommitCompositorFrame(); |
| 6757 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); | 6754 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); |
| 6758 } | 6755 } |
| 6759 | 6756 |
| 6760 } // namespace content | 6757 } // namespace content |
| OLD | NEW |