Changeset 44840 in webkit
- Timestamp:
- Jun 18, 2009 10:00:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r44839 r44840 1 2009-06-18 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Oliver Hunt. 4 5 Added a test of batik and a own one to check behavior of the 6 new feTile effect in SVG. 7 8 * platform/mac/svg/batik/filters/feTile-expected.checksum: Added. 9 * platform/mac/svg/batik/filters/feTile-expected.png: Added. 10 * platform/mac/svg/batik/filters/feTile-expected.txt: Added. 11 * platform/mac/svg/filters/feTile-expected.checksum: Added. 12 * platform/mac/svg/filters/feTile-expected.png: Added. 13 * platform/mac/svg/filters/feTile-expected.txt: Added. 14 * svg/batik/filters/feTile.svg: Added. 15 * svg/filters/feTile.svg: Added. 16 1 17 2009-06-18 Dirk Schulze <krit@webkit.org> 2 18 -
trunk/WebCore/ChangeLog
r44839 r44840 1 2009-06-18 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Oliver Hunt. 4 5 feTile implementation missing 6 [https://bugs.webkit.org/show_bug.cgi?id=26419] 7 8 Implementation of feTile, a pattern effect for SVG filters. It was 9 necessary to modify FilterEffect since source inputs need a secial 10 logic and we have to identify if an effect is a source input. 11 12 Tests: svg/batik/filters/feTile.svg 13 svg/filters/feTile.svg 14 15 * platform/graphics/filters/FilterEffect.h: 16 (WebCore::FilterEffect::isSourceInput): 17 * platform/graphics/filters/SourceAlpha.h: 18 (WebCore::SourceAlpha::isSourceInput): 19 * platform/graphics/filters/SourceGraphic.h: 20 (WebCore::SourceGraphic::isSourceInput): 21 * svg/graphics/filters/SVGFETile.cpp: 22 (WebCore::FETile::apply): 23 1 24 2009-06-18 Dirk Schulze <krit@webkit.org> 2 25 -
trunk/WebCore/platform/graphics/filters/FilterEffect.h
r44810 r44840 84 84 virtual void dump() = 0; 85 85 86 virtual bool isSourceInput() { return false; } 87 86 88 virtual TextStream& externalRepresentation(TextStream&) const; 87 89 protected: -
trunk/WebCore/platform/graphics/filters/SourceAlpha.h
r44655 r44840 35 35 static const AtomicString& effectName(); 36 36 37 virtual bool isSourceInput() { return true; } 37 38 virtual FloatRect calculateEffectRect(Filter* filter) { return filter->sourceImageRect(); } 38 39 void apply(Filter*); -
trunk/WebCore/platform/graphics/filters/SourceGraphic.h
r44655 r44840 36 36 static const AtomicString& effectName(); 37 37 38 virtual bool isSourceInput() { return true; } 38 39 virtual FloatRect calculateEffectRect(Filter*); 39 40 void apply(Filter*); -
trunk/WebCore/svg/graphics/filters/SVGFETile.cpp
r44655 r44840 1 1 /* 2 2 Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com> 3 2009 Dirk Schulze <krit@webkit.org> 3 4 4 5 This library is free software; you can redistribute it and/or … … 24 25 25 26 #include "Filter.h" 27 #include "GraphicsContext.h" 28 #include "Pattern.h" 29 #include "TransformationMatrix.h" 26 30 #include "SVGRenderTreeAsText.h" 27 31 … … 45 49 } 46 50 47 void FETile::apply(Filter* )51 void FETile::apply(Filter* filter) 48 52 { 53 m_in->apply(filter); 54 if (!m_in->resultImage()) 55 return; 56 57 GraphicsContext* filterContext = getEffectContext(); 58 if (!filterContext) 59 return; 60 61 IntRect tileRect = enclosingIntRect(m_in->subRegion()); 62 63 // Source input needs more attention. It has the size of the filterRegion but gives the 64 // size of the cutted sourceImage back. This is part of the specification and optimization. 65 if (m_in->isSourceInput()) 66 tileRect = enclosingIntRect(filter->filterRegion()); 67 68 OwnPtr<ImageBuffer> tileImage = ImageBuffer::create(tileRect.size(), false); 69 GraphicsContext* tileImageContext = tileImage->context(); 70 tileImageContext->drawImage(m_in->resultImage()->image(), IntPoint()); 71 RefPtr<Pattern> pattern = Pattern::create(tileImage->image(), true, true); 72 73 TransformationMatrix matrix; 74 matrix.translate(m_in->subRegion().x() - subRegion().x(), m_in->subRegion().y() - subRegion().y()); 75 pattern.get()->setPatternSpaceTransform(matrix); 76 77 filterContext->setFillPattern(pattern); 78 filterContext->fillRect(FloatRect(FloatPoint(), subRegion().size())); 49 79 } 50 80
Note: See TracChangeset
for help on using the changeset viewer.