skia库得GPU加速问题
在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的代码不同