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

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

Issue 403005: Refactors RenderWidget to extract a PaintAggregator class.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | « chrome/renderer/paint_aggregator_unittest.cc ('k') | chrome/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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 CHROME_RENDERER_RENDER_WIDGET_H_ 5 #ifndef CHROME_RENDERER_RENDER_WIDGET_H_
6 #define CHROME_RENDERER_RENDER_WIDGET_H_ 6 #define CHROME_RENDERER_RENDER_WIDGET_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "app/gfx/native_widget_types.h" 10 #include "app/gfx/native_widget_types.h"
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/gfx/point.h" 12 #include "base/gfx/point.h"
13 #include "base/gfx/rect.h" 13 #include "base/gfx/rect.h"
14 #include "base/gfx/size.h" 14 #include "base/gfx/size.h"
15 #include "base/ref_counted.h" 15 #include "base/ref_counted.h"
16 #include "base/shared_memory.h" 16 #include "base/shared_memory.h"
17 #include "chrome/renderer/paint_aggregator.h"
17 #include "chrome/renderer/render_process.h" 18 #include "chrome/renderer/render_process.h"
18 #include "ipc/ipc_channel.h" 19 #include "ipc/ipc_channel.h"
19 #include "skia/ext/platform_canvas.h" 20 #include "skia/ext/platform_canvas.h"
20 #include "third_party/skia/include/core/SkBitmap.h" 21 #include "third_party/skia/include/core/SkBitmap.h"
21 #include "third_party/WebKit/WebKit/chromium/public/WebCompositionCommand.h" 22 #include "third_party/WebKit/WebKit/chromium/public/WebCompositionCommand.h"
22 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" 23 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h"
23 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" 24 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h"
24 #include "third_party/WebKit/WebKit/chromium/public/WebWidgetClient.h" 25 #include "third_party/WebKit/WebKit/chromium/public/WebWidgetClient.h"
25 #include "webkit/glue/webcursor.h" 26 #include "webkit/glue/webcursor.h"
26 27
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 void Init(int32 opener_id); 114 void Init(int32 opener_id);
114 115
115 // Finishes creation of a pending view started with Init. 116 // Finishes creation of a pending view started with Init.
116 void CompleteInit(gfx::NativeViewId parent); 117 void CompleteInit(gfx::NativeViewId parent);
117 118
118 // Paints the given rectangular region of the WebWidget into canvas (a 119 // Paints the given rectangular region of the WebWidget into canvas (a
119 // shared memory segment returned by AllocPaintBuf on Windows). The caller 120 // shared memory segment returned by AllocPaintBuf on Windows). The caller
120 // must ensure that the given rect fits within the bounds of the WebWidget. 121 // must ensure that the given rect fits within the bounds of the WebWidget.
121 void PaintRect(const gfx::Rect& rect, skia::PlatformCanvas* canvas); 122 void PaintRect(const gfx::Rect& rect, skia::PlatformCanvas* canvas);
122 123
123 void CallDoDeferredPaint(); 124 void CallDoDeferredUpdate();
124 void DoDeferredPaint(); 125 void DoDeferredUpdate();
125 void CallDoDeferredScroll();
126 void DoDeferredScroll();
127 void DoDeferredClose(); 126 void DoDeferredClose();
128 void DoDeferredSetWindowRect(const WebKit::WebRect& pos); 127 void DoDeferredSetWindowRect(const WebKit::WebRect& pos);
129 128
130 // Set the background of the render widget to a bitmap. The bitmap will be 129 // Set the background of the render widget to a bitmap. The bitmap will be
131 // tiled in both directions if it isn't big enough to fill the area. This is 130 // tiled in both directions if it isn't big enough to fill the area. This is
132 // mainly intended to be used in conjuction with WebView::SetIsTransparent(). 131 // mainly intended to be used in conjuction with WebView::SetIsTransparent().
133 virtual void SetBackground(const SkBitmap& bitmap); 132 virtual void SetBackground(const SkBitmap& bitmap);
134 133
135 // RenderWidget IPC message handlers 134 // RenderWidget IPC message handlers
136 void OnClose(); 135 void OnClose();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 WebCursor current_cursor_; 232 WebCursor current_cursor_;
234 233
235 // The size of the RenderWidget. 234 // The size of the RenderWidget.
236 gfx::Size size_; 235 gfx::Size size_;
237 236
238 // Transport DIBs that are currently in use to transfer an image to the 237 // Transport DIBs that are currently in use to transfer an image to the
239 // browser. 238 // browser.
240 TransportDIB* current_paint_buf_; 239 TransportDIB* current_paint_buf_;
241 TransportDIB* current_scroll_buf_; 240 TransportDIB* current_scroll_buf_;
242 241
243 // The smallest bounding rectangle that needs to be re-painted. This is non- 242 PaintAggregator paint_aggregator_;
244 // empty if a paint event is pending.
245 gfx::Rect paint_rect_;
246
247 // The clip rect for the pending scroll event. This is non-empty if a
248 // scroll event is pending.
249 gfx::Rect scroll_rect_;
250 243
251 // The area that must be reserved for drawing the resize corner. 244 // The area that must be reserved for drawing the resize corner.
252 gfx::Rect resizer_rect_; 245 gfx::Rect resizer_rect_;
253 246
254 // The scroll delta for a pending scroll event.
255 gfx::Point scroll_delta_;
256
257 // Flags for the next ViewHostMsg_PaintRect message. 247 // Flags for the next ViewHostMsg_PaintRect message.
258 int next_paint_flags_; 248 int next_paint_flags_;
259 249
260 // True if we are expecting a PaintRect_ACK message (i.e., that a PaintRect 250 // True if we are expecting a PaintRect_ACK message (i.e., that a PaintRect
261 // message has been sent). 251 // message has been sent).
262 bool paint_reply_pending_; 252 bool paint_reply_pending_;
263 253
264 // Set to true if we should ignore RenderWidget::Show calls. 254 // Set to true if we should ignore RenderWidget::Show calls.
265 bool did_show_; 255 bool did_show_;
266 256
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 WebKit::WebRect pending_window_rect_; 309 WebKit::WebRect pending_window_rect_;
320 310
321 scoped_ptr<ViewHostMsg_ShowPopup_Params> popup_params_; 311 scoped_ptr<ViewHostMsg_ShowPopup_Params> popup_params_;
322 312
323 scoped_ptr<IPC::Message> pending_input_event_ack_; 313 scoped_ptr<IPC::Message> pending_input_event_ack_;
324 314
325 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 315 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
326 }; 316 };
327 317
328 #endif // CHROME_RENDERER_RENDER_WIDGET_H_ 318 #endif // CHROME_RENDERER_RENDER_WIDGET_H_
OLDNEW
« no previous file with comments | « chrome/renderer/paint_aggregator_unittest.cc ('k') | chrome/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698