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

Side by Side Diff: cc/layers/layer.h

Issue 2159513003: Setup LayerTree class, refactor 2 functions from LayerTreeHost to it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add proto to gyp file and modify inproper comment. Created 4 years, 5 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
« no previous file with comments | « cc/cc.gyp ('k') | cc/layers/layer.cc » ('j') | cc/layers/layer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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_LAYERS_LAYER_H_ 5 #ifndef CC_LAYERS_LAYER_H_
6 #define CC_LAYERS_LAYER_H_ 6 #define CC_LAYERS_LAYER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <set> 11 #include <set>
12 #include <string> 12 #include <string>
13 #include <unordered_map> 13 #include <unordered_map>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/callback.h" 16 #include "base/callback.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/memory/ref_counted.h" 18 #include "base/memory/ref_counted.h"
19 #include "base/observer_list.h" 19 #include "base/observer_list.h"
20 #include "cc/animation/element_id.h" 20 #include "cc/animation/element_id.h"
21 #include "cc/animation/target_property.h" 21 #include "cc/animation/target_property.h"
22 #include "cc/base/cc_export.h" 22 #include "cc/base/cc_export.h"
23 #include "cc/base/region.h" 23 #include "cc/base/region.h"
24 #include "cc/debug/micro_benchmark.h" 24 #include "cc/debug/micro_benchmark.h"
25 #include "cc/input/input_handler.h" 25 #include "cc/input/input_handler.h"
26 #include "cc/layers/layer_collections.h" 26 #include "cc/layers/layer_collections.h"
27 #include "cc/layers/layer_position_constraint.h" 27 #include "cc/layers/layer_position_constraint.h"
28 #include "cc/layers/paint_properties.h" 28 #include "cc/layers/paint_properties.h"
29 #include "cc/output/filter_operations.h" 29 #include "cc/output/filter_operations.h"
30 #include "cc/trees/layer_tree.h"
30 #include "cc/trees/mutator_host_client.h" 31 #include "cc/trees/mutator_host_client.h"
31 #include "cc/trees/property_tree.h" 32 #include "cc/trees/property_tree.h"
32 #include "third_party/skia/include/core/SkColor.h" 33 #include "third_party/skia/include/core/SkColor.h"
33 #include "third_party/skia/include/core/SkPicture.h" 34 #include "third_party/skia/include/core/SkPicture.h"
34 #include "third_party/skia/include/core/SkXfermode.h" 35 #include "third_party/skia/include/core/SkXfermode.h"
35 #include "ui/gfx/geometry/point3_f.h" 36 #include "ui/gfx/geometry/point3_f.h"
36 #include "ui/gfx/geometry/rect.h" 37 #include "ui/gfx/geometry/rect.h"
37 #include "ui/gfx/geometry/rect_f.h" 38 #include "ui/gfx/geometry/rect_f.h"
38 #include "ui/gfx/geometry/scroll_offset.h" 39 #include "ui/gfx/geometry/scroll_offset.h"
39 #include "ui/gfx/transform.h" 40 #include "ui/gfx/transform.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 void ToLayerPropertiesProto(proto::LayerUpdate* layer_update); 387 void ToLayerPropertiesProto(proto::LayerUpdate* layer_update);
387 388
388 // Read all property values from the given LayerProperties object and update 389 // Read all property values from the given LayerProperties object and update
389 // the current layer. The values for |needs_push_properties_| and 390 // the current layer. The values for |needs_push_properties_| and
390 // |num_dependents_need_push_properties_| are always updated, but the rest 391 // |num_dependents_need_push_properties_| are always updated, but the rest
391 // of |proto| is only read if |needs_push_properties_| is set. 392 // of |proto| is only read if |needs_push_properties_| is set.
392 void FromLayerPropertiesProto(const proto::LayerProperties& proto); 393 void FromLayerPropertiesProto(const proto::LayerProperties& proto);
393 394
394 LayerTreeHost* layer_tree_host() { return layer_tree_host_; } 395 LayerTreeHost* layer_tree_host() { return layer_tree_host_; }
395 const LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } 396 const LayerTreeHost* layer_tree_host() const { return layer_tree_host_; }
397 LayerTree* GetLayerTree() const;
vmpstr 2016/07/27 18:05:30 nit: Can you add a TODO to create an interface and
xingliu 2016/07/28 16:10:24 Done.
396 398
397 virtual ScrollbarLayerInterface* ToScrollbarLayer(); 399 virtual ScrollbarLayerInterface* ToScrollbarLayer();
398 400
399 virtual sk_sp<SkPicture> GetPicture() const; 401 virtual sk_sp<SkPicture> GetPicture() const;
400 402
401 // Constructs a LayerImpl of the correct runtime type for this Layer type. 403 // Constructs a LayerImpl of the correct runtime type for this Layer type.
402 virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); 404 virtual std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl);
403 405
404 bool NeedsDisplayForTesting() const { return !inputs_.update_rect.IsEmpty(); } 406 bool NeedsDisplayForTesting() const { return !inputs_.update_rect.IsEmpty(); }
405 void ResetNeedsDisplayForTesting() { inputs_.update_rect = gfx::Rect(); } 407 void ResetNeedsDisplayForTesting() { inputs_.update_rect = gfx::Rect(); }
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 // These all act like draw properties, so don't need push properties. 721 // These all act like draw properties, so don't need push properties.
720 gfx::Rect visible_layer_rect_; 722 gfx::Rect visible_layer_rect_;
721 size_t num_unclipped_descendants_; 723 size_t num_unclipped_descendants_;
722 724
723 DISALLOW_COPY_AND_ASSIGN(Layer); 725 DISALLOW_COPY_AND_ASSIGN(Layer);
724 }; 726 };
725 727
726 } // namespace cc 728 } // namespace cc
727 729
728 #endif // CC_LAYERS_LAYER_H_ 730 #endif // CC_LAYERS_LAYER_H_
OLDNEW
« no previous file with comments | « cc/cc.gyp ('k') | cc/layers/layer.cc » ('j') | cc/layers/layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698