OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <deque> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.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.h" | 16 #include "base/time.h" |
16 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
17 #include "content/renderer/paint_aggregator.h" | 18 #include "content/renderer/paint_aggregator.h" |
18 #include "ipc/ipc_channel.h" | 19 #include "ipc/ipc_channel.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.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/skia/include/core/SkBitmap.h" | 25 #include "third_party/skia/include/core/SkBitmap.h" |
25 #include "ui/base/ime/text_input_type.h" | 26 #include "ui/base/ime/text_input_type.h" |
26 #include "ui/gfx/native_widget_types.h" | 27 #include "ui/gfx/native_widget_types.h" |
27 #include "ui/gfx/rect.h" | 28 #include "ui/gfx/rect.h" |
28 #include "ui/gfx/size.h" | 29 #include "ui/gfx/size.h" |
29 #include "ui/gfx/surface/transport_dib.h" | 30 #include "ui/gfx/surface/transport_dib.h" |
30 #include "webkit/glue/webcursor.h" | 31 #include "webkit/glue/webcursor.h" |
31 | 32 |
| 33 struct ViewHostMsg_UpdateRect_Params; |
| 34 class ViewHostMsg_UpdateRect; |
| 35 |
32 namespace IPC { | 36 namespace IPC { |
33 class SyncMessage; | 37 class SyncMessage; |
34 } | 38 } |
35 | 39 |
36 namespace WebKit { | 40 namespace WebKit { |
37 class WebMouseEvent; | 41 class WebMouseEvent; |
38 class WebTouchEvent; | 42 class WebTouchEvent; |
39 class WebWidget; | 43 class WebWidget; |
40 } | 44 } |
41 | 45 |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should | 270 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should |
267 // use this method so that we can properly inform the RenderThread of our | 271 // use this method so that we can properly inform the RenderThread of our |
268 // state. | 272 // state. |
269 void SetHidden(bool hidden); | 273 void SetHidden(bool hidden); |
270 | 274 |
271 bool is_hidden() const { return is_hidden_; } | 275 bool is_hidden() const { return is_hidden_; } |
272 | 276 |
273 void WillToggleFullscreen(); | 277 void WillToggleFullscreen(); |
274 void DidToggleFullscreen(); | 278 void DidToggleFullscreen(); |
275 | 279 |
276 // True if an UpdateRect_ACK message is pending. | |
277 bool update_reply_pending() const { | |
278 return update_reply_pending_; | |
279 } | |
280 | |
281 bool next_paint_is_resize_ack() const; | 280 bool next_paint_is_resize_ack() const; |
282 bool next_paint_is_restore_ack() const; | 281 bool next_paint_is_restore_ack() const; |
283 void set_next_paint_is_resize_ack(); | 282 void set_next_paint_is_resize_ack(); |
284 void set_next_paint_is_restore_ack(); | 283 void set_next_paint_is_restore_ack(); |
285 void set_next_paint_is_repaint_ack(); | 284 void set_next_paint_is_repaint_ack(); |
286 | 285 |
287 // Checks if the text input state and compose inline mode have been changed. | 286 // Checks if the text input state and compose inline mode have been changed. |
288 // If they are changed, the new value will be sent to the browser process. | 287 // If they are changed, the new value will be sent to the browser process. |
289 void UpdateTextInputState(); | 288 void UpdateTextInputState(); |
290 | 289 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 bool is_accelerated_compositing_active_; | 462 bool is_accelerated_compositing_active_; |
464 | 463 |
465 base::Time animation_floor_time_; | 464 base::Time animation_floor_time_; |
466 bool animation_update_pending_; | 465 bool animation_update_pending_; |
467 bool animation_task_posted_; | 466 bool animation_task_posted_; |
468 bool invalidation_task_posted_; | 467 bool invalidation_task_posted_; |
469 | 468 |
470 bool has_disable_gpu_vsync_switch_; | 469 bool has_disable_gpu_vsync_switch_; |
471 base::TimeTicks last_do_deferred_update_time_; | 470 base::TimeTicks last_do_deferred_update_time_; |
472 | 471 |
| 472 // UpdateRect parameters for the current compositing pass. This is used to |
| 473 // pass state between DoDeferredUpdate and OnSwapBuffersPosted. |
| 474 scoped_ptr<ViewHostMsg_UpdateRect_Params> pending_update_params_; |
| 475 |
| 476 // Queue of UpdateRect messages corresponding to a SwapBuffers. We want to |
| 477 // delay sending of UpdateRect until the corresponding SwapBuffers has been |
| 478 // executed. Since we can have several in flight, we need to keep them in a |
| 479 // queue. Note: some SwapBuffers may not correspond to an update, in which |
| 480 // case NULL is added to the queue. |
| 481 std::deque<ViewHostMsg_UpdateRect*> updates_pending_swap_; |
| 482 |
473 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 483 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
474 }; | 484 }; |
475 | 485 |
476 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 486 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |