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

Side by Side Diff: Source/platform/graphics/filters/FilterEffect.cpp

Issue 182113002: Use implicit conversion to FloatRect to remove overloaded filterSize (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « Source/platform/graphics/filters/FilterEffect.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com> 2 * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 * Copyright (C) 2012 University of Szeged 5 * Copyright (C) 2012 University of Szeged
6 * Copyright (C) 2013 Google Inc. All rights reserved. 6 * Copyright (C) 2013 Google Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 bool FilterEffect::isFilterSizeValid(const FloatRect& rect) 64 bool FilterEffect::isFilterSizeValid(const FloatRect& rect)
65 { 65 {
66 if (rect.width() < 0 || rect.height() < 0 66 if (rect.width() < 0 || rect.height() < 0
67 || (rect.height() * rect.width() > kMaxFilterArea)) 67 || (rect.height() * rect.width() > kMaxFilterArea))
68 return false; 68 return false;
69 69
70 return true; 70 return true;
71 } 71 }
72 72
73
74 bool FilterEffect::isFilterSizeValid(const IntRect& rect)
75 {
76 return isFilterSizeValid(FloatRect(rect));
77 }
78
79 FloatRect FilterEffect::determineAbsolutePaintRect(const FloatRect& originalRequ estedRect) 73 FloatRect FilterEffect::determineAbsolutePaintRect(const FloatRect& originalRequ estedRect)
80 { 74 {
81 FloatRect requestedRect = originalRequestedRect; 75 FloatRect requestedRect = originalRequestedRect;
82 // Filters in SVG clip to primitive subregion, while CSS doesn't. 76 // Filters in SVG clip to primitive subregion, while CSS doesn't.
83 if (m_clipsToBounds) 77 if (m_clipsToBounds)
84 requestedRect.intersect(maxEffectRect()); 78 requestedRect.intersect(maxEffectRect());
85 79
86 // We may be called multiple times if result is used more than once. Return 80 // We may be called multiple times if result is used more than once. Return
87 // quickly if if nothing new is required. 81 // quickly if if nothing new is required.
88 if (absolutePaintRect().contains(enclosingIntRect(requestedRect))) 82 if (absolutePaintRect().contains(enclosingIntRect(requestedRect)))
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 } 569 }
576 if (hasHeight()) { 570 if (hasHeight()) {
577 rect.fBottom = rect.fTop + boundaries.height(); 571 rect.fBottom = rect.fTop + boundaries.height();
578 flags |= SkImageFilter::CropRect::kHasBottom_CropEdge; 572 flags |= SkImageFilter::CropRect::kHasBottom_CropEdge;
579 } 573 }
580 rect = filter()->mapLocalRectToAbsoluteRect(rect); 574 rect = filter()->mapLocalRectToAbsoluteRect(rect);
581 return SkImageFilter::CropRect(rect, flags); 575 return SkImageFilter::CropRect(rect, flags);
582 } 576 }
583 577
584 } // namespace WebCore 578 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/graphics/filters/FilterEffect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698