| Index: third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h
|
| diff --git a/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h b/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8bc10b29244f94f42e075dda197d9eb2864d39a5
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h
|
| @@ -0,0 +1,97 @@
|
| +// 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.
|
| +
|
| +#ifndef ScrollPaintPropertyNode_h
|
| +#define ScrollPaintPropertyNode_h
|
| +
|
| +#include "platform/PlatformExport.h"
|
| +#include "platform/geometry/FloatSize.h"
|
| +#include "platform/graphics/paint/TransformPaintPropertyNode.h"
|
| +#include "wtf/PassRefPtr.h"
|
| +#include "wtf/RefCounted.h"
|
| +#include "wtf/RefPtr.h"
|
| +
|
| +#include <iosfwd>
|
| +
|
| +namespace blink {
|
| +
|
| +// A scroll node contains auxillary scrolling information about areas that
|
| +// respond to user input and how far they can be scrolled. The actual scroll
|
| +// offset is applied in an associated TransformPaintPropertyNode.
|
| +class PLATFORM_EXPORT ScrollPaintPropertyNode : public RefCounted<ScrollPaintPropertyNode> {
|
| +public:
|
| + static PassRefPtr<ScrollPaintPropertyNode> create(
|
| + PassRefPtr<const ScrollPaintPropertyNode> parent,
|
| + PassRefPtr<const TransformPaintPropertyNode> transform,
|
| + const FloatSize& clip,
|
| + const FloatSize& bounds,
|
| + bool userScrollableHorizontal,
|
| + bool userScrollableVertical)
|
| + {
|
| + return adoptRef(new ScrollPaintPropertyNode(parent, transform, clip, bounds, userScrollableHorizontal, userScrollableVertical));
|
| + }
|
| +
|
| + void update(PassRefPtr<const ScrollPaintPropertyNode> parent, PassRefPtr<const TransformPaintPropertyNode> transform, const FloatSize& clip, const FloatSize& bounds, bool userScrollableHorizontal, bool userScrollableVertical)
|
| + {
|
| + m_parent = parent;
|
| + m_transform = transform;
|
| + m_clip = clip;
|
| + m_bounds = bounds;
|
| + m_userScrollableHorizontal = userScrollableHorizontal;
|
| + m_userScrollableVertical = userScrollableVertical;
|
| + }
|
| +
|
| + const ScrollPaintPropertyNode* parent() const { return m_parent.get(); }
|
| +
|
| + // Transform that the scroll is relative to.
|
| + const TransformPaintPropertyNode* transform() const { return m_transform.get(); }
|
| +
|
| + // The clipped area that contains the scrolled content. In the common case
|
| + // this is the area that could respond to user input.
|
| + const FloatSize& clip() const { return m_clip; }
|
| +
|
| + // The bounds of the content that is scrolled.
|
| + const FloatSize& bounds() const { return m_bounds; }
|
| +
|
| + bool userScrollableHorizontal() const { return m_userScrollableHorizontal; }
|
| + bool userScrollableVertical() const { return m_userScrollableVertical; }
|
| +
|
| +private:
|
| + ScrollPaintPropertyNode(
|
| + PassRefPtr<const ScrollPaintPropertyNode> parent,
|
| + PassRefPtr<const TransformPaintPropertyNode> transform,
|
| + FloatSize clip,
|
| + FloatSize bounds,
|
| + bool userScrollableHorizontal,
|
| + bool userScrollableVertical)
|
| + : m_parent(parent)
|
| + , m_transform(transform)
|
| + , m_clip(clip)
|
| + , m_bounds(bounds)
|
| + , m_userScrollableHorizontal(userScrollableHorizontal)
|
| + , m_userScrollableVertical(userScrollableVertical)
|
| + {
|
| + }
|
| +
|
| + RefPtr<const ScrollPaintPropertyNode> m_parent;
|
| + // TODO(pdr): Refactor as m_scrollOffsetTransform.
|
| + RefPtr<const TransformPaintPropertyNode> m_transform;
|
| + // TODO(pdr): Add an offset for the clip and bounds to the transform.
|
| + FloatSize m_clip;
|
| + FloatSize m_bounds;
|
| + bool m_userScrollableHorizontal;
|
| + bool m_userScrollableVertical;
|
| + // TODO(pdr): Add main thread scrolling reasons.
|
| + // TODO(pdr): Add scrollable bit.
|
| + // TODO(pdr): Add 2 bits for whether this is a viewport scroll node.
|
| + // TODO(pdr): Add a bit for whether this is affected by page scale.
|
| +};
|
| +
|
| +// Redeclared here to avoid ODR issues.
|
| +// See platform/testing/PaintPrinters.h.
|
| +void PrintTo(const ScrollPaintPropertyNode&, std::ostream*);
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // ScrollPaintPropertyNode_h
|
|
|