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

Side by Side Diff: gpu/ipc/service/direct_composition_surface_win.cc

Issue 2824793003: Use IDXGIOutput3::CheckOverlaySupport (Closed)
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/ipc/service/direct_composition_surface_win.h" 5 #include "gpu/ipc/service/direct_composition_surface_win.h"
6 6
7 #include <d3d11_1.h> 7 #include <d3d11_1.h>
8 #include <dcomptypes.h> 8 #include <dcomptypes.h>
9 9
10 #include <deque> 10 #include <deque>
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 base::win::ScopedComPtr<IDXGIDevice> dxgi_device; 822 base::win::ScopedComPtr<IDXGIDevice> dxgi_device;
823 d3d11_device.QueryInterface(dxgi_device.Receive()); 823 d3d11_device.QueryInterface(dxgi_device.Receive());
824 base::win::ScopedComPtr<IDXGIAdapter> dxgi_adapter; 824 base::win::ScopedComPtr<IDXGIAdapter> dxgi_adapter;
825 dxgi_device->GetAdapter(dxgi_adapter.Receive()); 825 dxgi_device->GetAdapter(dxgi_adapter.Receive());
826 826
827 unsigned int i = 0; 827 unsigned int i = 0;
828 while (true) { 828 while (true) {
829 base::win::ScopedComPtr<IDXGIOutput> output; 829 base::win::ScopedComPtr<IDXGIOutput> output;
830 if (FAILED(dxgi_adapter->EnumOutputs(i++, output.Receive()))) 830 if (FAILED(dxgi_adapter->EnumOutputs(i++, output.Receive())))
831 break; 831 break;
832 base::win::ScopedComPtr<IDXGIOutput2> output2; 832 base::win::ScopedComPtr<IDXGIOutput3> output3;
833 if (FAILED(output.QueryInterface(output2.Receive()))) 833 if (FAILED(output.QueryInterface(output3.Receive())))
834 return false; 834 continue;
835 835
836 if (output2->SupportsOverlays()) 836 UINT flags = 0;
837 if (FAILED(output3->CheckOverlaySupport(DXGI_FORMAT_YUY2,
838 d3d11_device.Get(), &flags)))
839 continue;
840
841 // Direct-only support might be ok in some circumstances, but since the
842 // overlay processor isn't set up to try to distinguish, only try to use
843 // overlays when scaling's enabled.
844 if (flags & DXGI_OVERLAY_SUPPORT_FLAG_SCALING)
837 return true; 845 return true;
838 } 846 }
839 return false; 847 return false;
840 } 848 }
841 849
842 bool DirectCompositionSurfaceWin::InitializeNativeWindow() { 850 bool DirectCompositionSurfaceWin::InitializeNativeWindow() {
843 if (window_) 851 if (window_)
844 return true; 852 return true;
845 853
846 bool result = child_window_.Initialize(); 854 bool result = child_window_.Initialize();
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 DirectCompositionSurfaceWin::GetWindowTaskRunnerForTesting() { 1165 DirectCompositionSurfaceWin::GetWindowTaskRunnerForTesting() {
1158 return child_window_.GetTaskRunnerForTesting(); 1166 return child_window_.GetTaskRunnerForTesting();
1159 } 1167 }
1160 1168
1161 base::win::ScopedComPtr<IDXGISwapChain1> 1169 base::win::ScopedComPtr<IDXGISwapChain1>
1162 DirectCompositionSurfaceWin::GetLayerSwapChainForTesting(size_t index) const { 1170 DirectCompositionSurfaceWin::GetLayerSwapChainForTesting(size_t index) const {
1163 return layer_tree_->GetLayerSwapChainForTesting(index); 1171 return layer_tree_->GetLayerSwapChainForTesting(index);
1164 } 1172 }
1165 1173
1166 } // namespace gpu 1174 } // namespace gpu
OLDNEW
« 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