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

Side by Side Diff: cc/HeadsUpDisplayLayerChromium.cpp

Issue 11122003: [cc] Rename all cc/ filenames to Chromium style (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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/HeadsUpDisplayLayerChromium.h ('k') | cc/IOSurfaceLayerChromium.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6
7 #include "HeadsUpDisplayLayerChromium.h"
8
9 #include "CCHeadsUpDisplayLayerImpl.h"
10 #include "CCLayerTreeHost.h"
11 #include "TraceEvent.h"
12
13 namespace cc {
14
15 scoped_refptr<HeadsUpDisplayLayerChromium> HeadsUpDisplayLayerChromium::create()
16 {
17 return make_scoped_refptr(new HeadsUpDisplayLayerChromium());
18 }
19
20 HeadsUpDisplayLayerChromium::HeadsUpDisplayLayerChromium()
21 : LayerChromium()
22 {
23
24 setBounds(IntSize(512, 128));
25 }
26
27 HeadsUpDisplayLayerChromium::~HeadsUpDisplayLayerChromium()
28 {
29 }
30
31 void HeadsUpDisplayLayerChromium::update(CCTextureUpdateQueue&, const CCOcclusio nTracker*, CCRenderingStats&)
32 {
33 const CCLayerTreeSettings& settings = layerTreeHost()->settings();
34 int maxTextureSize = layerTreeHost()->rendererCapabilities().maxTextureSize;
35
36 IntSize bounds;
37 if (settings.showPlatformLayerTree || settings.showDebugRects()) {
38 bounds.setWidth(std::min(maxTextureSize, layerTreeHost()->deviceViewport Size().width()));
39 bounds.setHeight(std::min(maxTextureSize, layerTreeHost()->deviceViewpor tSize().height()));
40 } else {
41 bounds.setWidth(512);
42 bounds.setHeight(128);
43 }
44
45 setBounds(bounds);
46 }
47
48 bool HeadsUpDisplayLayerChromium::drawsContent() const
49 {
50 return true;
51 }
52
53 void HeadsUpDisplayLayerChromium::setFontAtlas(scoped_ptr<CCFontAtlas> fontAtlas )
54 {
55 m_fontAtlas = fontAtlas.Pass();
56 setNeedsCommit();
57 }
58
59 scoped_ptr<CCLayerImpl> HeadsUpDisplayLayerChromium::createCCLayerImpl()
60 {
61 return CCHeadsUpDisplayLayerImpl::create(m_layerId).PassAs<CCLayerImpl>();
62 }
63
64 void HeadsUpDisplayLayerChromium::pushPropertiesTo(CCLayerImpl* layerImpl)
65 {
66 LayerChromium::pushPropertiesTo(layerImpl);
67
68 if (!m_fontAtlas.get())
69 return;
70
71 CCHeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<CCHeadsUpDisplayLayerI mpl*>(layerImpl);
72 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass());
73 }
74
75 }
OLDNEW
« no previous file with comments | « cc/HeadsUpDisplayLayerChromium.h ('k') | cc/IOSurfaceLayerChromium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698