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

Side by Side Diff: cc/trees/layer_tree_host_common.h

Issue 1014993002: [exp] cc: Introduce cc::CompositorMutator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_TREES_LAYER_TREE_HOST_COMMON_H_ 5 #ifndef CC_TREES_LAYER_TREE_HOST_COMMON_H_
6 #define CC_TREES_LAYER_TREE_HOST_COMMON_H_ 6 #define CC_TREES_LAYER_TREE_HOST_COMMON_H_
7 7
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "cc/base/cc_export.h" 13 #include "cc/base/cc_export.h"
14 #include "cc/base/scoped_ptr_vector.h" 14 #include "cc/base/scoped_ptr_vector.h"
15 #include "cc/layers/layer_lists.h" 15 #include "cc/layers/layer_lists.h"
16 #include "ui/gfx/geometry/rect.h" 16 #include "ui/gfx/geometry/rect.h"
17 #include "ui/gfx/geometry/vector2d.h" 17 #include "ui/gfx/geometry/vector2d.h"
18 #include "ui/gfx/transform.h" 18 #include "ui/gfx/transform.h"
19 19
20 namespace cc { 20 namespace cc {
21 21
22 class LayerImpl; 22 class LayerImpl;
23 class Layer; 23 class Layer;
24 class SwapPromise; 24 class SwapPromise;
25 25
26 enum class MutationProperty {
27 MUTATION_PROPERTY_TRANSFORM = 1,
28 MUTATION_PROPERTY_OPACITY,
29 };
30
31 union MutationValue {
32 struct {
33 int old_value;
34 int new_value;
35 } i;
36
37 struct {
38 float old_value;
39 float new_value;
40 } f;
41 };
42
43 struct Mutation {
44 Mutation();
45 ~Mutation();
46
47 int proxy_id;
48 int mutated_properties;
loyso (OOO) 2015/03/20 02:38:14 Could you elaborate how we refer/identify properti
49 std::vector<MutationValue> mutated_values;
50 };
51
52 class CompositorMutator {
53 public:
54 virtual ~CompositorMutator() {}
55
56 virtual void ApplyCustomMutations(base::TimeTicks monotonic_time,
57 const std::vector<Mutation>& mutations) = 0;
58 };
59
26 class CC_EXPORT LayerTreeHostCommon { 60 class CC_EXPORT LayerTreeHostCommon {
27 public: 61 public:
28 static gfx::Rect CalculateVisibleRect(const gfx::Rect& target_surface_rect, 62 static gfx::Rect CalculateVisibleRect(const gfx::Rect& target_surface_rect,
29 const gfx::Rect& layer_bound_rect, 63 const gfx::Rect& layer_bound_rect,
30 const gfx::Transform& transform); 64 const gfx::Transform& transform);
31 65
32 template <typename LayerType, typename RenderSurfaceLayerListType> 66 template <typename LayerType, typename RenderSurfaceLayerListType>
33 struct CalcDrawPropsInputs { 67 struct CalcDrawPropsInputs {
34 public: 68 public:
35 CalcDrawPropsInputs(LayerType* root_layer, 69 CalcDrawPropsInputs(LayerType* root_layer,
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 true, 312 true,
279 render_surface_layer_list, 313 render_surface_layer_list,
280 0) { 314 0) {
281 DCHECK(root_layer); 315 DCHECK(root_layer);
282 DCHECK(render_surface_layer_list); 316 DCHECK(render_surface_layer_list);
283 } 317 }
284 318
285 } // namespace cc 319 } // namespace cc
286 320
287 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ 321 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698