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

锯齿还有优化空间吗? #29

Open
caojianhua opened this issue Jun 29, 2018 · 4 comments
Open

锯齿还有优化空间吗? #29

caojianhua opened this issue Jun 29, 2018 · 4 comments

Comments

@caojianhua
Copy link

在一些比较老的机器上比较明显, 下面是红米手机的截图

image

@GcsSloop
Copy link
Owner

GcsSloop commented Jul 5, 2018

针对于背景,暂时没有更好的实现方案。

@caojianhua
Copy link
Author

创建一个layerpaint

Paint layerPaint = new Paint();
layerPaint.setXfermode(null);
layerPaint.setAntiAlias(true);

将下面的代码

canvas.saveLayer(mRoundHelper.mLayer, null, Canvas.ALL_SAVE_FLAG);

修改为

canvas.saveLayer(mRoundHelper.mLayer, layerPaint, Canvas.ALL_SAVE_FLAG);

发现可以很好的改善锯齿, 并且在部分低版本系统中圆角功能失效的问题也能得到解决, 目前还没有在所有机型上进行测试, 可以了解下

@GcsSloop
Copy link
Owner

谢谢反馈,我测试一下,

@lwlizhe
Copy link

lwlizhe commented Sep 12, 2018

把这句:
canvas.drawPath(mRCHelper.mClipPath, mPaint);
加到
super.draw(canvas);
后面也有效果……
不过,性能嘛………………
反正锯齿问题好了很多……&%……*……&

result2

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

No branches or pull requests

3 participants