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

Side by Side Diff: chrome/browser/renderer_host/backing_store_x.cc

Issue 4319003: Replace TabContentsViewGtk with TabContentsViewViews as part of the ongoing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Applied all comments and dealt with the move from chrome/browser/views to chrome/browser/ui/views Created 10 years, 1 month 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) 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::Rect& rect, XID target) {
434 XShowRect(gfx::Point(0, 0), rect, target);
435 }
436
437 void BackingStoreX::XShowRect(const gfx::Point &origin,
438 const gfx::Rect& rect, XID target) {
434 XCopyArea(display_, pixmap_, target, static_cast<GC>(pixmap_gc_), 439 XCopyArea(display_, pixmap_, target, static_cast<GC>(pixmap_gc_),
435 rect.x(), rect.y(), rect.width(), rect.height(), 440 rect.x(), rect.y(), rect.width(), rect.height(),
436 rect.x(), rect.y()); 441 rect.x() + origin.x(), rect.y() + origin.y());
437 } 442 }
438 443
439 void BackingStoreX::CairoShowRect(const gfx::Rect& rect, 444 void BackingStoreX::CairoShowRect(const gfx::Rect& rect,
440 GdkDrawable* drawable) { 445 GdkDrawable* drawable) {
441 cairo_surface_t* surface = cairo_xlib_surface_create( 446 cairo_surface_t* surface = cairo_xlib_surface_create(
442 display_, pixmap_, static_cast<Visual*>(visual_), 447 display_, pixmap_, static_cast<Visual*>(visual_),
443 size().width(), size().height()); 448 size().width(), size().height());
444 cairo_t* cr = gdk_cairo_create(drawable); 449 cairo_t* cr = gdk_cairo_create(drawable);
445 cairo_set_source_surface(cr, surface, 0, 0); 450 cairo_set_source_surface(cr, surface, 0, 0);
446 451
(...skipping 20 matching lines...) Expand all
467 cairo_set_source(cr, pattern); 472 cairo_set_source(cr, pattern);
468 cairo_pattern_destroy(pattern); 473 cairo_pattern_destroy(pattern);
469 474
470 cairo_identity_matrix(cr); 475 cairo_identity_matrix(cr);
471 476
472 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height()); 477 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
473 cairo_fill(cr); 478 cairo_fill(cr);
474 cairo_destroy(cr); 479 cairo_destroy(cr);
475 } 480 }
476 #endif 481 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698