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

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

Issue 2933453002: Always use DirectCompositionSurfaceWin when using DirectComposition (Closed)
Patch Set: post-review fixes Created 3 years, 5 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 | « gpu/ipc/service/direct_composition_surface_win.h ('k') | gpu/ipc/service/gpu_init.cc » ('j') | 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 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);
« no previous file with comments | « gpu/ipc/service/direct_composition_surface_win.h ('k') | gpu/ipc/service/gpu_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698