Chromium Code Reviews| 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 |