形状路径太大而无法渲染为纹理 [英] Shape path too large to be rendered into a texture

查看:107
本文介绍了形状路径太大而无法渲染为纹理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试解决此问题,但到目前为止,我发现的唯一一件事就是禁用硬件加速.它确实可以工作,但是却使滚动迟钝,有什么办法可以解决此问题,但又可以保持硬件加速?

I'm trying to solve this problem but so far the only thing i've found is disabling the hardware acceleration. It actually works but it makes the scroll laggy is there a way to solve this problem but keeping the hardware acceleration on?

推荐答案

因此,唯一的解决方案是使用软件渲染和优化代码,以便其平滑滚动.就我而言,我是使用onDraw方法绘制曲线的,每次我滚动滚动以每秒重绘几次的曲线时都会调用该曲线,这在使用硬件加速时速度很快,但是在软件上却很慢.现在,我仅在位图中绘制一次曲线,并将位图设置为视图的背景,仅重绘了滚动中的指针,即使没有软件加速也可以使滚动平滑.我希望这可以帮助任何遇到类似问题的人!

So the only solution was using software rendering and optimizing the code so it can scroll smoothly. In my case I was drawing the curve in the onDraw method and it was called everytime I scrolled redrawing the curve several times per second, this was fast using hardware acceleration but really slow on software. Now I draw the curve in a bitmap only once and set the bitmap as background of the view redrawing only the pointer onscroll making the scroll smooth even without software acceleration. I hope this can help anybody with the a similar problem!

这篇关于形状路径太大而无法渲染为纹理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆