summaryrefslogtreecommitdiffstats
path: root/ui/gfx/render_text.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-03 02:02:17 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-03 02:02:17 +0000
commit959e190697105800e6c1e777bd5ae8a9c9e2bc74 (patch)
tree593ba7ba47be8abccd9de8a279b91424ddcfefc0 /ui/gfx/render_text.cc
parentb2f28d2a1783fc9a4cbb5f3208b788341f03c922 (diff)
downloadchromium_src-959e190697105800e6c1e777bd5ae8a9c9e2bc74.zip
chromium_src-959e190697105800e6c1e777bd5ae8a9c9e2bc74.tar.gz
chromium_src-959e190697105800e6c1e777bd5ae8a9c9e2bc74.tar.bz2
browser: Minor changes to use SkPoint::iset() function.
R=pkasting@chromium.org TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/9588003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124820 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/render_text.cc')
-rw-r--r--ui/gfx/render_text.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index 2ce6279..35134e8 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -140,10 +140,6 @@ SkShader* CreateFadeShader(const gfx::Rect& text_rect,
SkColor color) {
// Fade alpha of 51/255 corresponds to a fade of 0.2 of the original color.
const SkColor fade_color = SkColorSetA(color, 51);
- const SkPoint points[2] = {
- SkPoint::Make(text_rect.x(), text_rect.y()),
- SkPoint::Make(text_rect.right(), text_rect.y())
- };
std::vector<SkScalar> positions;
std::vector<SkColor> colors;
@@ -161,12 +157,14 @@ SkShader* CreateFadeShader(const gfx::Rect& text_rect,
colors.push_back(colors.back());
}
+ SkPoint points[2];
+ points[0].iset(text_rect.x(), text_rect.y());
+ points[1].iset(text_rect.right(), text_rect.y());
+
return SkGradientShader::CreateLinear(&points[0], &colors[0], &positions[0],
- colors.size(),
- SkShader::kClamp_TileMode);
+ colors.size(), SkShader::kClamp_TileMode);
}
-
} // namespace
namespace gfx {