OLD | NEW |
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/gtk_util.h" | 5 #include "chrome/browser/ui/gtk/gtk_util.h" |
6 | 6 |
7 #include <cairo/cairo.h> | 7 #include <cairo/cairo.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cstdarg> | 10 #include <cstdarg> |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 cairo_rectangle(cr, | 737 cairo_rectangle(cr, |
738 tabstrip_origin.x(), | 738 tabstrip_origin.x(), |
739 tabstrip_origin.y(), | 739 tabstrip_origin.y(), |
740 event->area.x + event->area.width - tabstrip_origin.x(), | 740 event->area.x + event->area.width - tabstrip_origin.x(), |
741 event->area.y + event->area.height - tabstrip_origin.y()); | 741 event->area.y + event->area.height - tabstrip_origin.y()); |
742 cairo_fill(cr); | 742 cairo_fill(cr); |
743 } | 743 } |
744 | 744 |
745 void DrawFullImage(cairo_t* cr, | 745 void DrawFullImage(cairo_t* cr, |
746 GtkWidget* widget, | 746 GtkWidget* widget, |
747 const gfx::Image* image, | 747 const gfx::Image& image, |
748 gint dest_x, | 748 gint dest_x, |
749 gint dest_y) { | 749 gint dest_y) { |
750 gfx::CairoCachedSurface* surface = image->ToCairo(); | 750 gfx::CairoCachedSurface* surface = image.ToCairo(); |
751 surface->SetSource(cr, widget, dest_x, dest_y); | 751 surface->SetSource(cr, widget, dest_x, dest_y); |
752 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT); | 752 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT); |
753 cairo_rectangle(cr, dest_x, dest_y, surface->Width(), surface->Height()); | 753 cairo_rectangle(cr, dest_x, dest_y, surface->Width(), surface->Height()); |
754 cairo_fill(cr); | 754 cairo_fill(cr); |
755 } | 755 } |
756 | 756 |
757 GdkColor AverageColors(GdkColor color_one, GdkColor color_two) { | 757 GdkColor AverageColors(GdkColor color_one, GdkColor color_two) { |
758 GdkColor average_color; | 758 GdkColor average_color; |
759 average_color.pixel = 0; | 759 average_color.pixel = 0; |
760 average_color.red = (color_one.red + color_two.red) / 2; | 760 average_color.red = (color_one.red + color_two.red) / 2; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 if (gtk_window_get_modal(GTK_WINDOW(dialog))) { | 986 if (gtk_window_get_modal(GTK_WINDOW(dialog))) { |
987 // Work around a KDE 3 window manager bug. | 987 // Work around a KDE 3 window manager bug. |
988 scoped_ptr<base::Environment> env(base::Environment::Create()); | 988 scoped_ptr<base::Environment> env(base::Environment::Create()); |
989 if (base::nix::DESKTOP_ENVIRONMENT_KDE3 == | 989 if (base::nix::DESKTOP_ENVIRONMENT_KDE3 == |
990 base::nix::GetDesktopEnvironment(env.get())) | 990 base::nix::GetDesktopEnvironment(env.get())) |
991 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); | 991 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); |
992 } | 992 } |
993 } | 993 } |
994 | 994 |
995 } // namespace gtk_util | 995 } // namespace gtk_util |
OLD | NEW |