OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <cairo/cairo.h> | 7 #include <cairo/cairo.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
395 GdkRectangle grect = { | 395 GdkRectangle grect = { |
396 total_paint.x(), | 396 total_paint.x(), |
397 total_paint.y(), | 397 total_paint.y(), |
398 total_paint.width(), | 398 total_paint.width(), |
399 total_paint.height(), | 399 total_paint.height(), |
400 }; | 400 }; |
401 GdkWindow* window = view_->window; | 401 GdkWindow* window = view_->window; |
402 gdk_window_begin_paint_rect(window, &grect); | 402 gdk_window_begin_paint_rect(window, &grect); |
403 | 403 |
404 // BitBlit to the gdk window. | 404 // BitBlit to the gdk window. |
405 cairo_t* source_surface = canvas_->beginPlatformPaint(); | 405 cairo_t* source_surface = skia::BeginPlatformPaint(canvas_.get()); |
jamesr
2011/05/19 22:20:52
where's the EndPlatformPaint() for this call? Som
Jeff Timanus
2011/05/24 16:50:28
Thanks for catching that, James.
Fixed.
| |
406 cairo_t* cairo_drawable = gdk_cairo_create(window); | 406 cairo_t* cairo_drawable = gdk_cairo_create(window); |
407 cairo_set_source_surface(cairo_drawable, cairo_get_target(source_surface), | 407 cairo_set_source_surface(cairo_drawable, cairo_get_target(source_surface), |
408 0, 0); | 408 0, 0); |
409 cairo_paint(cairo_drawable); | 409 cairo_paint(cairo_drawable); |
410 cairo_destroy(cairo_drawable); | 410 cairo_destroy(cairo_drawable); |
411 | 411 |
412 gdk_window_end_paint(window); | 412 gdk_window_end_paint(window); |
413 } | 413 } |
414 | 414 |
415 WebScreenInfo WebWidgetHost::GetScreenInfo() { | 415 WebScreenInfo WebWidgetHost::GetScreenInfo() { |
416 Display* display = test_shell_x11::GtkWidgetGetDisplay(view_); | 416 Display* display = test_shell_x11::GtkWidgetGetDisplay(view_); |
417 int screen_num = test_shell_x11::GtkWidgetGetScreenNum(view_); | 417 int screen_num = test_shell_x11::GtkWidgetGetScreenNum(view_); |
418 return WebScreenInfoFactory::screenInfo(display, screen_num); | 418 return WebScreenInfoFactory::screenInfo(display, screen_num); |
419 } | 419 } |
420 | 420 |
421 void WebWidgetHost::ResetScrollRect() { | 421 void WebWidgetHost::ResetScrollRect() { |
422 // This method is only needed for optimized scroll painting, which we don't | 422 // This method is only needed for optimized scroll painting, which we don't |
423 // care about in the test shell, yet. | 423 // care about in the test shell, yet. |
424 } | 424 } |
425 | 425 |
426 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { | 426 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { |
427 set_painting(true); | 427 set_painting(true); |
428 webwidget_->paint(canvas_.get(), rect); | 428 webwidget_->paint(canvas_.get(), rect); |
429 set_painting(false); | 429 set_painting(false); |
430 } | 430 } |
431 | 431 |
432 void WebWidgetHost::WindowDestroyed() { | 432 void WebWidgetHost::WindowDestroyed() { |
433 delete this; | 433 delete this; |
434 } | 434 } |
OLD | NEW |