From 5af2af36eee061212be887ededd4293924a6b31a Mon Sep 17 00:00:00 2001 From: Zijie He Date: Fri, 28 Jul 2017 11:42:07 -0700 Subject: [PATCH] Remove resolution_tracker_ from dxgi_texture DxgiTexture now does not rely on a fixed resolution, so the ResolutionTracker can be removed from it. This change does not have logic impact, the upper component (DxgiDuplicatorController) always reinitializes itself once the screen resolution changes. And this check is also a legacy one: DxgiFrame now can take care of the resolution change itself without needing to return false in DxgiTexture. Bug: webrtc:8044 Change-Id: I3ad9ce175f2bc9bf03b0a3985efa2681aa55d14b Reviewed-on: https://chromium-review.googlesource.com/592247 Reviewed-by: Jamie Walch Commit-Queue: Zijie He Cr-Commit-Position: refs/heads/master@{#19191} --- webrtc/modules/desktop_capture/win/dxgi_texture.cc | 4 ---- webrtc/modules/desktop_capture/win/dxgi_texture.h | 2 -- 2 files changed, 6 deletions(-) diff --git a/webrtc/modules/desktop_capture/win/dxgi_texture.cc b/webrtc/modules/desktop_capture/win/dxgi_texture.cc index 6c19ee0932..964e00f9c7 100644 --- a/webrtc/modules/desktop_capture/win/dxgi_texture.cc +++ b/webrtc/modules/desktop_capture/win/dxgi_texture.cc @@ -57,10 +57,6 @@ bool DxgiTexture::CopyFrom(const DXGI_OUTDUPL_FRAME_INFO& frame_info, D3D11_TEXTURE2D_DESC desc = {0}; texture->GetDesc(&desc); desktop_size_.set(desc.Width, desc.Height); - if (resolution_tracker_.SetResolution(desktop_size_)) { - LOG(LS_ERROR) << "Texture size is not consistent with current DxgiTexture."; - return false; - } return CopyFromTexture(frame_info, texture.Get()); } diff --git a/webrtc/modules/desktop_capture/win/dxgi_texture.h b/webrtc/modules/desktop_capture/win/dxgi_texture.h index c2b0db4c9e..fb120921da 100644 --- a/webrtc/modules/desktop_capture/win/dxgi_texture.h +++ b/webrtc/modules/desktop_capture/win/dxgi_texture.h @@ -18,7 +18,6 @@ #include "webrtc/modules/desktop_capture/desktop_frame.h" #include "webrtc/modules/desktop_capture/desktop_geometry.h" -#include "webrtc/modules/desktop_capture/resolution_tracker.h" namespace webrtc { @@ -67,7 +66,6 @@ class DxgiTexture { DXGI_MAPPED_RECT rect_ = {0}; DesktopSize desktop_size_; std::unique_ptr frame_; - ResolutionTracker resolution_tracker_; }; } // namespace webrtc