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

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

Issue 1387573003: Pass SkiaImageFilterBuilder& to FilterEffect::createImageFilter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * Copyright (C) 2013 Google Inc. All rights reserved. 7 * Copyright (C) 2013 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 FloatRect FEOffset::mapRect(const FloatRect& rect, bool forward) 67 FloatRect FEOffset::mapRect(const FloatRect& rect, bool forward)
68 { 68 {
69 FloatRect result = rect; 69 FloatRect result = rect;
70 if (forward) 70 if (forward)
71 result.move(filter()->applyHorizontalScale(m_dx), filter()->applyVertica lScale(m_dy)); 71 result.move(filter()->applyHorizontalScale(m_dx), filter()->applyVertica lScale(m_dy));
72 else 72 else
73 result.move(-filter()->applyHorizontalScale(m_dx), -filter()->applyVerti calScale(m_dy)); 73 result.move(-filter()->applyHorizontalScale(m_dx), -filter()->applyVerti calScale(m_dy));
74 return result; 74 return result;
75 } 75 }
76 76
77 PassRefPtr<SkImageFilter> FEOffset::createImageFilter(SkiaImageFilterBuilder* bu ilder) 77 PassRefPtr<SkImageFilter> FEOffset::createImageFilter(SkiaImageFilterBuilder& bu ilder)
78 { 78 {
79 RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpa ce())); 79 RefPtr<SkImageFilter> input(builder.build(inputEffect(0), operatingColorSpac e()));
80 Filter* filter = this->filter(); 80 Filter* filter = this->filter();
81 SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset()); 81 SkImageFilter::CropRect cropRect = getCropRect(builder.cropOffset());
82 return adoptRef(SkOffsetImageFilter::Create(SkFloatToScalar(filter->applyHor izontalScale(m_dx)), SkFloatToScalar(filter->applyVerticalScale(m_dy)), input.ge t(), &cropRect)); 82 return adoptRef(SkOffsetImageFilter::Create(SkFloatToScalar(filter->applyHor izontalScale(m_dx)), SkFloatToScalar(filter->applyVerticalScale(m_dy)), input.ge t(), &cropRect));
83 } 83 }
84 84
85 TextStream& FEOffset::externalRepresentation(TextStream& ts, int indent) const 85 TextStream& FEOffset::externalRepresentation(TextStream& ts, int indent) const
86 { 86 {
87 writeIndent(ts, indent); 87 writeIndent(ts, indent);
88 ts << "[feOffset"; 88 ts << "[feOffset";
89 FilterEffect::externalRepresentation(ts); 89 FilterEffect::externalRepresentation(ts);
90 ts << " dx=\"" << dx() << "\" dy=\"" << dy() << "\"]\n"; 90 ts << " dx=\"" << dx() << "\" dy=\"" << dy() << "\"]\n";
91 inputEffect(0)->externalRepresentation(ts, indent + 1); 91 inputEffect(0)->externalRepresentation(ts, indent + 1);
92 return ts; 92 return ts;
93 } 93 }
94 94
95 } // namespace blink 95 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698