| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/gfx/nine_image_painter.h" | 5 #include "ui/gfx/nine_image_painter.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "third_party/skia/include/core/SkPaint.h" | 9 #include "third_party/skia/include/core/SkPaint.h" |
| 10 #include "third_party/skia/include/core/SkRect.h" | 10 #include "third_party/skia/include/core/SkRect.h" |
| 11 #include "third_party/skia/include/core/SkScalar.h" | 11 #include "third_party/skia/include/core/SkScalar.h" |
| 12 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
| 13 #include "ui/gfx/geometry/insets.h" |
| 13 #include "ui/gfx/geometry/rect_conversions.h" | 14 #include "ui/gfx/geometry/rect_conversions.h" |
| 14 #include "ui/gfx/geometry/safe_integer_conversions.h" | 15 #include "ui/gfx/geometry/safe_integer_conversions.h" |
| 15 #include "ui/gfx/image/image_skia_operations.h" | 16 #include "ui/gfx/image/image_skia_operations.h" |
| 16 #include "ui/gfx/insets.h" | |
| 17 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
| 18 #include "ui/gfx/scoped_canvas.h" | 18 #include "ui/gfx/scoped_canvas.h" |
| 19 #include "ui/gfx/skia_util.h" | 19 #include "ui/gfx/skia_util.h" |
| 20 | 20 |
| 21 namespace gfx { | 21 namespace gfx { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 // The following functions width and height of the image in pixels for the | 25 // The following functions width and height of the image in pixels for the |
| 26 // scale factor in the Canvas. | 26 // scale factor in the Canvas. |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 scaled_height - i2h - i8h, paint); | 148 scaled_height - i2h - i8h, paint); |
| 149 canvas->DrawImageIntInPixel(images_[6], 0, 0, i6w, i6h, 0, | 149 canvas->DrawImageIntInPixel(images_[6], 0, 0, i6w, i6h, 0, |
| 150 scaled_height - i6h, i6w, i6h, false, paint); | 150 scaled_height - i6h, i6w, i6h, false, paint); |
| 151 Fill(canvas, images_[7], i6w, scaled_height - i7h, scaled_width - i6w - i8w, | 151 Fill(canvas, images_[7], i6w, scaled_height - i7h, scaled_width - i6w - i8w, |
| 152 i7h, paint); | 152 i7h, paint); |
| 153 canvas->DrawImageIntInPixel(images_[8], 0, 0, i8w, i8h, scaled_width - i8w, | 153 canvas->DrawImageIntInPixel(images_[8], 0, 0, i8w, i8h, scaled_width - i8w, |
| 154 scaled_height - i8h, i8w, i8h, false, paint); | 154 scaled_height - i8h, i8w, i8h, false, paint); |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace gfx | 157 } // namespace gfx |
| OLD | NEW |