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

Side by Side Diff: cc/heads_up_display_layer.cc

Issue 11308153: Migrate most of cc/ from WebKit::WebTransformationMatrix to gfx::Transform (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch for landing 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 | Annotate | Revision Log
« no previous file with comments | « cc/gl_renderer_unittest.cc ('k') | cc/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
(...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; 35 gfx::Transform matrix;
36 matrix.makeIdentity(); 36 matrix.MakeIdentity();
37 37
38 if (settings.showPlatformLayerTree || settings.showDebugRects()) { 38 if (settings.showPlatformLayerTree || settings.showDebugRects()) {
39 int width = std::min(maxTextureSize, layerTreeHost()->deviceViewportSize ().width()); 39 int width = std::min(maxTextureSize, layerTreeHost()->deviceViewportSize ().width());
40 int height = std::min(maxTextureSize, layerTreeHost()->deviceViewportSiz e().height()); 40 int height = std::min(maxTextureSize, layerTreeHost()->deviceViewportSiz e().height());
41 bounds = gfx::Size(width, height); 41 bounds = gfx::Size(width, height);
42 } else { 42 } else {
43 bounds = gfx::Size(256, 128); 43 bounds = gfx::Size(256, 128);
44 matrix.translate(layerTreeHost()->deviceViewportSize().width() - 256, 0) ; 44 matrix.Translate(layerTreeHost()->deviceViewportSize().width() - 256, 0) ;
45 } 45 }
46 46
47 setBounds(bounds); 47 setBounds(bounds);
48 setTransform(matrix); 48 setTransform(matrix);
49 } 49 }
50 50
51 bool HeadsUpDisplayLayer::drawsContent() const 51 bool HeadsUpDisplayLayer::drawsContent() const
52 { 52 {
53 return true; 53 return true;
54 } 54 }
(...skipping 20 matching lines...) Expand all
75 Layer::pushPropertiesTo(layerImpl); 75 Layer::pushPropertiesTo(layerImpl);
76 76
77 HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl* >(layerImpl); 77 HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl* >(layerImpl);
78 hudLayerImpl->setShowFPSCounter(m_showFPSCounter); 78 hudLayerImpl->setShowFPSCounter(m_showFPSCounter);
79 79
80 if (m_fontAtlas.get()) 80 if (m_fontAtlas.get())
81 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass()); 81 hudLayerImpl->setFontAtlas(m_fontAtlas.Pass());
82 } 82 }
83 83
84 } // namespace cc 84 } // namespace cc
OLDNEW
« no previous file with comments | « cc/gl_renderer_unittest.cc ('k') | cc/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698