OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/gl/gl_angle_util_win.h" | 5 #include "ui/gl/gl_angle_util_win.h" |
6 | 6 |
7 #include <objbase.h> | 7 #include <objbase.h> |
8 | 8 |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "third_party/angle/include/EGL/egl.h" | 10 #include "third_party/angle/include/EGL/egl.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 using PFN_DCOMPOSITION_CREATE_DEVICE2 = HRESULT(WINAPI*)( | 113 using PFN_DCOMPOSITION_CREATE_DEVICE2 = HRESULT(WINAPI*)( |
114 IUnknown * renderingDevice, REFIID iid, void** dcompositionDevice); | 114 IUnknown * renderingDevice, REFIID iid, void** dcompositionDevice); |
115 PFN_DCOMPOSITION_CREATE_DEVICE2 create_device_function = | 115 PFN_DCOMPOSITION_CREATE_DEVICE2 create_device_function = |
116 reinterpret_cast<PFN_DCOMPOSITION_CREATE_DEVICE2>( | 116 reinterpret_cast<PFN_DCOMPOSITION_CREATE_DEVICE2>( |
117 ::GetProcAddress(dcomp_module, "DCompositionCreateDevice2")); | 117 ::GetProcAddress(dcomp_module, "DCompositionCreateDevice2")); |
118 if (!create_device_function) | 118 if (!create_device_function) |
119 return dcomp_device; | 119 return dcomp_device; |
120 | 120 |
121 base::win::ScopedComPtr<IDXGIDevice> dxgi_device; | 121 base::win::ScopedComPtr<IDXGIDevice> dxgi_device; |
122 d3d11_device.CopyTo(dxgi_device.Receive()); | 122 d3d11_device.CopyTo(dxgi_device.GetAddressOf()); |
123 base::win::ScopedComPtr<IDCompositionDesktopDevice> desktop_device; | 123 base::win::ScopedComPtr<IDCompositionDesktopDevice> desktop_device; |
124 hr = create_device_function(dxgi_device.Get(), | 124 hr = create_device_function(dxgi_device.Get(), |
125 IID_PPV_ARGS(desktop_device.Receive())); | 125 IID_PPV_ARGS(desktop_device.GetAddressOf())); |
126 if (FAILED(hr)) | 126 if (FAILED(hr)) |
127 return dcomp_device; | 127 return dcomp_device; |
128 | 128 |
129 hr = desktop_device.CopyTo(dcomp_device.Receive()); | 129 hr = desktop_device.CopyTo(dcomp_device.GetAddressOf()); |
130 CHECK(SUCCEEDED(hr)); | 130 CHECK(SUCCEEDED(hr)); |
131 d3d11_device->SetPrivateDataInterface(kDirectCompositionGUID, | 131 d3d11_device->SetPrivateDataInterface(kDirectCompositionGUID, |
132 dcomp_device.Get()); | 132 dcomp_device.Get()); |
133 | 133 |
134 return dcomp_device; | 134 return dcomp_device; |
135 } | 135 } |
136 | 136 |
137 } // namespace gl | 137 } // namespace gl |
OLD | NEW |