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