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

Unified Diff: webkit/tools/test_shell/webwidget_host_win.cc

Issue 21192: Add support for the "repaint" layout tests (LayoutTests/fast/repaint/*), whic... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: webkit/tools/test_shell/webwidget_host_win.cc
===================================================================
--- webkit/tools/test_shell/webwidget_host_win.cc (revision 9433)
+++ webkit/tools/test_shell/webwidget_host_win.cc (working copy)
@@ -207,6 +207,11 @@
}
void WebWidgetHost::Paint() {
+ PaintToCanvas();
+ PaintCanvasToView();
+}
+
+void WebWidgetHost::PaintToCanvas() {
RECT r;
GetClientRect(view_, &r);
gfx::Rect client_rect(r);
@@ -248,8 +253,9 @@
}
}
DCHECK(paint_rect_.IsEmpty());
+}
- // Paint to the screen
+void WebWidgetHost::PaintCanvasToView() {
PAINTSTRUCT ps;
BeginPaint(view_, &ps);
canvas_->getTopPlatformDevice().drawToHDC(ps.hdc,
@@ -262,6 +268,16 @@
UpdateWindow(view_);
}
+void WebWidgetHost::DisplayForRepaint() {
+ PaintToCanvas();
+
+ // Paint a gray mask over everything for the repaint Layout tests.
+ const SkColor kMaskColor = SkColorSetARGB(168, 0, 0, 0); // alpha=0.66
+ canvas_->drawColor(kMaskColor, SkPorterDuff::kSrcOver_Mode);
+
+ PaintCanvasToView();
+}
+
void WebWidgetHost::Resize(LPARAM lparam) {
// Force an entire re-paint. TODO(darin): Maybe reuse this memory buffer.
DiscardBackingStore();
« webkit/tools/test_shell/webwidget_host.h ('K') | « 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