| 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 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 #include "content/renderer/browser_plugin/old/guest_to_embedder_channel.h" | 67 #include "content/renderer/browser_plugin/old/guest_to_embedder_channel.h" |
| 68 #include "content/renderer/device_orientation_dispatcher.h" | 68 #include "content/renderer/device_orientation_dispatcher.h" |
| 69 #include "content/renderer/devtools_agent.h" | 69 #include "content/renderer/devtools_agent.h" |
| 70 #include "content/renderer/dom_automation_controller.h" | 70 #include "content/renderer/dom_automation_controller.h" |
| 71 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 71 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
| 72 #include "content/renderer/do_not_track_bindings.h" | 72 #include "content/renderer/do_not_track_bindings.h" |
| 73 #include "content/renderer/external_popup_menu.h" | 73 #include "content/renderer/external_popup_menu.h" |
| 74 #include "content/renderer/geolocation_dispatcher.h" | 74 #include "content/renderer/geolocation_dispatcher.h" |
| 75 #include "content/renderer/gpu/compositor_thread.h" | 75 #include "content/renderer/gpu/compositor_thread.h" |
| 76 #include "content/renderer/gpu/compositor_output_surface.h" | 76 #include "content/renderer/gpu/compositor_output_surface.h" |
| 77 #include "content/renderer/gpu/compositor_software_output_device_gl_adapter.h" |
| 77 #include "content/renderer/idle_user_detector.h" | 78 #include "content/renderer/idle_user_detector.h" |
| 78 #include "content/renderer/input_tag_speech_dispatcher.h" | 79 #include "content/renderer/input_tag_speech_dispatcher.h" |
| 79 #include "content/renderer/java/java_bridge_dispatcher.h" | 80 #include "content/renderer/java/java_bridge_dispatcher.h" |
| 80 #include "content/renderer/load_progress_tracker.h" | 81 #include "content/renderer/load_progress_tracker.h" |
| 81 #include "content/renderer/media/media_stream_dependency_factory.h" | 82 #include "content/renderer/media/media_stream_dependency_factory.h" |
| 82 #include "content/renderer/media/media_stream_dispatcher.h" | 83 #include "content/renderer/media/media_stream_dispatcher.h" |
| 83 #include "content/renderer/media/media_stream_impl.h" | 84 #include "content/renderer/media/media_stream_impl.h" |
| 84 #include "content/renderer/media/render_audiosourceprovider.h" | 85 #include "content/renderer/media/render_audiosourceprovider.h" |
| 85 #include "content/renderer/media/render_media_log.h" | 86 #include "content/renderer/media/render_media_log.h" |
| 86 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" | 87 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" |
| (...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1881 } | 1882 } |
| 1882 | 1883 |
| 1883 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace( | 1884 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace( |
| 1884 unsigned quota) { | 1885 unsigned quota) { |
| 1885 CHECK(session_storage_namespace_id_ != | 1886 CHECK(session_storage_namespace_id_ != |
| 1886 dom_storage::kInvalidSessionStorageNamespaceId); | 1887 dom_storage::kInvalidSessionStorageNamespaceId); |
| 1887 return new WebStorageNamespaceImpl(session_storage_namespace_id_); | 1888 return new WebStorageNamespaceImpl(session_storage_namespace_id_); |
| 1888 } | 1889 } |
| 1889 | 1890 |
| 1890 WebKit::WebCompositorOutputSurface* RenderViewImpl::createOutputSurface() { | 1891 WebKit::WebCompositorOutputSurface* RenderViewImpl::createOutputSurface() { |
| 1891 // TODO(aelias): if force-software-mode is on, create an output surface | |
| 1892 // without a 3D context. | |
| 1893 | |
| 1894 // Explicitly disable antialiasing for the compositor. As of the time of | 1892 // Explicitly disable antialiasing for the compositor. As of the time of |
| 1895 // this writing, the only platform that supported antialiasing for the | 1893 // this writing, the only platform that supported antialiasing for the |
| 1896 // compositor was Mac OS X, because the on-screen OpenGL context creation | 1894 // compositor was Mac OS X, because the on-screen OpenGL context creation |
| 1897 // code paths on Windows and Linux didn't yet have multisampling support. | 1895 // code paths on Windows and Linux didn't yet have multisampling support. |
| 1898 // Mac OS X essentially always behaves as though it's rendering offscreen. | 1896 // Mac OS X essentially always behaves as though it's rendering offscreen. |
| 1899 // Multisampling has a heavy cost especially on devices with relatively low | 1897 // Multisampling has a heavy cost especially on devices with relatively low |
| 1900 // fill rate like most notebooks, and the Mac implementation would need to | 1898 // fill rate like most notebooks, and the Mac implementation would need to |
| 1901 // be optimized to resolve directly into the IOSurface shared between the | 1899 // be optimized to resolve directly into the IOSurface shared between the |
| 1902 // GPU and browser processes. For these reasons and to avoid platform | 1900 // GPU and browser processes. For these reasons and to avoid platform |
| 1903 // disparities we explicitly disable antialiasing. | 1901 // disparities we explicitly disable antialiasing. |
| 1904 WebKit::WebGraphicsContext3D::Attributes attributes; | 1902 WebKit::WebGraphicsContext3D::Attributes attributes; |
| 1905 attributes.antialias = false; | 1903 attributes.antialias = false; |
| 1906 attributes.shareResources = true; | 1904 attributes.shareResources = true; |
| 1907 WebGraphicsContext3D* context = CreateGraphicsContext3D(attributes); | 1905 WebGraphicsContext3D* context = CreateGraphicsContext3D(attributes); |
| 1908 if (!context) | 1906 if (!context) |
| 1909 return NULL; | 1907 return NULL; |
| 1910 | 1908 |
| 1911 return new CompositorOutputSurface(routing_id(), context); | 1909 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 1910 if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) { |
| 1911 // In the absence of a software-based delegating renderer, use this |
| 1912 // stopgap adapter class to present the software renderer output using a |
| 1913 // 3d context. |
| 1914 return new CompositorOutputSurface(routing_id(), NULL, |
| 1915 new CompositorSoftwareOutputDeviceGLAdapter(context)); |
| 1916 } else |
| 1917 return new CompositorOutputSurface(routing_id(), context, NULL); |
| 1912 } | 1918 } |
| 1913 | 1919 |
| 1914 void RenderViewImpl::didAddMessageToConsole( | 1920 void RenderViewImpl::didAddMessageToConsole( |
| 1915 const WebConsoleMessage& message, const WebString& source_name, | 1921 const WebConsoleMessage& message, const WebString& source_name, |
| 1916 unsigned source_line) { | 1922 unsigned source_line) { |
| 1917 logging::LogSeverity log_severity = logging::LOG_VERBOSE; | 1923 logging::LogSeverity log_severity = logging::LOG_VERBOSE; |
| 1918 switch (message.level) { | 1924 switch (message.level) { |
| 1919 case WebConsoleMessage::LevelTip: | 1925 case WebConsoleMessage::LevelTip: |
| 1920 log_severity = logging::LOG_VERBOSE; | 1926 log_severity = logging::LOG_VERBOSE; |
| 1921 break; | 1927 break; |
| (...skipping 4341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6263 | 6269 |
| 6264 updating_frame_tree_ = true; | 6270 updating_frame_tree_ = true; |
| 6265 active_frame_id_map_.clear(); | 6271 active_frame_id_map_.clear(); |
| 6266 | 6272 |
| 6267 target_process_id_ = process_id; | 6273 target_process_id_ = process_id; |
| 6268 target_routing_id_ = route_id; | 6274 target_routing_id_ = route_id; |
| 6269 CreateFrameTree(webview()->mainFrame(), frames); | 6275 CreateFrameTree(webview()->mainFrame(), frames); |
| 6270 | 6276 |
| 6271 updating_frame_tree_ = false; | 6277 updating_frame_tree_ = false; |
| 6272 } | 6278 } |
| OLD | NEW |