| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "platform/graphics/GraphicsContextState.h" | 6 #include "platform/graphics/GraphicsContextState.h" |
| 7 | 7 |
| 8 namespace WebCore { | 8 namespace WebCore { |
| 9 | 9 |
| 10 GraphicsContextState::GraphicsContextState() | 10 GraphicsContextState::GraphicsContextState() |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 181 } |
| 182 | 182 |
| 183 void GraphicsContextState::clearFillPattern() | 183 void GraphicsContextState::clearFillPattern() |
| 184 { | 184 { |
| 185 m_fillPattern.clear(); | 185 m_fillPattern.clear(); |
| 186 ASSERT(!m_fillGradient); | 186 ASSERT(!m_fillGradient); |
| 187 m_fillPaint.setColor(applyAlpha(m_fillColor.rgb())); | 187 m_fillPaint.setColor(applyAlpha(m_fillColor.rgb())); |
| 188 } | 188 } |
| 189 | 189 |
| 190 // Shadow. (This will need tweaking if we use draw loopers for other things.) | 190 // Shadow. (This will need tweaking if we use draw loopers for other things.) |
| 191 void GraphicsContextState::setDrawLooper(const DrawLooper& drawLooper) | 191 void GraphicsContextState::setDrawLooper(PassRefPtr<SkDrawLooper> drawLooper) |
| 192 { | 192 { |
| 193 m_looper = drawLooper.skDrawLooper(); | 193 m_looper = drawLooper; |
| 194 m_strokePaint.setLooper(m_looper.get()); | 194 m_strokePaint.setLooper(m_looper.get()); |
| 195 m_fillPaint.setLooper(m_looper.get()); | 195 m_fillPaint.setLooper(m_looper.get()); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void GraphicsContextState::clearDrawLooper() | 198 void GraphicsContextState::clearDrawLooper() |
| 199 { | 199 { |
| 200 m_looper.clear(); | 200 m_looper.clear(); |
| 201 m_strokePaint.setLooper(0); | 201 m_strokePaint.setLooper(0); |
| 202 m_fillPaint.setLooper(0); | 202 m_fillPaint.setLooper(0); |
| 203 } | 203 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 245 |
| 246 void GraphicsContextState::setShouldAntialias(bool shouldAntialias) | 246 void GraphicsContextState::setShouldAntialias(bool shouldAntialias) |
| 247 { | 247 { |
| 248 m_shouldAntialias = shouldAntialias; | 248 m_shouldAntialias = shouldAntialias; |
| 249 m_strokePaint.setAntiAlias(shouldAntialias); | 249 m_strokePaint.setAntiAlias(shouldAntialias); |
| 250 m_fillPaint.setAntiAlias(shouldAntialias); | 250 m_fillPaint.setAntiAlias(shouldAntialias); |
| 251 } | 251 } |
| 252 | 252 |
| 253 | 253 |
| 254 } // namespace WebCore | 254 } // namespace WebCore |
| OLD | NEW |