Chromium Code Reviews| 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 706fa86e2f402fc45f1a2089b44fd4926071858b..fe96f217b42863dc02b3836984ab732991e30ac0 100644 |
| --- a/gpu/ipc/service/direct_composition_surface_win.cc |
| +++ b/gpu/ipc/service/direct_composition_surface_win.cc |
| @@ -991,10 +991,23 @@ DirectCompositionSurfaceWin::~DirectCompositionSurfaceWin() { |
| // static |
| bool DirectCompositionSurfaceWin::AreOverlaysSupported() { |
| - if (!HardwareSupportsOverlays()) |
| - return false; |
| + static bool initialized; |
| + static bool overlays_supported; |
| + if (initialized) |
| + return overlays_supported; |
| + |
| + initialized = true; |
| - return base::FeatureList::IsEnabled(switches::kDirectCompositionOverlays); |
| + if (HardwareSupportsOverlays()) { |
| + overlays_supported = |
|
sunnyps
2017/07/24 22:03:47
nit: overlays_supported = base::FeatureList::IsEna
|
| + base::FeatureList::IsEnabled(switches::kDirectCompositionOverlays); |
| + } else { |
| + overlays_supported = false; |
| + } |
| + |
| + UMA_HISTOGRAM_BOOLEAN("GPU.DirectComposition.OverlaysSupported", |
| + overlays_supported); |
| + return overlays_supported; |
| } |
| // static |
| @@ -1178,6 +1191,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); |