画布上的drawArc()导致慢帧

时间:2018-01-28 17:25:32

标签: android performance canvas draw

我创建了一个自定义视图,只需使用<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Cutting-Edge Solutions (Scotland)</title> </head> <body> <div id="root"> <header role="banner" aria-label="Cutting-Edge Solutions (Scotalnd)"> <nav class="menu__container"> <div class="gel-wrap"> <div class="gel-layout gel-layout--middle gel-layout--equal gel-layout--fit"> <div class="gel-layout__item "> <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"> <path d="M20 0 L40 20 L20 40 L0 20"></path> </svg> </div> <div class="gel-layout__item "><a href="/">Home</a></div> <div class="gel-layout__item "><a href="/oss">OSS</a></div> <div class="gel-layout__item "><a href="/blog">Blog</a></div> <div class="gel-layout__item "><a href="/privacy-policy">Privacy Policy</a></div> </div> </div> </nav> </header> <div class="gel-wrap"> <h1>Home</h1> </div> </div> </body> </html>绘制如下所示的圆圈:

enter image description here

这个简单的绘图命令,没有任何其他命令,已经导致播放商店中“Android Vitals”部分报告的慢帧。

我创建了一个sample app on github来演示行为。

0 个答案:

没有答案