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 #define _USE_MATH_DEFINES | 5 #define _USE_MATH_DEFINES |
6 #include <algorithm> | 6 #include <algorithm> |
7 #include <cmath> | 7 #include <cmath> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "skia/ext/image_operations.h" | 10 #include "skia/ext/image_operations.h" |
11 | 11 |
12 // TODO(pkasting): skia/ext should not depend on base/! | 12 // TODO(pkasting): skia/ext should not depend on base/! |
13 #include "base/containers/stack_container.h" | 13 #include "base/containers/stack_container.h" |
14 #include "base/debug/trace_event.h" | 14 #include "base/debug/trace_event.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
17 #include "base/time.h" | 17 #include "base/time/time.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "skia/ext/convolver.h" | 19 #include "skia/ext/convolver.h" |
20 #include "third_party/skia/include/core/SkColorPriv.h" | 20 #include "third_party/skia/include/core/SkColorPriv.h" |
| 21 #include "third_party/skia/include/core/SkFontHost.h" |
21 #include "third_party/skia/include/core/SkRect.h" | 22 #include "third_party/skia/include/core/SkRect.h" |
22 #include "third_party/skia/include/core/SkFontHost.h" | |
23 | 23 |
24 namespace skia { | 24 namespace skia { |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 // Returns the ceiling/floor as an integer. | 28 // Returns the ceiling/floor as an integer. |
29 inline int CeilInt(float val) { | 29 inline int CeilInt(float val) { |
30 return static_cast<int>(ceil(val)); | 30 return static_cast<int>(ceil(val)); |
31 } | 31 } |
32 inline int FloorInt(float val) { | 32 inline int FloorInt(float val) { |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 SkBitmap ImageOperations::Resize(const SkBitmap& source, | 535 SkBitmap ImageOperations::Resize(const SkBitmap& source, |
536 ResizeMethod method, | 536 ResizeMethod method, |
537 int dest_width, int dest_height, | 537 int dest_width, int dest_height, |
538 SkBitmap::Allocator* allocator) { | 538 SkBitmap::Allocator* allocator) { |
539 SkIRect dest_subset = { 0, 0, dest_width, dest_height }; | 539 SkIRect dest_subset = { 0, 0, dest_width, dest_height }; |
540 return Resize(source, method, dest_width, dest_height, dest_subset, | 540 return Resize(source, method, dest_width, dest_height, dest_subset, |
541 allocator); | 541 allocator); |
542 } | 542 } |
543 | 543 |
544 } // namespace skia | 544 } // namespace skia |
OLD | NEW |