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

Side by Side Diff: views/widget/widget.cc

Issue 7104039: First draft to enable turning off compositor for unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revised to add conditional compilation guards. Created 9 years, 6 months 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 | « views/view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « views/view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698