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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "HeadsUpDisplayLayerChromium.h" | 7 #include "HeadsUpDisplayLayerChromium.h" |
8 | 8 |
9 #include "CCHeadsUpDisplayLayerImpl.h" | 9 #include "CCHeadsUpDisplayLayerImpl.h" |
10 #include "CCLayerTreeHost.h" | 10 #include "CCLayerTreeHost.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 bounds.setWidth(std::min(maxTextureSize, layerTreeHost()->deviceViewport
Size().width())); | 38 bounds.setWidth(std::min(maxTextureSize, layerTreeHost()->deviceViewport
Size().width())); |
39 bounds.setHeight(std::min(maxTextureSize, layerTreeHost()->deviceViewpor
tSize().height())); | 39 bounds.setHeight(std::min(maxTextureSize, layerTreeHost()->deviceViewpor
tSize().height())); |
40 } else { | 40 } else { |
41 bounds.setWidth(512); | 41 bounds.setWidth(512); |
42 bounds.setHeight(128); | 42 bounds.setHeight(128); |
43 } | 43 } |
44 | 44 |
45 setBounds(bounds); | 45 setBounds(bounds); |
46 } | 46 } |
47 | 47 |
| 48 bool HeadsUpDisplayLayerChromium::drawsContent() const |
| 49 { |
| 50 return true; |
| 51 } |
| 52 |
48 void HeadsUpDisplayLayerChromium::setFontAtlas(PassOwnPtr<CCFontAtlas> fontAtlas
) | 53 void HeadsUpDisplayLayerChromium::setFontAtlas(PassOwnPtr<CCFontAtlas> fontAtlas
) |
49 { | 54 { |
50 m_fontAtlas = fontAtlas; | 55 m_fontAtlas = fontAtlas; |
51 setNeedsCommit(); | 56 setNeedsCommit(); |
52 } | 57 } |
53 | 58 |
54 PassOwnPtr<CCLayerImpl> HeadsUpDisplayLayerChromium::createCCLayerImpl() | 59 PassOwnPtr<CCLayerImpl> HeadsUpDisplayLayerChromium::createCCLayerImpl() |
55 { | 60 { |
56 return CCHeadsUpDisplayLayerImpl::create(m_layerId); | 61 return CCHeadsUpDisplayLayerImpl::create(m_layerId); |
57 } | 62 } |
58 | 63 |
59 void HeadsUpDisplayLayerChromium::pushPropertiesTo(CCLayerImpl* layerImpl) | 64 void HeadsUpDisplayLayerChromium::pushPropertiesTo(CCLayerImpl* layerImpl) |
60 { | 65 { |
61 LayerChromium::pushPropertiesTo(layerImpl); | 66 LayerChromium::pushPropertiesTo(layerImpl); |
62 | 67 |
63 if (!m_fontAtlas) | 68 if (!m_fontAtlas) |
64 return; | 69 return; |
65 | 70 |
66 CCHeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<CCHeadsUpDisplayLayerI
mpl*>(layerImpl); | 71 CCHeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<CCHeadsUpDisplayLayerI
mpl*>(layerImpl); |
67 hudLayerImpl->setFontAtlas(m_fontAtlas.release()); | 72 hudLayerImpl->setFontAtlas(m_fontAtlas.release()); |
68 } | 73 } |
69 | 74 |
70 } | 75 } |
OLD | NEW |