| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 bool isRadial() const { return m_radial; } | 90 bool isRadial() const { return m_radial; } |
| 91 bool isZeroSize() const { | 91 bool isZeroSize() const { |
| 92 return m_p0.x() == m_p1.x() && m_p0.y() == m_p1.y() && | 92 return m_p0.x() == m_p1.x() && m_p0.y() == m_p1.y() && |
| 93 (!m_radial || m_r0 == m_r1); | 93 (!m_radial || m_r0 == m_r1); |
| 94 } | 94 } |
| 95 | 95 |
| 96 const FloatPoint& p0() const { return m_p0; } | 96 const FloatPoint& p0() const { return m_p0; } |
| 97 const FloatPoint& p1() const { return m_p1; } | 97 const FloatPoint& p1() const { return m_p1; } |
| 98 | 98 |
| 99 void setP0(const FloatPoint& p) { | |
| 100 if (m_p0 == p) | |
| 101 return; | |
| 102 | |
| 103 m_p0 = p; | |
| 104 } | |
| 105 | |
| 106 void setP1(const FloatPoint& p) { | |
| 107 if (m_p1 == p) | |
| 108 return; | |
| 109 | |
| 110 m_p1 = p; | |
| 111 } | |
| 112 | |
| 113 float startRadius() const { return m_r0; } | 99 float startRadius() const { return m_r0; } |
| 114 float endRadius() const { return m_r1; } | 100 float endRadius() const { return m_r1; } |
| 115 | 101 |
| 116 void setStartRadius(float r) { | |
| 117 if (m_r0 == r) | |
| 118 return; | |
| 119 | |
| 120 m_r0 = r; | |
| 121 } | |
| 122 | |
| 123 void setEndRadius(float r) { | |
| 124 if (m_r1 == r) | |
| 125 return; | |
| 126 | |
| 127 m_r1 = r; | |
| 128 } | |
| 129 | |
| 130 void applyToFlags(PaintFlags&, const SkMatrix& localMatrix); | 102 void applyToFlags(PaintFlags&, const SkMatrix& localMatrix); |
| 131 | 103 |
| 132 GradientSpreadMethod spreadMethod() const { return m_spreadMethod; } | 104 GradientSpreadMethod spreadMethod() const { return m_spreadMethod; } |
| 133 | 105 |
| 134 private: | 106 private: |
| 135 Gradient(const FloatPoint& p0, | 107 Gradient(const FloatPoint& p0, |
| 136 const FloatPoint& p1, | 108 const FloatPoint& p1, |
| 137 GradientSpreadMethod, | 109 GradientSpreadMethod, |
| 138 ColorInterpolation); | 110 ColorInterpolation); |
| 139 Gradient(const FloatPoint& p0, | 111 Gradient(const FloatPoint& p0, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 158 bool m_stopsSorted; | 130 bool m_stopsSorted; |
| 159 GradientSpreadMethod m_spreadMethod; | 131 GradientSpreadMethod m_spreadMethod; |
| 160 ColorInterpolation m_colorInterpolation; | 132 ColorInterpolation m_colorInterpolation; |
| 161 | 133 |
| 162 mutable sk_sp<PaintShader> m_cachedShader; | 134 mutable sk_sp<PaintShader> m_cachedShader; |
| 163 }; | 135 }; |
| 164 | 136 |
| 165 } // namespace blink | 137 } // namespace blink |
| 166 | 138 |
| 167 #endif | 139 #endif |
| OLD | NEW |