| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 m_font.update(fontSelector); | 171 m_font.update(fontSelector); |
| 172 // FIXME: We only really need to invalidate the resolved filter if the font | 172 // FIXME: We only really need to invalidate the resolved filter if the font |
| 173 // update above changed anything and the filter uses font-dependent units. | 173 // update above changed anything and the filter uses font-dependent units. |
| 174 m_resolvedFilter.clear(); | 174 m_resolvedFilter.clear(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 DEFINE_TRACE(CanvasRenderingContext2DState) | 177 DEFINE_TRACE(CanvasRenderingContext2DState) |
| 178 { | 178 { |
| 179 visitor->trace(m_strokeStyle); | 179 visitor->trace(m_strokeStyle); |
| 180 visitor->trace(m_fillStyle); | 180 visitor->trace(m_fillStyle); |
| 181 visitor->trace(m_filterValue); | |
| 182 CSSFontSelectorClient::trace(visitor); | 181 CSSFontSelectorClient::trace(visitor); |
| 183 } | 182 } |
| 184 | 183 |
| 185 void CanvasRenderingContext2DState::setLineDashOffset(float offset) | 184 void CanvasRenderingContext2DState::setLineDashOffset(float offset) |
| 186 { | 185 { |
| 187 m_lineDashOffset = offset; | 186 m_lineDashOffset = offset; |
| 188 m_lineDashDirty = true; | 187 m_lineDashDirty = true; |
| 189 } | 188 } |
| 190 | 189 |
| 191 void CanvasRenderingContext2DState::setLineDash(const Vector<float>& dash) | 190 void CanvasRenderingContext2DState::setLineDash(const Vector<float>& dash) |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 m_shadowBlur = shadowBlur; | 427 m_shadowBlur = shadowBlur; |
| 429 shadowParameterChanged(); | 428 shadowParameterChanged(); |
| 430 } | 429 } |
| 431 | 430 |
| 432 void CanvasRenderingContext2DState::setShadowColor(SkColor shadowColor) | 431 void CanvasRenderingContext2DState::setShadowColor(SkColor shadowColor) |
| 433 { | 432 { |
| 434 m_shadowColor = shadowColor; | 433 m_shadowColor = shadowColor; |
| 435 shadowParameterChanged(); | 434 shadowParameterChanged(); |
| 436 } | 435 } |
| 437 | 436 |
| 438 void CanvasRenderingContext2DState::setFilter(PassRefPtrWillBeRawPtr<CSSValue> f
ilterValue) | 437 void CanvasRenderingContext2DState::setFilter(PassRefPtr<CSSValue> filterValue) |
| 439 { | 438 { |
| 440 m_filterValue = filterValue; | 439 m_filterValue = filterValue; |
| 441 m_resolvedFilter.clear(); | 440 m_resolvedFilter.clear(); |
| 442 } | 441 } |
| 443 | 442 |
| 444 void CanvasRenderingContext2DState::setGlobalComposite(SkXfermode::Mode mode) | 443 void CanvasRenderingContext2DState::setGlobalComposite(SkXfermode::Mode mode) |
| 445 { | 444 { |
| 446 m_strokePaint.setXfermodeMode(mode); | 445 m_strokePaint.setXfermodeMode(mode); |
| 447 m_fillPaint.setXfermodeMode(mode); | 446 m_fillPaint.setXfermodeMode(mode); |
| 448 m_imagePaint.setXfermodeMode(mode); | 447 m_imagePaint.setXfermodeMode(mode); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 paint->setLooper(0); | 523 paint->setLooper(0); |
| 525 paint->setImageFilter(shadowAndForegroundImageFilter()); | 524 paint->setImageFilter(shadowAndForegroundImageFilter()); |
| 526 return paint; | 525 return paint; |
| 527 } | 526 } |
| 528 paint->setLooper(shadowAndForegroundDrawLooper()); | 527 paint->setLooper(shadowAndForegroundDrawLooper()); |
| 529 paint->setImageFilter(0); | 528 paint->setImageFilter(0); |
| 530 return paint; | 529 return paint; |
| 531 } | 530 } |
| 532 | 531 |
| 533 } // blink | 532 } // blink |
| OLD | NEW |