Chromium Code Reviews| 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/surface/accelerated_surface_win.h" | 5 #include "ui/surface/accelerated_surface_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 325 return; | 325 return; |
| 326 } | 326 } |
| 327 } | 327 } |
| 328 | 328 |
| 329 NOTREACHED(); | 329 NOTREACHED(); |
| 330 } | 330 } |
| 331 | 331 |
| 332 scoped_refptr<AcceleratedPresenter> AcceleratedPresenterMap::GetPresenter( | 332 scoped_refptr<AcceleratedPresenter> AcceleratedPresenterMap::GetPresenter( |
| 333 gfx::PluginWindowHandle window) { | 333 gfx::PluginWindowHandle window) { |
| 334 base::AutoLock locked(lock_); | 334 base::AutoLock locked(lock_); |
| 335 | |
| 336 #if defined(USE_AURA) | |
| 337 if (!window) | |
| 338 return presenters_.begin()->second; | |
| 339 #endif | |
| 340 | |
| 341 PresenterMap::iterator it = presenters_.find(window); | 335 PresenterMap::iterator it = presenters_.find(window); |
| 342 if (it == presenters_.end()) | 336 if (it == presenters_.end()) |
| 343 return scoped_refptr<AcceleratedPresenter>(); | 337 return scoped_refptr<AcceleratedPresenter>(); |
| 344 | 338 |
| 345 return it->second; | 339 return it->second; |
| 346 } | 340 } |
| 347 | 341 |
| 348 void AcceleratedPresenterMap::ResetPresentThread( | 342 void AcceleratedPresenterMap::ResetPresentThread( |
| 349 PresentThread* present_thread) { | 343 PresentThread* present_thread) { |
| 350 base::AutoLock locked(lock_); | 344 base::AutoLock locked(lock_); |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 665 if (present_thread_ != present_thread) | 659 if (present_thread_ != present_thread) |
| 666 return; | 660 return; |
| 667 | 661 |
| 668 present_thread_->lock()->AssertAcquired(); | 662 present_thread_->lock()->AssertAcquired(); |
| 669 | 663 |
| 670 source_texture_ = NULL; | 664 source_texture_ = NULL; |
| 671 swap_chain_ = NULL; | 665 swap_chain_ = NULL; |
| 672 quantized_size_ = gfx::Size(); | 666 quantized_size_ = gfx::Size(); |
| 673 } | 667 } |
| 674 | 668 |
| 675 #if defined(USE_AURA) | |
| 676 void AcceleratedPresenter::SetNewTargetWindow(gfx::PluginWindowHandle window) { | |
| 677 window_ = window; | |
| 678 swap_chain_ = NULL; | |
|
cpu_(ooo_6.6-7.5)
2013/08/25 23:35:17
the new code does not null the swap chain, is that
gab
2013/08/26 19:46:03
no idea.... scott?
apatrick_chromium
2013/08/28 00:03:28
I think it's okay.
scottmg
2013/09/03 16:08:56
That was probably there to force the Present to cr
| |
| 679 } | |
| 680 #endif | |
| 681 | |
| 682 AcceleratedPresenter::~AcceleratedPresenter() { | 669 AcceleratedPresenter::~AcceleratedPresenter() { |
| 683 } | 670 } |
| 684 | 671 |
| 685 bool AcceleratedPresenter::IsSwapChainInitialized() const { | 672 bool AcceleratedPresenter::IsSwapChainInitialized() const { |
| 686 base::AutoLock locked(*present_thread_->lock()); | 673 base::AutoLock locked(*present_thread_->lock()); |
| 687 | 674 |
| 688 return !!swap_chain_; | 675 return !!swap_chain_; |
| 689 } | 676 } |
| 690 | 677 |
| 691 void AcceleratedPresenter::DoPresentAndAcknowledge( | 678 void AcceleratedPresenter::DoPresentAndAcknowledge( |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1103 presenter_->Suspend(); | 1090 presenter_->Suspend(); |
| 1104 } | 1091 } |
| 1105 | 1092 |
| 1106 void AcceleratedSurface::WasHidden() { | 1093 void AcceleratedSurface::WasHidden() { |
| 1107 presenter_->WasHidden(); | 1094 presenter_->WasHidden(); |
| 1108 } | 1095 } |
| 1109 | 1096 |
| 1110 void AcceleratedSurface::SetIsSessionLocked(bool locked) { | 1097 void AcceleratedSurface::SetIsSessionLocked(bool locked) { |
| 1111 presenter_->SetIsSessionLocked(locked); | 1098 presenter_->SetIsSessionLocked(locked); |
| 1112 } | 1099 } |
| OLD | NEW |