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

Side by Side Diff: src/views/SkParsePaint.cpp

Issue 111353003: deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPREC… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 | « src/utils/SkParseColor.cpp ('k') | src/views/SkStackViewLayout.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkParsePaint.h" 8 #include "SkParsePaint.h"
9 #include "SkTSearch.h" 9 #include "SkTSearch.h"
10 #include "SkParse.h" 10 #include "SkParse.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 { 89 {
90 SkColor c = paint->getColor(); 90 SkColor c = paint->getColor();
91 if (SkParse::FindColor(str, &c)) 91 if (SkParse::FindColor(str, &c))
92 paint->setColor(c); 92 paint->setColor(c);
93 } 93 }
94 94
95 // do this AFTER parsing for the color 95 // do this AFTER parsing for the color
96 if (dom.findScalar(node, "opacity", &x)) 96 if (dom.findScalar(node, "opacity", &x))
97 { 97 {
98 x = SkMaxScalar(0, SkMinScalar(x, SK_Scalar1)); 98 x = SkMaxScalar(0, SkMinScalar(x, SK_Scalar1));
99 paint->setAlpha(SkScalarRound(x * 255)); 99 paint->setAlpha(SkScalarRoundToInt(x * 255));
100 } 100 }
101 101
102 int index = dom.findList(node, "text-anchor", "left,center,right"); 102 int index = dom.findList(node, "text-anchor", "left,center,right");
103 if (index >= 0) 103 if (index >= 0)
104 paint->setTextAlign((SkPaint::Align)index); 104 paint->setTextAlign((SkPaint::Align)index);
105 105
106 SkShader* shader = inflate_shader(dom, node); 106 SkShader* shader = inflate_shader(dom, node);
107 if (shader) 107 if (shader)
108 paint->setShader(shader)->unref(); 108 paint->setShader(shader)->unref();
109 } 109 }
OLDNEW
« no previous file with comments | « src/utils/SkParseColor.cpp ('k') | src/views/SkStackViewLayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698