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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/filters/FilterOperation.cpp

Issue 2341923002: Harmonize FilterEffect::mapRect and mapPaintRect (Closed)
Patch Set: Rebase Created 4 years, 2 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 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 { 55 {
56 visitor->trace(m_filter); 56 visitor->trace(m_filter);
57 FilterOperation::trace(visitor); 57 FilterOperation::trace(visitor);
58 } 58 }
59 59
60 FloatRect ReferenceFilterOperation::mapRect(const FloatRect& rect) const 60 FloatRect ReferenceFilterOperation::mapRect(const FloatRect& rect) const
61 { 61 {
62 const auto* lastEffect = m_filter ? m_filter->lastEffect() : nullptr; 62 const auto* lastEffect = m_filter ? m_filter->lastEffect() : nullptr;
63 if (!lastEffect) 63 if (!lastEffect)
64 return rect; 64 return rect;
65 return lastEffect->mapRectRecursive(rect); 65 return lastEffect->mapRect(rect);
66 } 66 }
67 67
68 FilterOperation* BasicColorMatrixFilterOperation::blend(const FilterOperation* f rom, double progress) const 68 FilterOperation* BasicColorMatrixFilterOperation::blend(const FilterOperation* f rom, double progress) const
69 { 69 {
70 double fromAmount; 70 double fromAmount;
71 if (from) { 71 if (from) {
72 ASSERT_WITH_SECURITY_IMPLICATION(from->isSameType(*this)); 72 ASSERT_WITH_SECURITY_IMPLICATION(from->isSameType(*this));
73 fromAmount = toBasicColorMatrixFilterOperation(from)->amount(); 73 fromAmount = toBasicColorMatrixFilterOperation(from)->amount();
74 } else { 74 } else {
75 switch (m_type) { 75 switch (m_type) {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 bool BoxReflectFilterOperation::operator==(const FilterOperation& o) const 204 bool BoxReflectFilterOperation::operator==(const FilterOperation& o) const
205 { 205 {
206 if (!isSameType(o)) 206 if (!isSameType(o))
207 return false; 207 return false;
208 const auto& other = static_cast<const BoxReflectFilterOperation&>(o); 208 const auto& other = static_cast<const BoxReflectFilterOperation&>(o);
209 return m_reflection == other.m_reflection; 209 return m_reflection == other.m_reflection;
210 } 210 }
211 211
212 } // namespace blink 212 } // namespace blink
213 213
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698