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_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 #include "third_party/WebKit/public/web/WebKit.h" | 155 #include "third_party/WebKit/public/web/WebKit.h" |
156 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" | 156 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" |
157 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 157 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
158 #include "third_party/WebKit/public/web/WebScriptController.h" | 158 #include "third_party/WebKit/public/web/WebScriptController.h" |
159 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 159 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
160 #include "third_party/WebKit/public/web/WebView.h" | 160 #include "third_party/WebKit/public/web/WebView.h" |
161 #include "third_party/icu/source/i18n/unicode/timezone.h" | 161 #include "third_party/icu/source/i18n/unicode/timezone.h" |
162 #include "third_party/skia/include/core/SkGraphics.h" | 162 #include "third_party/skia/include/core/SkGraphics.h" |
163 #include "ui/base/layout.h" | 163 #include "ui/base/layout.h" |
164 #include "ui/base/ui_base_switches.h" | 164 #include "ui/base/ui_base_switches.h" |
| 165 #include "ui/gl/gl_switches.h" |
165 | 166 |
166 #if defined(OS_ANDROID) | 167 #if defined(OS_ANDROID) |
167 #include <cpu-features.h> | 168 #include <cpu-features.h> |
168 #include "content/renderer/android/synchronous_compositor_filter.h" | 169 #include "content/renderer/android/synchronous_compositor_filter.h" |
169 #include "content/renderer/android/synchronous_compositor_frame_sink.h" | 170 #include "content/renderer/android/synchronous_compositor_frame_sink.h" |
170 #include "content/renderer/media/android/renderer_demuxer_android.h" | 171 #include "content/renderer/media/android/renderer_demuxer_android.h" |
171 #include "content/renderer/media/android/stream_texture_factory.h" | 172 #include "content/renderer/media/android/stream_texture_factory.h" |
172 #include "media/base/android/media_codec_util.h" | 173 #include "media/base/android/media_codec_util.h" |
173 #endif | 174 #endif |
174 | 175 |
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1582 #endif | 1583 #endif |
1583 return gpu_memory_buffer_manager(); | 1584 return gpu_memory_buffer_manager(); |
1584 } | 1585 } |
1585 | 1586 |
1586 blink::scheduler::RendererScheduler* RenderThreadImpl::GetRendererScheduler() { | 1587 blink::scheduler::RendererScheduler* RenderThreadImpl::GetRendererScheduler() { |
1587 return renderer_scheduler_.get(); | 1588 return renderer_scheduler_.get(); |
1588 } | 1589 } |
1589 | 1590 |
1590 std::unique_ptr<cc::BeginFrameSource> | 1591 std::unique_ptr<cc::BeginFrameSource> |
1591 RenderThreadImpl::CreateExternalBeginFrameSource(int routing_id) { | 1592 RenderThreadImpl::CreateExternalBeginFrameSource(int routing_id) { |
| 1593 const base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
| 1594 if (cmd->HasSwitch(switches::kDisableGpuVsync)) { |
| 1595 std::string display_vsync_string = |
| 1596 cmd->GetSwitchValueASCII(switches::kDisableGpuVsync); |
| 1597 if (display_vsync_string != "gpu") { |
| 1598 // In disable gpu vsync mode, also let the renderer tick as fast as it |
| 1599 // can. The top level begin frame source will also be running as a back |
| 1600 // to back begin frame source, but using a synthetic begin frame source |
| 1601 // here reduces latency when in this mode (at least for frames |
| 1602 // starting--it potentially increases it for input on the other hand.) |
| 1603 base::SingleThreadTaskRunner* compositor_impl_side_task_runner = |
| 1604 compositor_task_runner_ ? compositor_task_runner_.get() |
| 1605 : base::ThreadTaskRunnerHandle::Get().get(); |
| 1606 return base::MakeUnique<cc::BackToBackBeginFrameSource>( |
| 1607 base::MakeUnique<cc::DelayBasedTimeSource>( |
| 1608 compositor_impl_side_task_runner)); |
| 1609 } |
| 1610 } |
| 1611 |
1592 return base::MakeUnique<CompositorExternalBeginFrameSource>( | 1612 return base::MakeUnique<CompositorExternalBeginFrameSource>( |
1593 compositor_message_filter_.get(), sync_message_filter(), routing_id); | 1613 compositor_message_filter_.get(), sync_message_filter(), routing_id); |
1594 } | 1614 } |
1595 | 1615 |
1596 cc::ImageSerializationProcessor* | 1616 cc::ImageSerializationProcessor* |
1597 RenderThreadImpl::GetImageSerializationProcessor() { | 1617 RenderThreadImpl::GetImageSerializationProcessor() { |
1598 return GetContentClient()->renderer()->GetImageSerializationProcessor(); | 1618 return GetContentClient()->renderer()->GetImageSerializationProcessor(); |
1599 } | 1619 } |
1600 | 1620 |
1601 cc::TaskGraphRunner* RenderThreadImpl::GetTaskGraphRunner() { | 1621 cc::TaskGraphRunner* RenderThreadImpl::GetTaskGraphRunner() { |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2245 if (blink::mainThreadIsolate()) { | 2265 if (blink::mainThreadIsolate()) { |
2246 blink::mainThreadIsolate()->MemoryPressureNotification( | 2266 blink::mainThreadIsolate()->MemoryPressureNotification( |
2247 v8::MemoryPressureLevel::kCritical); | 2267 v8::MemoryPressureLevel::kCritical); |
2248 blink::MemoryPressureNotificationToWorkerThreadIsolates( | 2268 blink::MemoryPressureNotificationToWorkerThreadIsolates( |
2249 v8::MemoryPressureLevel::kCritical); | 2269 v8::MemoryPressureLevel::kCritical); |
2250 } | 2270 } |
2251 } | 2271 } |
2252 | 2272 |
2253 | 2273 |
2254 } // namespace content | 2274 } // namespace content |
OLD | NEW |