画布SurfaceView - 硬件加速 [英] Canvas in SurfaceView - hardware acceleration

查看:2293
本文介绍了画布SurfaceView - 硬件加速的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发的ICS,并试图理解为什么一个 Canvas.isHardwareAccelerated()时,会使用一个总是返回FALSE 画布SurfaceView里。

I'm developing on ICS and trying to understand why a Canvas.isHardwareAccelerated() will always return FALSE when using a Canvas inside a SurfaceView.

我试过一个非常简单的例子是这样的: <一href="http://android-coding.blogspot.com/2011/05/drawing-on-surfaceview.html">http://android-coding.blogspot.com/2011/05/drawing-on-surfaceview.html 或者这一个:<一href="http://jmsliu.com/199/android-canvas-example.html">http://jmsliu.com/199/android-canvas-example.html

I've tried a very basic example like this: http://android-coding.blogspot.com/2011/05/drawing-on-surfaceview.html Or this one: http://jmsliu.com/199/android-canvas-example.html

我甚至修改他们没有平局循环中的任何帆布电话 以为我也许能得到一些不支持硬件加速操作 对于某些绘图调用。 我查了下,不支持的绘图操作这个名单 developer.android.com/guide/topics/graphics/hardware-accel.html 但我没有做任何的。

I even modified them to not have any canvas calls inside the draw loop thinking that I might have got in some unsupported HW accel operations for certain drawing calls. I checked this list under "Unsupported Drawing Operations" developer.android.com/guide/topics/graphics/hardware-accel.html but I'm not doing any of that.

我现在用的是开发人员选项里面的强制GPU渲染标志 和...一起 该清单里面,还我指定minSDK / targetSDK> = 14。

I am using the Force GPU rendering flag inside the Developer Options together with inside the manifests, also I'm specifying minSDK/targetSDK >= 14.

在View.isHardwareAccelerated将返回TRUE,而 Canvas.isHardwareAccelerated将返回始终为false。

The View.isHardwareAccelerated will return TRUE, while the Canvas.isHardwareAccelerated will return always FALSE.

我见过Canvas.java具有硬codeded返回false isHardwareAccelerated(),而HardwareCanvas.java有返回true。我想对于一些原因,我没有收到汉王路,为什么?

I've seen that Canvas.java has hard-codeded return false for isHardwareAccelerated(), while HardwareCanvas.java has return true. I guess for some reasons I'm not getting the HW path, why?

能否SurfaceView内的画布进行硬件加速?

Can a Canvas inside a SurfaceView be HW accelerated?

感谢

推荐答案

SurfaceView.lockCanvas()不能被硬件此刻加速。回到画布。

A Canvas returned by SurfaceView.lockCanvas() cannot be hardware accelerated at the moment.

这篇关于画布SurfaceView - 硬件加速的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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