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

Side by Side Diff: cc/heads_up_display_layer.cc

Issue 11413123: cc: switch to new WebLayerTreeViewClient API for requesting font atlas (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed WebKit tests for patch #1 Created 8 years 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
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_showFPSCounter(false) 20 , m_showFPSCounter(false)
21 , m_hasFontAtlas(false)
21 { 22 {
22 setBounds(gfx::Size(256, 128)); 23 setBounds(gfx::Size(256, 128));
23 } 24 }
24 25
25 HeadsUpDisplayLayer::~HeadsUpDisplayLayer() 26 HeadsUpDisplayLayer::~HeadsUpDisplayLayer()
26 { 27 {
27 } 28 }
28 29
29 void HeadsUpDisplayLayer::update(ResourceUpdateQueue&, const OcclusionTracker*, RenderingStats&) 30 void HeadsUpDisplayLayer::update(ResourceUpdateQueue&, const OcclusionTracker*, RenderingStats&)
30 { 31 {
(...skipping 19 matching lines...) Expand all
50 51
51 bool HeadsUpDisplayLayer::drawsContent() const 52 bool HeadsUpDisplayLayer::drawsContent() const
52 { 53 {
53 return true; 54 return true;
54 } 55 }
55 56
56 void HeadsUpDisplayLayer::setFontAtlas(scoped_ptr<FontAtlas> fontAtlas) 57 void HeadsUpDisplayLayer::setFontAtlas(scoped_ptr<FontAtlas> fontAtlas)
57 { 58 {
58 m_fontAtlas = fontAtlas.Pass(); 59 m_fontAtlas = fontAtlas.Pass();
59 setNeedsCommit(); 60 setNeedsCommit();
61 m_hasFontAtlas = true;
60 } 62 }
61 63
62 void HeadsUpDisplayLayer::setShowFPSCounter(bool show) 64 void HeadsUpDisplayLayer::setShowFPSCounter(bool show)
63 { 65 {
64 m_showFPSCounter = show; 66 m_showFPSCounter = show;
65 setNeedsCommit(); 67 setNeedsCommit();
66 } 68 }
67 69
68 scoped_ptr<LayerImpl> HeadsUpDisplayLayer::createLayerImpl() 70 scoped_ptr<LayerImpl> HeadsUpDisplayLayer::createLayerImpl()
69 { 71 {
70 return HeadsUpDisplayLayerImpl::create(m_layerId).PassAs<LayerImpl>(); 72 return HeadsUpDisplayLayerImpl::create(m_layerId).PassAs<LayerImpl>();
71 } 73 }
72 74
73 void HeadsUpDisplayLayer::pushPropertiesTo(LayerImpl* layerImpl) 75 void HeadsUpDisplayLayer::pushPropertiesTo(LayerImpl* layerImpl)
74 { 76 {
75 Layer::pushPropertiesTo(layerImpl); 77 Layer::pushPropertiesTo(layerImpl);
76 78
77 HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl* >(layerImpl); 79 HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl* >(layerImpl);
78 hudLayerImpl->setShowFPSCounter(m_showFPSCounter); 80 hudLayerImpl->setShowFPSCounter(m_showFPSCounter);
79 81
80 if (m_fontAtlas.get()) 82 if (m_fontAtlas.get())
81 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass()); 83 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass());
82 } 84 }
83 85
84 } // namespace cc 86 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698