| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/widget/widget.h" | 5 #include "views/widget/widget.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "ui/gfx/compositor/compositor.h" | 9 #include "ui/gfx/compositor/compositor.h" |
| 10 #include "views/focus/view_storage.h" | 10 #include "views/focus/view_storage.h" |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 | 627 |
| 628 //////////////////////////////////////////////////////////////////////////////// | 628 //////////////////////////////////////////////////////////////////////////////// |
| 629 // Widget, private: | 629 // Widget, private: |
| 630 | 630 |
| 631 void Widget::EnsureCompositor() { | 631 void Widget::EnsureCompositor() { |
| 632 DCHECK(!compositor_.get()); | 632 DCHECK(!compositor_.get()); |
| 633 | 633 |
| 634 // TODO(sad): If there is a parent Widget, then use the same compositor | 634 // TODO(sad): If there is a parent Widget, then use the same compositor |
| 635 // instead of creating a new one here. | 635 // instead of creating a new one here. |
| 636 gfx::AcceleratedWidget widget = native_widget_->GetAcceleratedWidget(); | 636 gfx::AcceleratedWidget widget = native_widget_->GetAcceleratedWidget(); |
| 637 if (widget != gfx::kNullAcceleratedWidget) | 637 if (widget != gfx::kNullAcceleratedWidget && |
| 638 View::get_use_acceleration_when_possible()) |
| 638 compositor_ = ui::Compositor::Create(widget); | 639 compositor_ = ui::Compositor::Create(widget); |
| 639 } | 640 } |
| 640 | 641 |
| 641 bool Widget::ShouldReleaseCaptureOnMouseReleased() const { | 642 bool Widget::ShouldReleaseCaptureOnMouseReleased() const { |
| 642 return true; | 643 return true; |
| 643 } | 644 } |
| 644 | 645 |
| 645 } // namespace views | 646 } // namespace views |
| OLD | NEW |