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

Side by Side Diff: webkit/tools/test_shell/webwidget_host_win.cc

Issue 6007006: Support for requestAnimationFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months 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 | « webkit/tools/test_shell/webwidget_host_gtk.cc ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "webkit/tools/test_shell/webwidget_host.h" 5 #include "webkit/tools/test_shell/webwidget_host.h"
6 6
7 #include "app/win/hwnd_util.h" 7 #include "app/win/hwnd_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "gfx/rect.h" 9 #include "gfx/rect.h"
10 #include "skia/ext/platform_canvas.h" 10 #include "skia/ext/platform_canvas.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 gfx::Rect client_rect(r); 235 gfx::Rect client_rect(r);
236 236
237 // Allocate a canvas if necessary 237 // Allocate a canvas if necessary
238 if (!canvas_.get()) { 238 if (!canvas_.get()) {
239 ResetScrollRect(); 239 ResetScrollRect();
240 paint_rect_ = client_rect; 240 paint_rect_ = client_rect;
241 canvas_.reset(new skia::PlatformCanvas( 241 canvas_.reset(new skia::PlatformCanvas(
242 paint_rect_.width(), paint_rect_.height(), true)); 242 paint_rect_.width(), paint_rect_.height(), true));
243 } 243 }
244 244
245 webwidget_->animate();
246
245 // This may result in more invalidation 247 // This may result in more invalidation
246 webwidget_->layout(); 248 webwidget_->layout();
247 249
248 // Scroll the canvas if necessary 250 // Scroll the canvas if necessary
249 scroll_rect_ = client_rect.Intersect(scroll_rect_); 251 scroll_rect_ = client_rect.Intersect(scroll_rect_);
250 if (!scroll_rect_.IsEmpty()) { 252 if (!scroll_rect_.IsEmpty()) {
251 HDC hdc = canvas_->getTopPlatformDevice().getBitmapDC(); 253 HDC hdc = canvas_->getTopPlatformDevice().getBitmapDC();
252 254
253 RECT damaged_rect, r = scroll_rect_.ToRECT(); 255 RECT damaged_rect, r = scroll_rect_.ToRECT();
254 ScrollDC(hdc, scroll_dx_, scroll_dy_, NULL, &r, NULL, &damaged_rect); 256 ScrollDC(hdc, scroll_dx_, scroll_dy_, NULL, &r, NULL, &damaged_rect);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { 373 void WebWidgetHost::PaintRect(const gfx::Rect& rect) {
372 #ifndef NDEBUG 374 #ifndef NDEBUG
373 DCHECK(!painting_); 375 DCHECK(!painting_);
374 #endif 376 #endif
375 DCHECK(canvas_.get()); 377 DCHECK(canvas_.get());
376 378
377 set_painting(true); 379 set_painting(true);
378 webwidget_->paint(canvas_.get(), rect); 380 webwidget_->paint(canvas_.get(), rect);
379 set_painting(false); 381 set_painting(false);
380 } 382 }
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/webwidget_host_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698