OLD | NEW |
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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
| 10 #include <vector> |
10 | 11 |
11 #include "base/callback.h" | 12 #include "base/callback.h" |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
14 #include "cc/animation/layer_animation_controller.h" | 15 #include "cc/animation/layer_animation_controller.h" |
15 #include "cc/animation/layer_animation_value_observer.h" | 16 #include "cc/animation/layer_animation_value_observer.h" |
16 #include "cc/animation/layer_animation_value_provider.h" | 17 #include "cc/animation/layer_animation_value_provider.h" |
17 #include "cc/base/cc_export.h" | 18 #include "cc/base/cc_export.h" |
18 #include "cc/base/region.h" | 19 #include "cc/base/region.h" |
19 #include "cc/base/scoped_ptr_vector.h" | 20 #include "cc/base/scoped_ptr_vector.h" |
| 21 #include "cc/debug/frame_timing_request.h" |
20 #include "cc/debug/micro_benchmark.h" | 22 #include "cc/debug/micro_benchmark.h" |
21 #include "cc/layers/draw_properties.h" | 23 #include "cc/layers/draw_properties.h" |
22 #include "cc/layers/layer_lists.h" | 24 #include "cc/layers/layer_lists.h" |
23 #include "cc/layers/layer_position_constraint.h" | 25 #include "cc/layers/layer_position_constraint.h" |
24 #include "cc/layers/paint_properties.h" | 26 #include "cc/layers/paint_properties.h" |
25 #include "cc/layers/render_surface.h" | 27 #include "cc/layers/render_surface.h" |
26 #include "cc/output/filter_operations.h" | 28 #include "cc/output/filter_operations.h" |
27 #include "cc/trees/property_tree.h" | 29 #include "cc/trees/property_tree.h" |
28 #include "skia/ext/refptr.h" | 30 #include "skia/ext/refptr.h" |
29 #include "third_party/skia/include/core/SkColor.h" | 31 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 // render surface determinations are moved out of CDP. They only exist because | 500 // render surface determinations are moved out of CDP. They only exist because |
499 // certain logic depends on whether or not a layer would render to a separate | 501 // certain logic depends on whether or not a layer would render to a separate |
500 // surface, but CDP destroys surfaces and targets it doesn't need, so without | 502 // surface, but CDP destroys surfaces and targets it doesn't need, so without |
501 // this boolean, this is impossible to determine after the fact without | 503 // this boolean, this is impossible to determine after the fact without |
502 // wastefully recomputing it. This is public for the time being so that it can | 504 // wastefully recomputing it. This is public for the time being so that it can |
503 // be accessed from CDP. | 505 // be accessed from CDP. |
504 bool has_render_surface() const { | 506 bool has_render_surface() const { |
505 return has_render_surface_; | 507 return has_render_surface_; |
506 } | 508 } |
507 | 509 |
| 510 // Sets new frame timing requests for this layer. |
| 511 void SetFrameTimingRequests(const std::vector<FrameTimingRequest>& requests); |
| 512 |
508 protected: | 513 protected: |
509 friend class LayerImpl; | 514 friend class LayerImpl; |
510 friend class TreeSynchronizer; | 515 friend class TreeSynchronizer; |
511 ~Layer() override; | 516 ~Layer() override; |
512 | 517 |
513 Layer(); | 518 Layer(); |
514 | 519 |
515 // These SetNeeds functions are in order of severity of update: | 520 // These SetNeeds functions are in order of severity of update: |
516 // | 521 // |
517 // Called when this layer has been modified in some way, but isn't sure | 522 // Called when this layer has been modified in some way, but isn't sure |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 base::Closure did_scroll_callback_; | 695 base::Closure did_scroll_callback_; |
691 | 696 |
692 DrawProperties<Layer> draw_properties_; | 697 DrawProperties<Layer> draw_properties_; |
693 | 698 |
694 PaintProperties paint_properties_; | 699 PaintProperties paint_properties_; |
695 // TODO(awoloszyn): This is redundant with has_render_surface_, | 700 // TODO(awoloszyn): This is redundant with has_render_surface_, |
696 // and should get removed once it is no longer needed on main thread. | 701 // and should get removed once it is no longer needed on main thread. |
697 scoped_ptr<RenderSurface> render_surface_; | 702 scoped_ptr<RenderSurface> render_surface_; |
698 | 703 |
699 gfx::Rect visible_rect_from_property_trees_; | 704 gfx::Rect visible_rect_from_property_trees_; |
| 705 |
| 706 std::vector<FrameTimingRequest> frame_timing_requests_; |
| 707 bool frame_timing_requests_dirty_; |
| 708 |
700 DISALLOW_COPY_AND_ASSIGN(Layer); | 709 DISALLOW_COPY_AND_ASSIGN(Layer); |
701 }; | 710 }; |
702 | 711 |
703 } // namespace cc | 712 } // namespace cc |
704 | 713 |
705 #endif // CC_LAYERS_LAYER_H_ | 714 #endif // CC_LAYERS_LAYER_H_ |
OLD | NEW |