| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 229 |
| 230 m_lineDashDirty = false; | 230 m_lineDashDirty = false; |
| 231 } | 231 } |
| 232 | 232 |
| 233 void CanvasRenderingContext2DState::setStrokeStyle(CanvasStyle* style) | 233 void CanvasRenderingContext2DState::setStrokeStyle(CanvasStyle* style) |
| 234 { | 234 { |
| 235 m_strokeStyle = style; | 235 m_strokeStyle = style; |
| 236 m_strokeStyleDirty = true; | 236 m_strokeStyleDirty = true; |
| 237 } | 237 } |
| 238 | 238 |
| 239 CanvasStyle* CanvasRenderingContext2DState::strokeStyle() const | |
| 240 { | |
| 241 return m_strokeStyle.get(); | |
| 242 } | |
| 243 | |
| 244 void CanvasRenderingContext2DState::setFillStyle(CanvasStyle* style) | 239 void CanvasRenderingContext2DState::setFillStyle(CanvasStyle* style) |
| 245 { | 240 { |
| 246 m_fillStyle = style; | 241 m_fillStyle = style; |
| 247 m_fillStyleDirty = true; | 242 m_fillStyleDirty = true; |
| 248 } | 243 } |
| 249 | 244 |
| 250 CanvasStyle* CanvasRenderingContext2DState::fillStyle() const | |
| 251 { | |
| 252 return m_fillStyle.get(); | |
| 253 } | |
| 254 | |
| 255 void CanvasRenderingContext2DState::updateStrokeStyle() const | 245 void CanvasRenderingContext2DState::updateStrokeStyle() const |
| 256 { | 246 { |
| 257 if (!m_strokeStyleDirty) | 247 if (!m_strokeStyleDirty) |
| 258 return; | 248 return; |
| 259 | 249 |
| 260 int clampedAlpha = clampedAlphaForBlending(m_globalAlpha); | 250 int clampedAlpha = clampedAlphaForBlending(m_globalAlpha); |
| 261 ASSERT(m_strokeStyle); | 251 ASSERT(m_strokeStyle); |
| 262 m_strokeStyle->applyToPaint(m_strokePaint); | 252 m_strokeStyle->applyToPaint(m_strokePaint); |
| 263 m_strokePaint.setColor(scaleAlpha(m_strokeStyle->paintColor(), clampedAlpha)
); | 253 m_strokePaint.setColor(scaleAlpha(m_strokeStyle->paintColor(), clampedAlpha)
); |
| 264 m_strokeStyleDirty = false; | 254 m_strokeStyleDirty = false; |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 paint->setLooper(0); | 584 paint->setLooper(0); |
| 595 paint->setImageFilter(shadowAndForegroundImageFilter()); | 585 paint->setImageFilter(shadowAndForegroundImageFilter()); |
| 596 return paint; | 586 return paint; |
| 597 } | 587 } |
| 598 paint->setLooper(shadowAndForegroundDrawLooper()); | 588 paint->setLooper(shadowAndForegroundDrawLooper()); |
| 599 paint->setImageFilter(0); | 589 paint->setImageFilter(0); |
| 600 return paint; | 590 return paint; |
| 601 } | 591 } |
| 602 | 592 |
| 603 } // blink | 593 } // blink |
| OLD | NEW |