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 9b75f9e4f7aa345b24d621ae0e072f10e9dca347..7f011fd8066a6068700f9161c2a35988dbb6bfa0 100644 |
--- a/gpu/ipc/service/direct_composition_surface_win.cc |
+++ b/gpu/ipc/service/direct_composition_surface_win.cc |
@@ -1013,10 +1013,20 @@ DirectCompositionSurfaceWin::~DirectCompositionSurfaceWin() { |
// static |
bool DirectCompositionSurfaceWin::AreOverlaysSupported() { |
- if (!HardwareSupportsOverlays()) |
- return false; |
+ static bool initialized; |
+ static bool overlays_supported; |
+ if (initialized) |
+ return overlays_supported; |
+ |
+ initialized = true; |
+ |
+ overlays_supported = |
+ HardwareSupportsOverlays() && |
+ base::FeatureList::IsEnabled(switches::kDirectCompositionOverlays); |
- return base::FeatureList::IsEnabled(switches::kDirectCompositionOverlays); |
+ UMA_HISTOGRAM_BOOLEAN("GPU.DirectComposition.OverlaysSupported", |
+ overlays_supported); |
+ return overlays_supported; |
} |
// static |
@@ -1200,6 +1210,10 @@ bool DirectCompositionSurfaceWin::SupportsDCLayers() const { |
return true; |
} |
+bool DirectCompositionSurfaceWin::UseOverlaysForVideo() const { |
+ return AreOverlaysSupported(); |
+} |
+ |
bool DirectCompositionSurfaceWin::SetDrawRectangle(const gfx::Rect& rectangle) { |
if (root_surface_) |
return root_surface_->SetDrawRectangle(rectangle); |