OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/backing_store_x.h" | 5 #include "chrome/browser/renderer_host/backing_store_x.h" |
6 | 6 |
7 #include <cairo-xlib.h> | 7 #include <cairo-xlib.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <sys/ipc.h> | 10 #include <sys/ipc.h> |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 std::max(clip_rect.x(), clip_rect.x() - dx), | 423 std::max(clip_rect.x(), clip_rect.x() - dx), |
424 clip_rect.y() /* source y */, | 424 clip_rect.y() /* source y */, |
425 clip_rect.width() - abs(dx), | 425 clip_rect.width() - abs(dx), |
426 clip_rect.height(), | 426 clip_rect.height(), |
427 std::max(clip_rect.x(), clip_rect.x() + dx) /* dest x */, | 427 std::max(clip_rect.x(), clip_rect.x() + dx) /* dest x */, |
428 clip_rect.y() /* dest x */); | 428 clip_rect.y() /* dest x */); |
429 } | 429 } |
430 } | 430 } |
431 } | 431 } |
432 | 432 |
433 void BackingStoreX::XShowRect(const gfx::Rect& rect, XID target) { | 433 void BackingStoreX::XShowRect(const gfx::Point &origin, |
| 434 const gfx::Rect& rect, XID target) { |
434 XCopyArea(display_, pixmap_, target, static_cast<GC>(pixmap_gc_), | 435 XCopyArea(display_, pixmap_, target, static_cast<GC>(pixmap_gc_), |
435 rect.x(), rect.y(), rect.width(), rect.height(), | 436 rect.x(), rect.y(), rect.width(), rect.height(), |
436 rect.x(), rect.y()); | 437 rect.x() + origin.x(), rect.y() + origin.y()); |
437 } | 438 } |
438 | 439 |
439 void BackingStoreX::CairoShowRect(const gfx::Rect& rect, | 440 void BackingStoreX::CairoShowRect(const gfx::Rect& rect, |
440 GdkDrawable* drawable) { | 441 GdkDrawable* drawable) { |
441 cairo_surface_t* surface = cairo_xlib_surface_create( | 442 cairo_surface_t* surface = cairo_xlib_surface_create( |
442 display_, pixmap_, static_cast<Visual*>(visual_), | 443 display_, pixmap_, static_cast<Visual*>(visual_), |
443 size().width(), size().height()); | 444 size().width(), size().height()); |
444 cairo_t* cr = gdk_cairo_create(drawable); | 445 cairo_t* cr = gdk_cairo_create(drawable); |
445 cairo_set_source_surface(cr, surface, 0, 0); | 446 cairo_set_source_surface(cr, surface, 0, 0); |
446 | 447 |
(...skipping 20 matching lines...) Expand all Loading... |
467 cairo_set_source(cr, pattern); | 468 cairo_set_source(cr, pattern); |
468 cairo_pattern_destroy(pattern); | 469 cairo_pattern_destroy(pattern); |
469 | 470 |
470 cairo_identity_matrix(cr); | 471 cairo_identity_matrix(cr); |
471 | 472 |
472 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height()); | 473 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height()); |
473 cairo_fill(cr); | 474 cairo_fill(cr); |
474 cairo_destroy(cr); | 475 cairo_destroy(cr); |
475 } | 476 } |
476 #endif | 477 #endif |
OLD | NEW |