| 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 SkPaint fillPaintForFilter; | 310 SkPaint fillPaintForFilter; |
| 311 SkPaint strokePaintForFilter; | 311 SkPaint strokePaintForFilter; |
| 312 m_fillStyle->applyToPaint(fillPaintForFilter); | 312 m_fillStyle->applyToPaint(fillPaintForFilter); |
| 313 m_strokeStyle->applyToPaint(strokePaintForFilter); | 313 m_strokeStyle->applyToPaint(strokePaintForFilter); |
| 314 fillPaintForFilter.setColor(m_fillStyle->paintColor()); | 314 fillPaintForFilter.setColor(m_fillStyle->paintColor()); |
| 315 strokePaintForFilter.setColor(m_strokeStyle->paintColor()); | 315 strokePaintForFilter.setColor(m_strokeStyle->paintColor()); |
| 316 FloatSize floatCanvasSize(canvasSize); | 316 FloatSize floatCanvasSize(canvasSize); |
| 317 const double effectiveZoom = 1.0; // Deliberately ignore zoom on the can
vas element | 317 const double effectiveZoom = 1.0; // Deliberately ignore zoom on the can
vas element |
| 318 filterEffectBuilder->build(styleResolutionHost, filterStyle->filter(), e
ffectiveZoom, &floatCanvasSize, &fillPaintForFilter, &strokePaintForFilter); | 318 filterEffectBuilder->build(styleResolutionHost, filterStyle->filter(), e
ffectiveZoom, &floatCanvasSize, &fillPaintForFilter, &strokePaintForFilter); |
| 319 | 319 |
| 320 SkiaImageFilterBuilder imageFilterBuilder; | |
| 321 FilterEffect* lastEffect = filterEffectBuilder->lastEffect(); | 320 FilterEffect* lastEffect = filterEffectBuilder->lastEffect(); |
| 322 if (lastEffect) { | 321 if (lastEffect) { |
| 323 lastEffect->determineFilterPrimitiveSubregion(); | 322 lastEffect->determineFilterPrimitiveSubregion(); |
| 324 } | 323 } |
| 325 m_resolvedFilter = imageFilterBuilder.build(lastEffect, ColorSpaceDevice
RGB); | 324 m_resolvedFilter = SkiaImageFilterBuilder::build(lastEffect, ColorSpaceD
eviceRGB); |
| 326 if (m_resolvedFilter) { | 325 if (m_resolvedFilter) { |
| 327 updateFilterReferences(toHTMLCanvasElement(styleResolutionHost), con
text, filterStyle->filter()); | 326 updateFilterReferences(toHTMLCanvasElement(styleResolutionHost), con
text, filterStyle->filter()); |
| 328 if (lastEffect->originTainted()) | 327 if (lastEffect->originTainted()) |
| 329 context->setOriginTainted(); | 328 context->setOriginTainted(); |
| 330 } | 329 } |
| 331 } | 330 } |
| 332 | 331 |
| 333 return m_resolvedFilter.get(); | 332 return m_resolvedFilter.get(); |
| 334 } | 333 } |
| 335 | 334 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 paint->setLooper(0); | 557 paint->setLooper(0); |
| 559 paint->setImageFilter(shadowAndForegroundImageFilter()); | 558 paint->setImageFilter(shadowAndForegroundImageFilter()); |
| 560 return paint; | 559 return paint; |
| 561 } | 560 } |
| 562 paint->setLooper(sk_ref_sp(shadowAndForegroundDrawLooper())); | 561 paint->setLooper(sk_ref_sp(shadowAndForegroundDrawLooper())); |
| 563 paint->setImageFilter(0); | 562 paint->setImageFilter(0); |
| 564 return paint; | 563 return paint; |
| 565 } | 564 } |
| 566 | 565 |
| 567 } // namespace blink | 566 } // namespace blink |
| OLD | NEW |