Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(763)

Side by Side Diff: cc/layers/layer.cc

Issue 16903005: Add layer name into frame viewer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase code Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/location.h" 10 #include "base/location.h"
10 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
11 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
12 #include "cc/animation/animation.h" 13 #include "cc/animation/animation.h"
13 #include "cc/animation/animation_events.h" 14 #include "cc/animation/animation_events.h"
14 #include "cc/animation/layer_animation_controller.h" 15 #include "cc/animation/layer_animation_controller.h"
15 #include "cc/layers/layer_impl.h" 16 #include "cc/layers/layer_impl.h"
16 #include "cc/output/copy_output_request.h" 17 #include "cc/output/copy_output_request.h"
17 #include "cc/output/copy_output_result.h" 18 #include "cc/output/copy_output_result.h"
18 #include "cc/trees/layer_tree_host.h" 19 #include "cc/trees/layer_tree_host.h"
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 } 837 }
837 838
838 void Layer::SavePaintProperties() { 839 void Layer::SavePaintProperties() {
839 // TODO(reveman): Save all layer properties that we depend on not 840 // TODO(reveman): Save all layer properties that we depend on not
840 // changing until PushProperties() has been called. crbug.com/231016 841 // changing until PushProperties() has been called. crbug.com/231016
841 paint_properties_.bounds = bounds_; 842 paint_properties_.bounds = bounds_;
842 } 843 }
843 844
844 bool Layer::Update(ResourceUpdateQueue* queue, 845 bool Layer::Update(ResourceUpdateQueue* queue,
845 const OcclusionTracker* occlusion) { 846 const OcclusionTracker* occlusion) {
847 bool is_tracing;
enne (OOO) 2013/08/01 22:12:59 Could you do this during Layer::PushPropertiesTo i
qiankun 2013/08/02 17:50:26 Done.
848 TRACE_EVENT_CATEGORY_GROUP_ENABLED("cc", &is_tracing);
849 if (is_tracing)
850 SetDebugName(DebugName());
851 else
852 SetDebugName(std::string());
846 return false; 853 return false;
847 } 854 }
848 855
849 bool Layer::NeedMoreUpdates() { 856 bool Layer::NeedMoreUpdates() {
850 return false; 857 return false;
851 } 858 }
852 859
853 void Layer::SetDebugName(const std::string& debug_name) { 860 void Layer::SetDebugName(const std::string& debug_name) {
854 debug_name_ = debug_name; 861 debug_name_ = debug_name;
855 SetNeedsCommit(); 862 SetNeedsCommit();
856 } 863 }
857 864
865 std::string Layer::DebugName() {
866 if (!client_)
867 return std::string();
868 return client_->DebugName();
869 }
870
858 void Layer::SetCompositingReasons(CompositingReasons reasons) { 871 void Layer::SetCompositingReasons(CompositingReasons reasons) {
859 compositing_reasons_ = reasons; 872 compositing_reasons_ = reasons;
860 } 873 }
861 874
862 void Layer::CreateRenderSurface() { 875 void Layer::CreateRenderSurface() {
863 DCHECK(!draw_properties_.render_surface); 876 DCHECK(!draw_properties_.render_surface);
864 draw_properties_.render_surface = make_scoped_ptr(new RenderSurface(this)); 877 draw_properties_.render_surface = make_scoped_ptr(new RenderSurface(this));
865 draw_properties_.render_target = this; 878 draw_properties_.render_target = this;
866 } 879 }
867 880
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 968
956 RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const { 969 RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const {
957 return layer_tree_host_->rendering_stats_instrumentation(); 970 return layer_tree_host_->rendering_stats_instrumentation();
958 } 971 }
959 972
960 bool Layer::SupportsLCDText() const { 973 bool Layer::SupportsLCDText() const {
961 return false; 974 return false;
962 } 975 }
963 976
964 } // namespace cc 977 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698