0

0

关于Layer组件的同步以及减少GPU带宽的问题

零到壹度

零到壹度

发布时间:2018-03-28 13:24:14

|

2663人浏览过

|

来源于php中文网

原创

本文主要为大家分享一篇P关于Layer组件的同步以及减少GPU带宽的问题,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧。

问题:

1) Layer 之间能否进行单独更新,比如其中video 层上面弹出的状态栏场景如何优化;

初步构想每次仅更新video layer或则将video layer 绕过BQ 进行处理。 

2)FW 以及GPU对video layer 的常见处理;

3)几个变量的理解;

(1)mCurrentTexture ,nextTextureImage;

(2)BufferItem,BufferQueue,mslots;slot,mqueuedframe,mqueuedItem;

(3)syncForReleaseLocked,updateAndReleaseLocked,releaseBufferLocked,releaseBuffer

(4)

司马诸葛
司马诸葛

基于企业知识文档,就可训练专属AI数字员工

下载
/ acquireBuffer attempts to acquire ownership of the next pending buffer in the BufferQueue.
      // If no buffer is pending then it returns NO_BUFFER_AVAILABLE. If a buffer is successfully
      // acquired, the information about the buffer is returned in BufferItem.
      //
      // If the buffer returned had previously been acquired then the BufferItem::mGraphicBuffer field
      // of buffer is set to NULL and it is assumed that the consumer still holds a reference to the
      // buffer.
      //
      // If presentWhen is non-zero, it indicates the time when the buffer will be displayed on
      // screen. If the buffer's timestamp is farther in the future, the buffer won't be acquired, and
      // PRESENT_LATER will be returned. The presentation time is in nanoseconds, and the time base
      // is CLOCK_MONOTONIC.
      //
      // If maxFrameNumber is non-zero, it indicates that acquireBuffer should only return a buffer
      // with a frame number less than or equal to maxFrameNumber. If no such frame is available
      // (such as when a buffer has been replaced but the consumer has not received the
      // onFrameReplaced callback), then PRESENT_LATER will be returned.
      //
      // Return of NO_ERROR means the operation completed as normal.
      //
      // Return of a positive value means the operation could not be completed at this time, but the
      // user should try again later:
      // * NO_BUFFER_AVAILABLE - no buffer is pending (nothing queued by producer)
      // * PRESENT_LATER - the buffer's timestamp is farther in the future
      //
      // Return of a negative value means an error has occurred:
      // * INVALID_OPERATION - too many buffers have been acquired
  // Returned by releaseBuffer, after which the consumer must free any references to the
            // just-released buffer that it might have.
            STALE_BUFFER_SLOT = 1,
          // Returned by dequeueBuffer if there are no pending buffers available.
          NO_BUFFER_AVAILABLE,
          // Returned by dequeueBuffer if it's too early for the buffer to be acquired.
          PRESENT_LATER,

(5)mslots 与mframe 以及mframenumber 的区别

(6)onframavailable 和latchbuffer ,reject,updateteximage,的逻辑。

其中updateteximage;

(7)bufferitem 与mslots的区别

(8)bufferqueueconsumer 与bufferitemconsumer区别;

(9)acquirebuffer的fence 逻辑,fencefd是哪来的;

fence 相关接口定义参见ui/Fence.h

 status_t Fence::waitForever(const char* logname) {64      ATRACE_CALL();
      if (mFenceFd == -1) {
          return NO_ERROR;
      }
      int warningTimeout = 3000;
      int err = sync_wait(mFenceFd, warningTimeout);
      if (err < 0 && errno == ETIME) {
          ALOGE("%s: fence %d didn't signal in %u ms", logname, mFenceFd,
                  warningTimeout);
          err = sync_wait(mFenceFd, TIMEOUT_NEVER);
      }
      return err < 0 ? -errno : status_t(NO_ERROR);
  }
  struct EglSlot {
           EglSlot() : mEglFence(EGL_NO_SYNC_KHR) {}
            // mEglImage is the EGLImage created from mGraphicBuffer.
            sp mEglImage;
           // mFence is the EGL sync object that must signal before the buffer
            // associated with this buffer slot may be dequeued. It is initialized
            // to EGL_NO_SYNC_KHR when the buffer is created and (optionally, based
           // on a compile-time option) set to a new sync object in updateTexImage.
            EGLSyncKHR mEglFence;
      };

(10)

updateAndReleaseLocked(item, &mPendingRelease),
updateAndReleaseLocked(item),
bindTextureImageLocked()

相关专题

更多
苹果官网入口直接访问
苹果官网入口直接访问

苹果官网直接访问入口是https://www.apple.com/cn/,该页面具备0.8秒首屏渲染、HTTP/3与Brotli加速、WebP+AVIF双格式图片、免登录浏览全参数等特性。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。

115

2025.12.24

拼豆图纸在线生成器
拼豆图纸在线生成器

拼豆图纸生成器有PixelBeads在线版、BeadGen和“豆图快转”;推荐通过pixelbeads.online或搜索“beadgen free online”直达官网,避开需注册的诱导页面。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。

82

2025.12.24

俄罗斯搜索引擎yandex官方入口地址(最新版)
俄罗斯搜索引擎yandex官方入口地址(最新版)

Yandex官方入口网址是https://yandex.com。用户可通过网页端直连或移动端浏览器直接访问,无需登录即可使用搜索、图片、新闻、地图等全部基础功能,并支持多语种检索与静态资源精准筛选。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。

546

2025.12.24

JavaScript ES6新特性
JavaScript ES6新特性

ES6是JavaScript的根本性升级,引入let/const实现块级作用域、箭头函数解决this绑定问题、解构赋值与模板字符串简化数据处理、对象简写与模块化提升代码可读性与组织性。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。

150

2025.12.24

php框架基础知识汇总
php框架基础知识汇总

php框架是构建web应用程序的架构,提供工具和功能,以简化开发过程。选择合适的框架取决于项目需求和技能水平。实战案例展示了使用laravel构建博客的步骤,包括安装、创建模型、定义路由、编写控制器和呈现视图。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。

20

2025.12.24

Word 字间距调整方法汇总
Word 字间距调整方法汇总

本专题整合了Word字间距调整方法,阅读下面的文章了解更详细操作。

47

2025.12.24

任务管理器教程
任务管理器教程

本专题整合了任务管理器相关教程,阅读下面的文章了解更多详细操作。

7

2025.12.24

AppleID格式
AppleID格式

本专题整合了AppleID相关内容,阅读专题下面的文章了解更多详细教程。

12

2025.12.24

csgo视频观看入口合集
csgo视频观看入口合集

本专题整合了csgo观看入口合集,阅读下面的文章了知道更多入口地址。

371

2025.12.24

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
Layer弹窗基础参数入门
Layer弹窗基础参数入门

共43课时 | 5.9万人学习

CSS3 教程
CSS3 教程

共18课时 | 4万人学习

TypeScript 教程
TypeScript 教程

共19课时 | 1.7万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号