Chromium Code Reviews| Index: webrtc/modules/desktop_capture/win/dxgi_texture.cc |
| diff --git a/webrtc/modules/desktop_capture/win/dxgi_texture.cc b/webrtc/modules/desktop_capture/win/dxgi_texture.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a4174e2953f3bea84437650cfca0187f57e673e6 |
| --- /dev/null |
| +++ b/webrtc/modules/desktop_capture/win/dxgi_texture.cc |
| @@ -0,0 +1,36 @@ |
| +/* |
| + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| + * |
| + * Use of this source code is governed by a BSD-style license |
| + * that can be found in the LICENSE file in the root of the source |
| + * tree. An additional intellectual property rights grant can be found |
| + * in the file PATENTS. All contributing project authors may |
| + * be found in the AUTHORS file in the root of the source tree. |
| + */ |
| + |
| +#include "webrtc/modules/desktop_capture/win/dxgi_texture.h" |
| + |
| +namespace webrtc { |
| + |
| +DxgiTexture::DxgiTexture(const DesktopRect& desktop_rect) |
| + : desktop_rect_(desktop_rect) {} |
| + |
| +DxgiTexture::DxgiDesktopFrame::DxgiDesktopFrame(const DxgiTexture& texture) |
|
Sergey Ulanov
2016/07/20 19:05:17
move this above DxgiTexture constructor.
Hzj_jie
2016/07/22 18:43:43
Done.
|
| + : DesktopFrame(texture.desktop_rect().size(), |
| + texture.pitch(), |
| + texture.bits(), |
| + nullptr) {} |
| + |
| +const DesktopFrame& DxgiTexture::AsDesktopFrame() { |
| + if (!frame_) { |
| + frame_.reset(new DxgiDesktopFrame(*this)); |
| + } |
| + return *frame_; |
| +} |
| + |
| +bool DxgiTexture::Release() { |
| + frame_.reset(); |
| + return DoRelease(); |
| +} |
| + |
| +} // namespace webrtc |