Skip to content

Commit

Permalink
Only use overlays on windows 10 anniversary update and later.
Browse files Browse the repository at this point in the history
Before this Chrome would never be assigned overlays so trying to use
them won't save power.

BUG=678800
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2781833003
Cr-Commit-Position: refs/heads/master@{#460663}
  • Loading branch information
jbauman2 authored and Commit bot committed Mar 30, 2017
1 parent 4faad2d commit 8c39bf0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion base/win/windows_version.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ Version MajorMinorBuildToVersion(int major, int minor, int build) {
} else if (major == 10) {
if (build < 10586) {
return VERSION_WIN10;
} else {
} else if (build < 14393) {
return VERSION_WIN10_TH2;
} else {
return VERSION_WIN10_R1;
}
} else if (major > 6) {
NOTREACHED();
Expand Down
1 change: 1 addition & 0 deletions base/win/windows_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ enum Version {
VERSION_WIN8_1 = 6, // Also includes Windows Server 2012 R2.
VERSION_WIN10 = 7, // Also includes Windows 10 Server.
VERSION_WIN10_TH2 = 8, // Threshold 2: Version 1511, Build 10586.
VERSION_WIN10_R1 = 9, // Redstone 1: Version 1607, Build 14393.
VERSION_WIN_LAST, // Indicates error condition.
};

Expand Down
4 changes: 4 additions & 0 deletions content/browser/gpu/gpu_data_manager_impl_private.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ enum WinSubVersion {
kWin8_1,
kWin10,
kWin10_TH2,
kWin10_R1,
kNumWinSubVersions
};

Expand Down Expand Up @@ -103,6 +104,9 @@ int GetGpuBlacklistHistogramValueWin(gpu::GpuFeatureStatus status) {
case base::win::VERSION_WIN10_TH2:
sub_version = kWin10_TH2;
break;
case base::win::VERSION_WIN10_R1:
sub_version = kWin10_R1;
break;
}
}
int entry_index = static_cast<int>(sub_version) * gpu::kGpuFeatureStatusMax;
Expand Down
6 changes: 6 additions & 0 deletions gpu/ipc/service/direct_composition_surface_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "base/synchronization/waitable_event.h"
#include "base/trace_event/trace_event.h"
#include "base/win/scoped_handle.h"
#include "base/win/windows_version.h"
#include "gpu/ipc/service/gpu_channel_manager.h"
#include "gpu/ipc/service/gpu_channel_manager_delegate.h"
#include "gpu/ipc/service/switches.h"
Expand Down Expand Up @@ -634,6 +635,11 @@ bool DirectCompositionSurfaceWin::AreOverlaysSupported() {
if (command_line->HasSwitch(switches::kDisableDirectCompositionLayers))
return false;

// Before Windows 10 Anniversary Update (Redstone 1), overlay planes
// wouldn't be assigned to non-UWP apps.
if (base::win::GetVersion() < base::win::VERSION_WIN10_R1)
return false;

base::win::ScopedComPtr<ID3D11Device> d3d11_device =
gl::QueryD3D11DeviceObjectFromANGLE();
DCHECK(d3d11_device);
Expand Down

0 comments on commit 8c39bf0

Please sign in to comment.