summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-02 22:35:42 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-02 22:35:42 +0000
commit004a96a015b5dfcadaad4ea1b192c97c415b75de (patch)
treecb32d3809e4366c07e837416a106a3083d2690a5 /chrome/browser/views
parentf8ed412acb7bcab9855d0ebd9d29f7e38a3a8f92 (diff)
downloadchromium_src-004a96a015b5dfcadaad4ea1b192c97c415b75de.zip
chromium_src-004a96a015b5dfcadaad4ea1b192c97c415b75de.tar.gz
chromium_src-004a96a015b5dfcadaad4ea1b192c97c415b75de.tar.bz2
Move convolver, image_operations, and skia_utils from base/gfx to skia/ext.
This changes the namespace in those files from "gfx" to "skia". I split skia_utils into two parts, the Windows specific part is now in a separate file called skia_utils_win. There were several obsolete includes of these headers which I removed. I also removed img_resize_perftest which isn't used and has bitrotted. Review URL: http://codereview.chromium.org/12842 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6248 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/bookmark_bar_view.cc30
-rw-r--r--chrome/browser/views/bookmark_manager_view.cc5
-rw-r--r--chrome/browser/views/options/content_page_view.cc4
-rw-r--r--chrome/browser/views/options/fonts_page_view.cc1
-rw-r--r--chrome/browser/views/options/languages_page_view.cc1
-rw-r--r--chrome/browser/views/options/options_group_view.cc1
-rw-r--r--chrome/browser/views/sad_tab_view.cc13
-rw-r--r--chrome/browser/views/tabs/tab_renderer.cc8
8 files changed, 26 insertions, 37 deletions
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc
index aaca5af..49d817b 100644
--- a/chrome/browser/views/bookmark_bar_view.cc
+++ b/chrome/browser/views/bookmark_bar_view.cc
@@ -7,7 +7,6 @@
#include <limits>
#include "base/base_drag_source.h"
-#include "base/gfx/skia_utils.h"
#include "chrome/app/theme/theme_resources.h"
#include "chrome/browser/bookmarks/bookmark_context_menu.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
@@ -45,6 +44,7 @@
#include "chrome/views/widget.h"
#include "chrome/views/window.h"
#include "generated_resources.h"
+#include "skia/ext/skia_utils.h"
using views::BaseButton;
using views::DropTargetEvent;
@@ -255,7 +255,7 @@ class BookmarkButton : public views::TextButton {
// the parent's actual bounds because they differ from what is painted.
SkPaint paint;
paint.setAlpha(static_cast<int>((1.0 - animation_value) * 255));
- paint.setShader(gfx::CreateGradientShader(0,
+ paint.setShader(skia::CreateGradientShader(0,
view->height() + kTopMargin + kBottomMargin,
kTopBorderColor,
kBackgroundColor))->safeUnref();
@@ -603,16 +603,16 @@ class ButtonSeparatorView : public views::View {
virtual void Paint(ChromeCanvas* canvas) {
SkPaint paint;
- paint.setShader(gfx::CreateGradientShader(0,
- height() / 2,
- kTopBorderColor,
- kSeparatorColor))->safeUnref();
+ paint.setShader(skia::CreateGradientShader(0,
+ height() / 2,
+ kTopBorderColor,
+ kSeparatorColor))->safeUnref();
SkRect rc = {SkIntToScalar(kSeparatorStartX), SkIntToScalar(0),
SkIntToScalar(1), SkIntToScalar(height() / 2) };
canvas->drawRect(rc, paint);
SkPaint paint_down;
- paint_down.setShader(gfx::CreateGradientShader(height() / 2,
+ paint_down.setShader(skia::CreateGradientShader(height() / 2,
height(),
kSeparatorColor,
kBackgroundColor))->safeUnref();
@@ -904,10 +904,10 @@ void BookmarkBarView::Paint(ChromeCanvas* canvas) {
// Draw our background.
SkPaint paint;
paint.setAntiAlias(true);
- paint.setShader(gfx::CreateGradientShader(0,
- height(),
- kTopBorderColor,
- kBackgroundColor))->safeUnref();
+ paint.setShader(skia::CreateGradientShader(0,
+ height(),
+ kTopBorderColor,
+ kBackgroundColor))->safeUnref();
canvas->drawRoundRect(rect,
SkDoubleToScalar(roundness),
@@ -924,10 +924,10 @@ void BookmarkBarView::Paint(ChromeCanvas* canvas) {
SkDoubleToScalar(roundness), border_paint);
} else {
SkPaint paint;
- paint.setShader(gfx::CreateGradientShader(0,
- height(),
- kTopBorderColor,
- kBackgroundColor))->safeUnref();
+ paint.setShader(skia::CreateGradientShader(0,
+ height(),
+ kTopBorderColor,
+ kBackgroundColor))->safeUnref();
canvas->FillRectInt(0, 0, width(), height(), paint);
canvas->FillRectInt(kTopBorderColor, 0, 0, width(), 1);
diff --git a/chrome/browser/views/bookmark_manager_view.cc b/chrome/browser/views/bookmark_manager_view.cc
index c0c307e..684c252 100644
--- a/chrome/browser/views/bookmark_manager_view.cc
+++ b/chrome/browser/views/bookmark_manager_view.cc
@@ -6,7 +6,6 @@
#include <algorithm>
-#include "base/gfx/skia_utils.h"
#include "chrome/app/locales/locale_settings.h"
#include "chrome/browser/bookmarks/bookmark_folder_tree_model.h"
#include "chrome/browser/bookmarks/bookmark_html_writer.h"
@@ -31,8 +30,8 @@
#include "chrome/views/menu_button.h"
#include "chrome/views/single_split_view.h"
#include "chrome/views/window.h"
-
#include "generated_resources.h"
+#include "skia/ext/skia_utils.h"
// If non-null, there is an open editor and this is the window it is contained
// in it.
@@ -299,7 +298,7 @@ void BookmarkManagerView::PaintBackground(ChromeCanvas* canvas) {
canvas->drawColor(kBackgroundColorBottom, SkPorterDuff::kSrc_Mode);
SkPaint paint;
- paint.setShader(gfx::CreateGradientShader(0, kBackgroundGradientHeight,
+ paint.setShader(skia::CreateGradientShader(0, kBackgroundGradientHeight,
kBackgroundColorTop,
kBackgroundColorBottom))->safeUnref();
canvas->FillRectInt(0, 0, width(), kBackgroundGradientHeight, paint);
diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc
index e4e443d..a534a4b 100644
--- a/chrome/browser/views/options/content_page_view.cc
+++ b/chrome/browser/views/options/content_page_view.cc
@@ -11,7 +11,6 @@
#include "base/file_util.h"
#include "base/gfx/native_theme.h"
-#include "base/gfx/skia_utils.h"
#include "chrome/app/theme/theme_resources.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/shell_dialogs.h"
@@ -31,6 +30,7 @@
#include "chrome/views/text_field.h"
#include "chrome/views/widget.h"
#include "generated_resources.h"
+#include "skia/ext/skia_utils_win.h"
#include "skia/include/SkBitmap.h"
namespace {
@@ -102,7 +102,7 @@ void FileDisplayArea::Paint(ChromeCanvas* canvas) {
RECT rect = { 0, 0, width(), height() };
gfx::NativeTheme::instance()->PaintTextField(
dc, EP_EDITTEXT, ETS_READONLY, 0, &rect,
- gfx::SkColorToCOLORREF(text_field_background_color_), true, true);
+ skia::SkColorToCOLORREF(text_field_background_color_), true, true);
canvas->endPlatformPaint();
canvas->DrawBitmapInt(default_folder_icon_, icon_bounds_.x(),
icon_bounds_.y());
diff --git a/chrome/browser/views/options/fonts_page_view.cc b/chrome/browser/views/options/fonts_page_view.cc
index b41fb55..d73191b 100644
--- a/chrome/browser/views/options/fonts_page_view.cc
+++ b/chrome/browser/views/options/fonts_page_view.cc
@@ -10,7 +10,6 @@
#include "base/file_util.h"
#include "base/gfx/native_theme.h"
-#include "base/gfx/skia_utils.h"
#include "base/string_util.h"
#include "chrome/app/theme/theme_resources.h"
#include "chrome/app/locales/locale_settings.h"
diff --git a/chrome/browser/views/options/languages_page_view.cc b/chrome/browser/views/options/languages_page_view.cc
index 118ac10..e9a1e8b 100644
--- a/chrome/browser/views/options/languages_page_view.cc
+++ b/chrome/browser/views/options/languages_page_view.cc
@@ -11,7 +11,6 @@
#include "base/file_util.h"
#include "base/string_util.h"
#include "base/gfx/native_theme.h"
-#include "base/gfx/skia_utils.h"
#include "base/string_util.h"
#include "chrome/app/theme/theme_resources.h"
#include "chrome/browser/browser_process.h"
diff --git a/chrome/browser/views/options/options_group_view.cc b/chrome/browser/views/options/options_group_view.cc
index bdf76ea..9ff07f5 100644
--- a/chrome/browser/views/options/options_group_view.cc
+++ b/chrome/browser/views/options/options_group_view.cc
@@ -8,7 +8,6 @@
#include "chrome/browser/views/options/options_group_view.h"
#include "base/gfx/native_theme.h"
-#include "base/gfx/skia_utils.h"
#include "chrome/app/locales/locale_settings.h"
#include "chrome/browser/views/standard_layout.h"
#include "chrome/common/gfx/chrome_font.h"
diff --git a/chrome/browser/views/sad_tab_view.cc b/chrome/browser/views/sad_tab_view.cc
index 7b34bcb..e22aea2 100644
--- a/chrome/browser/views/sad_tab_view.cc
+++ b/chrome/browser/views/sad_tab_view.cc
@@ -10,6 +10,7 @@
#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
#include "generated_resources.h"
+#include "skia/ext/skia_utils.h"
#include "skia/include/SkGradientShader.h"
static const int kSadTabOffset = -64;
@@ -34,17 +35,9 @@ SadTabView::SadTabView() {
InitClass();
}
-static SkShader* CreateGradientShader(int end_point) {
- SkColor grad_colors[2] = { kBackgroundColor, kBackgroundEndColor };
- SkPoint grad_points[2];
- grad_points[0].set(SkIntToScalar(0), SkIntToScalar(0));
- grad_points[1].set(SkIntToScalar(0), SkIntToScalar(end_point));
- return SkGradientShader::CreateLinear(
- grad_points, grad_colors, NULL, 2, SkShader::kRepeat_TileMode);
-}
-
void SadTabView::Paint(ChromeCanvas* canvas) {
- SkShader* background_shader = CreateGradientShader(height());
+ SkShader* background_shader = skia::CreateGradientShader(
+ 0, height(), kBackgroundColor, kBackgroundEndColor);
SkPaint paint;
paint.setShader(background_shader);
background_shader->unref();
diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc
index f1d00b3..4581f6d 100644
--- a/chrome/browser/views/tabs/tab_renderer.cc
+++ b/chrome/browser/views/tabs/tab_renderer.cc
@@ -6,7 +6,6 @@
#include "chrome/browser/views/tabs/tab_renderer.h"
-#include "base/gfx/image_operations.h"
#include "chrome/app/theme/theme_resources.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/tabs/tab_strip_model.h"
@@ -17,6 +16,7 @@
#include "chrome/common/resource_bundle.h"
#include "chrome/common/win_util.h"
#include "generated_resources.h"
+#include "skia/ext/image_operations.h"
static const int kLeftPadding = 16;
static const int kTopPadding = 6;
@@ -586,13 +586,13 @@ void TabRenderer::PaintActiveTabBackground(ChromeCanvas* canvas) {
void TabRenderer::PaintHoverTabBackground(ChromeCanvas* canvas,
double opacity) {
bool is_otr = data_.off_the_record;
- SkBitmap left = gfx::ImageOperations::CreateBlendedBitmap(
+ SkBitmap left = skia::ImageOperations::CreateBlendedBitmap(
(is_otr ? *tab_inactive_otr_l : *tab_inactive_l),
*tab_hover_l, opacity);
- SkBitmap center = gfx::ImageOperations::CreateBlendedBitmap(
+ SkBitmap center = skia::ImageOperations::CreateBlendedBitmap(
(is_otr ? *tab_inactive_otr_c : *tab_inactive_c),
*tab_hover_c, opacity);
- SkBitmap right = gfx::ImageOperations::CreateBlendedBitmap(
+ SkBitmap right = skia::ImageOperations::CreateBlendedBitmap(
(is_otr ? *tab_inactive_otr_r : *tab_inactive_r),
*tab_hover_r, opacity);