Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / platform / graphics / filters / SourceGraphic.cpp
index f9c1195..b5bf6c3 100644 (file)
 
 #include "platform/graphics/GraphicsContext.h"
 #include "platform/text/TextStream.h"
+#include "third_party/skia/include/effects/SkPictureImageFilter.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/text/WTFString.h"
 
-namespace WebCore {
+namespace blink {
 
 PassRefPtr<SourceGraphic> SourceGraphic::create(Filter* filter)
 {
@@ -62,6 +63,19 @@ void SourceGraphic::applySoftware()
     }
 }
 
+void SourceGraphic::setDisplayList(PassRefPtr<DisplayList> displayList)
+{
+    m_displayList = displayList;
+}
+
+PassRefPtr<SkImageFilter> SourceGraphic::createImageFilter(SkiaImageFilterBuilder*)
+{
+    if (!m_displayList)
+        return nullptr;
+
+    return adoptRef(SkPictureImageFilter::Create(m_displayList->picture(), m_displayList->bounds()));
+}
+
 TextStream& SourceGraphic::externalRepresentation(TextStream& ts, int indent) const
 {
     writeIndent(ts, indent);
@@ -69,4 +83,4 @@ TextStream& SourceGraphic::externalRepresentation(TextStream& ts, int indent) co
     return ts;
 }
 
-} // namespace WebCore
+} // namespace blink