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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 layer->SetAnchorPointZ(anchor_point_z_); | 866 layer->SetAnchorPointZ(anchor_point_z_); |
867 layer->SetBackgroundColor(background_color_); | 867 layer->SetBackgroundColor(background_color_); |
868 layer->SetBounds(use_paint_properties ? paint_properties_.bounds | 868 layer->SetBounds(use_paint_properties ? paint_properties_.bounds |
869 : bounds_); | 869 : bounds_); |
870 layer->SetContentBounds(content_bounds()); | 870 layer->SetContentBounds(content_bounds()); |
871 layer->SetContentsScale(contents_scale_x(), contents_scale_y()); | 871 layer->SetContentsScale(contents_scale_x(), contents_scale_y()); |
872 | 872 |
873 bool is_tracing; | 873 bool is_tracing; |
874 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("cc.debug"), | 874 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("cc.debug"), |
875 &is_tracing); | 875 &is_tracing); |
876 if (is_tracing) | 876 if (is_tracing) { |
877 layer->SetDebugName(DebugName()); | 877 layer->SetDebugName(DebugName()); |
878 else | 878 layer->SetDebugInfo(TakeDebugInfo()); |
879 layer->SetDebugName(std::string()); | 879 } else { |
| 880 layer->SetDebugName(std::string()); |
| 881 } |
880 | 882 |
881 layer->SetCompositingReasons(compositing_reasons_); | 883 layer->SetCompositingReasons(compositing_reasons_); |
882 layer->SetDoubleSided(double_sided_); | 884 layer->SetDoubleSided(double_sided_); |
883 layer->SetDrawCheckerboardForMissingTiles( | 885 layer->SetDrawCheckerboardForMissingTiles( |
884 draw_checkerboard_for_missing_tiles_); | 886 draw_checkerboard_for_missing_tiles_); |
885 layer->SetForceRenderSurface(force_render_surface_); | 887 layer->SetForceRenderSurface(force_render_surface_); |
886 layer->SetDrawsContent(DrawsContent()); | 888 layer->SetDrawsContent(DrawsContent()); |
887 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); | 889 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); |
888 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) | 890 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) |
889 layer->SetFilters(filters_); | 891 layer->SetFilters(filters_); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1027 } | 1029 } |
1028 | 1030 |
1029 bool Layer::NeedMoreUpdates() { | 1031 bool Layer::NeedMoreUpdates() { |
1030 return false; | 1032 return false; |
1031 } | 1033 } |
1032 | 1034 |
1033 std::string Layer::DebugName() { | 1035 std::string Layer::DebugName() { |
1034 return client_ ? client_->DebugName() : std::string(); | 1036 return client_ ? client_->DebugName() : std::string(); |
1035 } | 1037 } |
1036 | 1038 |
| 1039 scoped_refptr<base::debug::ConvertableToTraceFormat> Layer::TakeDebugInfo() { |
| 1040 if (client_) |
| 1041 return client_->TakeDebugInfo(); |
| 1042 else |
| 1043 return NULL; |
| 1044 } |
| 1045 |
| 1046 |
1037 void Layer::SetCompositingReasons(CompositingReasons reasons) { | 1047 void Layer::SetCompositingReasons(CompositingReasons reasons) { |
1038 compositing_reasons_ = reasons; | 1048 compositing_reasons_ = reasons; |
1039 } | 1049 } |
1040 | 1050 |
1041 void Layer::CreateRenderSurface() { | 1051 void Layer::CreateRenderSurface() { |
1042 DCHECK(!draw_properties_.render_surface); | 1052 DCHECK(!draw_properties_.render_surface); |
1043 draw_properties_.render_surface = make_scoped_ptr(new RenderSurface(this)); | 1053 draw_properties_.render_surface = make_scoped_ptr(new RenderSurface(this)); |
1044 draw_properties_.render_target = this; | 1054 draw_properties_.render_target = this; |
1045 } | 1055 } |
1046 | 1056 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 clip_parent_->RemoveClipChild(this); | 1168 clip_parent_->RemoveClipChild(this); |
1159 | 1169 |
1160 clip_parent_ = NULL; | 1170 clip_parent_ = NULL; |
1161 } | 1171 } |
1162 | 1172 |
1163 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 1173 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
1164 benchmark->RunOnLayer(this); | 1174 benchmark->RunOnLayer(this); |
1165 } | 1175 } |
1166 | 1176 |
1167 } // namespace cc | 1177 } // namespace cc |
OLD | NEW |