Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <stack> | 8 #include <stack> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/debug/trace_event.h" | 12 #include "base/debug/trace_event.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
| 16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 17 #include "cc/animation/animation_registrar.h" | 17 #include "cc/animation/animation_registrar.h" |
| 18 #include "cc/animation/layer_animation_controller.h" | 18 #include "cc/animation/layer_animation_controller.h" |
| 19 #include "cc/base/math_util.h" | 19 #include "cc/base/math_util.h" |
| 20 #include "cc/debug/devtools_instrumentation.h" | |
| 20 #include "cc/debug/overdraw_metrics.h" | 21 #include "cc/debug/overdraw_metrics.h" |
| 21 #include "cc/debug/rendering_stats_instrumentation.h" | 22 #include "cc/debug/rendering_stats_instrumentation.h" |
| 22 #include "cc/input/top_controls_manager.h" | 23 #include "cc/input/top_controls_manager.h" |
| 23 #include "cc/layers/heads_up_display_layer.h" | 24 #include "cc/layers/heads_up_display_layer.h" |
| 24 #include "cc/layers/heads_up_display_layer_impl.h" | 25 #include "cc/layers/heads_up_display_layer_impl.h" |
| 25 #include "cc/layers/layer.h" | 26 #include "cc/layers/layer.h" |
| 26 #include "cc/layers/layer_iterator.h" | 27 #include "cc/layers/layer_iterator.h" |
| 27 #include "cc/layers/render_surface.h" | 28 #include "cc/layers/render_surface.h" |
| 28 #include "cc/layers/scrollbar_layer.h" | 29 #include "cc/layers/scrollbar_layer.h" |
| 29 #include "cc/resources/prioritized_resource_manager.h" | 30 #include "cc/resources/prioritized_resource_manager.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 device_scale_factor_(1.f), | 90 device_scale_factor_(1.f), |
| 90 visible_(true), | 91 visible_(true), |
| 91 page_scale_factor_(1.f), | 92 page_scale_factor_(1.f), |
| 92 min_page_scale_factor_(1.f), | 93 min_page_scale_factor_(1.f), |
| 93 max_page_scale_factor_(1.f), | 94 max_page_scale_factor_(1.f), |
| 94 trigger_idle_updates_(true), | 95 trigger_idle_updates_(true), |
| 95 background_color_(SK_ColorWHITE), | 96 background_color_(SK_ColorWHITE), |
| 96 has_transparent_background_(false), | 97 has_transparent_background_(false), |
| 97 partial_texture_update_requests_(0), | 98 partial_texture_update_requests_(0), |
| 98 in_paint_layer_contents_(false), | 99 in_paint_layer_contents_(false), |
| 99 total_frames_used_for_lcd_text_metrics_(0) { | 100 total_frames_used_for_lcd_text_metrics_(0), |
| 101 instrumentation_cookie_(0) { | |
|
nduca
2013/06/26 05:08:46
do you still need the cookie init now?
| |
| 100 if (settings_.accelerated_animation_enabled) | 102 if (settings_.accelerated_animation_enabled) |
| 101 animation_registrar_ = AnimationRegistrar::Create(); | 103 animation_registrar_ = AnimationRegistrar::Create(); |
| 102 s_num_layer_tree_instances++; | 104 s_num_layer_tree_instances++; |
| 103 | 105 |
| 104 rendering_stats_instrumentation_->set_record_rendering_stats( | 106 rendering_stats_instrumentation_->set_record_rendering_stats( |
| 105 debug_state_.RecordRenderingStats()); | 107 debug_state_.RecordRenderingStats()); |
| 106 } | 108 } |
| 107 | 109 |
| 108 bool LayerTreeHost::Initialize( | 110 bool LayerTreeHost::Initialize( |
| 109 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { | 111 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 939 it != end; | 941 it != end; |
| 940 ++it) { | 942 ++it) { |
| 941 bool prevent_occlusion = it.target_render_surface_layer()->HasCopyRequest(); | 943 bool prevent_occlusion = it.target_render_surface_layer()->HasCopyRequest(); |
| 942 occlusion_tracker.EnterLayer(it, prevent_occlusion); | 944 occlusion_tracker.EnterLayer(it, prevent_occlusion); |
| 943 | 945 |
| 944 if (it.represents_target_render_surface()) { | 946 if (it.represents_target_render_surface()) { |
| 945 DCHECK(it->render_surface()->draw_opacity() || | 947 DCHECK(it->render_surface()->draw_opacity() || |
| 946 it->render_surface()->draw_opacity_is_animating()); | 948 it->render_surface()->draw_opacity_is_animating()); |
| 947 need_more_updates |= PaintMasksForRenderSurface(*it, queue, stats_ptr); | 949 need_more_updates |= PaintMasksForRenderSurface(*it, queue, stats_ptr); |
| 948 } else if (it.represents_itself()) { | 950 } else if (it.represents_itself()) { |
| 951 devtools_instrumentation::ScopedLayerTreeTask | |
| 952 update_layer(devtools_instrumentation::kUpdateLayer, it->id(), id()); | |
| 949 DCHECK(!it->paint_properties().bounds.IsEmpty()); | 953 DCHECK(!it->paint_properties().bounds.IsEmpty()); |
| 950 it->Update(queue, &occlusion_tracker, stats_ptr); | 954 it->Update(queue, &occlusion_tracker, stats_ptr); |
| 951 need_more_updates |= it->NeedMoreUpdates(); | 955 need_more_updates |= it->NeedMoreUpdates(); |
| 952 } | 956 } |
| 953 | 957 |
| 954 occlusion_tracker.LeaveLayer(it); | 958 occlusion_tracker.LeaveLayer(it); |
| 955 } | 959 } |
| 956 | 960 |
| 957 in_paint_layer_contents_ = false; | 961 in_paint_layer_contents_ = false; |
| 958 | 962 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1081 bool start_ready_animations = true; | 1085 bool start_ready_animations = true; |
| 1082 (*iter).second->UpdateState(start_ready_animations, NULL); | 1086 (*iter).second->UpdateState(start_ready_animations, NULL); |
| 1083 } | 1087 } |
| 1084 } | 1088 } |
| 1085 | 1089 |
| 1086 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { | 1090 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { |
| 1087 return proxy_->CapturePicture(); | 1091 return proxy_->CapturePicture(); |
| 1088 } | 1092 } |
| 1089 | 1093 |
| 1090 } // namespace cc | 1094 } // namespace cc |
| OLD | NEW |