Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(642)

Side by Side Diff: content/renderer/render_widget.h

Issue 8498036: Delay UpdateRect until the SwapBuffers callback when accelerated compositing is on. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: allow multiple update messages in flight Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/view_messages.h ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/platform/WebRect.h" 22 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should 271 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should
268 // use this method so that we can properly inform the RenderThread of our 272 // use this method so that we can properly inform the RenderThread of our
269 // state. 273 // state.
270 void SetHidden(bool hidden); 274 void SetHidden(bool hidden);
271 275
272 bool is_hidden() const { return is_hidden_; } 276 bool is_hidden() const { return is_hidden_; }
273 277
274 void WillToggleFullscreen(); 278 void WillToggleFullscreen();
275 void DidToggleFullscreen(); 279 void DidToggleFullscreen();
276 280
277 // True if an UpdateRect_ACK message is pending.
278 bool update_reply_pending() const {
279 return update_reply_pending_;
280 }
281
282 bool next_paint_is_resize_ack() const; 281 bool next_paint_is_resize_ack() const;
283 bool next_paint_is_restore_ack() const; 282 bool next_paint_is_restore_ack() const;
284 void set_next_paint_is_resize_ack(); 283 void set_next_paint_is_resize_ack();
285 void set_next_paint_is_restore_ack(); 284 void set_next_paint_is_restore_ack();
286 void set_next_paint_is_repaint_ack(); 285 void set_next_paint_is_repaint_ack();
287 286
288 // Checks if the text input state and compose inline mode have been changed. 287 // Checks if the text input state and compose inline mode have been changed.
289 // If they are changed, the new value will be sent to the browser process. 288 // If they are changed, the new value will be sent to the browser process.
290 void UpdateTextInputState(); 289 void UpdateTextInputState();
291 290
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 bool is_accelerated_compositing_active_; 463 bool is_accelerated_compositing_active_;
465 464
466 base::Time animation_floor_time_; 465 base::Time animation_floor_time_;
467 bool animation_update_pending_; 466 bool animation_update_pending_;
468 bool animation_task_posted_; 467 bool animation_task_posted_;
469 bool invalidation_task_posted_; 468 bool invalidation_task_posted_;
470 469
471 bool has_disable_gpu_vsync_switch_; 470 bool has_disable_gpu_vsync_switch_;
472 base::TimeTicks last_do_deferred_update_time_; 471 base::TimeTicks last_do_deferred_update_time_;
473 472
473 // UpdateRect parameters for the current compositing pass. This is used to
474 // pass state between DoDeferredUpdate and OnSwapBuffersPosted.
475 scoped_ptr<ViewHostMsg_UpdateRect_Params> pending_update_params_;
476
477 // Queue of UpdateRect messages corresponding to a SwapBuffers. We want to
478 // delay sending of UpdateRect until the corresponding SwapBuffers has been
479 // executed. Since we can have several in flight, we need to keep them in a
480 // queue. Note: some SwapBuffers may not correspond to an update, in which
481 // case NULL is added to the queue.
482 std::deque<ViewHostMsg_UpdateRect*> updates_pending_swap_;
483
474 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 484 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
475 }; 485 };
476 486
477 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 487 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_
OLDNEW
« no previous file with comments | « content/common/view_messages.h ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698