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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 // TODO(danakj): The HUD could swap between two textures instead of creating a | 92 // TODO(danakj): The HUD could swap between two textures instead of creating a |
93 // texture every frame in ubercompositor. | 93 // texture every frame in ubercompositor. |
94 if (hud_resource_->size() != content_bounds() || | 94 if (hud_resource_->size() != content_bounds() || |
95 (hud_resource_->id() && | 95 (hud_resource_->id() && |
96 resource_provider->InUseByConsumer(hud_resource_->id()))) { | 96 resource_provider->InUseByConsumer(hud_resource_->id()))) { |
97 hud_resource_->Free(); | 97 hud_resource_->Free(); |
98 } | 98 } |
99 | 99 |
100 if (!hud_resource_->id()) { | 100 if (!hud_resource_->id()) { |
101 hud_resource_->Allocate(content_bounds(), | 101 hud_resource_->Allocate( |
102 ResourceProvider::TextureUsageAny, | 102 content_bounds(), ResourceProvider::TextureHintImmutable, RGBA_8888); |
103 RGBA_8888); | |
104 } | 103 } |
105 | 104 |
106 return LayerImpl::WillDraw(draw_mode, resource_provider); | 105 return LayerImpl::WillDraw(draw_mode, resource_provider); |
107 } | 106 } |
108 | 107 |
109 void HeadsUpDisplayLayerImpl::AppendQuads( | 108 void HeadsUpDisplayLayerImpl::AppendQuads( |
110 RenderPass* render_pass, | 109 RenderPass* render_pass, |
111 const OcclusionTracker<LayerImpl>& occlusion_tracker, | 110 const OcclusionTracker<LayerImpl>& occlusion_tracker, |
112 AppendQuadsData* append_quads_data) { | 111 AppendQuadsData* append_quads_data) { |
113 if (!hud_resource_->id()) | 112 if (!hud_resource_->id()) |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 return "cc::HeadsUpDisplayLayerImpl"; | 762 return "cc::HeadsUpDisplayLayerImpl"; |
764 } | 763 } |
765 | 764 |
766 void HeadsUpDisplayLayerImpl::AsValueInto( | 765 void HeadsUpDisplayLayerImpl::AsValueInto( |
767 base::debug::TracedValue* dict) const { | 766 base::debug::TracedValue* dict) const { |
768 LayerImpl::AsValueInto(dict); | 767 LayerImpl::AsValueInto(dict); |
769 dict->SetString("layer_name", "Heads Up Display Layer"); | 768 dict->SetString("layer_name", "Heads Up Display Layer"); |
770 } | 769 } |
771 | 770 |
772 } // namespace cc | 771 } // namespace cc |
OLD | NEW |