| 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();
|
|
|