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 <vector> | 9 #include <vector> |
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/time.h" | 15 #include "base/time.h" |
16 #include "base/timer.h" | 16 #include "base/timer.h" |
17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
18 #include "content/renderer/paint_aggregator.h" | 18 #include "content/renderer/paint_aggregator.h" |
19 #include "ipc/ipc_channel.h" | 19 #include "ipc/ipc_channel.h" |
| 20 #include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h
" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidgetClient.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidgetClient.h" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
25 #include "third_party/skia/include/core/SkBitmap.h" | 26 #include "third_party/skia/include/core/SkBitmap.h" |
26 #include "ui/base/ime/text_input_type.h" | 27 #include "ui/base/ime/text_input_type.h" |
27 #include "ui/base/range/range.h" | 28 #include "ui/base/range/range.h" |
28 #include "ui/gfx/native_widget_types.h" | 29 #include "ui/gfx/native_widget_types.h" |
29 #include "ui/gfx/rect.h" | 30 #include "ui/gfx/rect.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 virtual void resetInputMethod(); | 146 virtual void resetInputMethod(); |
146 | 147 |
147 // Called when a plugin is moved. These events are queued up and sent with | 148 // Called when a plugin is moved. These events are queued up and sent with |
148 // the next paint or scroll message to the host. | 149 // the next paint or scroll message to the host. |
149 void SchedulePluginMove(const webkit::npapi::WebPluginGeometry& move); | 150 void SchedulePluginMove(const webkit::npapi::WebPluginGeometry& move); |
150 | 151 |
151 // Called when a plugin window has been destroyed, to make sure the currently | 152 // Called when a plugin window has been destroyed, to make sure the currently |
152 // pending moves don't try to reference it. | 153 // pending moves don't try to reference it. |
153 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); | 154 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); |
154 | 155 |
| 156 // Fills in a WebRenderingStats struct containing information about |
| 157 // rendering, e.g. count of frames rendered, time spent painting. |
| 158 // This call is relatively expensive in accelerated threaded mode, |
| 159 // as it blocks on the compositor thread. |
| 160 void GetRenderingStats(WebKit::WebRenderingStats&) const; |
| 161 |
155 // Directs the host to begin a smooth scroll. This scroll should have the same | 162 // Directs the host to begin a smooth scroll. This scroll should have the same |
156 // performance characteristics as a user-initiated scroll. | 163 // performance characteristics as a user-initiated scroll. |
157 void BeginSmoothScroll(bool scroll_down, bool scroll_far); | 164 void BeginSmoothScroll(bool scroll_down, bool scroll_far); |
158 | 165 |
159 // Close the underlying WebWidget. | 166 // Close the underlying WebWidget. |
160 virtual void Close(); | 167 virtual void Close(); |
161 | 168 |
162 float filtered_time_per_frame() const { | 169 float filtered_time_per_frame() const { |
163 return filtered_time_per_frame_; | 170 return filtered_time_per_frame_; |
164 } | 171 } |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 bool is_accelerated_compositing_active_; | 543 bool is_accelerated_compositing_active_; |
537 | 544 |
538 base::OneShotTimer<RenderWidget> animation_timer_; | 545 base::OneShotTimer<RenderWidget> animation_timer_; |
539 base::Time animation_floor_time_; | 546 base::Time animation_floor_time_; |
540 bool animation_update_pending_; | 547 bool animation_update_pending_; |
541 bool invalidation_task_posted_; | 548 bool invalidation_task_posted_; |
542 | 549 |
543 bool has_disable_gpu_vsync_switch_; | 550 bool has_disable_gpu_vsync_switch_; |
544 base::TimeTicks last_do_deferred_update_time_; | 551 base::TimeTicks last_do_deferred_update_time_; |
545 | 552 |
| 553 WebKit::WebRenderingStats software_stats_; |
| 554 |
546 // UpdateRect parameters for the current compositing pass. This is used to | 555 // UpdateRect parameters for the current compositing pass. This is used to |
547 // pass state between DoDeferredUpdate and OnSwapBuffersPosted. | 556 // pass state between DoDeferredUpdate and OnSwapBuffersPosted. |
548 scoped_ptr<ViewHostMsg_UpdateRect_Params> pending_update_params_; | 557 scoped_ptr<ViewHostMsg_UpdateRect_Params> pending_update_params_; |
549 | 558 |
550 // Queue of UpdateRect messages corresponding to a SwapBuffers. We want to | 559 // Queue of UpdateRect messages corresponding to a SwapBuffers. We want to |
551 // delay sending of UpdateRect until the corresponding SwapBuffers has been | 560 // delay sending of UpdateRect until the corresponding SwapBuffers has been |
552 // executed. Since we can have several in flight, we need to keep them in a | 561 // executed. Since we can have several in flight, we need to keep them in a |
553 // queue. Note: some SwapBuffers may not correspond to an update, in which | 562 // queue. Note: some SwapBuffers may not correspond to an update, in which |
554 // case NULL is added to the queue. | 563 // case NULL is added to the queue. |
555 std::deque<ViewHostMsg_UpdateRect*> updates_pending_swap_; | 564 std::deque<ViewHostMsg_UpdateRect*> updates_pending_swap_; |
556 | 565 |
557 // Properties of the screen hosting this RenderWidget instance. | 566 // Properties of the screen hosting this RenderWidget instance. |
558 WebKit::WebScreenInfo screen_info_; | 567 WebKit::WebScreenInfo screen_info_; |
559 | 568 |
560 // The device scale factor. This value is computed from the DPI entries in | 569 // The device scale factor. This value is computed from the DPI entries in |
561 // |screen_info_| on some platforms, and defaults to 1 on other platforms. | 570 // |screen_info_| on some platforms, and defaults to 1 on other platforms. |
562 float device_scale_factor_; | 571 float device_scale_factor_; |
563 | 572 |
564 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 573 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
565 }; | 574 }; |
566 | 575 |
567 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 576 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |