OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/host/transformer_helper.h" | 5 #include "ash/host/transformer_helper.h" |
6 | 6 |
7 #include "ash/host/ash_window_tree_host.h" | 7 #include "ash/host/ash_window_tree_host.h" |
8 #include "ash/host/root_window_transformer.h" | 8 #include "ash/host/root_window_transformer.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/aura/window_tree_host.h" | 10 #include "ui/aura/window_tree_host.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 const aura::Window* root_window_; | 51 const aura::Window* root_window_; |
52 const gfx::Transform transform_; | 52 const gfx::Transform transform_; |
53 | 53 |
54 DISALLOW_COPY_AND_ASSIGN(SimpleRootWindowTransformer); | 54 DISALLOW_COPY_AND_ASSIGN(SimpleRootWindowTransformer); |
55 }; | 55 }; |
56 | 56 |
57 } // namespace | 57 } // namespace |
58 | 58 |
59 TransformerHelper::TransformerHelper(AshWindowTreeHost* ash_host) | 59 TransformerHelper::TransformerHelper(AshWindowTreeHost* ash_host) |
60 : ash_host_(ash_host) { | 60 : ash_host_(ash_host) { |
61 SetTransform(gfx::Transform()); | 61 #if defined(OS_WIN) |
62 Init(); | |
oshima
2015/05/01 20:58:16
here
Jun Mukai
2015/05/01 22:06:07
I'm not sure what's this is for.
_ozone, _x11, and
oshima
2015/05/01 22:44:57
As I mentioned, I'm still investigating but window
| |
63 #endif | |
62 } | 64 } |
63 | 65 |
64 TransformerHelper::~TransformerHelper() {} | 66 TransformerHelper::~TransformerHelper() {} |
65 | 67 |
68 void TransformerHelper::Init() { | |
69 SetTransform(gfx::Transform()); | |
70 } | |
71 | |
66 gfx::Insets TransformerHelper::GetHostInsets() const { | 72 gfx::Insets TransformerHelper::GetHostInsets() const { |
67 return transformer_->GetHostInsets(); | 73 return transformer_->GetHostInsets(); |
68 } | 74 } |
69 | 75 |
70 void TransformerHelper::SetTransform(const gfx::Transform& transform) { | 76 void TransformerHelper::SetTransform(const gfx::Transform& transform) { |
71 scoped_ptr<RootWindowTransformer> transformer(new SimpleRootWindowTransformer( | 77 scoped_ptr<RootWindowTransformer> transformer(new SimpleRootWindowTransformer( |
72 ash_host_->AsWindowTreeHost()->window(), transform)); | 78 ash_host_->AsWindowTreeHost()->window(), transform)); |
73 SetRootWindowTransformer(transformer.Pass()); | 79 SetRootWindowTransformer(transformer.Pass()); |
74 } | 80 } |
75 | 81 |
(...skipping 25 matching lines...) Expand all Loading... | |
101 transform.Scale(1.0f / scale, 1.0f / scale); | 107 transform.Scale(1.0f / scale, 1.0f / scale); |
102 return transformer_->GetInverseTransform() * transform; | 108 return transformer_->GetInverseTransform() * transform; |
103 } | 109 } |
104 | 110 |
105 void TransformerHelper::UpdateWindowSize(const gfx::Size& host_size) { | 111 void TransformerHelper::UpdateWindowSize(const gfx::Size& host_size) { |
106 ash_host_->AsWindowTreeHost()->window()->SetBounds( | 112 ash_host_->AsWindowTreeHost()->window()->SetBounds( |
107 transformer_->GetRootWindowBounds(host_size)); | 113 transformer_->GetRootWindowBounds(host_size)); |
108 } | 114 } |
109 | 115 |
110 } // namespace ash | 116 } // namespace ash |
OLD | NEW |