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

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

Issue 2945973002: use simpler api for SkMergeImageFilter (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | 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) 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) 2013 Google Inc. All rights reserved. 5 * Copyright (C) 2013 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 28 matching lines...) Expand all
39 sk_sp<SkImageFilter> FEMerge::CreateImageFilter() { 39 sk_sp<SkImageFilter> FEMerge::CreateImageFilter() {
40 unsigned size = NumberOfEffectInputs(); 40 unsigned size = NumberOfEffectInputs();
41 41
42 std::unique_ptr<sk_sp<SkImageFilter>[]> input_refs = 42 std::unique_ptr<sk_sp<SkImageFilter>[]> input_refs =
43 WrapArrayUnique(new sk_sp<SkImageFilter>[size]); 43 WrapArrayUnique(new sk_sp<SkImageFilter>[size]);
44 for (unsigned i = 0; i < size; ++i) { 44 for (unsigned i = 0; i < size; ++i) {
45 input_refs[i] = SkiaImageFilterBuilder::Build( 45 input_refs[i] = SkiaImageFilterBuilder::Build(
46 InputEffect(i), OperatingInterpolationSpace()); 46 InputEffect(i), OperatingInterpolationSpace());
47 } 47 }
48 SkImageFilter::CropRect rect = GetCropRect(); 48 SkImageFilter::CropRect rect = GetCropRect();
49 return SkMergeImageFilter::MakeN(input_refs.get(), size, nullptr, &rect); 49 return SkMergeImageFilter::Make(input_refs.get(), size, &rect);
50 } 50 }
51 51
52 TextStream& FEMerge::ExternalRepresentation(TextStream& ts, int indent) const { 52 TextStream& FEMerge::ExternalRepresentation(TextStream& ts, int indent) const {
53 WriteIndent(ts, indent); 53 WriteIndent(ts, indent);
54 ts << "[feMerge"; 54 ts << "[feMerge";
55 FilterEffect::ExternalRepresentation(ts); 55 FilterEffect::ExternalRepresentation(ts);
56 unsigned size = NumberOfEffectInputs(); 56 unsigned size = NumberOfEffectInputs();
57 ts << " mergeNodes=\"" << size << "\"]\n"; 57 ts << " mergeNodes=\"" << size << "\"]\n";
58 for (unsigned i = 0; i < size; ++i) 58 for (unsigned i = 0; i < size; ++i)
59 InputEffect(i)->ExternalRepresentation(ts, indent + 1); 59 InputEffect(i)->ExternalRepresentation(ts, indent + 1);
60 return ts; 60 return ts;
61 } 61 }
62 62
63 } // namespace blink 63 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698