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/gfx/canvas.h" | 5 #include "ui/gfx/canvas.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
13 #include "third_party/skia/include/effects/SkGradientShader.h" | 13 #include "third_party/skia/include/effects/SkGradientShader.h" |
14 #include "ui/gfx/font_list.h" | 14 #include "ui/gfx/font_list.h" |
15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
16 #include "ui/gfx/geometry/rect_conversions.h" | 16 #include "ui/gfx/geometry/rect_conversions.h" |
17 #include "ui/gfx/geometry/safe_integer_conversions.h" | 17 #include "ui/gfx/geometry/safe_integer_conversions.h" |
| 18 #include "ui/gfx/geometry/size_conversions.h" |
18 #include "ui/gfx/scoped_canvas.h" | 19 #include "ui/gfx/scoped_canvas.h" |
19 #include "ui/gfx/size_conversions.h" | |
20 #include "ui/gfx/skia_util.h" | 20 #include "ui/gfx/skia_util.h" |
21 #include "ui/gfx/transform.h" | 21 #include "ui/gfx/transform.h" |
22 | 22 |
23 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
24 #include "ui/gfx/canvas_skia_paint.h" | 24 #include "ui/gfx/canvas_skia_paint.h" |
25 #endif | 25 #endif |
26 | 26 |
27 namespace gfx { | 27 namespace gfx { |
28 | 28 |
29 Canvas::Canvas(const Size& size, float image_scale, bool is_opaque) | 29 Canvas::Canvas(const Size& size, float image_scale, bool is_opaque) |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 SkPaint p(paint); | 634 SkPaint p(paint); |
635 p.setFilterLevel(filter ? SkPaint::kLow_FilterLevel | 635 p.setFilterLevel(filter ? SkPaint::kLow_FilterLevel |
636 : SkPaint::kNone_FilterLevel); | 636 : SkPaint::kNone_FilterLevel); |
637 p.setShader(shader.get()); | 637 p.setShader(shader.get()); |
638 | 638 |
639 // The rect will be filled by the bitmap. | 639 // The rect will be filled by the bitmap. |
640 canvas_->drawRect(dest_rect, p); | 640 canvas_->drawRect(dest_rect, p); |
641 } | 641 } |
642 | 642 |
643 } // namespace gfx | 643 } // namespace gfx |
OLD | NEW |