diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-26 00:47:59 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-26 00:47:59 +0000 |
commit | ad02174ccfde818097757bef93c9ae6ea62c68bd (patch) | |
tree | 3d7190ae70d55bec354bab112ee6bcbcad7e29ad | |
parent | 05af3561d9685d9b54e4d2e4fe35b2c69bd6bec0 (diff) | |
download | chromium_src-ad02174ccfde818097757bef93c9ae6ea62c68bd.zip chromium_src-ad02174ccfde818097757bef93c9ae6ea62c68bd.tar.gz chromium_src-ad02174ccfde818097757bef93c9ae6ea62c68bd.tar.bz2 |
Move skia_utils_gtk.cc/.h to app/gfx/. Original patch by Thiago Farina (see http://codereview.chromium.org/660063 ), r=me.
BUG=22853
TEST=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40083 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | app/app_base.gypi | 4 | ||||
-rw-r--r-- | app/gfx/skia_utils_gtk.cc (renamed from skia/ext/skia_utils_gtk.cc) | 8 | ||||
-rw-r--r-- | app/gfx/skia_utils_gtk.h (renamed from skia/ext/skia_utils_gtk.h) | 12 | ||||
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc | 6 | ||||
-rw-r--r-- | chrome/browser/chromeos/options/settings_page_view.cc | 6 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/download_item_gtk.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/gtk_theme_provider.cc | 4 | ||||
-rw-r--r-- | skia/skia.gyp | 4 | ||||
-rw-r--r-- | views/controls/tabbed_pane/native_tabbed_pane_gtk.cc | 6 | ||||
-rw-r--r-- | views/controls/textfield/native_textfield_gtk.cc | 8 | ||||
-rw-r--r-- | views/window/dialog_client_view.cc | 6 |
12 files changed, 36 insertions, 36 deletions
diff --git a/app/app_base.gypi b/app/app_base.gypi index 81305aa..9c41cce 100644 --- a/app/app_base.gypi +++ b/app/app_base.gypi @@ -1,4 +1,4 @@ -# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -152,6 +152,8 @@ 'gfx/skbitmap_operations.h', 'gfx/skia_util.cc', 'gfx/skia_util.h', + 'gfx/skia_utils_gtk.cc', + 'gfx/skia_utils_gtk.h', 'gfx/text_elider.cc', 'gfx/text_elider.h', 'gtk_dnd_util.cc', diff --git a/skia/ext/skia_utils_gtk.cc b/app/gfx/skia_utils_gtk.cc index da56374..3937d46 100644 --- a/skia/ext/skia_utils_gtk.cc +++ b/app/gfx/skia_utils_gtk.cc @@ -1,12 +1,12 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "skia/ext/skia_utils_gtk.h" +#include "app/gfx/skia_utils_gtk.h" #include <gdk/gdkcolor.h> -namespace skia { +namespace gfx { const int kSkiaToGDKMultiplier = 257; @@ -29,4 +29,4 @@ GdkColor SkColorToGdkColor(SkColor color) { return gdk_color; } -} // namespace +} // namespace gfx diff --git a/skia/ext/skia_utils_gtk.h b/app/gfx/skia_utils_gtk.h index c9e993d..df68581 100644 --- a/skia/ext/skia_utils_gtk.h +++ b/app/gfx/skia_utils_gtk.h @@ -1,15 +1,15 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef SKIA_EXT_SKIA_UTILS_GTK_H_ -#define SKIA_EXT_SKIA_UTILS_GTK_H_ +#ifndef APP_GFX_SKIA_UTILS_GTK_H_ +#define APP_GFX_SKIA_UTILS_GTK_H_ #include "third_party/skia/include/core/SkColor.h" typedef struct _GdkColor GdkColor; -namespace skia { +namespace gfx { // Converts GdkColors to the ARGB layout Skia expects. SkColor GdkColorToSkColor(GdkColor color); @@ -17,6 +17,6 @@ SkColor GdkColorToSkColor(GdkColor color); // Converts ARGB to GdkColor. GdkColor SkColorToGdkColor(SkColor color); -} // namespace skia +} // namespace gfx -#endif // SKIA_EXT_SKIA_UTILS_GTK_H_ +#endif // APP_GFX_SKIA_UTILS_GTK_H_ diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc index 2d0a458..9b0b902 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -33,8 +33,8 @@ #include "net/base/escape.h" #if defined(TOOLKIT_VIEWS) +#include "app/gfx/skia_utils_gtk.h" #include "chrome/browser/views/location_bar_view.h" -#include "skia/ext/skia_utils_gtk.h" #else #include "chrome/browser/gtk/gtk_theme_provider.h" #include "chrome/browser/gtk/location_bar_view_gtk.h" @@ -595,7 +595,7 @@ void AutocompleteEditViewGtk::SetBaseColor() { &style->text[GTK_STATE_NORMAL], NULL); } else { #if defined(TOOLKIT_VIEWS) - const GdkColor background_color = skia::SkColorToGdkColor( + const GdkColor background_color = gfx::SkColorToGdkColor( LocationBarView::GetColor(is_secure, LocationBarView::BACKGROUND)); gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL, &background_color); diff --git a/chrome/browser/chromeos/options/settings_page_view.cc b/chrome/browser/chromeos/options/settings_page_view.cc index 3fddf1f..e1df169 100644 --- a/chrome/browser/chromeos/options/settings_page_view.cc +++ b/chrome/browser/chromeos/options/settings_page_view.cc @@ -1,10 +1,10 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/chromeos/options/settings_page_view.h" -#include "skia/ext/skia_utils_gtk.h" +#include "app/gfx/skia_utils_gtk.h" #include "views/controls/label.h" #include "views/fill_layout.h" #include "views/widget/widget_gtk.h" @@ -24,7 +24,7 @@ GtkWidget* SettingsPageView::WrapInGtkWidget() { // Set to a solid background with the same color as the widget's bg color. GtkStyle* window_style = gtk_widget_get_style(widget->GetNativeView()); set_background(views::Background::CreateSolidBackground( - skia::GdkColorToSkColor(window_style->bg[GTK_STATE_NORMAL]))); + gfx::GdkColorToSkColor(window_style->bg[GTK_STATE_NORMAL]))); widget->Show(); // Removing the widget from the container results in unref'ing the widget. We // need to ref here otherwise the removal deletes the widget. The caller ends diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 1521eca..258dcc6 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -10,6 +10,7 @@ #include "app/gfx/color_utils.h" #include "app/gfx/gtk_util.h" +#include "app/gfx/skia_utils_gtk.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "app/theme_provider.h" @@ -84,7 +85,6 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" -#include "skia/ext/skia_utils_gtk.h" namespace { @@ -256,7 +256,7 @@ GdkCursorType GdkWindowEdgeToGdkCursorType(GdkWindowEdge edge) { } GdkColor SkColorToGdkColor(const SkColor& color) { - return skia::SkColorToGdkColor(color); + return gfx::SkColorToGdkColor(color); } // A helper method for setting the GtkWindow size that should be used in place diff --git a/chrome/browser/gtk/download_item_gtk.cc b/chrome/browser/gtk/download_item_gtk.cc index a71374b..3f4f32c 100644 --- a/chrome/browser/gtk/download_item_gtk.cc +++ b/chrome/browser/gtk/download_item_gtk.cc @@ -8,6 +8,7 @@ #include "app/gfx/canvas_paint.h" #include "app/gfx/color_utils.h" #include "app/gfx/font.h" +#include "app/gfx/skia_utils_gtk.h" #include "app/gfx/text_elider.h" #include "app/menus/simple_menu_model.h" #include "app/resource_bundle.h" @@ -32,7 +33,6 @@ #include "chrome/common/notification_service.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" -#include "skia/ext/skia_utils_gtk.h" #include "third_party/skia/include/core/SkBitmap.h" namespace { @@ -511,7 +511,7 @@ void DownloadItemGtk::UpdateStatusLabel(GtkWidget* status_label, // Lighten the color by blending it with the download item body color. These // values are taken from IDR_DOWNLOAD_BUTTON. SkColor blend_color = SkColorSetRGB(241, 245, 250); - text_color = skia::SkColorToGdkColor( + text_color = gfx::SkColorToGdkColor( color_utils::AlphaBlend(blend_color, color, 77)); } diff --git a/chrome/browser/gtk/gtk_theme_provider.cc b/chrome/browser/gtk/gtk_theme_provider.cc index 16adcdb..111b237 100644 --- a/chrome/browser/gtk/gtk_theme_provider.cc +++ b/chrome/browser/gtk/gtk_theme_provider.cc @@ -9,6 +9,7 @@ #include "app/gfx/color_utils.h" #include "app/gfx/gtk_util.h" #include "app/gfx/skbitmap_operations.h" +#include "app/gfx/skia_utils_gtk.h" #include "app/resource_bundle.h" #include "base/stl_util-inl.h" #include "chrome/browser/metrics/user_metrics.h" @@ -22,7 +23,6 @@ #include "chrome/common/notification_service.h" #include "chrome/common/notification_source.h" #include "chrome/common/notification_type.h" -#include "skia/ext/skia_utils_gtk.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkColor.h" @@ -220,7 +220,7 @@ bool GtkThemeProvider::UseGtkTheme() const { } GdkColor GtkThemeProvider::GetGdkColor(int id) const { - return skia::SkColorToGdkColor(GetColor(id)); + return gfx::SkColorToGdkColor(GetColor(id)); } GdkColor GtkThemeProvider::GetBorderColor() const { diff --git a/skia/skia.gyp b/skia/skia.gyp index d85f2a1..78a71ac 100644 --- a/skia/skia.gyp +++ b/skia/skia.gyp @@ -1,4 +1,4 @@ -# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -522,8 +522,6 @@ 'ext/platform_device_win.cc', 'ext/platform_device_win.h', 'ext/SkMemory_new_handler.cpp', - 'ext/skia_utils_gtk.cc', - 'ext/skia_utils_gtk.h', 'ext/skia_utils_mac.mm', 'ext/skia_utils_mac.h', 'ext/skia_utils_win.cc', diff --git a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc index 110a688..ffdeb5e 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,11 +8,11 @@ #include "app/gfx/canvas.h" #include "app/gfx/font.h" +#include "app/gfx/skia_utils_gtk.h" #include "app/resource_bundle.h" #include "base/logging.h" #include "base/stl_util-inl.h" #include "base/string_util.h" -#include "skia/ext/skia_utils_gtk.h" #include "views/background.h" #include "views/controls/tabbed_pane/tabbed_pane.h" #include "views/fill_layout.h" @@ -145,7 +145,7 @@ void NativeTabbedPaneGtk::DoAddTabAtIndex(int index, const std::wstring& title, gtk_widget_get_style(page_container->GetNativeView()); contents->set_background( Background::CreateSolidBackground( - skia::GdkColorToSkColor(window_style->bg[GTK_STATE_NORMAL]))); + gfx::GdkColorToSkColor(window_style->bg[GTK_STATE_NORMAL]))); } GtkWidget* page = page_container->GetNativeView(); diff --git a/views/controls/textfield/native_textfield_gtk.cc b/views/controls/textfield/native_textfield_gtk.cc index 026a6b7..e3732b5 100644 --- a/views/controls/textfield/native_textfield_gtk.cc +++ b/views/controls/textfield/native_textfield_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,8 +8,8 @@ #include "app/gfx/insets.h" #include "app/gfx/gtk_util.h" +#include "app/gfx/skia_utils_gtk.h" #include "base/string_util.h" -#include "skia/ext/skia_utils_gtk.h" #include "views/controls/textfield/textfield.h" namespace views { @@ -97,7 +97,7 @@ void NativeTextfieldGtk::UpdateTextColor() { gtk_widget_modify_text(native_view(), GTK_STATE_NORMAL, NULL); return; } - GdkColor gdk_color = skia::SkColorToGdkColor(textfield_->text_color()); + GdkColor gdk_color = gfx::SkColorToGdkColor(textfield_->text_color()); gtk_widget_modify_text(native_view(), GTK_STATE_NORMAL, &gdk_color); } @@ -108,7 +108,7 @@ void NativeTextfieldGtk::UpdateBackgroundColor() { gtk_widget_modify_base(native_view(), GTK_STATE_NORMAL, NULL); return; } - GdkColor gdk_color = skia::SkColorToGdkColor(textfield_->background_color()); + GdkColor gdk_color = gfx::SkColorToGdkColor(textfield_->background_color()); gtk_widget_modify_base(native_view(), GTK_STATE_NORMAL, &gdk_color); } diff --git a/views/window/dialog_client_view.cc b/views/window/dialog_client_view.cc index 3eac93c..f54ae32 100644 --- a/views/window/dialog_client_view.cc +++ b/views/window/dialog_client_view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,11 +16,11 @@ #include "app/gfx/canvas.h" #include "app/gfx/font.h" +#include "app/gfx/skia_utils_gtk.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/keyboard_codes.h" #include "grit/app_strings.h" -#include "skia/ext/skia_utils_gtk.h" #include "views/controls/button/native_button.h" #include "views/standard_layout.h" #include "views/window/dialog_delegate.h" @@ -300,7 +300,7 @@ void DialogClientView::Paint(gfx::Canvas* canvas) { GtkWidget* widget = GetWidget()->GetNativeView(); if (GTK_IS_WINDOW(widget)) { GtkStyle* window_style = gtk_widget_get_style(widget); - canvas->FillRectInt(skia::GdkColorToSkColor( + canvas->FillRectInt(gfx::GdkColorToSkColor( window_style->bg[GTK_STATE_NORMAL]), 0, 0, width(), height()); } |