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, 10 insertions, 3 deletions
diff --git a/chrome/browser/views/sad_tab_view.cc b/chrome/browser/views/sad_tab_view.cc index e22aea2..7b34bcb 100644 --- a/chrome/browser/views/sad_tab_view.cc +++ b/chrome/browser/views/sad_tab_view.cc @@ -10,7 +10,6 @@ #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; @@ -35,9 +34,17 @@ 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 = skia::CreateGradientShader( - 0, height(), kBackgroundColor, kBackgroundEndColor); + SkShader* background_shader = CreateGradientShader(height()); SkPaint paint; paint.setShader(background_shader); background_shader->unref(); |