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

Unified Diff: gpu/ipc/service/direct_composition_surface_win.cc

Issue 2895783002: Avoid scaling overlays on systems that don't support them. (Closed)
Patch Set: fix build Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/direct_composition_surface_win.cc
diff --git a/gpu/ipc/service/direct_composition_surface_win.cc b/gpu/ipc/service/direct_composition_surface_win.cc
index 85c651e1bf47b6fb95956c60e4941358dc81a8dc..43b0ae97c4e24c0b2ae98caa1690adc35ac963df 100644
--- a/gpu/ipc/service/direct_composition_surface_win.cc
+++ b/gpu/ipc/service/direct_composition_surface_win.cc
@@ -108,6 +108,8 @@ class PresentationHistory {
gfx::Size g_overlay_monitor_size;
+bool g_supports_scaled_overlays = true;
+
// This is the raw support info, which shouldn't depend on field trial state.
bool HardwareSupportsOverlays() {
if (!gl::GLSurfaceEGL::IsDirectCompositionSupported())
@@ -165,6 +167,8 @@ bool HardwareSupportsOverlays() {
continue;
g_overlay_monitor_size =
gfx::Rect(monitor_desc.DesktopCoordinates).size();
+ g_supports_scaled_overlays =
+ !!(flags & DXGI_OVERLAY_SUPPORT_FLAG_SCALING);
return true;
}
}
@@ -512,7 +516,9 @@ void DCLayerTree::SwapChainPresenter::PresentToSwapChain(
gfx::Rect bounds_rect = params.rect;
gfx::Size ceiled_input_size = gfx::ToCeiledSize(params.contents_rect.size());
gfx::Size swap_chain_size = bounds_rect.size();
- swap_chain_size.SetToMin(ceiled_input_size);
+
+ if (g_supports_scaled_overlays)
+ swap_chain_size.SetToMin(ceiled_input_size);
// YUY2 surfaces must have an even width.
if (swap_chain_size.width() % 2 == 1)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698