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.h" | 5 #include "cc/heads_up_display_layer.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "cc/heads_up_display_layer_impl.h" | 8 #include "cc/heads_up_display_layer_impl.h" |
9 #include "cc/layer_tree_host.h" | 9 #include "cc/layer_tree_host.h" |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 void HeadsUpDisplayLayer::update(ResourceUpdateQueue&, const OcclusionTracker*,
RenderingStats&) | 28 void HeadsUpDisplayLayer::update(ResourceUpdateQueue&, const OcclusionTracker*,
RenderingStats&) |
29 { | 29 { |
30 const LayerTreeDebugState& debugState = layerTreeHost()->debugState(); | 30 const LayerTreeDebugState& debugState = layerTreeHost()->debugState(); |
31 int maxTextureSize = layerTreeHost()->rendererCapabilities().maxTextureSize; | 31 int maxTextureSize = layerTreeHost()->rendererCapabilities().maxTextureSize; |
32 | 32 |
33 gfx::Size bounds; | 33 gfx::Size bounds; |
34 gfx::Transform matrix; | 34 gfx::Transform matrix; |
35 matrix.MakeIdentity(); | 35 matrix.MakeIdentity(); |
36 | 36 |
37 if (debugState.showPlatformLayerTree || debugState.showHudRects()) { | 37 if (debugState.showPlatformLayerTree || debugState.showHudRects()) { |
38 int width = std::min(maxTextureSize, layerTreeHost()->deviceViewportSize
().width()); | 38 int width = std::min(maxTextureSize, layerTreeHost()->layoutViewportSize
().width()); |
39 int height = std::min(maxTextureSize, layerTreeHost()->deviceViewportSiz
e().height()); | 39 int height = std::min(maxTextureSize, layerTreeHost()->layoutViewportSiz
e().height()); |
40 bounds = gfx::Size(width, height); | 40 bounds = gfx::Size(width, height); |
41 } else { | 41 } else { |
42 bounds = gfx::Size(256, 128); | 42 bounds = gfx::Size(256, 128); |
43 matrix.Translate(layerTreeHost()->deviceViewportSize().width() - 256, 0)
; | 43 matrix.Translate(layerTreeHost()->layoutViewportSize().width() - 256, 0)
; |
44 } | 44 } |
45 | 45 |
46 setBounds(bounds); | 46 setBounds(bounds); |
47 setTransform(matrix); | 47 setTransform(matrix); |
48 } | 48 } |
49 | 49 |
50 bool HeadsUpDisplayLayer::drawsContent() const | 50 bool HeadsUpDisplayLayer::drawsContent() const |
51 { | 51 { |
52 return true; | 52 return true; |
53 } | 53 } |
(...skipping 14 matching lines...) Expand all Loading... |
68 Layer::pushPropertiesTo(layerImpl); | 68 Layer::pushPropertiesTo(layerImpl); |
69 | 69 |
70 if (!m_fontAtlas) | 70 if (!m_fontAtlas) |
71 return; | 71 return; |
72 | 72 |
73 HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl*
>(layerImpl); | 73 HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl*
>(layerImpl); |
74 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass()); | 74 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass()); |
75 } | 75 } |
76 | 76 |
77 } // namespace cc | 77 } // namespace cc |
OLD | NEW |