Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(521)

Unified Diff: third_party/WebKit/Source/platform/graphics/CompositorFilterOperations.cpp

Issue 1616653002: CC Animation: Move files from cc_blink to Source/platform/animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Fix copyrights and years. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/CompositorFilterOperations.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/CompositorFilterOperations.cpp b/third_party/WebKit/Source/platform/graphics/CompositorFilterOperations.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f575c1fb7cc1ff0a572a9fa85a8e6e40aaf8190f
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/CompositorFilterOperations.cpp
@@ -0,0 +1,111 @@
+// 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/CompositorFilterOperations.h"
+
+#include "skia/ext/refptr.h"
+#include "third_party/skia/include/core/SkImageFilter.h"
+
+namespace blink {
+
+CompositorFilterOperations::CompositorFilterOperations()
+{
+}
+
+CompositorFilterOperations::~CompositorFilterOperations()
+{
+}
+
+const cc::FilterOperations& CompositorFilterOperations::asFilterOperations() const
+{
+ return m_filterOperations;
+}
+
+void CompositorFilterOperations::appendGrayscaleFilter(float amount)
+{
+ m_filterOperations.Append(cc::FilterOperation::CreateGrayscaleFilter(amount));
+}
+
+void CompositorFilterOperations::appendSepiaFilter(float amount)
+{
+ m_filterOperations.Append(cc::FilterOperation::CreateSepiaFilter(amount));
+}
+
+void CompositorFilterOperations::appendSaturateFilter(float amount)
+{
+ m_filterOperations.Append(cc::FilterOperation::CreateSaturateFilter(amount));
+}
+
+void CompositorFilterOperations::appendHueRotateFilter(float amount)
+{
+ m_filterOperations.Append(cc::FilterOperation::CreateHueRotateFilter(amount));
+}
+
+void CompositorFilterOperations::appendInvertFilter(float amount)
+{
+ m_filterOperations.Append(cc::FilterOperation::CreateInvertFilter(amount));
+}
+
+void CompositorFilterOperations::appendBrightnessFilter(float amount)
+{
+ m_filterOperations.Append(
+ cc::FilterOperation::CreateBrightnessFilter(amount));
+}
+
+void CompositorFilterOperations::appendContrastFilter(float amount)
+{
+ m_filterOperations.Append(cc::FilterOperation::CreateContrastFilter(amount));
+}
+
+void CompositorFilterOperations::appendOpacityFilter(float amount)
+{
+ m_filterOperations.Append(cc::FilterOperation::CreateOpacityFilter(amount));
+}
+
+void CompositorFilterOperations::appendBlurFilter(float amount)
+{
+ m_filterOperations.Append(cc::FilterOperation::CreateBlurFilter(amount));
+}
+
+void CompositorFilterOperations::appendDropShadowFilter(IntPoint offset, float stdDeviation, Color color)
+{
+ gfx::Point gfxOffset(offset.x(), offset.y());
+ m_filterOperations.Append(cc::FilterOperation::CreateDropShadowFilter(gfxOffset, stdDeviation, color.rgb()));
+}
+
+void CompositorFilterOperations::appendColorMatrixFilter(SkScalar matrix[20])
+{
+ m_filterOperations.Append(
+ cc::FilterOperation::CreateColorMatrixFilter(matrix));
+}
+
+void CompositorFilterOperations::appendZoomFilter(float amount, int inset)
+{
+ m_filterOperations.Append(
+ cc::FilterOperation::CreateZoomFilter(amount, inset));
+}
+
+void CompositorFilterOperations::appendSaturatingBrightnessFilter(float amount)
+{
+ m_filterOperations.Append(
+ cc::FilterOperation::CreateSaturatingBrightnessFilter(amount));
+}
+
+void CompositorFilterOperations::appendReferenceFilter(SkImageFilter* imageFilter)
+{
+ m_filterOperations.Append(
+ cc::FilterOperation::CreateReferenceFilter(skia::SharePtr(imageFilter)));
+}
+
+void CompositorFilterOperations::clear()
+{
+ m_filterOperations.Clear();
+}
+
+bool CompositorFilterOperations::isEmpty() const
+{
+ return m_filterOperations.IsEmpty();
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698