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

Side by Side Diff: chrome/browser/ui/gtk/browser_toolbar_gtk.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 years, 2 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/gtk/browser_toolbar_gtk.h" 5 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #include <X11/XF86keysym.h> 9 #include <X11/XF86keysym.h>
10 10
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 allocation.y - kShadowThickness, 517 allocation.y - kShadowThickness,
518 kCornerWidth, 518 kCornerWidth,
519 allocation.height + kShadowThickness); 519 allocation.height + kShadowThickness);
520 gfx::Rect left(allocation.x - kShadowThickness, 520 gfx::Rect left(allocation.x - kShadowThickness,
521 allocation.y - kShadowThickness, 521 allocation.y - kShadowThickness,
522 kCornerWidth, 522 kCornerWidth,
523 allocation.height + kShadowThickness); 523 allocation.height + kShadowThickness);
524 524
525 if (window_->ShouldDrawContentDropShadow()) { 525 if (window_->ShouldDrawContentDropShadow()) {
526 // Leave room to draw rounded corners. 526 // Leave room to draw rounded corners.
527 area = area.Subtract(right).Subtract(left); 527 area.Subtract(right);
528 area.Subtract(left);
528 } 529 }
529 530
530 gfx::Image background = theme_service_->GetImageNamed(IDR_THEME_TOOLBAR); 531 gfx::Image background = theme_service_->GetImageNamed(IDR_THEME_TOOLBAR);
531 background.ToCairo()->SetSource( 532 background.ToCairo()->SetSource(
532 cr, widget, tabstrip_origin.x(), tabstrip_origin.y()); 533 cr, widget, tabstrip_origin.x(), tabstrip_origin.y());
533 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT); 534 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT);
534 cairo_rectangle(cr, area.x(), area.y(), area.width(), area.height()); 535 cairo_rectangle(cr, area.x(), area.y(), area.width(), area.height());
535 cairo_fill(cr); 536 cairo_fill(cr);
536 537
537 if (!window_->ShouldDrawContentDropShadow()) { 538 if (!window_->ShouldDrawContentDropShadow()) {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 const gfx::ImageSkia* badge = theme_service_->GetImageSkiaNamed(resource_id); 698 const gfx::ImageSkia* badge = theme_service_->GetImageSkiaNamed(resource_id);
698 gfx::CanvasSkiaPaint canvas(expose, false); 699 gfx::CanvasSkiaPaint canvas(expose, false);
699 int x_offset = base::i18n::IsRTL() ? 0 : allocation.width - badge->width(); 700 int x_offset = base::i18n::IsRTL() ? 0 : allocation.width - badge->width();
700 int y_offset = 0; 701 int y_offset = 0;
701 canvas.DrawImageInt(*badge, 702 canvas.DrawImageInt(*badge,
702 allocation.x + x_offset, 703 allocation.x + x_offset,
703 allocation.y + y_offset); 704 allocation.y + y_offset);
704 705
705 return FALSE; 706 return FALSE;
706 } 707 }
OLDNEW
« no previous file with comments | « chrome/browser/notifications/balloon_collection_impl.cc ('k') | chrome/browser/ui/panels/panel_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698