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/Platform/chromium/public/WebRenderingStats.h " |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextInputInfo.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextInputInfo.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidgetClient.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidgetClient.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
28 #include "third_party/skia/include/core/SkBitmap.h" | 29 #include "third_party/skia/include/core/SkBitmap.h" |
29 #include "ui/base/ime/text_input_type.h" | 30 #include "ui/base/ime/text_input_type.h" |
30 #include "ui/base/range/range.h" | 31 #include "ui/base/range/range.h" |
31 #include "ui/gfx/native_widget_types.h" | 32 #include "ui/gfx/native_widget_types.h" |
32 #include "ui/gfx/rect.h" | 33 #include "ui/gfx/rect.h" |
33 #include "ui/gfx/vector2d.h" | 34 #include "ui/gfx/vector2d.h" |
34 #include "ui/surface/transport_dib.h" | 35 #include "ui/surface/transport_dib.h" |
35 #include "webkit/glue/webcursor.h" | 36 #include "webkit/glue/webcursor.h" |
36 | 37 |
37 struct ViewHostMsg_UpdateRect_Params; | 38 struct ViewHostMsg_UpdateRect_Params; |
38 class ViewHostMsg_UpdateRect; | 39 class ViewHostMsg_UpdateRect; |
39 | 40 |
40 namespace IPC { | 41 namespace IPC { |
41 class SyncMessage; | 42 class SyncMessage; |
42 } | 43 } |
43 | 44 |
45 namespace cc { | |
46 struct RenderingStats; | |
47 } | |
Ian Vollick
2012/11/13 21:26:06
Don't think you need to forward declare this if yo
hartmanng
2012/11/13 21:42:53
Done.
| |
48 | |
44 namespace WebKit { | 49 namespace WebKit { |
45 class WebGestureEvent; | 50 class WebGestureEvent; |
46 class WebMouseEvent; | 51 class WebMouseEvent; |
47 class WebTouchEvent; | 52 class WebTouchEvent; |
48 } | 53 } |
49 | 54 |
50 namespace skia { | 55 namespace skia { |
51 class PlatformCanvas; | 56 class PlatformCanvas; |
52 } | 57 } |
53 | 58 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 void SchedulePluginMove(const webkit::npapi::WebPluginGeometry& move); | 153 void SchedulePluginMove(const webkit::npapi::WebPluginGeometry& move); |
149 | 154 |
150 // Called when a plugin window has been destroyed, to make sure the currently | 155 // Called when a plugin window has been destroyed, to make sure the currently |
151 // pending moves don't try to reference it. | 156 // pending moves don't try to reference it. |
152 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); | 157 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); |
153 | 158 |
154 // Fills in a WebRenderingStats struct containing information about | 159 // Fills in a WebRenderingStats struct containing information about |
155 // rendering, e.g. count of frames rendered, time spent painting. | 160 // rendering, e.g. count of frames rendered, time spent painting. |
156 // This call is relatively expensive in threaded compositing mode, | 161 // This call is relatively expensive in threaded compositing mode, |
157 // as it blocks on the compositor thread. | 162 // as it blocks on the compositor thread. |
163 #ifdef NOT_USING_WEB_RENDERING_STATS | |
164 void GetRenderingStats(cc::RenderingStats&) const; | |
165 #else | |
158 void GetRenderingStats(WebKit::WebRenderingStats&) const; | 166 void GetRenderingStats(WebKit::WebRenderingStats&) const; |
167 #endif // NOT_USING_WEB_RENDERING_STATS | |
159 | 168 |
160 // Fills in a GpuRenderingStats struct containing information about | 169 // Fills in a GpuRenderingStats struct containing information about |
161 // GPU rendering, e.g. count of texture uploads performed, time spent | 170 // GPU rendering, e.g. count of texture uploads performed, time spent |
162 // uploading. | 171 // uploading. |
163 // This call is relatively expensive as it blocks on the GPU process | 172 // This call is relatively expensive as it blocks on the GPU process |
164 bool GetGpuRenderingStats(GpuRenderingStats*) const; | 173 bool GetGpuRenderingStats(GpuRenderingStats*) const; |
165 | 174 |
166 // Callback for use with BeginSmoothScroll. | 175 // Callback for use with BeginSmoothScroll. |
167 typedef base::Callback<void()> SmoothScrollCompletionCallback; | 176 typedef base::Callback<void()> SmoothScrollCompletionCallback; |
168 | 177 |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
585 bool is_accelerated_compositing_active_; | 594 bool is_accelerated_compositing_active_; |
586 | 595 |
587 base::OneShotTimer<RenderWidget> animation_timer_; | 596 base::OneShotTimer<RenderWidget> animation_timer_; |
588 base::Time animation_floor_time_; | 597 base::Time animation_floor_time_; |
589 bool animation_update_pending_; | 598 bool animation_update_pending_; |
590 bool invalidation_task_posted_; | 599 bool invalidation_task_posted_; |
591 | 600 |
592 bool has_disable_gpu_vsync_switch_; | 601 bool has_disable_gpu_vsync_switch_; |
593 base::TimeTicks last_do_deferred_update_time_; | 602 base::TimeTicks last_do_deferred_update_time_; |
594 | 603 |
604 #ifdef NOT_USING_WEB_RENDERING_STATS | |
605 cc::RenderingStats software_stats_; | |
606 #else | |
595 WebKit::WebRenderingStats software_stats_; | 607 WebKit::WebRenderingStats software_stats_; |
608 #endif // NOT_USING_WEB_RENDERING_STATS | |
596 | 609 |
597 // UpdateRect parameters for the current compositing pass. This is used to | 610 // UpdateRect parameters for the current compositing pass. This is used to |
598 // pass state between DoDeferredUpdate and OnSwapBuffersPosted. | 611 // pass state between DoDeferredUpdate and OnSwapBuffersPosted. |
599 scoped_ptr<ViewHostMsg_UpdateRect_Params> pending_update_params_; | 612 scoped_ptr<ViewHostMsg_UpdateRect_Params> pending_update_params_; |
600 | 613 |
601 // Queue of UpdateRect messages corresponding to a SwapBuffers. We want to | 614 // Queue of UpdateRect messages corresponding to a SwapBuffers. We want to |
602 // delay sending of UpdateRect until the corresponding SwapBuffers has been | 615 // 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 | 616 // 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 | 617 // queue. Note: some SwapBuffers may not correspond to an update, in which |
605 // case NULL is added to the queue. | 618 // case NULL is added to the queue. |
(...skipping 17 matching lines...) Expand all Loading... | |
623 | 636 |
624 // Specified whether the compositor will run in its own thread. | 637 // Specified whether the compositor will run in its own thread. |
625 bool is_threaded_compositing_enabled_; | 638 bool is_threaded_compositing_enabled_; |
626 | 639 |
627 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 640 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
628 }; | 641 }; |
629 | 642 |
630 } // namespace content | 643 } // namespace content |
631 | 644 |
632 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 645 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |