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

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

Issue 2981713002: Revert of Allow presenting DXGI share handles as overlays. (Closed)
Patch Set: 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 | « no previous file | gpu/ipc/service/direct_composition_surface_win_unittest.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 066edf0002b90a10be17889bca4d392a4fc4e94c..706fa86e2f402fc45f1a2089b44fd4926071858b 100644
--- a/gpu/ipc/service/direct_composition_surface_win.cc
+++ b/gpu/ipc/service/direct_composition_surface_win.cc
@@ -474,8 +474,8 @@
void DCLayerTree::SwapChainPresenter::PresentToSwapChain(
const ui::DCRendererLayerParams& params) {
- gl::GLImageDXGIBase* image_dxgi =
- gl::GLImageDXGIBase::FromGLImage(params.image[0].get());
+ gl::GLImageDXGI* image_dxgi =
+ gl::GLImageDXGI::FromGLImage(params.image[0].get());
gl::GLImageMemory* y_image_memory = nullptr;
gl::GLImageMemory* uv_image_memory = nullptr;
if (params.image.size() >= 2) {
@@ -557,13 +557,9 @@
base::win::ScopedComPtr<ID3D11Texture2D> input_texture;
UINT input_level;
- base::win::ScopedComPtr<IDXGIKeyedMutex> keyed_mutex;
if (image_dxgi) {
input_texture = image_dxgi->texture();
input_level = (UINT)image_dxgi->level();
- if (!input_texture)
- return;
- input_texture.CopyTo(keyed_mutex.GetAddressOf());
staging_texture_.Reset();
} else {
DCHECK(y_image_memory);
@@ -628,19 +624,6 @@
}
{
- if (keyed_mutex) {
- // The producer may still be using this texture for a short period of
- // time, so wait long enough to hopefully avoid glitches. For example,
- // all levels of the texture share the same keyed mutex, so if the
- // hardware decoder acquired the mutex to decode into a different array
- // level then it still may block here temporarily.
- const int kMaxSyncTimeMs = 1000;
- HRESULT hr = keyed_mutex->AcquireSync(0, kMaxSyncTimeMs);
- if (FAILED(hr)) {
- DLOG(ERROR) << "Error acquiring keyed mutex: " << std::hex << hr;
- return;
- }
- }
D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC in_desc = {};
in_desc.ViewDimension = D3D11_VPIV_DIMENSION_TEXTURE2D;
in_desc.Texture2D.ArraySlice = input_level;
@@ -669,10 +652,6 @@
hr = video_context_->VideoProcessorBlt(video_processor_.Get(),
out_view_.Get(), 0, 1, &stream);
CHECK(SUCCEEDED(hr));
- if (keyed_mutex) {
- HRESULT hr = keyed_mutex->ReleaseSync(0);
- DCHECK(SUCCEEDED(hr));
- }
}
if (first_present) {
« no previous file with comments | « no previous file | gpu/ipc/service/direct_composition_surface_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698