Index: Source/core/platform/graphics/DrawLooper.h |
diff --git a/Source/core/css/resolver/TransformBuilder.h b/Source/core/platform/graphics/DrawLooper.h |
similarity index 56% |
copy from Source/core/css/resolver/TransformBuilder.h |
copy to Source/core/platform/graphics/DrawLooper.h |
index 8807205dac541fa3339f15c2e4bba92f22763d44..6bfdfc4ffe74c526e19b12298461bd0647e711b0 100644 |
--- a/Source/core/css/resolver/TransformBuilder.h |
+++ b/Source/core/platform/graphics/DrawLooper.h |
@@ -28,26 +28,53 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef TransformBuilder_h |
-#define TransformBuilder_h |
+#ifndef DrawLooper_h |
+#define DrawLooper_h |
-#include "core/platform/graphics/transforms/TransformOperations.h" |
+#include "third_party/skia/include/core/SkDrawLooper.h" |
+ |
+// SkPaint and SkPoint are needed before SkLayerDrawLooper.h; they should be #included there. |
+// Can be removed once https://codereview.chromium.org/14607015/ is submitted. |
+#include "third_party/skia/include/core/SkPaint.h" |
+#include "third_party/skia/include/core/SkPoint.h" |
+ |
+#include "third_party/skia/include/core/SkRefCnt.h" |
+#include "third_party/skia/include/effects/SkLayerDrawLooper.h" |
#include "wtf/Noncopyable.h" |
namespace WebCore { |
-class RenderStyle; |
-class CSSValue; |
+class Color; |
+class FloatSize; |
+ |
+class DrawLooper { |
+ // Implementing the copy constructor properly would require writing code to |
+ // copy the underlying SkDrawLooper. |
+ WTF_MAKE_NONCOPYABLE(DrawLooper); |
-class TransformBuilder { |
- WTF_MAKE_NONCOPYABLE(TransformBuilder); WTF_MAKE_FAST_ALLOCATED; |
public: |
- TransformBuilder(); |
- ~TransformBuilder(); |
+ enum ShadowTransformMode { |
+ ShadowRespectsTransforms, |
+ ShadowIgnoresTransforms |
+ }; |
+ enum ShadowAlphaMode { |
+ ShadowRespectsAlpha, |
+ ShadowIgnoresAlpha |
+ }; |
+ |
+ DrawLooper(); |
+ ~DrawLooper() { } |
+ SkLayerDrawLooper* skDrawLooper() { return m_skDrawLooper.get(); } |
+ |
+ void addUnmodifiedContent(); |
+ void addShadow(const FloatSize& offset, float blur, const Color&, |
+ ShadowTransformMode = ShadowRespectsTransforms, |
+ ShadowAlphaMode = ShadowRespectsAlpha); |
- static bool createTransformOperations(CSSValue* inValue, RenderStyle* inStyle, RenderStyle* rootStyle, TransformOperations& outOperations); |
+private: |
+ SkAutoTUnref<SkLayerDrawLooper> m_skDrawLooper; |
}; |
} // namespace WebCore |
-#endif // TransformBuilder_h |
+#endif // DrawLooper_h |