Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在Image对象中缓存Graphics和Pen对象 #59

Merged
merged 12 commits into from
Oct 24, 2020

Conversation

royqh1979
Copy link
Collaborator

目前所有的ege_系列函数都在内部创建一个Graphics对象,处理后释放。
这会影响图像绘制时的性能。

这个Patch在Image对象内部缓存了Graphics对象和Pen对象。ege_系列函数在绘图时会使用这两个缓存的对象,不在创建新对象。

为了节省资源,这两个对象使用延迟加载,只有在第一次使用时才会被创建。

为了提高速度,相关函数做成了inline的形式。

请大家审核吧

@chirsz-ever
Copy link
Collaborator

目前还要考虑兼容 VC6,所以……

@royqh1979
Copy link
Collaborator Author

目前还要考虑兼容 VC6,所以……

所以不能用智能指针?

@royqh1979
Copy link
Collaborator Author

目前还要考虑兼容 VC6,所以……

改用普通指针实现了

@royqh1979 royqh1979 merged commit 6d1e7d9 into wysaid:master Oct 24, 2020
@royqh1979 royqh1979 deleted the gdinew branch October 24, 2020 23:42
yixy-only added a commit to yixy-only/xege that referenced this pull request Apr 17, 2024
 原因: 在创建图像时创建了 GDI+ 对象但并未在此之前对 GDI+ 进行初始化 。wysaid#59 中引入(083423f)
yixy-only added a commit to yixy-only/xege that referenced this pull request May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants