OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "views/painter.h" | 5 #include "views/painter.h" |
6 | 6 |
7 #include "app/gfx/chrome_canvas.h" | 7 #include "app/gfx/chrome_canvas.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "skia/include/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
11 #include "skia/include/SkGradientShader.h" | 11 #include "third_party/skia/include/effects/SkGradientShader.h" |
12 | 12 |
13 namespace views { | 13 namespace views { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 class GradientPainter : public Painter { | 17 class GradientPainter : public Painter { |
18 public: | 18 public: |
19 GradientPainter(bool horizontal, const SkColor& top, const SkColor& bottom) | 19 GradientPainter(bool horizontal, const SkColor& top, const SkColor& bottom) |
20 : horizontal_(horizontal) { | 20 : horizontal_(horizontal) { |
21 colors_[0] = top; | 21 colors_[0] = top; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 canvas->DrawBitmapInt(*images_[LEFT], 0, 0); | 156 canvas->DrawBitmapInt(*images_[LEFT], 0, 0); |
157 canvas->DrawBitmapInt(*images_[RIGHT], w - images_[RIGHT]->width(), 0); | 157 canvas->DrawBitmapInt(*images_[RIGHT], w - images_[RIGHT]->width(), 0); |
158 canvas->TileImageInt(*images_[CENTER], | 158 canvas->TileImageInt(*images_[CENTER], |
159 images_[LEFT]->width(), | 159 images_[LEFT]->width(), |
160 0, | 160 0, |
161 w - images_[LEFT]->width() - images_[RIGHT]->width(), | 161 w - images_[LEFT]->width() - images_[RIGHT]->width(), |
162 height_); | 162 height_); |
163 } | 163 } |
164 | 164 |
165 } // namespace views | 165 } // namespace views |
OLD | NEW |