Chromium Code Reviews| 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/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 163 layer_rect, | 163 layer_rect, |
| 164 layer_rect, | 164 layer_rect, |
| 165 gfx::Vector2d()); | 165 gfx::Vector2d()); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void HeadsUpDisplayLayerImpl::DidDraw(ResourceProvider* resource_provider) { | 168 void HeadsUpDisplayLayerImpl::DidDraw(ResourceProvider* resource_provider) { |
| 169 LayerImpl::DidDraw(resource_provider); | 169 LayerImpl::DidDraw(resource_provider); |
| 170 | 170 |
| 171 if (!hud_resource_->id()) | 171 if (!hud_resource_->id()) |
| 172 return; | 172 return; |
| 173 | |
| 174 // FIXME: the following assert will not be true when sending resources to a | |
| 175 // parent compositor. We will probably need to hold on to hud_resource_ for | |
| 176 // longer, and have several HUD textures in the pipeline. | |
| 177 DCHECK(!resource_provider->InUseByConsumer(hud_resource_->id())); | |
| 178 } | 173 } |
|
piman
2013/05/08 19:24:36
Looks like this function doesn't do anything anymo
danakj
2013/05/08 23:43:47
Done.
| |
| 179 | 174 |
| 180 void HeadsUpDisplayLayerImpl::DidLoseOutputSurface() { hud_resource_.reset(); } | 175 void HeadsUpDisplayLayerImpl::DidLoseOutputSurface() { hud_resource_.reset(); } |
| 181 | 176 |
| 182 bool HeadsUpDisplayLayerImpl::LayerIsAlwaysDamaged() const { return true; } | 177 bool HeadsUpDisplayLayerImpl::LayerIsAlwaysDamaged() const { return true; } |
| 183 | 178 |
| 184 void HeadsUpDisplayLayerImpl::UpdateHudContents() { | 179 void HeadsUpDisplayLayerImpl::UpdateHudContents() { |
| 185 const LayerTreeDebugState& debug_state = layer_tree_impl()->debug_state(); | 180 const LayerTreeDebugState& debug_state = layer_tree_impl()->debug_state(); |
| 186 | 181 |
| 187 // Don't update numbers every frame so text is readable. | 182 // Don't update numbers every frame so text is readable. |
| 188 base::TimeTicks now = layer_tree_impl()->CurrentFrameTimeTicks(); | 183 base::TimeTicks now = layer_tree_impl()->CurrentFrameTimeTicks(); |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 685 } | 680 } |
| 686 | 681 |
| 687 canvas->restore(); | 682 canvas->restore(); |
| 688 } | 683 } |
| 689 | 684 |
| 690 const char* HeadsUpDisplayLayerImpl::LayerTypeAsString() const { | 685 const char* HeadsUpDisplayLayerImpl::LayerTypeAsString() const { |
| 691 return "HeadsUpDisplayLayer"; | 686 return "HeadsUpDisplayLayer"; |
| 692 } | 687 } |
| 693 | 688 |
| 694 } // namespace cc | 689 } // namespace cc |
| OLD | NEW |