| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/heads_up_display_layer_impl.h" | 5 #include "cc/layers/heads_up_display_layer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 typeface_(skia::AdoptRef( | 71 typeface_(skia::AdoptRef( |
| 72 SkTypeface::CreateFromName("monospace", SkTypeface::kBold))), | 72 SkTypeface::CreateFromName("monospace", SkTypeface::kBold))), |
| 73 fps_graph_(60.0, 80.0), | 73 fps_graph_(60.0, 80.0), |
| 74 paint_time_graph_(16.0, 48.0), | 74 paint_time_graph_(16.0, 48.0), |
| 75 fade_step_(0) {} | 75 fade_step_(0) {} |
| 76 | 76 |
| 77 HeadsUpDisplayLayerImpl::~HeadsUpDisplayLayerImpl() {} | 77 HeadsUpDisplayLayerImpl::~HeadsUpDisplayLayerImpl() {} |
| 78 | 78 |
| 79 scoped_ptr<LayerImpl> HeadsUpDisplayLayerImpl::CreateLayerImpl( | 79 scoped_ptr<LayerImpl> HeadsUpDisplayLayerImpl::CreateLayerImpl( |
| 80 LayerTreeImpl* tree_impl) { | 80 LayerTreeImpl* tree_impl) { |
| 81 return HeadsUpDisplayLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>(); | 81 return HeadsUpDisplayLayerImpl::Create(tree_impl, id()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void HeadsUpDisplayLayerImpl::AcquireResource( | 84 void HeadsUpDisplayLayerImpl::AcquireResource( |
| 85 ResourceProvider* resource_provider) { | 85 ResourceProvider* resource_provider) { |
| 86 for (ScopedPtrVector<ScopedResource>::iterator it = resources_.begin(); | 86 for (ScopedPtrVector<ScopedResource>::iterator it = resources_.begin(); |
| 87 it != resources_.end(); | 87 it != resources_.end(); |
| 88 ++it) { | 88 ++it) { |
| 89 if (!resource_provider->InUseByConsumer((*it)->id())) { | 89 if (!resource_provider->InUseByConsumer((*it)->id())) { |
| 90 resources_.swap(it, resources_.end() - 1); | 90 resources_.swap(it, resources_.end() - 1); |
| 91 return; | 91 return; |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 return "cc::HeadsUpDisplayLayerImpl"; | 788 return "cc::HeadsUpDisplayLayerImpl"; |
| 789 } | 789 } |
| 790 | 790 |
| 791 void HeadsUpDisplayLayerImpl::AsValueInto( | 791 void HeadsUpDisplayLayerImpl::AsValueInto( |
| 792 base::debug::TracedValue* dict) const { | 792 base::debug::TracedValue* dict) const { |
| 793 LayerImpl::AsValueInto(dict); | 793 LayerImpl::AsValueInto(dict); |
| 794 dict->SetString("layer_name", "Heads Up Display Layer"); | 794 dict->SetString("layer_name", "Heads Up Display Layer"); |
| 795 } | 795 } |
| 796 | 796 |
| 797 } // namespace cc | 797 } // namespace cc |
| OLD | NEW |