文字唯一暂停GLSurfaceView银河S3后可见 - 文字模糊移动时。没有按钮背景 [英] Text only thing visible after pausing GLSurfaceView on Galaxy S3 - Text blur when moved. No button backgrounds

查看:283
本文介绍了文字唯一暂停GLSurfaceView银河S3后可见 - 文字模糊移动时。没有按钮背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一个银河S3一些奇怪的行为(我的其他测试设备(不S3S)错误没有了像下面)。

I'm getting some STRANGE behavior on a Galaxy S3 (none of my other test devices (not S3s) bug out like the following).

方案:

我通过JNI从libffmpeg处理的RTSP流走YUV数据。 我把这些价值观,用openGL使他们可以映射到纹理养活他们为C ++ code。 (基本上,显示从RTSP流在OpenGL视频)。

I'm taking YUV data via JNI from an RTSP stream processed by libffmpeg. I take these values and feed them into C++ code using openGL so they may be mapped to a texture. (Basically, display the video from an RTSP stream in openGL).

问题:

我一直在试图增加一个叠加到视频(与正常的Andr​​oid小工具/视图/ XML)和我注意到在Galaxy S3(无处)的背景的按钮(无论他们是一个R.color, R.drawable等)都丢失。 **按钮上的文字是可见的。

I've been trying to add an overlay to the video (with normal Android widgets/views/xml) and I noticed on the Galaxy S3 (nowhere else) the backgrounds to buttons (whether they're an R.color, R.drawable, etc.) are all missing. **The text on buttons IS visible.

最大的问题是:在pressing回来,返回到普通的旧非OpenGL的activites他们都损坏(截图如下)。在这些视图中显示的唯一的事情是文本。如果文本移动(想想分页)文本将模糊(见截图)。

The biggest issue is: after pressing back to return to regular old non opengl activites they're all corrupted (screenshots follow). The only thing visible on these views is the text. If the text moves (think pagination) the text will blur (see screenshot).

我试过5其他设备没有问题,我的应用程序。这两个问题发生在我的Galaxy S3,所以我认为他们是相关的。

I've tried my app on 5 other devices with no issues. Both of these issues happen on my Galaxy S3, so I think they're related.

尽管我最好的谷歌福,我没有发现任何有关。 任何信息大大AP preciated。 TY

Despite my best Google-fu I've not found anything relevant. Any info is greatly appreciated. TY

文本的openGL后可见暂停(返回到之前的活动),但模糊移动时。可见没有其他元素(应该是):

Text visible after openGL paused (back to activity before it), but blurred when moved. No other elements visible (they should be):

这是视频是什么样子(应该是一个现实生活中的场景)如果返回到previous活动后恢复它。注:有没有灰色背景上的按钮。这是真实的,当OpenGL的活动是第一次打开,而且也没有其他腐败行为:

This is what the video looks like (should be a real life scene) if one resumes it after returning to previous activity. Note: there's no grey background on the button. This is true when the OpenGL activity is first opened and there's no other corruption:

推荐答案

事实证明,我被调用函数设置openGL的在UI线程。 我打电话给我的平局()在连接到我的GLSurfaceView渲染器创建的线程(等)的方法。 因为安装方法被调用的UI线程用于硬件加速OpenGL的已被损坏。

It turns out I was calling the function to setup openGL on the UI Thread. I was calling my draw() (etc) methods in the thread created by the Renderer attached to my GLSurfaceView . Because the setup method was being called on the UI thread the openGL used for hardware acceleration was being corrupted.

TL; DR:不作任何(甚至设置)渲染器类用于GLSurfaceView的要求之外,因为它创建了一个单独的线程,以便您的OpenGL调用不与OpenGL的运行干扰在用于硬件加速的UI线程。

TL;DR: don't make ANY (even setup) calls outside of the Renderer class used for GLSurfaceView as it creates a separate thread so your openGL calls don't interfere with the openGL running on the UI Thread used for hardware acceleration.

这是简单的测试,看看你的应用程序是由这个问题困扰是禁用硬件加速您的Andr​​oid清单,并检查问题是否消失或不:

An easy test to see if your app is plagued by this issue is to disable hardware acceleration in your android manifest and check whether the issue goes away or not:

<application android:hardwareAccelerated="false" ...>

我希望这可以帮助别人:)

I hope this helps someone else :)

这篇关于文字唯一暂停GLSurfaceView银河S3后可见 - 文字模糊移动时。没有按钮背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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