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/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 "cc/rendering_stats.h" |
17 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
18 #include "content/renderer/paint_aggregator.h" | 19 #include "content/renderer/paint_aggregator.h" |
19 #include "ipc/ipc_listener.h" | 20 #include "ipc/ipc_listener.h" |
20 #include "ipc/ipc_sender.h" | 21 #include "ipc/ipc_sender.h" |
21 #include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h
" | |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextInputInfo.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextInputInfo.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidgetClient.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidgetClient.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
28 #include "third_party/skia/include/core/SkBitmap.h" | 28 #include "third_party/skia/include/core/SkBitmap.h" |
29 #include "ui/base/ime/text_input_type.h" | 29 #include "ui/base/ime/text_input_type.h" |
30 #include "ui/base/range/range.h" | 30 #include "ui/base/range/range.h" |
31 #include "ui/gfx/native_widget_types.h" | 31 #include "ui/gfx/native_widget_types.h" |
32 #include "ui/gfx/rect.h" | 32 #include "ui/gfx/rect.h" |
33 #include "ui/gfx/vector2d.h" | 33 #include "ui/gfx/vector2d.h" |
34 #include "ui/surface/transport_dib.h" | 34 #include "ui/surface/transport_dib.h" |
35 #include "webkit/glue/webcursor.h" | 35 #include "webkit/glue/webcursor.h" |
36 | 36 |
37 struct ViewHostMsg_UpdateRect_Params; | 37 struct ViewHostMsg_UpdateRect_Params; |
38 class ViewHostMsg_UpdateRect; | 38 class ViewHostMsg_UpdateRect; |
39 | 39 |
40 namespace IPC { | 40 namespace IPC { |
41 class SyncMessage; | 41 class SyncMessage; |
42 } | 42 } |
43 | 43 |
44 namespace WebKit { | 44 namespace WebKit { |
45 class WebGestureEvent; | 45 class WebGestureEvent; |
46 class WebMouseEvent; | 46 class WebMouseEvent; |
| 47 struct WebRenderingStatsImpl; |
47 class WebTouchEvent; | 48 class WebTouchEvent; |
48 } | 49 } |
49 | 50 |
50 namespace skia { | 51 namespace skia { |
51 class PlatformCanvas; | 52 class PlatformCanvas; |
52 } | 53 } |
53 | 54 |
54 namespace ui { | 55 namespace ui { |
55 class Range; | 56 class Range; |
56 } | 57 } |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 virtual void resetInputMethod(); | 145 virtual void resetInputMethod(); |
145 | 146 |
146 // Called when a plugin is moved. These events are queued up and sent with | 147 // Called when a plugin is moved. These events are queued up and sent with |
147 // the next paint or scroll message to the host. | 148 // the next paint or scroll message to the host. |
148 void SchedulePluginMove(const webkit::npapi::WebPluginGeometry& move); | 149 void SchedulePluginMove(const webkit::npapi::WebPluginGeometry& move); |
149 | 150 |
150 // Called when a plugin window has been destroyed, to make sure the currently | 151 // Called when a plugin window has been destroyed, to make sure the currently |
151 // pending moves don't try to reference it. | 152 // pending moves don't try to reference it. |
152 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); | 153 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); |
153 | 154 |
154 // Fills in a WebRenderingStats struct containing information about | 155 // Fills in a WebRenderingStatsImpl struct containing information about |
155 // rendering, e.g. count of frames rendered, time spent painting. | 156 // rendering, e.g. count of frames rendered, time spent painting. |
156 // This call is relatively expensive in threaded compositing mode, | 157 // This call is relatively expensive in threaded compositing mode, |
157 // as it blocks on the compositor thread. | 158 // as it blocks on the compositor thread. |
158 void GetRenderingStats(WebKit::WebRenderingStats&) const; | 159 void GetRenderingStats(WebKit::WebRenderingStatsImpl&) const; |
159 | 160 |
160 // Fills in a GpuRenderingStats struct containing information about | 161 // Fills in a GpuRenderingStats struct containing information about |
161 // GPU rendering, e.g. count of texture uploads performed, time spent | 162 // GPU rendering, e.g. count of texture uploads performed, time spent |
162 // uploading. | 163 // uploading. |
163 // This call is relatively expensive as it blocks on the GPU process | 164 // This call is relatively expensive as it blocks on the GPU process |
164 bool GetGpuRenderingStats(GpuRenderingStats*) const; | 165 bool GetGpuRenderingStats(GpuRenderingStats*) const; |
165 | 166 |
166 // Callback for use with BeginSmoothScroll. | 167 // Callback for use with BeginSmoothScroll. |
167 typedef base::Callback<void()> SmoothScrollCompletionCallback; | 168 typedef base::Callback<void()> SmoothScrollCompletionCallback; |
168 | 169 |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 bool is_accelerated_compositing_active_; | 586 bool is_accelerated_compositing_active_; |
586 | 587 |
587 base::OneShotTimer<RenderWidget> animation_timer_; | 588 base::OneShotTimer<RenderWidget> animation_timer_; |
588 base::Time animation_floor_time_; | 589 base::Time animation_floor_time_; |
589 bool animation_update_pending_; | 590 bool animation_update_pending_; |
590 bool invalidation_task_posted_; | 591 bool invalidation_task_posted_; |
591 | 592 |
592 bool has_disable_gpu_vsync_switch_; | 593 bool has_disable_gpu_vsync_switch_; |
593 base::TimeTicks last_do_deferred_update_time_; | 594 base::TimeTicks last_do_deferred_update_time_; |
594 | 595 |
595 WebKit::WebRenderingStats software_stats_; | 596 cc::RenderingStats software_stats_; |
596 | 597 |
597 // UpdateRect parameters for the current compositing pass. This is used to | 598 // UpdateRect parameters for the current compositing pass. This is used to |
598 // pass state between DoDeferredUpdate and OnSwapBuffersPosted. | 599 // pass state between DoDeferredUpdate and OnSwapBuffersPosted. |
599 scoped_ptr<ViewHostMsg_UpdateRect_Params> pending_update_params_; | 600 scoped_ptr<ViewHostMsg_UpdateRect_Params> pending_update_params_; |
600 | 601 |
601 // Queue of UpdateRect messages corresponding to a SwapBuffers. We want to | 602 // Queue of UpdateRect messages corresponding to a SwapBuffers. We want to |
602 // delay sending of UpdateRect until the corresponding SwapBuffers has been | 603 // delay sending of UpdateRect until the corresponding SwapBuffers has been |
603 // executed. Since we can have several in flight, we need to keep them in a | 604 // executed. Since we can have several in flight, we need to keep them in a |
604 // queue. Note: some SwapBuffers may not correspond to an update, in which | 605 // queue. Note: some SwapBuffers may not correspond to an update, in which |
605 // case NULL is added to the queue. | 606 // case NULL is added to the queue. |
(...skipping 17 matching lines...) Expand all Loading... |
623 | 624 |
624 // Specified whether the compositor will run in its own thread. | 625 // Specified whether the compositor will run in its own thread. |
625 bool is_threaded_compositing_enabled_; | 626 bool is_threaded_compositing_enabled_; |
626 | 627 |
627 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 628 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
628 }; | 629 }; |
629 | 630 |
630 } // namespace content | 631 } // namespace content |
631 | 632 |
632 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 633 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |