Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp

Issue 1862733002: Remove all use of crop edges from SkImageFilter::CropRect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix FEMorphology bug Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
322 m_fillStyle->applyToPaint(fillPaintForFilter); 322 m_fillStyle->applyToPaint(fillPaintForFilter);
323 m_strokeStyle->applyToPaint(strokePaintForFilter); 323 m_strokeStyle->applyToPaint(strokePaintForFilter);
324 fillPaintForFilter.setColor(m_fillStyle->paintColor()); 324 fillPaintForFilter.setColor(m_fillStyle->paintColor());
325 strokePaintForFilter.setColor(m_strokeStyle->paintColor()); 325 strokePaintForFilter.setColor(m_strokeStyle->paintColor());
326 FloatSize floatCanvasSize(canvasSize); 326 FloatSize floatCanvasSize(canvasSize);
327 const double effectiveZoom = 1.0; // Deliberately ignore zoom on the can vas element 327 const double effectiveZoom = 1.0; // Deliberately ignore zoom on the can vas element
328 filterEffectBuilder->build(styleResolutionHost, filterStyle->filter(), e ffectiveZoom, &floatCanvasSize, &fillPaintForFilter, &strokePaintForFilter); 328 filterEffectBuilder->build(styleResolutionHost, filterStyle->filter(), e ffectiveZoom, &floatCanvasSize, &fillPaintForFilter, &strokePaintForFilter);
329 329
330 SkiaImageFilterBuilder imageFilterBuilder; 330 SkiaImageFilterBuilder imageFilterBuilder;
331 RawPtr<FilterEffect> lastEffect = filterEffectBuilder->lastEffect(); 331 RawPtr<FilterEffect> lastEffect = filterEffectBuilder->lastEffect();
332 if (lastEffect) {
333 lastEffect->determineFilterPrimitiveSubregion();
f(malita) 2016/04/06 14:21:08 Is this something that could be pushed into Filter
Stephen White 2016/04/11 21:30:22 Unfortunately, each of the paths (HTML and SVG) is
f(malita) 2016/04/12 05:00:18 Ack.
334 }
332 m_resolvedFilter = imageFilterBuilder.build(lastEffect.get(), ColorSpace DeviceRGB); 335 m_resolvedFilter = imageFilterBuilder.build(lastEffect.get(), ColorSpace DeviceRGB);
333 if (m_resolvedFilter) { 336 if (m_resolvedFilter) {
334 updateFilterReferences(toHTMLCanvasElement(styleResolutionHost), con text, filterStyle->filter()); 337 updateFilterReferences(toHTMLCanvasElement(styleResolutionHost), con text, filterStyle->filter());
335 if (lastEffect->originTainted()) 338 if (lastEffect->originTainted())
336 context->setOriginTainted(); 339 context->setOriginTainted();
337 } 340 }
338 } 341 }
339 342
340 return m_resolvedFilter.get(); 343 return m_resolvedFilter.get();
341 } 344 }
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 paint->setLooper(0); 568 paint->setLooper(0);
566 paint->setImageFilter(shadowAndForegroundImageFilter()); 569 paint->setImageFilter(shadowAndForegroundImageFilter());
567 return paint; 570 return paint;
568 } 571 }
569 paint->setLooper(sk_ref_sp(shadowAndForegroundDrawLooper())); 572 paint->setLooper(sk_ref_sp(shadowAndForegroundDrawLooper()));
570 paint->setImageFilter(0); 573 paint->setImageFilter(0);
571 return paint; 574 return paint;
572 } 575 }
573 576
574 } // namespace blink 577 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698