Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 10873099: Flag and adapter class for software compositing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Apply comments and rename everything to "Software" Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #include "content/renderer/browser_plugin/old/browser_plugin_constants.h" 63 #include "content/renderer/browser_plugin/old/browser_plugin_constants.h"
64 #include "content/renderer/browser_plugin/old/guest_to_embedder_channel.h" 64 #include "content/renderer/browser_plugin/old/guest_to_embedder_channel.h"
65 #include "content/renderer/device_orientation_dispatcher.h" 65 #include "content/renderer/device_orientation_dispatcher.h"
66 #include "content/renderer/devtools_agent.h" 66 #include "content/renderer/devtools_agent.h"
67 #include "content/renderer/dom_automation_controller.h" 67 #include "content/renderer/dom_automation_controller.h"
68 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" 68 #include "content/renderer/dom_storage/webstoragenamespace_impl.h"
69 #include "content/renderer/external_popup_menu.h" 69 #include "content/renderer/external_popup_menu.h"
70 #include "content/renderer/geolocation_dispatcher.h" 70 #include "content/renderer/geolocation_dispatcher.h"
71 #include "content/renderer/gpu/compositor_thread.h" 71 #include "content/renderer/gpu/compositor_thread.h"
72 #include "content/renderer/gpu/compositor_output_surface.h" 72 #include "content/renderer/gpu/compositor_output_surface.h"
73 #include "content/renderer/gpu/compositor_output_surface_software_gl_adapter.h"
73 #include "content/renderer/idle_user_detector.h" 74 #include "content/renderer/idle_user_detector.h"
74 #include "content/renderer/input_tag_speech_dispatcher.h" 75 #include "content/renderer/input_tag_speech_dispatcher.h"
75 #include "content/renderer/java/java_bridge_dispatcher.h" 76 #include "content/renderer/java/java_bridge_dispatcher.h"
76 #include "content/renderer/load_progress_tracker.h" 77 #include "content/renderer/load_progress_tracker.h"
77 #include "content/renderer/media/media_stream_dependency_factory.h" 78 #include "content/renderer/media/media_stream_dependency_factory.h"
78 #include "content/renderer/media/media_stream_dispatcher.h" 79 #include "content/renderer/media/media_stream_dispatcher.h"
79 #include "content/renderer/media/media_stream_impl.h" 80 #include "content/renderer/media/media_stream_impl.h"
80 #include "content/renderer/media/render_audiosourceprovider.h" 81 #include "content/renderer/media/render_audiosourceprovider.h"
81 #include "content/renderer/media/render_media_log.h" 82 #include "content/renderer/media/render_media_log.h"
82 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" 83 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h"
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after
1797 } 1798 }
1798 1799
1799 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace( 1800 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace(
1800 unsigned quota) { 1801 unsigned quota) {
1801 CHECK(session_storage_namespace_id_ != 1802 CHECK(session_storage_namespace_id_ !=
1802 dom_storage::kInvalidSessionStorageNamespaceId); 1803 dom_storage::kInvalidSessionStorageNamespaceId);
1803 return new WebStorageNamespaceImpl(session_storage_namespace_id_); 1804 return new WebStorageNamespaceImpl(session_storage_namespace_id_);
1804 } 1805 }
1805 1806
1806 WebKit::WebCompositorOutputSurface* RenderViewImpl::createOutputSurface() { 1807 WebKit::WebCompositorOutputSurface* RenderViewImpl::createOutputSurface() {
1807 // TODO(aelias): if force-software-mode is on, create an output surface
1808 // without a 3D context.
1809
1810 // Explicitly disable antialiasing for the compositor. As of the time of 1808 // Explicitly disable antialiasing for the compositor. As of the time of
1811 // this writing, the only platform that supported antialiasing for the 1809 // this writing, the only platform that supported antialiasing for the
1812 // compositor was Mac OS X, because the on-screen OpenGL context creation 1810 // compositor was Mac OS X, because the on-screen OpenGL context creation
1813 // code paths on Windows and Linux didn't yet have multisampling support. 1811 // code paths on Windows and Linux didn't yet have multisampling support.
1814 // Mac OS X essentially always behaves as though it's rendering offscreen. 1812 // Mac OS X essentially always behaves as though it's rendering offscreen.
1815 // Multisampling has a heavy cost especially on devices with relatively low 1813 // Multisampling has a heavy cost especially on devices with relatively low
1816 // fill rate like most notebooks, and the Mac implementation would need to 1814 // fill rate like most notebooks, and the Mac implementation would need to
1817 // be optimized to resolve directly into the IOSurface shared between the 1815 // be optimized to resolve directly into the IOSurface shared between the
1818 // GPU and browser processes. For these reasons and to avoid platform 1816 // GPU and browser processes. For these reasons and to avoid platform
1819 // disparities we explicitly disable antialiasing. 1817 // disparities we explicitly disable antialiasing.
1820 WebKit::WebGraphicsContext3D::Attributes attributes; 1818 WebKit::WebGraphicsContext3D::Attributes attributes;
1821 attributes.antialias = false; 1819 attributes.antialias = false;
1822 attributes.shareResources = true; 1820 attributes.shareResources = true;
1823 WebGraphicsContext3D* context = CreateGraphicsContext3D(attributes); 1821 WebGraphicsContext3D* context = CreateGraphicsContext3D(attributes);
1824 if (!context) 1822 if (!context)
1825 return NULL; 1823 return NULL;
1826 1824
1827 return new CompositorOutputSurface(routing_id(), context); 1825 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
1826 if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) {
1827 // In the absence of a software-based delegating renderer, use this
1828 // stopgap adapter class to present the software renderer output using a
1829 // 3d context.
1830 return new CompositorOutputSurface(routing_id(), NULL,
1831 new CompositorOutputSurfaceSoftwareGLAdapter(context));
1832 } else
1833 return new CompositorOutputSurface(routing_id(), context, NULL);
1828 } 1834 }
1829 1835
1830 void RenderViewImpl::didAddMessageToConsole( 1836 void RenderViewImpl::didAddMessageToConsole(
1831 const WebConsoleMessage& message, const WebString& source_name, 1837 const WebConsoleMessage& message, const WebString& source_name,
1832 unsigned source_line) { 1838 unsigned source_line) {
1833 logging::LogSeverity log_severity = logging::LOG_VERBOSE; 1839 logging::LogSeverity log_severity = logging::LOG_VERBOSE;
1834 switch (message.level) { 1840 switch (message.level) {
1835 case WebConsoleMessage::LevelTip: 1841 case WebConsoleMessage::LevelTip:
1836 log_severity = logging::LOG_VERBOSE; 1842 log_severity = logging::LOG_VERBOSE;
1837 break; 1843 break;
(...skipping 4054 matching lines...) Expand 10 before | Expand all | Expand 10 after
5892 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5898 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5893 return !!RenderThreadImpl::current()->compositor_thread(); 5899 return !!RenderThreadImpl::current()->compositor_thread();
5894 } 5900 }
5895 5901
5896 void RenderViewImpl::OnJavaBridgeInit() { 5902 void RenderViewImpl::OnJavaBridgeInit() {
5897 DCHECK(!java_bridge_dispatcher_); 5903 DCHECK(!java_bridge_dispatcher_);
5898 #if defined(ENABLE_JAVA_BRIDGE) 5904 #if defined(ENABLE_JAVA_BRIDGE)
5899 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); 5905 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this);
5900 #endif 5906 #endif
5901 } 5907 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698