| 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/rect_conversions.h" | 13 #include "ui/gfx/geometry/rect_conversions.h" |
| 14 #include "ui/gfx/geometry/safe_integer_conversions.h" | 14 #include "ui/gfx/geometry/safe_integer_conversions.h" |
| 15 #include "ui/gfx/image/image_skia_operations.h" | 15 #include "ui/gfx/image/image_skia_operations.h" |
| 16 #include "ui/gfx/insets.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 #include "base/debug/stack_trace.h" |
| 22 |
| 21 namespace gfx { | 23 namespace gfx { |
| 22 | 24 |
| 23 namespace { | 25 namespace { |
| 24 | 26 |
| 25 // The following functions width and height of the image in pixels for the | 27 // The following functions width and height of the image in pixels for the |
| 26 // scale factor in the Canvas. | 28 // scale factor in the Canvas. |
| 27 int ImageWidthInPixels(const ImageSkia& i, Canvas* c) { | 29 int ImageWidthInPixels(const ImageSkia& i, Canvas* c) { |
| 28 return i.GetRepresentation(c->image_scale()).pixel_width(); | 30 return i.GetRepresentation(c->image_scale()).pixel_width(); |
| 29 } | 31 } |
| 30 | 32 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 height_in_pixels - i2h - i8h, paint); | 160 height_in_pixels - i2h - i8h, paint); |
| 159 canvas->DrawImageIntInPixel(images_[6], 0, 0, i6w, i6h, 0, | 161 canvas->DrawImageIntInPixel(images_[6], 0, 0, i6w, i6h, 0, |
| 160 height_in_pixels - i6h, i6w, i6h, false, paint); | 162 height_in_pixels - i6h, i6w, i6h, false, paint); |
| 161 Fill(canvas, images_[7], i6w, height_in_pixels - i7h, | 163 Fill(canvas, images_[7], i6w, height_in_pixels - i7h, |
| 162 width_in_pixels - i6w - i8w, i7h, paint); | 164 width_in_pixels - i6w - i8w, i7h, paint); |
| 163 canvas->DrawImageIntInPixel(images_[8], 0, 0, i8w, i8h, width_in_pixels - i8w, | 165 canvas->DrawImageIntInPixel(images_[8], 0, 0, i8w, i8h, width_in_pixels - i8w, |
| 164 height_in_pixels - i8h, i8w, i8h, false, paint); | 166 height_in_pixels - i8h, i8w, i8h, false, paint); |
| 165 } | 167 } |
| 166 | 168 |
| 167 } // namespace gfx | 169 } // namespace gfx |
| OLD | NEW |