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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 abs(window_size.height() - pixel_size.height()); | 723 abs(window_size.height() - pixel_size.height()); |
724 #else | 724 #else |
725 bool size_mismatch = size != window_size; | 725 bool size_mismatch = size != window_size; |
726 #endif | 726 #endif |
727 if (hidden_ && size_mismatch) { | 727 if (hidden_ && size_mismatch) { |
728 TRACE_EVENT2("gpu", "EarlyOut_WrongWindowSize", | 728 TRACE_EVENT2("gpu", "EarlyOut_WrongWindowSize", |
729 "backwidth", size.width(), "backheight", size.height()); | 729 "backwidth", size.width(), "backheight", size.height()); |
730 TRACE_EVENT2("gpu", "EarlyOut_WrongWindowSize2", | 730 TRACE_EVENT2("gpu", "EarlyOut_WrongWindowSize2", |
731 "windowwidth", window_size.width(), | 731 "windowwidth", window_size.width(), |
732 "windowheight", window_size.height()); | 732 "windowheight", window_size.height()); |
| 733 #if !defined(ENABLE_HIDPI) |
733 return; | 734 return; |
| 735 #endif |
734 } | 736 } |
735 #endif | 737 #endif |
736 | 738 |
737 // Round up size so the swap chain is not continuously resized with the | 739 // Round up size so the swap chain is not continuously resized with the |
738 // surface, which could lead to memory fragmentation. | 740 // surface, which could lead to memory fragmentation. |
739 const int kRound = 64; | 741 const int kRound = 64; |
740 gfx::Size quantized_size( | 742 gfx::Size quantized_size( |
741 std::max(1, (size.width() + kRound - 1) / kRound * kRound), | 743 std::max(1, (size.width() + kRound - 1) / kRound * kRound), |
742 std::max(1, (size.height() + kRound - 1) / kRound * kRound)); | 744 std::max(1, (size.height() + kRound - 1) / kRound * kRound)); |
743 | 745 |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 presenter_->Suspend(); | 1087 presenter_->Suspend(); |
1086 } | 1088 } |
1087 | 1089 |
1088 void AcceleratedSurface::WasHidden() { | 1090 void AcceleratedSurface::WasHidden() { |
1089 presenter_->WasHidden(); | 1091 presenter_->WasHidden(); |
1090 } | 1092 } |
1091 | 1093 |
1092 void AcceleratedSurface::SetIsSessionLocked(bool locked) { | 1094 void AcceleratedSurface::SetIsSessionLocked(bool locked) { |
1093 presenter_->SetIsSessionLocked(locked); | 1095 presenter_->SetIsSessionLocked(locked); |
1094 } | 1096 } |
OLD | NEW |