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/skia_util.h" | 5 #include "ui/gfx/skia_util.h" |
6 | 6 |
7 #include "base/i18n/char_iterator.h" | 7 #include "base/i18n/char_iterator.h" |
8 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
9 #include "third_party/skia/include/core/SkColorPriv.h" | 9 #include "third_party/skia/include/core/SkColorPriv.h" |
10 #include "third_party/skia/include/core/SkShader.h" | 10 #include "third_party/skia/include/core/SkShader.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 static_cast<int>(rect.width()), | 30 static_cast<int>(rect.width()), |
31 static_cast<int>(rect.height())); | 31 static_cast<int>(rect.height())); |
32 } | 32 } |
33 | 33 |
34 SkShader* CreateGradientShader(int start_point, | 34 SkShader* CreateGradientShader(int start_point, |
35 int end_point, | 35 int end_point, |
36 SkColor start_color, | 36 SkColor start_color, |
37 SkColor end_color) { | 37 SkColor end_color) { |
38 SkColor grad_colors[2] = { start_color, end_color}; | 38 SkColor grad_colors[2] = { start_color, end_color}; |
39 SkPoint grad_points[2]; | 39 SkPoint grad_points[2]; |
40 grad_points[0].set(SkIntToScalar(0), SkIntToScalar(start_point)); | 40 grad_points[0].iset(0, start_point); |
41 grad_points[1].set(SkIntToScalar(0), SkIntToScalar(end_point)); | 41 grad_points[1].iset(0, end_point); |
42 | 42 |
43 return SkGradientShader::CreateLinear( | 43 return SkGradientShader::CreateLinear( |
44 grad_points, grad_colors, NULL, 2, SkShader::kRepeat_TileMode); | 44 grad_points, grad_colors, NULL, 2, SkShader::kRepeat_TileMode); |
45 } | 45 } |
46 | 46 |
47 bool BitmapsAreEqual(const SkBitmap& bitmap1, const SkBitmap& bitmap2) { | 47 bool BitmapsAreEqual(const SkBitmap& bitmap1, const SkBitmap& bitmap2) { |
48 void* addr1 = NULL; | 48 void* addr1 = NULL; |
49 void* addr2 = NULL; | 49 void* addr2 = NULL; |
50 size_t size1 = 0; | 50 size_t size1 = 0; |
51 size_t size2 = 0; | 51 size_t size2 = 0; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 if (accelerated_char_pos) | 96 if (accelerated_char_pos) |
97 *accelerated_char_pos = last_char_pos; | 97 *accelerated_char_pos = last_char_pos; |
98 if (accelerated_char_span) | 98 if (accelerated_char_span) |
99 *accelerated_char_span = last_char_span; | 99 *accelerated_char_span = last_char_span; |
100 | 100 |
101 return accelerator_removed; | 101 return accelerator_removed; |
102 } | 102 } |
103 | 103 |
104 } // namespace gfx | 104 } // namespace gfx |
OLD | NEW |