OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 | 91 |
92 m_stopsSorted = true; | 92 m_stopsSorted = true; |
93 | 93 |
94 if (!m_stops.size()) | 94 if (!m_stops.size()) |
95 return; | 95 return; |
96 | 96 |
97 std::stable_sort(m_stops.begin(), m_stops.end(), compareStops); | 97 std::stable_sort(m_stops.begin(), m_stops.end(), compareStops); |
98 } | 98 } |
99 | 99 |
100 void Gradient::setSpreadMethod(GradientSpreadMethod spreadMethod) { | 100 void Gradient::setSpreadMethod(GradientSpreadMethod spreadMethod) { |
101 // FIXME: Should it become necessary, allow calls to this method after m_gradi ent has been set. | 101 // FIXME: Should it become necessary, allow calls to this method after |
102 // m_gradient has been set. | |
Stephen White
2016/10/05 14:45:37
Nit: |m_gradient|?
Peter Kasting
2016/10/05 18:46:01
Done.
| |
102 DCHECK(!m_cachedShader); | 103 DCHECK(!m_cachedShader); |
103 | 104 |
104 if (m_spreadMethod == spreadMethod) | 105 if (m_spreadMethod == spreadMethod) |
105 return; | 106 return; |
106 | 107 |
107 m_spreadMethod = spreadMethod; | 108 m_spreadMethod = spreadMethod; |
108 } | 109 } |
109 | 110 |
110 void Gradient::setDrawsInPMColorSpace(bool drawInPMColorSpace) { | 111 void Gradient::setDrawsInPMColorSpace(bool drawInPMColorSpace) { |
111 if (drawInPMColorSpace == m_drawInPMColorSpace) | 112 if (drawInPMColorSpace == m_drawInPMColorSpace) |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 if (!m_cachedShader || localMatrix != m_cachedShader->getLocalMatrix()) | 253 if (!m_cachedShader || localMatrix != m_cachedShader->getLocalMatrix()) |
253 m_cachedShader = createShader(localMatrix); | 254 m_cachedShader = createShader(localMatrix); |
254 | 255 |
255 paint.setShader(m_cachedShader); | 256 paint.setShader(m_cachedShader); |
256 | 257 |
257 // Legacy behavior: gradients are always dithered. | 258 // Legacy behavior: gradients are always dithered. |
258 paint.setDither(true); | 259 paint.setDither(true); |
259 } | 260 } |
260 | 261 |
261 } // namespace blink | 262 } // namespace blink |
OLD | NEW |