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 "modules/canvas2d/CanvasRenderingContext2DState.h" | 5 #include "modules/canvas2d/CanvasRenderingContext2DState.h" |
6 | 6 |
7 #include "core/css/CSSFontSelector.h" | 7 #include "core/css/CSSFontSelector.h" |
8 #include "core/css/resolver/FilterOperationResolver.h" | 8 #include "core/css/resolver/FilterOperationResolver.h" |
9 #include "core/css/resolver/StyleBuilder.h" | 9 #include "core/css/resolver/StyleBuilder.h" |
10 #include "core/css/resolver/StyleResolverState.h" | 10 #include "core/css/resolver/StyleResolverState.h" |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 if (!m_resolvedFilter) { | 322 if (!m_resolvedFilter) { |
323 // Update the filter value to the proper base URL if needed. | 323 // Update the filter value to the proper base URL if needed. |
324 if (m_filterValue->mayContainUrl()) | 324 if (m_filterValue->mayContainUrl()) |
325 m_filterValue->reResolveUrl(styleResolutionHost->document()); | 325 m_filterValue->reResolveUrl(styleResolutionHost->document()); |
326 | 326 |
327 RefPtr<ComputedStyle> filterStyle = ComputedStyle::create(); | 327 RefPtr<ComputedStyle> filterStyle = ComputedStyle::create(); |
328 // Must set font in case the filter uses any font-relative units (em, ex) | 328 // Must set font in case the filter uses any font-relative units (em, ex) |
329 filterStyle->setFont(m_fontForFilter); | 329 filterStyle->setFont(m_fontForFilter); |
330 | 330 |
331 StyleResolverState resolverState(styleResolutionHost->document(), | 331 StyleResolverState resolverState(styleResolutionHost->document(), |
332 styleResolutionHost, filterStyle.get()); | 332 styleResolutionHost, filterStyle.get(), |
| 333 filterStyle.get()); |
333 resolverState.setStyle(filterStyle); | 334 resolverState.setStyle(filterStyle); |
334 | 335 |
335 StyleBuilder::applyProperty(CSSPropertyFilter, resolverState, | 336 StyleBuilder::applyProperty(CSSPropertyFilter, resolverState, |
336 *m_filterValue); | 337 *m_filterValue); |
337 resolverState.loadPendingResources(); | 338 resolverState.loadPendingResources(); |
338 | 339 |
339 // We can't reuse m_fillFlags and m_strokeFlags for the filter, since these | 340 // We can't reuse m_fillFlags and m_strokeFlags for the filter, since these |
340 // incorporate the global alpha, which isn't applicable here. | 341 // incorporate the global alpha, which isn't applicable here. |
341 PaintFlags fillFlagsForFilter; | 342 PaintFlags fillFlagsForFilter; |
342 m_fillStyle->applyToFlags(fillFlagsForFilter); | 343 m_fillStyle->applyToFlags(fillFlagsForFilter); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 flags->setLooper(0); | 593 flags->setLooper(0); |
593 flags->setImageFilter(shadowAndForegroundImageFilter()); | 594 flags->setImageFilter(shadowAndForegroundImageFilter()); |
594 return flags; | 595 return flags; |
595 } | 596 } |
596 flags->setLooper(sk_ref_sp(shadowAndForegroundDrawLooper())); | 597 flags->setLooper(sk_ref_sp(shadowAndForegroundDrawLooper())); |
597 flags->setImageFilter(0); | 598 flags->setImageFilter(0); |
598 return flags; | 599 return flags; |
599 } | 600 } |
600 | 601 |
601 } // namespace blink | 602 } // namespace blink |
OLD | NEW |