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

Unified Diff: third_party/WebKit/Source/platform/testing/PaintPropertyTestHelpers.h

Issue 2565903002: [SPv2] Add createOpacityOnlyEffect test helper (Closed)
Patch Set: rebase Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/testing/PaintPropertyTestHelpers.h
diff --git a/third_party/WebKit/Source/platform/testing/PaintPropertyTestHelpers.h b/third_party/WebKit/Source/platform/testing/PaintPropertyTestHelpers.h
new file mode 100644
index 0000000000000000000000000000000000000000..444fab90b4def323675079bd4fd3fda5361ccc02
--- /dev/null
+++ b/third_party/WebKit/Source/platform/testing/PaintPropertyTestHelpers.h
@@ -0,0 +1,30 @@
+// 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/paint/ClipPaintPropertyNode.h"
+#include "platform/graphics/paint/EffectPaintPropertyNode.h"
+#include "platform/graphics/paint/PaintChunkProperties.h"
+#include "platform/graphics/paint/ScrollPaintPropertyNode.h"
+#include "platform/graphics/paint/TransformPaintPropertyNode.h"
+
+namespace blink {
+namespace testing {
+
+static inline PassRefPtr<EffectPaintPropertyNode> createOpacityOnlyEffect(PassRefPtr<const EffectPaintPropertyNode> parent, float opacity) {
pdr. 2016/12/12 18:47:08 Nit: please format to 80cols.
+ RefPtr<TransformPaintPropertyNode> localTransformSpace = const_cast<TransformPaintPropertyNode*>(parent->localTransformSpace());
+ RefPtr<ClipPaintPropertyNode> outputClip = const_cast<ClipPaintPropertyNode*>(parent->outputClip());
+ return EffectPaintPropertyNode::create(std::move(parent), std::move(localTransformSpace), std::move(outputClip), CompositorFilterOperations(), opacity);
+}
+
+static inline PaintChunkProperties defaultPaintChunkProperties() {
+ PaintChunkProperties defaultProperties;
+ defaultProperties.transform = TransformPaintPropertyNode::root();
+ defaultProperties.clip = ClipPaintPropertyNode::root();
+ defaultProperties.effect = EffectPaintPropertyNode::root();
+ defaultProperties.scroll = ScrollPaintPropertyNode::root();
+ return defaultProperties;
+}
+
+} // namespace testing
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698