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 #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/debug/trace_event_synthetic_delay.h" |
13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
15 #include "base/time/time.h" | 16 #include "base/time/time.h" |
16 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
17 #include "cc/debug/rendering_stats_instrumentation.h" | 18 #include "cc/debug/rendering_stats_instrumentation.h" |
18 #include "content/common/browser_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" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // Directs the host to begin a pinch gesture. This gesture should have the | 192 // Directs the host to begin a pinch gesture. This gesture should have the |
192 // same performance characteristics as a user-initiated pinch. | 193 // same performance characteristics as a user-initiated pinch. |
193 // |pixels_to_move|, |anchor_x| and |anchor_y| are expected to be in local | 194 // |pixels_to_move|, |anchor_x| and |anchor_y| are expected to be in local |
194 // DIP coordinates. | 195 // DIP coordinates. |
195 void BeginPinch(bool zoom_in, | 196 void BeginPinch(bool zoom_in, |
196 int pixels_to_move, | 197 int pixels_to_move, |
197 int anchor_x, | 198 int anchor_x, |
198 int anchor_y, | 199 int anchor_y, |
199 const SyntheticGestureCompletionCallback& callback); | 200 const SyntheticGestureCompletionCallback& callback); |
200 | 201 |
| 202 // Configure a synthetic delay across all processes. Once all processes have |
| 203 // acknowledged the new delay configuration, |callback| will be called back. |
| 204 typedef base::Callback<void()> SyntheticDelayConfigurationCallback; |
| 205 void ConfigureSyntheticDelay( |
| 206 const std::string& name, |
| 207 base::TimeDelta target_duration, |
| 208 base::debug::TraceEventSyntheticDelay::Mode mode, |
| 209 const SyntheticDelayConfigurationCallback& callback); |
| 210 |
201 // Close the underlying WebWidget. | 211 // Close the underlying WebWidget. |
202 virtual void Close(); | 212 virtual void Close(); |
203 | 213 |
204 // Notifies about a compositor frame commit operation having finished. | 214 // Notifies about a compositor frame commit operation having finished. |
205 virtual void DidCommitCompositorFrame(); | 215 virtual void DidCommitCompositorFrame(); |
206 | 216 |
207 float filtered_time_per_frame() const { | 217 float filtered_time_per_frame() const { |
208 return filtered_time_per_frame_; | 218 return filtered_time_per_frame_; |
209 } | 219 } |
210 | 220 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 int selection_end); | 361 int selection_end); |
352 virtual void OnImeConfirmComposition(const string16& text, | 362 virtual void OnImeConfirmComposition(const string16& text, |
353 const gfx::Range& replacement_range, | 363 const gfx::Range& replacement_range, |
354 bool keep_selection); | 364 bool keep_selection); |
355 void OnPaintAtSize(const TransportDIB::Handle& dib_id, | 365 void OnPaintAtSize(const TransportDIB::Handle& dib_id, |
356 int tag, | 366 int tag, |
357 const gfx::Size& page_size, | 367 const gfx::Size& page_size, |
358 const gfx::Size& desired_size); | 368 const gfx::Size& desired_size); |
359 void OnRepaint(gfx::Size size_to_paint); | 369 void OnRepaint(gfx::Size size_to_paint); |
360 void OnSyntheticGestureCompleted(); | 370 void OnSyntheticGestureCompleted(); |
| 371 void OnConfigureSyntheticDelayAck(); |
361 void OnSetTextDirection(blink::WebTextDirection direction); | 372 void OnSetTextDirection(blink::WebTextDirection direction); |
362 void OnGetFPS(); | 373 void OnGetFPS(); |
363 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, | 374 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, |
364 const gfx::Rect& window_screen_rect); | 375 const gfx::Rect& window_screen_rect); |
365 #if defined(OS_ANDROID) | 376 #if defined(OS_ANDROID) |
366 void OnShowImeIfNeeded(); | 377 void OnShowImeIfNeeded(); |
367 | 378 |
368 // Whenever an IME event that needs an acknowledgement is sent to the browser, | 379 // Whenever an IME event that needs an acknowledgement is sent to the browser, |
369 // the number of outstanding IME events that needs acknowledgement should be | 380 // the number of outstanding IME events that needs acknowledgement should be |
370 // incremented. All IME events will be dropped until we receive an ack from | 381 // incremented. All IME events will be dropped until we receive an ack from |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 blink::WebScreenInfo screen_info_; | 764 blink::WebScreenInfo screen_info_; |
754 | 765 |
755 // The device scale factor. This value is computed from the DPI entries in | 766 // The device scale factor. This value is computed from the DPI entries in |
756 // |screen_info_| on some platforms, and defaults to 1 on other platforms. | 767 // |screen_info_| on some platforms, and defaults to 1 on other platforms. |
757 float device_scale_factor_; | 768 float device_scale_factor_; |
758 | 769 |
759 // State associated with the synthetic gestures function | 770 // State associated with the synthetic gestures function |
760 // (e.g. BeginSmoothScroll). | 771 // (e.g. BeginSmoothScroll). |
761 SyntheticGestureCompletionCallback pending_synthetic_gesture_; | 772 SyntheticGestureCompletionCallback pending_synthetic_gesture_; |
762 | 773 |
| 774 SyntheticDelayConfigurationCallback pending_delay_configuration_; |
| 775 |
763 // Specified whether the compositor will run in its own thread. | 776 // Specified whether the compositor will run in its own thread. |
764 bool is_threaded_compositing_enabled_; | 777 bool is_threaded_compositing_enabled_; |
765 | 778 |
766 // The last set of rendering stats received from the browser. This is only | 779 // The last set of rendering stats received from the browser. This is only |
767 // received when using the --enable-gpu-benchmarking flag. | 780 // received when using the --enable-gpu-benchmarking flag. |
768 BrowserRenderingStats browser_rendering_stats_; | 781 BrowserRenderingStats browser_rendering_stats_; |
769 | 782 |
770 // The latency information for any current non-accelerated-compositing | 783 // The latency information for any current non-accelerated-compositing |
771 // frame. | 784 // frame. |
772 ui::LatencyInfo latency_info_; | 785 ui::LatencyInfo latency_info_; |
(...skipping 16 matching lines...) Expand all Loading... |
789 float popup_origin_scale_for_emulation_; | 802 float popup_origin_scale_for_emulation_; |
790 | 803 |
791 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; | 804 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; |
792 | 805 |
793 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 806 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
794 }; | 807 }; |
795 | 808 |
796 } // namespace content | 809 } // namespace content |
797 | 810 |
798 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 811 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |