| 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/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 layer->SetBounds(use_paint_properties ? paint_properties_.bounds | 863 layer->SetBounds(use_paint_properties ? paint_properties_.bounds |
| 864 : bounds_); | 864 : bounds_); |
| 865 layer->SetContentBounds(content_bounds()); | 865 layer->SetContentBounds(content_bounds()); |
| 866 layer->SetContentsScale(contents_scale_x(), contents_scale_y()); | 866 layer->SetContentsScale(contents_scale_x(), contents_scale_y()); |
| 867 | 867 |
| 868 bool is_tracing; | 868 bool is_tracing; |
| 869 TRACE_EVENT_CATEGORY_GROUP_ENABLED( | 869 TRACE_EVENT_CATEGORY_GROUP_ENABLED( |
| 870 TRACE_DISABLED_BY_DEFAULT("cc.debug") "," TRACE_DISABLED_BY_DEFAULT( | 870 TRACE_DISABLED_BY_DEFAULT("cc.debug") "," TRACE_DISABLED_BY_DEFAULT( |
| 871 "devtools.timeline.layers"), | 871 "devtools.timeline.layers"), |
| 872 &is_tracing); | 872 &is_tracing); |
| 873 |
| 873 if (is_tracing) | 874 if (is_tracing) |
| 874 layer->SetDebugInfo(TakeDebugInfo()); | 875 layer->SetDebugInfo(TakeDebugInfo()); |
| 875 | 876 |
| 876 layer->SetDoubleSided(double_sided_); | 877 layer->SetDoubleSided(double_sided_); |
| 877 layer->SetDrawCheckerboardForMissingTiles( | 878 layer->SetDrawCheckerboardForMissingTiles( |
| 878 draw_checkerboard_for_missing_tiles_); | 879 draw_checkerboard_for_missing_tiles_); |
| 879 layer->SetForceRenderSurface(force_render_surface_); | 880 layer->SetForceRenderSurface(force_render_surface_); |
| 880 layer->SetDrawsContent(DrawsContent()); | 881 layer->SetDrawsContent(DrawsContent()); |
| 881 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); | 882 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); |
| 882 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) | 883 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1064 } | 1065 } |
| 1065 | 1066 |
| 1066 bool Layer::NeedMoreUpdates() { | 1067 bool Layer::NeedMoreUpdates() { |
| 1067 return false; | 1068 return false; |
| 1068 } | 1069 } |
| 1069 | 1070 |
| 1070 bool Layer::IsSuitableForGpuRasterization() const { | 1071 bool Layer::IsSuitableForGpuRasterization() const { |
| 1071 return true; | 1072 return true; |
| 1072 } | 1073 } |
| 1073 | 1074 |
| 1074 scoped_refptr<base::debug::ConvertableToTraceFormat> Layer::TakeDebugInfo() { | 1075 scoped_refptr<LayerDebugInfo> Layer::TakeDebugInfo() { |
| 1075 if (client_) | 1076 if (client_) |
| 1076 return client_->TakeDebugInfo(); | 1077 return client_->TakeDebugInfo(); |
| 1077 else | 1078 else |
| 1078 return NULL; | 1079 return NULL; |
| 1079 } | 1080 } |
| 1080 | 1081 |
| 1081 void Layer::CreateRenderSurface() { | 1082 void Layer::CreateRenderSurface() { |
| 1082 DCHECK(!draw_properties_.render_surface); | 1083 DCHECK(!draw_properties_.render_surface); |
| 1083 draw_properties_.render_surface = make_scoped_ptr(new RenderSurface(this)); | 1084 draw_properties_.render_surface = make_scoped_ptr(new RenderSurface(this)); |
| 1084 draw_properties_.render_target = this; | 1085 draw_properties_.render_target = this; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 | 1238 |
| 1238 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 1239 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
| 1239 benchmark->RunOnLayer(this); | 1240 benchmark->RunOnLayer(this); |
| 1240 } | 1241 } |
| 1241 | 1242 |
| 1242 bool Layer::HasDelegatedContent() const { | 1243 bool Layer::HasDelegatedContent() const { |
| 1243 return false; | 1244 return false; |
| 1244 } | 1245 } |
| 1245 | 1246 |
| 1246 } // namespace cc | 1247 } // namespace cc |
| OLD | NEW |