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 14 matching lines...) Expand all Loading... |
25 HeadsUpDisplayLayer::~HeadsUpDisplayLayer() | 25 HeadsUpDisplayLayer::~HeadsUpDisplayLayer() |
26 { | 26 { |
27 } | 27 } |
28 | 28 |
29 void HeadsUpDisplayLayer::update(ResourceUpdateQueue&, const OcclusionTracker*,
RenderingStats&) | 29 void HeadsUpDisplayLayer::update(ResourceUpdateQueue&, const OcclusionTracker*,
RenderingStats&) |
30 { | 30 { |
31 const LayerTreeSettings& settings = layerTreeHost()->settings(); | 31 const LayerTreeSettings& settings = layerTreeHost()->settings(); |
32 int maxTextureSize = layerTreeHost()->rendererCapabilities().maxTextureSize; | 32 int maxTextureSize = layerTreeHost()->rendererCapabilities().maxTextureSize; |
33 | 33 |
34 gfx::Size bounds; | 34 gfx::Size bounds; |
| 35 WebKit::WebTransformationMatrix matrix; |
| 36 matrix.makeIdentity(); |
| 37 |
35 if (settings.showPlatformLayerTree || settings.showDebugRects()) { | 38 if (settings.showPlatformLayerTree || settings.showDebugRects()) { |
36 int width = std::min(maxTextureSize, layerTreeHost()->deviceViewportSize
().width()); | 39 int width = std::min(maxTextureSize, layerTreeHost()->deviceViewportSize
().width()); |
37 int height = std::min(maxTextureSize, layerTreeHost()->deviceViewportSiz
e().height()); | 40 int height = std::min(maxTextureSize, layerTreeHost()->deviceViewportSiz
e().height()); |
38 bounds = gfx::Size(width, height); | 41 bounds = gfx::Size(width, height); |
39 } else { | 42 } else { |
40 bounds = gfx::Size(256, 128); | 43 bounds = gfx::Size(256, 128); |
| 44 matrix.translate(layerTreeHost()->deviceViewportSize().width() - 256, 0)
; |
41 } | 45 } |
42 | 46 |
43 setBounds(bounds); | 47 setBounds(bounds); |
| 48 setTransform(matrix); |
44 } | 49 } |
45 | 50 |
46 bool HeadsUpDisplayLayer::drawsContent() const | 51 bool HeadsUpDisplayLayer::drawsContent() const |
47 { | 52 { |
48 return true; | 53 return true; |
49 } | 54 } |
50 | 55 |
51 void HeadsUpDisplayLayer::setFontAtlas(scoped_ptr<FontAtlas> fontAtlas) | 56 void HeadsUpDisplayLayer::setFontAtlas(scoped_ptr<FontAtlas> fontAtlas) |
52 { | 57 { |
53 m_fontAtlas = fontAtlas.Pass(); | 58 m_fontAtlas = fontAtlas.Pass(); |
(...skipping 16 matching lines...) Expand all Loading... |
70 Layer::pushPropertiesTo(layerImpl); | 75 Layer::pushPropertiesTo(layerImpl); |
71 | 76 |
72 HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl*
>(layerImpl); | 77 HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl*
>(layerImpl); |
73 hudLayerImpl->setShowFPSCounter(m_showFPSCounter); | 78 hudLayerImpl->setShowFPSCounter(m_showFPSCounter); |
74 | 79 |
75 if (m_fontAtlas.get()) | 80 if (m_fontAtlas.get()) |
76 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass()); | 81 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass()); |
77 } | 82 } |
78 | 83 |
79 } // namespace cc | 84 } // namespace cc |
OLD | NEW |