| Index: third_party/WebKit/Source/platform/graphics/CompositorMutation.h
|
| diff --git a/third_party/WebKit/Source/platform/graphics/CompositorMutation.h b/third_party/WebKit/Source/platform/graphics/CompositorMutation.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..dd499d606a55b2d72d2084ae03d16fb8cd58059a
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/platform/graphics/CompositorMutation.h
|
| @@ -0,0 +1,61 @@
|
| +// 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 CompositorMutation_h
|
| +#define CompositorMutation_h
|
| +
|
| +#include "platform/graphics/CompositorMutableProperties.h"
|
| +#include "third_party/skia/include/utils/SkMatrix44.h"
|
| +#include "wtf/HashMap.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class CompositorMutation {
|
| +public:
|
| + void setOpacity(float opacity)
|
| + {
|
| + m_mutatedFlags |= CompositorMutablePropertyOpacity;
|
| + m_opacity = opacity;
|
| + }
|
| + void setScrollLeft(float scrollLeft)
|
| + {
|
| + m_mutatedFlags |= CompositorMutablePropertyScrollLeft;
|
| + m_scrollLeft = scrollLeft;
|
| + }
|
| + void setScrollTop(float scrollTop)
|
| + {
|
| + m_mutatedFlags |= CompositorMutablePropertyScrollTop;
|
| + m_scrollTop = scrollTop;
|
| + }
|
| + void setTransform(const SkMatrix44& transform)
|
| + {
|
| + m_mutatedFlags |= CompositorMutablePropertyTransform;
|
| + m_transform = transform;
|
| + }
|
| +
|
| + bool isOpacityMutated() const { return m_mutatedFlags & CompositorMutablePropertyOpacity; }
|
| + bool isScrollLeftMutated() const { return m_mutatedFlags & CompositorMutablePropertyScrollLeft; }
|
| + bool isScrollTopMutated() const { return m_mutatedFlags & CompositorMutablePropertyScrollTop; }
|
| + bool isTransformMutated() const { return m_mutatedFlags & CompositorMutablePropertyTransform; }
|
| +
|
| + float opacity() const { return m_opacity; }
|
| + float scrollLeft() const { return m_scrollLeft; }
|
| + float scrollTop() const { return m_scrollTop; }
|
| + SkMatrix44 transform() const { return m_transform; }
|
| +
|
| +private:
|
| + uint32_t m_mutatedFlags = 0;
|
| + float m_opacity = 0;
|
| + float m_scrollLeft = 0;
|
| + float m_scrollTop = 0;
|
| + SkMatrix44 m_transform;
|
| +};
|
| +
|
| +struct CompositorMutations {
|
| + HashMap<uint64_t, OwnPtr<CompositorMutation>> map;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // CompositorMutation_h
|
|
|