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_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "content/common/swapped_out_messages.h" | 17 #include "content/common/swapped_out_messages.h" |
18 #include "content/common/view_messages.h" | 18 #include "content/common/view_messages.h" |
19 #include "content/public/common/content_switches.h" | 19 #include "content/public/common/content_switches.h" |
20 #include "content/public/common/gpu_rendering_stats.h" | |
20 #include "content/renderer/render_process.h" | 21 #include "content/renderer/render_process.h" |
21 #include "content/renderer/render_thread_impl.h" | 22 #include "content/renderer/render_thread_impl.h" |
22 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 23 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
23 #include "ipc/ipc_sync_message.h" | 24 #include "ipc/ipc_sync_message.h" |
24 #include "skia/ext/platform_canvas.h" | 25 #include "skia/ext/platform_canvas.h" |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHelperPlugin.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHelperPlugin.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPagePopup.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPagePopup.h" |
28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" |
29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" |
(...skipping 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1817 } | 1818 } |
1818 } | 1819 } |
1819 | 1820 |
1820 void RenderWidget::GetRenderingStats(WebKit::WebRenderingStats& stats) const { | 1821 void RenderWidget::GetRenderingStats(WebKit::WebRenderingStats& stats) const { |
1821 webwidget()->renderingStats(stats); | 1822 webwidget()->renderingStats(stats); |
1822 stats.numAnimationFrames += software_stats_.numAnimationFrames; | 1823 stats.numAnimationFrames += software_stats_.numAnimationFrames; |
1823 stats.numFramesSentToScreen += software_stats_.numFramesSentToScreen; | 1824 stats.numFramesSentToScreen += software_stats_.numFramesSentToScreen; |
1824 stats.totalPaintTimeInSeconds += software_stats_.totalPaintTimeInSeconds; | 1825 stats.totalPaintTimeInSeconds += software_stats_.totalPaintTimeInSeconds; |
1825 } | 1826 } |
1826 | 1827 |
1828 void RenderWidget::GetGpuRenderingStats( | |
1829 content::GpuRenderingStats& stats) const { | |
1830 RenderThreadImpl::current()->GetGpuRenderingStats(stats); | |
nduca
2012/08/23 18:51:27
Any reason to not do RenderThreadIMpl::current()->
| |
1831 } | |
1832 | |
1827 void RenderWidget::BeginSmoothScroll( | 1833 void RenderWidget::BeginSmoothScroll( |
1828 bool down, | 1834 bool down, |
1829 bool scroll_far, | 1835 bool scroll_far, |
1830 const SmoothScrollCompletionCallback& callback) { | 1836 const SmoothScrollCompletionCallback& callback) { |
1831 DCHECK(!callback.is_null()); | 1837 DCHECK(!callback.is_null()); |
1832 int id = next_smooth_scroll_gesture_id_++; | 1838 int id = next_smooth_scroll_gesture_id_++; |
1833 Send(new ViewHostMsg_BeginSmoothScroll(routing_id_, id, down, scroll_far)); | 1839 Send(new ViewHostMsg_BeginSmoothScroll(routing_id_, id, down, scroll_far)); |
1834 pending_smooth_scroll_gestures_.insert(std::make_pair(id, callback)); | 1840 pending_smooth_scroll_gestures_.insert(std::make_pair(id, callback)); |
1835 } | 1841 } |
1836 | 1842 |
1837 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 1843 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
1838 return false; | 1844 return false; |
1839 } | 1845 } |
1840 | 1846 |
1841 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { | 1847 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
1842 return false; | 1848 return false; |
1843 } | 1849 } |
OLD | NEW |