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

Unified Diff: third_party/WebKit/Source/platform/graphics/CompositorMutation.h

Issue 1547893003: WIP - compositor worker mega patch. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 months 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
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..30aa0c701539624de387a4c217a954030b16096e
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/CompositorMutation.h
@@ -0,0 +1,64 @@
+// 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 "public/platform/WebCompositorMutations.h"
+#include "third_party/skia/include/utils/SkMatrix44.h"
+
+#include <map>
+
+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 : public WebCompositorMutations {
+ virtual ~CompositorMutations() {}
+ std::map<uint64_t, CompositorMutation> map;
+};
+
+} // namespace blink
+
+#endif // CompositorMutation_h

Powered by Google App Engine
This is Rietveld 408576698