| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/controls/button/border_images.h" | 5 #include "ui/views/controls/button/border_images.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
| 9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
| 10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
| 11 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
| 12 | 12 |
| 13 #define BORDER_IMAGES(x) x ## _TOP_LEFT, x ## _TOP, x ## _TOP_RIGHT, \ | |
| 14 x ## _LEFT, x ## _CENTER, x ## _RIGHT, \ | |
| 15 x ## _BOTTOM_LEFT, x ## _BOTTOM, x ## _BOTTOM_RIGHT, | |
| 16 | |
| 17 namespace views { | 13 namespace views { |
| 18 | 14 |
| 19 // static | 15 // static |
| 20 const int BorderImages::kHot[] = { BORDER_IMAGES(IDR_TEXTBUTTON_HOVER) }; | 16 const int BorderImages::kHot[] = { BORDER_IMAGES(IDR_TEXTBUTTON_HOVER) }; |
| 21 // static | 17 // static |
| 22 const int BorderImages::kPushed[] = { BORDER_IMAGES(IDR_TEXTBUTTON_PRESSED) }; | 18 const int BorderImages::kPushed[] = { BORDER_IMAGES(IDR_TEXTBUTTON_PRESSED) }; |
| 23 | 19 |
| 24 BorderImages::BorderImages() {} | 20 BorderImages::BorderImages() {} |
| 25 | 21 |
| 26 BorderImages::BorderImages(const int image_ids[]) { | 22 BorderImages::BorderImages(const int image_ids[]) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 canvas->TileImageInt(left, x[0], y[1], x[1] - x[0], y[2] - y[1]); | 54 canvas->TileImageInt(left, x[0], y[1], x[1] - x[0], y[2] - y[1]); |
| 59 canvas->DrawImageInt(center, 0, 0, center.width(), center.height(), | 55 canvas->DrawImageInt(center, 0, 0, center.width(), center.height(), |
| 60 x[1], y[1], x[2] - x[1], y[2] - y[1], false); | 56 x[1], y[1], x[2] - x[1], y[2] - y[1], false); |
| 61 canvas->TileImageInt(right, x[2], y[1], x[3] - x[2], y[2] - y[1]); | 57 canvas->TileImageInt(right, x[2], y[1], x[3] - x[2], y[2] - y[1]); |
| 62 canvas->DrawImageInt(bottom_left, 0, y[2]); | 58 canvas->DrawImageInt(bottom_left, 0, y[2]); |
| 63 canvas->TileImageInt(bottom, x[1], y[2], x[2] - x[1], y[3] - y[2]); | 59 canvas->TileImageInt(bottom, x[1], y[2], x[2] - x[1], y[3] - y[2]); |
| 64 canvas->DrawImageInt(bottom_right, x[2], y[2]); | 60 canvas->DrawImageInt(bottom_right, x[2], y[2]); |
| 65 } | 61 } |
| 66 | 62 |
| 67 } // namespace views | 63 } // namespace views |
| OLD | NEW |