Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Side by Side Diff: ui/gfx/skia_util.cc

Issue 9544001: ui: Let skia do the conversion work for us by using the integer version of set() function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: peter review Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/native_theme_chromeos.cc ('k') | ui/views/bubble/bubble_border.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/gfx/native_theme_chromeos.cc ('k') | ui/views/bubble/bubble_border.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698