OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 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) 2008 Torch Mobile, Inc. | 4 * Copyright (C) 2008 Torch Mobile, Inc. |
5 * Copyright (C) 2013 Google Inc. All rights reserved. | 5 * Copyright (C) 2013 Google Inc. All rights reserved. |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 66 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
67 float stop; | 67 float stop; |
68 Color color; | 68 Color color; |
69 | 69 |
70 ColorStop(float s, const Color& c) : stop(s), color(c) {} | 70 ColorStop(float s, const Color& c) : stop(s), color(c) {} |
71 }; | 71 }; |
72 void addColorStop(const ColorStop&); | 72 void addColorStop(const ColorStop&); |
73 void addColorStop(float value, const Color& color) { | 73 void addColorStop(float value, const Color& color) { |
74 addColorStop(ColorStop(value, color)); | 74 addColorStop(ColorStop(value, color)); |
75 } | 75 } |
| 76 void addColorStops(const Vector<Gradient::ColorStop>&); |
76 | 77 |
77 bool isRadial() const { return m_radial; } | 78 bool isRadial() const { return m_radial; } |
78 bool isZeroSize() const { | 79 bool isZeroSize() const { |
79 return m_p0.x() == m_p1.x() && m_p0.y() == m_p1.y() && | 80 return m_p0.x() == m_p1.x() && m_p0.y() == m_p1.y() && |
80 (!m_radial || m_r0 == m_r1); | 81 (!m_radial || m_r0 == m_r1); |
81 } | 82 } |
82 | 83 |
83 const FloatPoint& p0() const { return m_p0; } | 84 const FloatPoint& p0() const { return m_p0; } |
84 const FloatPoint& p1() const { return m_p1; } | 85 const FloatPoint& p1() const { return m_p1; } |
85 | 86 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 bool m_stopsSorted; | 144 bool m_stopsSorted; |
144 bool m_drawInPMColorSpace; | 145 bool m_drawInPMColorSpace; |
145 GradientSpreadMethod m_spreadMethod; | 146 GradientSpreadMethod m_spreadMethod; |
146 | 147 |
147 mutable sk_sp<PaintShader> m_cachedShader; | 148 mutable sk_sp<PaintShader> m_cachedShader; |
148 }; | 149 }; |
149 | 150 |
150 } // namespace blink | 151 } // namespace blink |
151 | 152 |
152 #endif | 153 #endif |
OLD | NEW |