OLD | NEW |
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/layers/heads_up_display_layer.h" | 5 #include "cc/layers/heads_up_display_layer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "cc/layers/heads_up_display_layer_impl.h" | 10 #include "cc/layers/heads_up_display_layer_impl.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 void HeadsUpDisplayLayer::PrepareForCalculateDrawProperties( | 33 void HeadsUpDisplayLayer::PrepareForCalculateDrawProperties( |
34 const gfx::Size& device_viewport, float device_scale_factor) { | 34 const gfx::Size& device_viewport, float device_scale_factor) { |
35 gfx::Size device_viewport_in_layout_pixels = gfx::Size( | 35 gfx::Size device_viewport_in_layout_pixels = gfx::Size( |
36 device_viewport.width() / device_scale_factor, | 36 device_viewport.width() / device_scale_factor, |
37 device_viewport.height() / device_scale_factor); | 37 device_viewport.height() / device_scale_factor); |
38 | 38 |
39 gfx::Size bounds; | 39 gfx::Size bounds; |
40 gfx::Transform matrix; | 40 gfx::Transform matrix; |
41 matrix.MakeIdentity(); | 41 matrix.MakeIdentity(); |
42 | 42 |
43 if (layer_tree_host()->debug_state().ShowHudRects()) { | 43 if (layer_tree_host()->GetDebugState().ShowHudRects()) { |
44 bounds = device_viewport_in_layout_pixels; | 44 bounds = device_viewport_in_layout_pixels; |
45 } else { | 45 } else { |
46 int size = 256; | 46 int size = 256; |
47 bounds.SetSize(size, size); | 47 bounds.SetSize(size, size); |
48 matrix.Translate(device_viewport_in_layout_pixels.width() - size, 0.0); | 48 matrix.Translate(device_viewport_in_layout_pixels.width() - size, 0.0); |
49 } | 49 } |
50 | 50 |
51 SetBounds(bounds); | 51 SetBounds(bounds); |
52 SetTransform(matrix); | 52 SetTransform(matrix); |
53 } | 53 } |
(...skipping 15 matching lines...) Expand all Loading... |
69 void HeadsUpDisplayLayer::PushPropertiesTo(LayerImpl* layer) { | 69 void HeadsUpDisplayLayer::PushPropertiesTo(LayerImpl* layer) { |
70 Layer::PushPropertiesTo(layer); | 70 Layer::PushPropertiesTo(layer); |
71 TRACE_EVENT0("cc", "HeadsUpDisplayLayer::PushPropertiesTo"); | 71 TRACE_EVENT0("cc", "HeadsUpDisplayLayer::PushPropertiesTo"); |
72 HeadsUpDisplayLayerImpl* layer_impl = | 72 HeadsUpDisplayLayerImpl* layer_impl = |
73 static_cast<HeadsUpDisplayLayerImpl*>(layer); | 73 static_cast<HeadsUpDisplayLayerImpl*>(layer); |
74 | 74 |
75 layer_impl->SetHUDTypeface(typeface_); | 75 layer_impl->SetHUDTypeface(typeface_); |
76 } | 76 } |
77 | 77 |
78 } // namespace cc | 78 } // namespace cc |
OLD | NEW |