| Index: webkit/tools/test_shell/webwidget_host_gtk.cc
|
| ===================================================================
|
| --- webkit/tools/test_shell/webwidget_host_gtk.cc (revision 9433)
|
| +++ webkit/tools/test_shell/webwidget_host_gtk.cc (working copy)
|
| @@ -278,6 +278,11 @@
|
| }
|
|
|
| void WebWidgetHost::Paint() {
|
| + PaintToCanvas();
|
| + PaintCanvasToView();
|
| +}
|
| +
|
| +void WebWidgetHost::PaintToCanvas() {
|
| int width = view_->allocation.width;
|
| int height = view_->allocation.height;
|
| gfx::Rect client_rect(width, height);
|
| @@ -316,14 +321,17 @@
|
| }
|
| DCHECK(paint_rect_.IsEmpty());
|
|
|
| +}
|
| +
|
| +void WebWidgetHost::PaintCanvasToView() {
|
| // Invalidate the paint region on the widget's underlying gdk window. Note
|
| // that gdk_window_invalidate_* will generate extra expose events, which
|
| // we wish to avoid. So instead we use calls to begin_paint/end_paint.
|
| GdkRectangle grect = {
|
| - total_paint.x(),
|
| - total_paint.y(),
|
| - total_paint.width(),
|
| - total_paint.height(),
|
| + 0,
|
| + 0,
|
| + canvas_->width(),
|
| + canvas_->height(),
|
| };
|
| GdkWindow* window = view_->window;
|
| gdk_window_begin_paint_rect(window, &grect);
|
| @@ -340,6 +348,16 @@
|
| gdk_window_end_paint(window);
|
| }
|
|
|
| +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::ResetScrollRect() {
|
| // This method is only needed for optimized scroll painting, which we don't
|
| // care about in the test shell, yet.
|
|
|