skia库得GPU加速问题

braisure 2019-03-21 12:59:17
在windows平台下,用skia库离屏渲染图片,要开启GPU加速,可是开启后,总是绘制不成功,用CPU绘制就可以,求大牛能指点下.

这是GPU的surface,在这个surface上绘制不成功
GrContextOptions opts;
sk_gpu_test::GrContextFactory factory(opts);
sk_gpu_test::ContextInfo ctxInfo = factory.getContextInfo(sk_gpu_test::GrContextFactory::kGL_ContextType);
SkImageInfo info = SkImageInfo::MakeN32Premul(mvComponent->GetMvWidth(), mvComponent->GetMvHeight());
surface_ = SkSurface::MakeRenderTarget(ctxInfo.grContext(), SkBudgeted::kNo, info);


这是CPU得surface,在这个上边绘制没问题
surface_ = SkSurface::MakeRasterN32Premul(mvComponent->GetMvWidth(), mvComponent->GetMvHeight());

其他代码全部一样,就这两个创建surface的代码不同
...全文
341 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧