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

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

Issue 2303703002: Revamp filter primitive region calculations for Filter Effects (Closed)
Patch Set: Baselines again; Manual for mac10.11-retina Created 4 years, 3 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) 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) 2013 Google Inc. All rights reserved. 4 * Copyright (C) 2013 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 FloatRect FETile::mapPaintRect(const FloatRect& rect, bool forward) const 41 FloatRect FETile::mapPaintRect(const FloatRect& rect, bool forward) const
42 { 42 {
43 return forward ? maxEffectRect() : inputEffect(0)->maxEffectRect(); 43 return forward ? maxEffectRect() : inputEffect(0)->maxEffectRect();
44 } 44 }
45 45
46 sk_sp<SkImageFilter> FETile::createImageFilter() 46 sk_sp<SkImageFilter> FETile::createImageFilter()
47 { 47 {
48 sk_sp<SkImageFilter> input(SkiaImageFilterBuilder::build(inputEffect(0), ope ratingColorSpace())); 48 sk_sp<SkImageFilter> input(SkiaImageFilterBuilder::build(inputEffect(0), ope ratingColorSpace()));
49 FloatRect srcRect = inputEffect(0)->filterPrimitiveSubregion(); 49 FloatRect srcRect;
50 FloatRect dstRect = applyEffectBoundaries(getFilter()->filterRegion()); 50 if (inputEffect(0)->getFilterEffectType() == FilterEffectTypeSourceInput)
Stephen White 2016/09/13 15:48:02 Would it not be possible to have make filterPrimit
fs 2016/09/13 16:11:52 I think that more general here would be to check c
51 srcRect = getFilter()->filterRegion();
52 else
53 srcRect = inputEffect(0)->filterPrimitiveSubregion();
54 FloatRect dstRect = filterPrimitiveSubregion();
51 return SkTileImageFilter::Make(srcRect, dstRect, std::move(input)); 55 return SkTileImageFilter::Make(srcRect, dstRect, std::move(input));
52 } 56 }
53 57
54 TextStream& FETile::externalRepresentation(TextStream& ts, int indent) const 58 TextStream& FETile::externalRepresentation(TextStream& ts, int indent) const
55 { 59 {
56 writeIndent(ts, indent); 60 writeIndent(ts, indent);
57 ts << "[feTile"; 61 ts << "[feTile";
58 FilterEffect::externalRepresentation(ts); 62 FilterEffect::externalRepresentation(ts);
59 ts << "]\n"; 63 ts << "]\n";
60 inputEffect(0)->externalRepresentation(ts, indent + 1); 64 inputEffect(0)->externalRepresentation(ts, indent + 1);
61 65
62 return ts; 66 return ts;
63 } 67 }
64 68
65 } // namespace blink 69 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698