| 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 "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
| 8 #include "cc/debug_colors.h" | 8 #include "cc/debug_colors.h" |
| 9 #include "cc/debug_rect_history.h" | 9 #include "cc/debug_rect_history.h" |
| 10 #include "cc/font_atlas.h" | 10 #include "cc/font_atlas.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 : LayerImpl(treeImpl, id) | 68 : LayerImpl(treeImpl, id) |
| 69 , m_fpsGraph(60.0, 80.0) | 69 , m_fpsGraph(60.0, 80.0) |
| 70 , m_paintTimeGraph(16.0, 48.0) | 70 , m_paintTimeGraph(16.0, 48.0) |
| 71 { | 71 { |
| 72 } | 72 } |
| 73 | 73 |
| 74 HeadsUpDisplayLayerImpl::~HeadsUpDisplayLayerImpl() | 74 HeadsUpDisplayLayerImpl::~HeadsUpDisplayLayerImpl() |
| 75 { | 75 { |
| 76 } | 76 } |
| 77 | 77 |
| 78 scoped_ptr<LayerImpl> HeadsUpDisplayLayerImpl::createLayerImpl(LayerTreeImpl* tr
eeImpl) |
| 79 { |
| 80 return HeadsUpDisplayLayerImpl::create(treeImpl, id()).PassAs<LayerImpl>(); |
| 81 } |
| 82 |
| 83 void HeadsUpDisplayLayerImpl::pushPropertiesTo(LayerImpl* layerImpl) |
| 84 { |
| 85 LayerImpl::pushPropertiesTo(layerImpl); |
| 86 |
| 87 if (!m_fontAtlas) |
| 88 return; |
| 89 |
| 90 HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl*
>(layerImpl); |
| 91 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass()); |
| 92 } |
| 93 |
| 78 void HeadsUpDisplayLayerImpl::setFontAtlas(scoped_ptr<FontAtlas> fontAtlas) | 94 void HeadsUpDisplayLayerImpl::setFontAtlas(scoped_ptr<FontAtlas> fontAtlas) |
| 79 { | 95 { |
| 80 m_fontAtlas = fontAtlas.Pass(); | 96 m_fontAtlas = fontAtlas.Pass(); |
| 81 } | 97 } |
| 82 | 98 |
| 83 void HeadsUpDisplayLayerImpl::willDraw(ResourceProvider* resourceProvider) | 99 void HeadsUpDisplayLayerImpl::willDraw(ResourceProvider* resourceProvider) |
| 84 { | 100 { |
| 85 LayerImpl::willDraw(resourceProvider); | 101 LayerImpl::willDraw(resourceProvider); |
| 86 | 102 |
| 87 if (!m_hudTexture) | 103 if (!m_hudTexture) |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 483 |
| 468 canvas->restore(); | 484 canvas->restore(); |
| 469 } | 485 } |
| 470 | 486 |
| 471 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const | 487 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const |
| 472 { | 488 { |
| 473 return "HeadsUpDisplayLayer"; | 489 return "HeadsUpDisplayLayer"; |
| 474 } | 490 } |
| 475 | 491 |
| 476 } // namespace cc | 492 } // namespace cc |
| OLD | NEW |