Index: third_party/WebKit/Source/platform/graphics/filters/PaintFilterEffect.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/filters/PaintFilterEffect.cpp b/third_party/WebKit/Source/platform/graphics/filters/PaintFilterEffect.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7addc0d998bdffefb847dc66cb813087b0effb76 |
--- /dev/null |
+++ b/third_party/WebKit/Source/platform/graphics/filters/PaintFilterEffect.cpp |
@@ -0,0 +1,41 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "platform/graphics/filters/PaintFilterEffect.h" |
+ |
+#include "platform/graphics/filters/Filter.h" |
+#include "platform/text/TextStream.h" |
+#include "third_party/skia/include/effects/SkPaintImageFilter.h" |
+ |
+namespace blink { |
+ |
+PaintFilterEffect::PaintFilterEffect(Filter* filter, const SkPaint& paint) |
+ : FilterEffect(filter) |
+ , m_paint(paint) |
+{ |
+ setOperatingColorSpace(ColorSpaceDeviceRGB); |
+} |
+ |
+PaintFilterEffect::~PaintFilterEffect() |
+{ |
+} |
+ |
+PassRefPtrWillBeRawPtr<PaintFilterEffect> PaintFilterEffect::create(Filter* filter, const SkPaint& paint) |
+{ |
+ return adoptRefWillBeNoop(new PaintFilterEffect(filter, paint)); |
+} |
+ |
+PassRefPtr<SkImageFilter> PaintFilterEffect::createImageFilter(SkiaImageFilterBuilder&) |
+{ |
+ return adoptRef(SkPaintImageFilter::Create(m_paint, nullptr)); |
+} |
+ |
+TextStream& PaintFilterEffect::externalRepresentation(TextStream& ts, int indent) const |
+{ |
+ writeIndent(ts, indent); |
+ ts << "[PaintFilterEffect]\n"; |
+ return ts; |
+} |
+ |
+} // namespace blink |