diff options
Diffstat (limited to 'chrome/browser/views/sad_tab_view.cc')
-rw-r--r-- | chrome/browser/views/sad_tab_view.cc | 13 |
1 files changed, 3 insertions, 10 deletions
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(); |