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

Side by Side Diff: cc/heads_up_display_layer.cc

Issue 11415208: cc: Fix hudLayer size and paint rects scale for deviceScaleFactor != 1 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to 170476 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
« no previous file with comments | « no previous file | cc/heads_up_display_layer_impl.cc » ('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
(...skipping 17 matching lines...) Expand all
28 void HeadsUpDisplayLayer::update(ResourceUpdateQueue&, const OcclusionTracker*, RenderingStats&) 28 void HeadsUpDisplayLayer::update(ResourceUpdateQueue&, const OcclusionTracker*, RenderingStats&)
29 { 29 {
30 const LayerTreeDebugState& debugState = layerTreeHost()->debugState(); 30 const LayerTreeDebugState& debugState = layerTreeHost()->debugState();
31 int maxTextureSize = layerTreeHost()->rendererCapabilities().maxTextureSize; 31 int maxTextureSize = layerTreeHost()->rendererCapabilities().maxTextureSize;
32 32
33 gfx::Size bounds; 33 gfx::Size bounds;
34 gfx::Transform matrix; 34 gfx::Transform matrix;
35 matrix.MakeIdentity(); 35 matrix.MakeIdentity();
36 36
37 if (debugState.showPlatformLayerTree || debugState.showHudRects()) { 37 if (debugState.showPlatformLayerTree || debugState.showHudRects()) {
38 int width = std::min(maxTextureSize, layerTreeHost()->deviceViewportSize ().width()); 38 int width = std::min(maxTextureSize, layerTreeHost()->layoutViewportSize ().width());
39 int height = std::min(maxTextureSize, layerTreeHost()->deviceViewportSiz e().height()); 39 int height = std::min(maxTextureSize, layerTreeHost()->layoutViewportSiz e().height());
40 bounds = gfx::Size(width, height); 40 bounds = gfx::Size(width, height);
41 } else { 41 } else {
42 bounds = gfx::Size(256, 128); 42 bounds = gfx::Size(256, 128);
43 matrix.Translate(layerTreeHost()->deviceViewportSize().width() - 256, 0) ; 43 matrix.Translate(layerTreeHost()->layoutViewportSize().width() - 256, 0) ;
44 } 44 }
45 45
46 setBounds(bounds); 46 setBounds(bounds);
47 setTransform(matrix); 47 setTransform(matrix);
48 } 48 }
49 49
50 bool HeadsUpDisplayLayer::drawsContent() const 50 bool HeadsUpDisplayLayer::drawsContent() const
51 { 51 {
52 return true; 52 return true;
53 } 53 }
(...skipping 14 matching lines...) Expand all
68 Layer::pushPropertiesTo(layerImpl); 68 Layer::pushPropertiesTo(layerImpl);
69 69
70 if (!m_fontAtlas) 70 if (!m_fontAtlas)
71 return; 71 return;
72 72
73 HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl* >(layerImpl); 73 HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl* >(layerImpl);
74 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass()); 74 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass());
75 } 75 }
76 76
77 } // namespace cc 77 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/heads_up_display_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698