Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: cc/heads_up_display_layer.cc

Issue 11369200: improving UI of FPS counter (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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) ;
egraether 2012/11/12 23:44:06 Moves the HUDLayer to the right of the screen if o
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698