#ifndef CC_TEST_PROPERTY_TREE_TEST_UTILS_H_
#define CC_TEST_PROPERTY_TREE_TEST_UTILS_H_
#include "cc/trees/clip_node.h"
#include "cc/trees/effect_node.h"
#include "cc/trees/property_tree.h"
#include "cc/trees/scroll_node.h"
#include "cc/trees/transform_node.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/vector2d_f.h"
namespace cc {
class Layer;
class LayerImpl;
class PictureLayer;
class PictureLayerImpl;
void SetupRootProperties(Layer* root);
void SetupRootProperties(LayerImpl* root);
void CopyProperties(Layer* from, Layer* to);
void CopyProperties(const LayerImpl* from, LayerImpl* to);
TransformNode& CreateTransformNode(Layer*,
int parent_id = kInvalidPropertyNodeId);
TransformNode& CreateTransformNode(LayerImpl*,
int parent_id = kInvalidPropertyNodeId);
ClipNode& CreateClipNode(Layer*, int parent_id = kInvalidPropertyNodeId);
ClipNode& CreateClipNode(LayerImpl*, int parent_id = kInvalidPropertyNodeId);
EffectNode& CreateEffectNode(Layer*, int parent_id = kInvalidPropertyNodeId);
EffectNode& CreateEffectNode(LayerImpl*,
int parent_id = kInvalidPropertyNodeId);
ScrollNode& CreateScrollNode(Layer*,
const gfx::Size& scroll_container_bounds,
int parent_id = kInvalidPropertyNodeId);
ScrollNode& CreateScrollNode(LayerImpl*,
const gfx::Size& scroll_container_bounds,
int parent_id = kInvalidPropertyNodeId);
TransformNode& CreateTransformNode(PropertyTrees*, int parent_id);
ClipNode& CreateClipNode(PropertyTrees*, int parent_id, int transform_id);
EffectNode& CreateEffectNode(PropertyTrees*,
int parent_id,
int transform_id,
int clip_id);
ScrollNode& CreateScrollNodeForNonCompositedScroller(
PropertyTrees* property_trees,
int parent_id,
ElementId element_id,
const gfx::Size& bounds,
const gfx::Size& scroll_container_bounds);
void SetupMaskProperties(LayerImpl* masked_layer, PictureLayerImpl* mask_layer);
void SetupMaskProperties(Layer* masked_layer, PictureLayer* mask_layer);
PropertyTrees* GetPropertyTrees(Layer* layer);
const PropertyTrees* GetPropertyTrees(const Layer* layer);
PropertyTrees* GetPropertyTrees(LayerImpl* layer);
const PropertyTrees* GetPropertyTrees(const LayerImpl* layer);
template <typename LayerType>
TransformNode* GetTransformNode(LayerType* layer) { … }
template <typename LayerType>
const TransformNode* GetTransformNode(const LayerType* layer) { … }
template <typename LayerType>
ClipNode* GetClipNode(LayerType* layer) { … }
template <typename LayerType>
const ClipNode* GetClipNode(const LayerType* layer) { … }
template <typename LayerType>
EffectNode* GetEffectNode(LayerType* layer) { … }
template <typename LayerType>
const EffectNode* GetEffectNode(const LayerType* layer) { … }
template <typename LayerType>
ScrollNode* GetScrollNode(LayerType* layer) { … }
template <typename LayerType>
const ScrollNode* GetScrollNode(const LayerType* layer) { … }
void SetScrollOffset(Layer*, const gfx::PointF&);
void SetScrollOffset(LayerImpl*, const gfx::PointF&);
void SetScrollOffsetFromImplSide(Layer*, const gfx::PointF&);
template <typename LayerType>
void SetLocalTransformChanged(LayerType* layer) { … }
template <typename LayerType>
void SetWillChangeTransform(LayerType* layer, bool will_change_transform) { … }
template <typename LayerType>
void SetTransform(LayerType* layer, const gfx::Transform& transform) { … }
template <typename LayerType>
void SetTransformOrigin(LayerType* layer, const gfx::Point3F& origin) { … }
template <typename LayerType>
void SetPostTranslation(LayerType* layer,
const gfx::Vector2dF& post_translation) { … }
template <typename LayerType>
void SetOpacity(LayerType* layer, float opacity) { … }
template <typename LayerType>
void SetFilter(LayerType* layer, const FilterOperations& filters) { … }
template <typename LayerType>
void SetRenderSurfaceReason(LayerType* layer, RenderSurfaceReason reason) { … }
template <typename LayerType>
void SetBackdropFilter(LayerType* layer, const FilterOperations& filters) { … }
template <typename LayerType>
void SetClipRect(LayerType* layer, const gfx::RectF& clip) { … }
void SetupViewport(Layer* root,
const gfx::Size& outer_viewport_size,
const gfx::Size& content_size);
void SetupViewport(Layer* root,
scoped_refptr<Layer> outer_viewport_scroll_layer,
const gfx::Size& outer_viewport_size);
void SetupViewport(LayerImpl* root,
const gfx::Size& outer_viewport_size,
const gfx::Size& content_size);
RenderSurfaceImpl* GetRenderSurface(LayerImpl* layer);
const RenderSurfaceImpl* GetRenderSurface(const LayerImpl* layer);
gfx::PointF ScrollOffsetBase(const LayerImpl* layer);
gfx::Vector2dF ScrollDelta(const LayerImpl* layer);
gfx::PointF CurrentScrollOffset(const Layer* layer,
const PropertyTrees* property_trees = nullptr);
gfx::PointF CurrentScrollOffset(const LayerImpl* layer);
gfx::PointF MaxScrollOffset(const LayerImpl* layer);
}
#endif