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

Side by Side Diff: cc/heads_up_display_layer.cc

Issue 12095053: cc: Avoid expensive RenderingStats collection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 10 months 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 | Annotate | Revision Log
« no previous file with comments | « cc/heads_up_display_layer.h ('k') | cc/image_layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 namespace cc { 11 namespace cc {
12 12
13 scoped_refptr<HeadsUpDisplayLayer> HeadsUpDisplayLayer::create() 13 scoped_refptr<HeadsUpDisplayLayer> HeadsUpDisplayLayer::create()
14 { 14 {
15 return make_scoped_refptr(new HeadsUpDisplayLayer()); 15 return make_scoped_refptr(new HeadsUpDisplayLayer());
16 } 16 }
17 17
18 HeadsUpDisplayLayer::HeadsUpDisplayLayer() 18 HeadsUpDisplayLayer::HeadsUpDisplayLayer()
19 : Layer() 19 : Layer()
20 , m_hasFontAtlas(false) 20 , m_hasFontAtlas(false)
21 { 21 {
22 setBounds(gfx::Size(256, 128)); 22 setBounds(gfx::Size(256, 128));
23 } 23 }
24 24
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 LayerTreeDebugState& debugState = layerTreeHost()->debugState(); 31 const LayerTreeDebugState& debugState = layerTreeHost()->debugState();
32 int maxTextureSize = layerTreeHost()->rendererCapabilities().maxTextureSize; 32 int maxTextureSize = layerTreeHost()->rendererCapabilities().maxTextureSize;
33 33
34 gfx::Size bounds; 34 gfx::Size bounds;
35 gfx::Transform matrix; 35 gfx::Transform matrix;
36 matrix.MakeIdentity(); 36 matrix.MakeIdentity();
37 37
38 if (debugState.showPlatformLayerTree || debugState.showHudRects()) { 38 if (debugState.showPlatformLayerTree || debugState.showHudRects()) {
39 int width = std::min(maxTextureSize, layerTreeHost()->layoutViewportSize ().width()); 39 int width = std::min(maxTextureSize, layerTreeHost()->layoutViewportSize ().width());
(...skipping 29 matching lines...) Expand all
69 Layer::pushPropertiesTo(layerImpl); 69 Layer::pushPropertiesTo(layerImpl);
70 70
71 if (!m_fontAtlas) 71 if (!m_fontAtlas)
72 return; 72 return;
73 73
74 HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl* >(layerImpl); 74 HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl* >(layerImpl);
75 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass()); 75 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass());
76 } 76 }
77 77
78 } // namespace cc 78 } // namespace cc
OLDNEW
« no previous file with comments | « cc/heads_up_display_layer.h ('k') | cc/image_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698