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

Side by Side Diff: ui/aura/desktop.cc

Issue 8805033: Makes tests either use mock compositor or mock WebGraphicsContext3D (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 9 years 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
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 "ui/aura/desktop.h" 5 #include "ui/aura/desktop.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 capture_window_(NULL), 408 capture_window_(NULL),
409 mouse_pressed_handler_(NULL), 409 mouse_pressed_handler_(NULL),
410 mouse_moved_handler_(NULL), 410 mouse_moved_handler_(NULL),
411 focused_window_(NULL), 411 focused_window_(NULL),
412 touch_event_handler_(NULL) { 412 touch_event_handler_(NULL) {
413 SetName("RootWindow"); 413 SetName("RootWindow");
414 gfx::Screen::SetInstance(screen_); 414 gfx::Screen::SetInstance(screen_);
415 host_->SetDesktop(this); 415 host_->SetDesktop(this);
416 last_mouse_location_ = host_->QueryMouseLocation(); 416 last_mouse_location_ = host_->QueryMouseLocation();
417 417
418 if (ui::Compositor::compositor_factory()) {
419 compositor_ = (*ui::Compositor::compositor_factory())(this);
420 } else {
421 #ifdef USE_WEBKIT_COMPOSITOR 418 #ifdef USE_WEBKIT_COMPOSITOR
422 ui::CompositorCC::Initialize(false); 419 ui::CompositorCC::Initialize(false);
423 #endif 420 #endif
424 compositor_ = ui::Compositor::Create(this, host_->GetAcceleratedWidget(), 421 compositor_ = ui::Compositor::Create(this, host_->GetAcceleratedWidget(),
425 host_->GetSize()); 422 host_->GetSize());
426 }
427 DCHECK(compositor_.get()); 423 DCHECK(compositor_.get());
428 } 424 }
429 425
430 Desktop::~Desktop() { 426 Desktop::~Desktop() {
431 in_destructor_ = true; 427 in_destructor_ = true;
428 // Make sure to NULL out the compositor before terminating so that state is
429 // cleared and we don't hit asserts.
430 compositor_ = NULL;
432 #ifdef USE_WEBKIT_COMPOSITOR 431 #ifdef USE_WEBKIT_COMPOSITOR
433 if (!ui::Compositor::compositor_factory()) 432 ui::CompositorCC::Terminate();
434 ui::CompositorCC::Terminate();
435 #endif 433 #endif
436 if (instance_ == this) 434 if (instance_ == this)
437 instance_ = NULL; 435 instance_ = NULL;
438 } 436 }
439 437
440 void Desktop::HandleMouseMoved(const MouseEvent& event, Window* target) { 438 void Desktop::HandleMouseMoved(const MouseEvent& event, Window* target) {
441 if (target == mouse_moved_handler_) 439 if (target == mouse_moved_handler_)
442 return; 440 return;
443 441
444 // Send an exited event. 442 // Send an exited event.
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { 597 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) {
600 bounds.set_size(gfx::Size(parsed_width, parsed_height)); 598 bounds.set_size(gfx::Size(parsed_width, parsed_height));
601 } else if (use_fullscreen_host_window_) { 599 } else if (use_fullscreen_host_window_) {
602 bounds = gfx::Rect(DesktopHost::GetNativeScreenSize()); 600 bounds = gfx::Rect(DesktopHost::GetNativeScreenSize());
603 } 601 }
604 602
605 return bounds; 603 return bounds;
606 } 604 }
607 605
608 } // namespace aura 606 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698