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) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
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 10 matching lines...) Expand all Loading... |
21 */ | 21 */ |
22 | 22 |
23 #ifndef FilterEffect_h | 23 #ifndef FilterEffect_h |
24 #define FilterEffect_h | 24 #define FilterEffect_h |
25 | 25 |
26 #include "platform/PlatformExport.h" | 26 #include "platform/PlatformExport.h" |
27 #include "platform/geometry/FloatRect.h" | 27 #include "platform/geometry/FloatRect.h" |
28 #include "platform/geometry/IntRect.h" | 28 #include "platform/geometry/IntRect.h" |
29 #include "platform/graphics/Color.h" | 29 #include "platform/graphics/Color.h" |
30 #include "platform/graphics/ColorSpace.h" | 30 #include "platform/graphics/ColorSpace.h" |
| 31 #include "platform/heap/Handle.h" |
31 | 32 |
32 #include "third_party/skia/include/core/SkImageFilter.h" | 33 #include "third_party/skia/include/core/SkImageFilter.h" |
33 | 34 |
34 #include "wtf/PassOwnPtr.h" | 35 #include "wtf/PassOwnPtr.h" |
35 #include "wtf/RefCounted.h" | 36 #include "wtf/RefCounted.h" |
36 #include "wtf/RefPtr.h" | 37 #include "wtf/RefPtr.h" |
37 #include "wtf/Uint8ClampedArray.h" | 38 #include "wtf/Uint8ClampedArray.h" |
38 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
39 | 40 |
40 namespace blink { | 41 namespace blink { |
41 | 42 |
42 class Filter; | 43 class Filter; |
43 class FilterEffect; | 44 class FilterEffect; |
44 class TextStream; | 45 class TextStream; |
45 | 46 |
46 class SkiaImageFilterBuilder; | 47 class SkiaImageFilterBuilder; |
47 | 48 |
48 typedef Vector<RefPtr<FilterEffect> > FilterEffectVector; | 49 typedef WillBeHeapVector<RefPtrWillBeMember<FilterEffect> > FilterEffectVector; |
49 | 50 |
50 enum FilterEffectType { | 51 enum FilterEffectType { |
51 FilterEffectTypeUnknown, | 52 FilterEffectTypeUnknown, |
52 FilterEffectTypeImage, | 53 FilterEffectTypeImage, |
53 FilterEffectTypeTile, | 54 FilterEffectTypeTile, |
54 FilterEffectTypeSourceInput | 55 FilterEffectTypeSourceInput |
55 }; | 56 }; |
56 | 57 |
57 enum DetermineSubregionFlag { | 58 enum DetermineSubregionFlag { |
58 DetermineSubregionNone = 0, | 59 DetermineSubregionNone = 0, |
59 MapRectForward = 1, | 60 MapRectForward = 1, |
60 ClipToFilterRegion = 1 << 1 | 61 ClipToFilterRegion = 1 << 1 |
61 }; | 62 }; |
62 | 63 |
63 typedef int DetermineSubregionFlags; | 64 typedef int DetermineSubregionFlags; |
64 | 65 |
65 class PLATFORM_EXPORT FilterEffect : public RefCounted<FilterEffect> { | 66 class PLATFORM_EXPORT FilterEffect : public RefCountedWillBeGarbageCollectedFina
lized<FilterEffect> { |
66 public: | 67 public: |
67 virtual ~FilterEffect(); | 68 virtual ~FilterEffect(); |
| 69 virtual void trace(Visitor*); |
68 | 70 |
69 static bool isFilterSizeValid(const FloatRect&); | 71 static bool isFilterSizeValid(const FloatRect&); |
70 static float maxFilterArea(); | 72 static float maxFilterArea(); |
71 | 73 |
72 void clearResult(); | 74 void clearResult(); |
73 void clearResultsRecursive(); | 75 void clearResultsRecursive(); |
74 | 76 |
75 FilterEffectVector& inputEffects() { return m_inputEffects; } | 77 FilterEffectVector& inputEffects() { return m_inputEffects; } |
76 FilterEffect* inputEffect(unsigned) const; | 78 FilterEffect* inputEffect(unsigned) const; |
77 unsigned numberOfEffectInputs() const { return m_inputEffects.size(); } | 79 unsigned numberOfEffectInputs() const { return m_inputEffects.size(); } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 206 |
205 ColorSpace m_operatingColorSpace; | 207 ColorSpace m_operatingColorSpace; |
206 ColorSpace m_resultColorSpace; | 208 ColorSpace m_resultColorSpace; |
207 | 209 |
208 RefPtr<SkImageFilter> m_imageFilters[4]; | 210 RefPtr<SkImageFilter> m_imageFilters[4]; |
209 }; | 211 }; |
210 | 212 |
211 } // namespace blink | 213 } // namespace blink |
212 | 214 |
213 #endif // FilterEffect_h | 215 #endif // FilterEffect_h |
OLD | NEW |