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

Side by Side Diff: content/renderer/render_widget.h

Issue 14931012: Add support for latency measurement to Telemetry smoothness benchmarks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/gpu/gpu_benchmarking_extension.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_
6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/time.h" 16 #include "base/time.h"
17 #include "base/timer.h" 17 #include "base/timer.h"
18 #include "cc/debug/rendering_stats.h" 18 #include "cc/debug/rendering_stats.h"
19 #include "content/common/browser_rendering_stats.h"
19 #include "content/common/content_export.h" 20 #include "content/common/content_export.h"
20 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 21 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
21 #include "content/renderer/paint_aggregator.h" 22 #include "content/renderer/paint_aggregator.h"
22 #include "ipc/ipc_listener.h" 23 #include "ipc/ipc_listener.h"
23 #include "ipc/ipc_sender.h" 24 #include "ipc/ipc_sender.h"
24 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" 25 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h"
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h" 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h"
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h"
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextInputInfo.h" 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextInputInfo.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // Fills in a WebRenderingStatsImpl struct containing information about 168 // Fills in a WebRenderingStatsImpl struct containing information about
168 // rendering, e.g. count of frames rendered, time spent painting. 169 // rendering, e.g. count of frames rendered, time spent painting.
169 void GetRenderingStats(WebKit::WebRenderingStatsImpl&) const; 170 void GetRenderingStats(WebKit::WebRenderingStatsImpl&) const;
170 171
171 // Fills in a GpuRenderingStats struct containing information about 172 // Fills in a GpuRenderingStats struct containing information about
172 // GPU rendering, e.g. count of texture uploads performed, time spent 173 // GPU rendering, e.g. count of texture uploads performed, time spent
173 // uploading. 174 // uploading.
174 // This call is relatively expensive as it blocks on the GPU process 175 // This call is relatively expensive as it blocks on the GPU process
175 bool GetGpuRenderingStats(GpuRenderingStats*) const; 176 bool GetGpuRenderingStats(GpuRenderingStats*) const;
176 177
178 void GetBrowserRenderingStats(BrowserRenderingStats* stats);
179
177 RenderWidgetCompositor* compositor() const; 180 RenderWidgetCompositor* compositor() const;
178 181
179 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(); 182 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface();
180 183
181 // Callback for use with BeginSmoothScroll. 184 // Callback for use with BeginSmoothScroll.
182 typedef base::Callback<void()> SmoothScrollCompletionCallback; 185 typedef base::Callback<void()> SmoothScrollCompletionCallback;
183 186
184 // Directs the host to begin a smooth scroll. This scroll should have the same 187 // Directs the host to begin a smooth scroll. This scroll should have the same
185 // performance characteristics as a user-initiated scroll. Returns an ID of 188 // performance characteristics as a user-initiated scroll. Returns an ID of
186 // the scroll gesture. |mouse_event_x| and |mouse_event_y| are expected to be 189 // the scroll gesture. |mouse_event_x| and |mouse_event_y| are expected to be
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 void OnSmoothScrollCompleted(); 327 void OnSmoothScrollCompleted();
325 void OnSetTextDirection(WebKit::WebTextDirection direction); 328 void OnSetTextDirection(WebKit::WebTextDirection direction);
326 void OnGetFPS(); 329 void OnGetFPS();
327 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, 330 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect,
328 const gfx::Rect& window_screen_rect); 331 const gfx::Rect& window_screen_rect);
329 #if defined(OS_ANDROID) 332 #if defined(OS_ANDROID)
330 void OnImeBatchStateChanged(bool is_begin); 333 void OnImeBatchStateChanged(bool is_begin);
331 void OnShowImeIfNeeded(); 334 void OnShowImeIfNeeded();
332 #endif 335 #endif
333 void OnSnapshot(const gfx::Rect& src_subrect); 336 void OnSnapshot(const gfx::Rect& src_subrect);
337 void OnSetBrowserRenderingStats(const BrowserRenderingStats& stats);
334 338
335 // Notify the compositor about a change in viewport size. This should be 339 // Notify the compositor about a change in viewport size. This should be
336 // used only with auto resize mode WebWidgets, as normal WebWidgets should 340 // used only with auto resize mode WebWidgets, as normal WebWidgets should
337 // go through OnResize. 341 // go through OnResize.
338 void AutoResizeCompositor(); 342 void AutoResizeCompositor();
339 343
340 virtual void SetDeviceScaleFactor(float device_scale_factor); 344 virtual void SetDeviceScaleFactor(float device_scale_factor);
341 345
342 // Override points to notify derived classes that a paint has happened. 346 // Override points to notify derived classes that a paint has happened.
343 // WillInitiatePaint happens when we're about to generate a new bitmap and 347 // WillInitiatePaint happens when we're about to generate a new bitmap and
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 705
702 // State associated with the BeginSmoothScroll synthetic scrolling function. 706 // State associated with the BeginSmoothScroll synthetic scrolling function.
703 SmoothScrollCompletionCallback pending_smooth_scroll_gesture_; 707 SmoothScrollCompletionCallback pending_smooth_scroll_gesture_;
704 708
705 // Specified whether the compositor will run in its own thread. 709 // Specified whether the compositor will run in its own thread.
706 bool is_threaded_compositing_enabled_; 710 bool is_threaded_compositing_enabled_;
707 711
708 // Specifies whether overscroll notifications are forwarded to the host. 712 // Specifies whether overscroll notifications are forwarded to the host.
709 bool overscroll_notifications_enabled_; 713 bool overscroll_notifications_enabled_;
710 714
715 // The last set of rendering stats received from the browser. This is only
716 // received when using the --enable-gpu-benchmarking flag.
717 BrowserRenderingStats browser_rendering_stats_;
718
711 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_; 719 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_;
712 720
713 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 721 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
714 }; 722 };
715 723
716 } // namespace content 724 } // namespace content
717 725
718 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 726 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_
OLDNEW
« no previous file with comments | « content/renderer/gpu/gpu_benchmarking_extension.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698