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/heads_up_display_layer_impl.h" | 5 #include "cc/heads_up_display_layer_impl.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "cc/debug_colors.h" | 10 #include "cc/debug_colors.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 , m_averageFPS(0) | 53 , m_averageFPS(0) |
54 , m_minFPS(0) | 54 , m_minFPS(0) |
55 , m_maxFPS(0) | 55 , m_maxFPS(0) |
56 { | 56 { |
57 } | 57 } |
58 | 58 |
59 HeadsUpDisplayLayerImpl::~HeadsUpDisplayLayerImpl() | 59 HeadsUpDisplayLayerImpl::~HeadsUpDisplayLayerImpl() |
60 { | 60 { |
61 } | 61 } |
62 | 62 |
| 63 scoped_ptr<LayerImpl> HeadsUpDisplayLayerImpl::createLayerImpl(LayerTreeImpl* tr
eeImpl) |
| 64 { |
| 65 return HeadsUpDisplayLayerImpl::create(treeImpl, id()).PassAs<LayerImpl>(); |
| 66 } |
| 67 |
| 68 void HeadsUpDisplayLayerImpl::pushPropertiesTo(LayerImpl* layerImpl) |
| 69 { |
| 70 LayerImpl::pushPropertiesTo(layerImpl); |
| 71 |
| 72 if (!m_fontAtlas) |
| 73 return; |
| 74 |
| 75 HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl*
>(layerImpl); |
| 76 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass()); |
| 77 } |
| 78 |
63 void HeadsUpDisplayLayerImpl::setFontAtlas(scoped_ptr<FontAtlas> fontAtlas) | 79 void HeadsUpDisplayLayerImpl::setFontAtlas(scoped_ptr<FontAtlas> fontAtlas) |
64 { | 80 { |
65 m_fontAtlas = fontAtlas.Pass(); | 81 m_fontAtlas = fontAtlas.Pass(); |
66 } | 82 } |
67 | 83 |
68 void HeadsUpDisplayLayerImpl::willDraw(ResourceProvider* resourceProvider) | 84 void HeadsUpDisplayLayerImpl::willDraw(ResourceProvider* resourceProvider) |
69 { | 85 { |
70 LayerImpl::willDraw(resourceProvider); | 86 LayerImpl::willDraw(resourceProvider); |
71 | 87 |
72 if (!m_hudTexture) | 88 if (!m_hudTexture) |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 | 401 |
386 canvas->restore(); | 402 canvas->restore(); |
387 } | 403 } |
388 | 404 |
389 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const | 405 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const |
390 { | 406 { |
391 return "HeadsUpDisplayLayer"; | 407 return "HeadsUpDisplayLayer"; |
392 } | 408 } |
393 | 409 |
394 } // namespace cc | 410 } // namespace cc |
OLD | NEW |