OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 | 6 |
7 #include "modules/canvas2d/CanvasRenderingContext2DState.h" | 7 #include "modules/canvas2d/CanvasRenderingContext2DState.h" |
8 | 8 |
9 #include "core/css/CSSFontSelector.h" | 9 #include "core/css/CSSFontSelector.h" |
10 #include "core/css/resolver/FilterOperationResolver.h" | 10 #include "core/css/resolver/FilterOperationResolver.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 227 |
228 m_lineDashDirty = false; | 228 m_lineDashDirty = false; |
229 } | 229 } |
230 | 230 |
231 void CanvasRenderingContext2DState::setStrokeStyle(CanvasStyle* style) | 231 void CanvasRenderingContext2DState::setStrokeStyle(CanvasStyle* style) |
232 { | 232 { |
233 m_strokeStyle = style; | 233 m_strokeStyle = style; |
234 m_strokeStyleDirty = true; | 234 m_strokeStyleDirty = true; |
235 } | 235 } |
236 | 236 |
| 237 CanvasStyle* CanvasRenderingContext2DState::strokeStyle() const |
| 238 { |
| 239 return m_strokeStyle.get(); |
| 240 } |
| 241 |
237 void CanvasRenderingContext2DState::setFillStyle(CanvasStyle* style) | 242 void CanvasRenderingContext2DState::setFillStyle(CanvasStyle* style) |
238 { | 243 { |
239 m_fillStyle = style; | 244 m_fillStyle = style; |
240 m_fillStyleDirty = true; | 245 m_fillStyleDirty = true; |
241 } | 246 } |
242 | 247 |
| 248 CanvasStyle* CanvasRenderingContext2DState::fillStyle() const |
| 249 { |
| 250 return m_fillStyle.get(); |
| 251 } |
| 252 |
243 void CanvasRenderingContext2DState::updateStrokeStyle() const | 253 void CanvasRenderingContext2DState::updateStrokeStyle() const |
244 { | 254 { |
245 if (!m_strokeStyleDirty) | 255 if (!m_strokeStyleDirty) |
246 return; | 256 return; |
247 | 257 |
248 int clampedAlpha = clampedAlphaForBlending(m_globalAlpha); | 258 int clampedAlpha = clampedAlphaForBlending(m_globalAlpha); |
249 ASSERT(m_strokeStyle); | 259 ASSERT(m_strokeStyle); |
250 m_strokeStyle->applyToPaint(m_strokePaint); | 260 m_strokeStyle->applyToPaint(m_strokePaint); |
251 m_strokePaint.setColor(scaleAlpha(m_strokeStyle->paintColor(), clampedAlpha)
); | 261 m_strokePaint.setColor(scaleAlpha(m_strokeStyle->paintColor(), clampedAlpha)
); |
252 m_strokeStyleDirty = false; | 262 m_strokeStyleDirty = false; |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 paint->setLooper(0); | 592 paint->setLooper(0); |
583 paint->setImageFilter(shadowAndForegroundImageFilter()); | 593 paint->setImageFilter(shadowAndForegroundImageFilter()); |
584 return paint; | 594 return paint; |
585 } | 595 } |
586 paint->setLooper(shadowAndForegroundDrawLooper()); | 596 paint->setLooper(shadowAndForegroundDrawLooper()); |
587 paint->setImageFilter(0); | 597 paint->setImageFilter(0); |
588 return paint; | 598 return paint; |
589 } | 599 } |
590 | 600 |
591 } // blink | 601 } // blink |
OLD | NEW |