Chromium Code Reviews| Index: ui/surface/accelerated_surface_win.cc |
| diff --git a/ui/surface/accelerated_surface_win.cc b/ui/surface/accelerated_surface_win.cc |
| index bcdf5f95d680ff52c1c1891cf00574bcc2514d1a..72d7929630c39e2a0c1b15a65874f0cab40507bd 100644 |
| --- a/ui/surface/accelerated_surface_win.cc |
| +++ b/ui/surface/accelerated_surface_win.cc |
| @@ -23,6 +23,7 @@ |
| #include "base/threading/thread_restrictions.h" |
| #include "base/time.h" |
| #include "base/win/wrapped_window_proc.h" |
| +#include "ui/base/win/dpi.h" |
| #include "ui/base/win/hwnd_util.h" |
| #include "ui/gfx/rect.h" |
| #include "ui/gl/gl_switches.h" |
| @@ -476,7 +477,19 @@ void AcceleratedPresenter::DoPresentAndAcknowledge( |
| // If the window is a different size than the swap chain that is being |
| // presented then drop the frame. |
| gfx::Size window_size = GetWindowSize(); |
| - if (hidden_ && size != window_size) { |
| +#if defined(ENABLE_HIDPI) |
| + // Check if the size mismatch is within allowable round off or truncation |
| + // error. |
| + gfx::Size dip_size = ui::win::ScreenToDIPSize(window_size); |
|
sky
2013/01/28 20:56:35
Does this ifdef mean GetWindowSize has different m
kevers
2013/01/28 22:53:40
The size mismatch on Windows with high-DPI enabled
|
| + gfx::Size pixel_size = ui::win::DIPToScreenSize(dip_size); |
| + bool size_mismatch = abs(window_size.width() - size.width()) > |
| + abs(window_size.width() - pixel_size.width()) || |
| + abs(window_size.height() - size.height()) > |
| + abs(window_size.height() - pixel_size.height()); |
| +#else |
| + bool size_mismatch = size != window_size; |
| +#endif |
| + if (hidden_ && size_mismatch) { |
| TRACE_EVENT2("gpu", "EarlyOut_WrongWindowSize", |
| "backwidth", size.width(), "backheight", size.height()); |
| TRACE_EVENT2("gpu", "EarlyOut_WrongWindowSize2", |