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 #include "cc/layers/layer.h" | 5 #include "cc/layers/layer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 layer->SetAnchorPointZ(anchor_point_z_); | 868 layer->SetAnchorPointZ(anchor_point_z_); |
869 layer->SetBackgroundColor(background_color_); | 869 layer->SetBackgroundColor(background_color_); |
870 layer->SetBounds(use_paint_properties ? paint_properties_.bounds | 870 layer->SetBounds(use_paint_properties ? paint_properties_.bounds |
871 : bounds_); | 871 : bounds_); |
872 layer->SetContentBounds(content_bounds()); | 872 layer->SetContentBounds(content_bounds()); |
873 layer->SetContentsScale(contents_scale_x(), contents_scale_y()); | 873 layer->SetContentsScale(contents_scale_x(), contents_scale_y()); |
874 | 874 |
875 bool is_tracing; | 875 bool is_tracing; |
876 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("cc.debug"), | 876 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("cc.debug"), |
877 &is_tracing); | 877 &is_tracing); |
878 if (is_tracing) { | 878 if (is_tracing) |
879 layer->SetDebugName(DebugName()); | |
880 layer->SetDebugInfo(TakeDebugInfo()); | 879 layer->SetDebugInfo(TakeDebugInfo()); |
881 } else { | |
882 layer->SetDebugName(std::string()); | |
883 } | |
884 | 880 |
885 layer->SetDoubleSided(double_sided_); | 881 layer->SetDoubleSided(double_sided_); |
886 layer->SetDrawCheckerboardForMissingTiles( | 882 layer->SetDrawCheckerboardForMissingTiles( |
887 draw_checkerboard_for_missing_tiles_); | 883 draw_checkerboard_for_missing_tiles_); |
888 layer->SetForceRenderSurface(force_render_surface_); | 884 layer->SetForceRenderSurface(force_render_surface_); |
889 layer->SetDrawsContent(DrawsContent()); | 885 layer->SetDrawsContent(DrawsContent()); |
890 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); | 886 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); |
891 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) | 887 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) |
892 layer->SetFilters(filters_); | 888 layer->SetFilters(filters_); |
893 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); | 889 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 DCHECK_EQ(layer_tree_host_->source_frame_number(), | 1022 DCHECK_EQ(layer_tree_host_->source_frame_number(), |
1027 paint_properties_.source_frame_number) << | 1023 paint_properties_.source_frame_number) << |
1028 "SavePaintProperties must be called for any layer that is painted."; | 1024 "SavePaintProperties must be called for any layer that is painted."; |
1029 return false; | 1025 return false; |
1030 } | 1026 } |
1031 | 1027 |
1032 bool Layer::NeedMoreUpdates() { | 1028 bool Layer::NeedMoreUpdates() { |
1033 return false; | 1029 return false; |
1034 } | 1030 } |
1035 | 1031 |
1036 std::string Layer::DebugName() { | |
1037 return client_ ? client_->DebugName() : std::string(); | |
1038 } | |
1039 | |
1040 scoped_refptr<base::debug::ConvertableToTraceFormat> Layer::TakeDebugInfo() { | 1032 scoped_refptr<base::debug::ConvertableToTraceFormat> Layer::TakeDebugInfo() { |
1041 if (client_) | 1033 if (client_) |
1042 return client_->TakeDebugInfo(); | 1034 return client_->TakeDebugInfo(); |
1043 else | 1035 else |
1044 return NULL; | 1036 return NULL; |
1045 } | 1037 } |
1046 | 1038 |
1047 void Layer::CreateRenderSurface() { | 1039 void Layer::CreateRenderSurface() { |
1048 DCHECK(!draw_properties_.render_surface); | 1040 DCHECK(!draw_properties_.render_surface); |
1049 draw_properties_.render_surface = make_scoped_ptr(new RenderSurface(this)); | 1041 draw_properties_.render_surface = make_scoped_ptr(new RenderSurface(this)); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 clip_parent_->RemoveClipChild(this); | 1166 clip_parent_->RemoveClipChild(this); |
1175 | 1167 |
1176 clip_parent_ = NULL; | 1168 clip_parent_ = NULL; |
1177 } | 1169 } |
1178 | 1170 |
1179 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 1171 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
1180 benchmark->RunOnLayer(this); | 1172 benchmark->RunOnLayer(this); |
1181 } | 1173 } |
1182 | 1174 |
1183 } // namespace cc | 1175 } // namespace cc |
OLD | NEW |