截图优化 (#1480)

* BitBlt 优化

* BitBlt恢复Top-down

* 渲染时翻转图像

* CaptureSession引用计数

* 恢复成无拷贝Mat

* 合法性检查

* 优化截图预览窗口

* 保存截图文件必要时需要克隆一份Mat

* BitBlt内存池

* 返回拷贝就不用对Session做引用计数了

* 移除CaptureImageRes

* 优化DirectX

* 更好地处理padding

* BitBlt去掉padding

1920*1080的游戏窗口是4字节对齐的,因此不会有性能影响。这里主要用于测试。

* 修复修改窗口大小

* 合并CreateStagingTexture

* 修复设备丢失崩溃

* WGC截图支持HDR

* fix typo

* CodeQA

* 去掉1px窗口边框

* DirectX截图去掉A通道

* HDR转换使用GPU加速

---------

Co-authored-by: 辉鸭蛋 <huiyadanli@gmail.com>
This commit is contained in:
Shatyuka
2025-05-11 01:17:18 +08:00
committed by GitHub
parent 5b3bac478d
commit 0bea2d095a
29 changed files with 670 additions and 759 deletions

View File

@@ -78,23 +78,6 @@ public class ImageRegion : Region
_srcMat = mat;
}
public ImageRegion(CaptureImageRes image, int x, int y, Region? owner = null, INodeConverter? converter = null,
DrawContent? drawContent = null) : base(x, y, image.Width, image.Height, owner, converter, drawContent)
{
if (image.Bitmap != null)
{
_srcBitmap = image.Bitmap;
}
else if (image.Mat != null)
{
_srcMat = image.Mat;
}
else
{
throw new Exception("ImageRegion的构造函数参数错误");
}
}
private bool HasImage()
{
return _srcBitmap != null || _srcMat != null;