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

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

Issue 7019013: Removal of dependencies on PlatformDevice classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Syncing merge conflicts. Created 9 years, 7 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
OLDNEW
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
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 skia::ScopedPlatformPaint scoped_platform_paint(canvas_.get());
406 cairo_t* source_surface = scoped_platform_paint.GetPlatformSurface();
406 cairo_t* cairo_drawable = gdk_cairo_create(window); 407 cairo_t* cairo_drawable = gdk_cairo_create(window);
407 cairo_set_source_surface(cairo_drawable, cairo_get_target(source_surface), 408 cairo_set_source_surface(cairo_drawable, cairo_get_target(source_surface),
408 0, 0); 409 0, 0);
409 cairo_paint(cairo_drawable); 410 cairo_paint(cairo_drawable);
410 cairo_destroy(cairo_drawable); 411 cairo_destroy(cairo_drawable);
411 412
412 gdk_window_end_paint(window); 413 gdk_window_end_paint(window);
413 } 414 }
414 415
415 WebScreenInfo WebWidgetHost::GetScreenInfo() { 416 WebScreenInfo WebWidgetHost::GetScreenInfo() {
416 Display* display = test_shell_x11::GtkWidgetGetDisplay(view_); 417 Display* display = test_shell_x11::GtkWidgetGetDisplay(view_);
417 int screen_num = test_shell_x11::GtkWidgetGetScreenNum(view_); 418 int screen_num = test_shell_x11::GtkWidgetGetScreenNum(view_);
418 return WebScreenInfoFactory::screenInfo(display, screen_num); 419 return WebScreenInfoFactory::screenInfo(display, screen_num);
419 } 420 }
420 421
421 void WebWidgetHost::ResetScrollRect() { 422 void WebWidgetHost::ResetScrollRect() {
422 // This method is only needed for optimized scroll painting, which we don't 423 // This method is only needed for optimized scroll painting, which we don't
423 // care about in the test shell, yet. 424 // care about in the test shell, yet.
424 } 425 }
425 426
426 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { 427 void WebWidgetHost::PaintRect(const gfx::Rect& rect) {
427 set_painting(true); 428 set_painting(true);
428 webwidget_->paint(canvas_.get(), rect); 429 webwidget_->paint(canvas_.get(), rect);
429 set_painting(false); 430 set_painting(false);
430 } 431 }
431 432
432 void WebWidgetHost::WindowDestroyed() { 433 void WebWidgetHost::WindowDestroyed() {
433 delete this; 434 delete this;
434 } 435 }
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/test_shell_webthemecontrol.cc ('k') | webkit/tools/test_shell/webwidget_host_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698