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/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 resource.swap(resources_.back()); | 96 resource.swap(resources_.back()); |
97 return; | 97 return; |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 scoped_ptr<ScopedResource> resource = | 101 scoped_ptr<ScopedResource> resource = |
102 ScopedResource::Create(resource_provider); | 102 ScopedResource::Create(resource_provider); |
103 resource->Allocate(internal_content_bounds_, | 103 resource->Allocate(internal_content_bounds_, |
104 ResourceProvider::TEXTURE_HINT_IMMUTABLE, | 104 ResourceProvider::TEXTURE_HINT_IMMUTABLE, |
105 resource_provider->best_texture_format()); | 105 resource_provider->best_texture_format()); |
106 resources_.push_back(resource.Pass()); | 106 resources_.push_back(std::move(resource)); |
107 } | 107 } |
108 | 108 |
109 void HeadsUpDisplayLayerImpl::ReleaseUnmatchedSizeResources( | 109 void HeadsUpDisplayLayerImpl::ReleaseUnmatchedSizeResources( |
110 ResourceProvider* resource_provider) { | 110 ResourceProvider* resource_provider) { |
111 auto it_erase = | 111 auto it_erase = |
112 std::remove_if(resources_.begin(), resources_.end(), | 112 std::remove_if(resources_.begin(), resources_.end(), |
113 [this](const scoped_ptr<ScopedResource>& resource) { | 113 [this](const scoped_ptr<ScopedResource>& resource) { |
114 return internal_content_bounds_ != resource->size(); | 114 return internal_content_bounds_ != resource->size(); |
115 }); | 115 }); |
116 resources_.erase(it_erase, resources_.end()); | 116 resources_.erase(it_erase, resources_.end()); |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 return "cc::HeadsUpDisplayLayerImpl"; | 791 return "cc::HeadsUpDisplayLayerImpl"; |
792 } | 792 } |
793 | 793 |
794 void HeadsUpDisplayLayerImpl::AsValueInto( | 794 void HeadsUpDisplayLayerImpl::AsValueInto( |
795 base::trace_event::TracedValue* dict) const { | 795 base::trace_event::TracedValue* dict) const { |
796 LayerImpl::AsValueInto(dict); | 796 LayerImpl::AsValueInto(dict); |
797 dict->SetString("layer_name", "Heads Up Display Layer"); | 797 dict->SetString("layer_name", "Heads Up Display Layer"); |
798 } | 798 } |
799 | 799 |
800 } // namespace cc | 800 } // namespace cc |
OLD | NEW |