OLD | NEW |
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 Loading... |
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; | 49 FloatRect srcRect = inputEffect(0)->filterPrimitiveSubregion(); |
50 if (inputEffect(0)->getFilterEffectType() == FilterEffectTypeSourceInput) | 50 FloatRect dstRect = applyEffectBoundaries(getFilter()->filterRegion()); |
51 srcRect = getFilter()->filterRegion(); | |
52 else | |
53 srcRect = inputEffect(0)->filterPrimitiveSubregion(); | |
54 FloatRect dstRect = filterPrimitiveSubregion(); | |
55 return SkTileImageFilter::Make(srcRect, dstRect, std::move(input)); | 51 return SkTileImageFilter::Make(srcRect, dstRect, std::move(input)); |
56 } | 52 } |
57 | 53 |
58 TextStream& FETile::externalRepresentation(TextStream& ts, int indent) const | 54 TextStream& FETile::externalRepresentation(TextStream& ts, int indent) const |
59 { | 55 { |
60 writeIndent(ts, indent); | 56 writeIndent(ts, indent); |
61 ts << "[feTile"; | 57 ts << "[feTile"; |
62 FilterEffect::externalRepresentation(ts); | 58 FilterEffect::externalRepresentation(ts); |
63 ts << "]\n"; | 59 ts << "]\n"; |
64 inputEffect(0)->externalRepresentation(ts, indent + 1); | 60 inputEffect(0)->externalRepresentation(ts, indent + 1); |
65 | 61 |
66 return ts; | 62 return ts; |
67 } | 63 } |
68 | 64 |
69 } // namespace blink | 65 } // namespace blink |
OLD | NEW |