| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/aura/root_window.h" | 5 #include "ui/aura/root_window.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 ui::EventTarget* RootWindow::GetParentTarget() { | 540 ui::EventTarget* RootWindow::GetParentTarget() { |
| 541 return client::GetEventClient(this) ? | 541 return client::GetEventClient(this) ? |
| 542 client::GetEventClient(this)->GetToplevelEventTarget() : | 542 client::GetEventClient(this)->GetToplevelEventTarget() : |
| 543 Env::GetInstance(); | 543 Env::GetInstance(); |
| 544 } | 544 } |
| 545 | 545 |
| 546 //////////////////////////////////////////////////////////////////////////////// | 546 //////////////////////////////////////////////////////////////////////////////// |
| 547 // RootWindow, ui::CompositorDelegate implementation: | 547 // RootWindow, ui::CompositorDelegate implementation: |
| 548 | 548 |
| 549 void RootWindow::ScheduleDraw() { | 549 void RootWindow::ScheduleDraw() { |
| 550 DCHECK(!ui::Compositor::WasInitializedWithThread()); |
| 550 if (!defer_draw_scheduling_) { | 551 if (!defer_draw_scheduling_) { |
| 551 defer_draw_scheduling_ = true; | 552 defer_draw_scheduling_ = true; |
| 552 MessageLoop::current()->PostTask( | 553 MessageLoop::current()->PostTask( |
| 553 FROM_HERE, | 554 FROM_HERE, |
| 554 base::Bind(&RootWindow::Draw, schedule_paint_factory_.GetWeakPtr())); | 555 base::Bind(&RootWindow::Draw, schedule_paint_factory_.GetWeakPtr())); |
| 555 } | 556 } |
| 556 } | 557 } |
| 557 | 558 |
| 558 //////////////////////////////////////////////////////////////////////////////// | 559 //////////////////////////////////////////////////////////////////////////////// |
| 559 // RootWindow, ui::CompositorObserver implementation: | 560 // RootWindow, ui::CompositorObserver implementation: |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1181 } | 1182 } |
| 1182 | 1183 |
| 1183 gfx::Transform RootWindow::GetInverseRootTransform() const { | 1184 gfx::Transform RootWindow::GetInverseRootTransform() const { |
| 1184 float scale = ui::GetDeviceScaleFactor(layer()); | 1185 float scale = ui::GetDeviceScaleFactor(layer()); |
| 1185 gfx::Transform transform; | 1186 gfx::Transform transform; |
| 1186 transform.Scale(1.0f / scale, 1.0f / scale); | 1187 transform.Scale(1.0f / scale, 1.0f / scale); |
| 1187 return transformer_->GetInverseTransform() * transform; | 1188 return transformer_->GetInverseTransform() * transform; |
| 1188 } | 1189 } |
| 1189 | 1190 |
| 1190 } // namespace aura | 1191 } // namespace aura |
| OLD | NEW |