BufferLayerConsumer.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. /*
  2. * Copyright (C) 2010 The Android Open Source Project
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #undef LOG_TAG
  17. #define LOG_TAG "BufferLayerConsumer"
  18. #define ATRACE_TAG ATRACE_TAG_GRAPHICS
  19. //#define LOG_NDEBUG 0
  20. #include "BufferLayerConsumer.h"
  21. #include "Layer.h"
  22. #include "Scheduler/DispSync.h"
  23. #include <inttypes.h>
  24. #include <cutils/compiler.h>
  25. #include <hardware/hardware.h>
  26. #include <math/mat4.h>
  27. #include <gui/BufferItem.h>
  28. #include <gui/GLConsumer.h>
  29. #include <gui/ISurfaceComposer.h>
  30. #include <gui/SurfaceComposerClient.h>
  31. #include <private/gui/ComposerService.h>
  32. #include <renderengine/Image.h>
  33. #include <renderengine/RenderEngine.h>
  34. #include <utils/Log.h>
  35. #include <utils/String8.h>
  36. #include <utils/Trace.h>
  37. namespace android {
  38. // Macros for including the BufferLayerConsumer name in log messages
  39. #define BLC_LOGV(x, ...) ALOGV("[%s] " x, mName.string(), ##__VA_ARGS__)
  40. #define BLC_LOGD(x, ...) ALOGD("[%s] " x, mName.string(), ##__VA_ARGS__)
  41. //#define BLC_LOGI(x, ...) ALOGI("[%s] " x, mName.string(), ##__VA_ARGS__)
  42. #define BLC_LOGW(x, ...) ALOGW("[%s] " x, mName.string(), ##__VA_ARGS__)
  43. #define BLC_LOGE(x, ...) ALOGE("[%s] " x, mName.string(), ##__VA_ARGS__)
  44. static const mat4 mtxIdentity;
  45. BufferLayerConsumer::BufferLayerConsumer(const sp<IGraphicBufferConsumer>& bq,
  46. renderengine::RenderEngine& engine, uint32_t tex,
  47. Layer* layer)
  48. : ConsumerBase(bq, false),
  49. mCurrentCrop(Rect::EMPTY_RECT),
  50. mCurrentTransform(0),
  51. mCurrentScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
  52. mCurrentFence(Fence::NO_FENCE),
  53. mCurrentTimestamp(0),
  54. mCurrentDataSpace(ui::Dataspace::UNKNOWN),
  55. mCurrentFrameNumber(0),
  56. mCurrentTransformToDisplayInverse(false),
  57. mCurrentSurfaceDamage(),
  58. mCurrentApi(0),
  59. mDefaultWidth(1),
  60. mDefaultHeight(1),
  61. mFilteringEnabled(true),
  62. mRE(engine),
  63. mTexName(tex),
  64. mLayer(layer),
  65. mCurrentTexture(BufferQueue::INVALID_BUFFER_SLOT) {
  66. BLC_LOGV("BufferLayerConsumer");
  67. memcpy(mCurrentTransformMatrix, mtxIdentity.asArray(), sizeof(mCurrentTransformMatrix));
  68. mConsumer->setConsumerUsageBits(DEFAULT_USAGE_FLAGS);
  69. }
  70. status_t BufferLayerConsumer::setDefaultBufferSize(uint32_t w, uint32_t h) {
  71. Mutex::Autolock lock(mMutex);
  72. if (mAbandoned) {
  73. BLC_LOGE("setDefaultBufferSize: BufferLayerConsumer is abandoned!");
  74. return NO_INIT;
  75. }
  76. mDefaultWidth = w;
  77. mDefaultHeight = h;
  78. return mConsumer->setDefaultBufferSize(w, h);
  79. }
  80. void BufferLayerConsumer::setContentsChangedListener(const wp<ContentsChangedListener>& listener) {
  81. setFrameAvailableListener(listener);
  82. Mutex::Autolock lock(mMutex);
  83. mContentsChangedListener = listener;
  84. }
  85. status_t BufferLayerConsumer::updateTexImage(BufferRejecter* rejecter, nsecs_t expectedPresentTime,
  86. bool* autoRefresh, bool* queuedBuffer,
  87. uint64_t maxFrameNumber) {
  88. ATRACE_CALL();
  89. BLC_LOGV("updateTexImage");
  90. Mutex::Autolock lock(mMutex);
  91. if (mAbandoned) {
  92. BLC_LOGE("updateTexImage: BufferLayerConsumer is abandoned!");
  93. return NO_INIT;
  94. }
  95. BufferItem item;
  96. // Acquire the next buffer.
  97. // In asynchronous mode the list is guaranteed to be one buffer
  98. // deep, while in synchronous mode we use the oldest buffer.
  99. status_t err = acquireBufferLocked(&item, expectedPresentTime, maxFrameNumber);
  100. if (err != NO_ERROR) {
  101. if (err == BufferQueue::NO_BUFFER_AVAILABLE) {
  102. err = NO_ERROR;
  103. } else if (err == BufferQueue::PRESENT_LATER) {
  104. // return the error, without logging
  105. } else {
  106. BLC_LOGE("updateTexImage: acquire failed: %s (%d)", strerror(-err), err);
  107. }
  108. return err;
  109. }
  110. if (autoRefresh) {
  111. *autoRefresh = item.mAutoRefresh;
  112. }
  113. if (queuedBuffer) {
  114. *queuedBuffer = item.mQueuedBuffer;
  115. }
  116. // We call the rejecter here, in case the caller has a reason to
  117. // not accept this buffer. This is used by SurfaceFlinger to
  118. // reject buffers which have the wrong size
  119. int slot = item.mSlot;
  120. if (rejecter && rejecter->reject(mSlots[slot].mGraphicBuffer, item)) {
  121. releaseBufferLocked(slot, mSlots[slot].mGraphicBuffer);
  122. return BUFFER_REJECTED;
  123. }
  124. // Release the previous buffer.
  125. err = updateAndReleaseLocked(item, &mPendingRelease);
  126. if (err != NO_ERROR) {
  127. return err;
  128. }
  129. if (!mRE.useNativeFenceSync()) {
  130. // Bind the new buffer to the GL texture.
  131. //
  132. // Older devices require the "implicit" synchronization provided
  133. // by glEGLImageTargetTexture2DOES, which this method calls. Newer
  134. // devices will either call this in Layer::onDraw, or (if it's not
  135. // a GL-composited layer) not at all.
  136. err = bindTextureImageLocked();
  137. }
  138. return err;
  139. }
  140. status_t BufferLayerConsumer::bindTextureImage() {
  141. Mutex::Autolock lock(mMutex);
  142. return bindTextureImageLocked();
  143. }
  144. void BufferLayerConsumer::setReleaseFence(const sp<Fence>& fence) {
  145. if (!fence->isValid()) {
  146. return;
  147. }
  148. auto slot = mPendingRelease.isPending ? mPendingRelease.currentTexture : mCurrentTexture;
  149. if (slot == BufferQueue::INVALID_BUFFER_SLOT) {
  150. return;
  151. }
  152. auto buffer = mPendingRelease.isPending ? mPendingRelease.graphicBuffer
  153. : mCurrentTextureBuffer->graphicBuffer();
  154. auto err = addReleaseFence(slot, buffer, fence);
  155. if (err != OK) {
  156. BLC_LOGE("setReleaseFence: failed to add the fence: %s (%d)", strerror(-err), err);
  157. }
  158. }
  159. bool BufferLayerConsumer::releasePendingBuffer() {
  160. if (!mPendingRelease.isPending) {
  161. BLC_LOGV("Pending buffer already released");
  162. return false;
  163. }
  164. BLC_LOGV("Releasing pending buffer");
  165. Mutex::Autolock lock(mMutex);
  166. status_t result =
  167. releaseBufferLocked(mPendingRelease.currentTexture, mPendingRelease.graphicBuffer);
  168. if (result < NO_ERROR) {
  169. BLC_LOGE("releasePendingBuffer failed: %s (%d)", strerror(-result), result);
  170. }
  171. mPendingRelease = PendingRelease();
  172. return true;
  173. }
  174. sp<Fence> BufferLayerConsumer::getPrevFinalReleaseFence() const {
  175. Mutex::Autolock lock(mMutex);
  176. return ConsumerBase::mPrevFinalReleaseFence;
  177. }
  178. status_t BufferLayerConsumer::acquireBufferLocked(BufferItem* item, nsecs_t presentWhen,
  179. uint64_t maxFrameNumber) {
  180. status_t err = ConsumerBase::acquireBufferLocked(item, presentWhen, maxFrameNumber);
  181. if (err != NO_ERROR) {
  182. return err;
  183. }
  184. // If item->mGraphicBuffer is not null, this buffer has not been acquired
  185. // before, so we need to clean up old references.
  186. if (item->mGraphicBuffer != nullptr) {
  187. std::lock_guard<std::mutex> lock(mImagesMutex);
  188. if (mImages[item->mSlot] == nullptr || mImages[item->mSlot]->graphicBuffer() == nullptr ||
  189. mImages[item->mSlot]->graphicBuffer()->getId() != item->mGraphicBuffer->getId()) {
  190. mImages[item->mSlot] = std::make_shared<Image>(item->mGraphicBuffer, mRE);
  191. }
  192. }
  193. return NO_ERROR;
  194. }
  195. status_t BufferLayerConsumer::updateAndReleaseLocked(const BufferItem& item,
  196. PendingRelease* pendingRelease) {
  197. status_t err = NO_ERROR;
  198. int slot = item.mSlot;
  199. BLC_LOGV("updateAndRelease: (slot=%d buf=%p) -> (slot=%d buf=%p)", mCurrentTexture,
  200. (mCurrentTextureBuffer != nullptr && mCurrentTextureBuffer->graphicBuffer() != nullptr)
  201. ? mCurrentTextureBuffer->graphicBuffer()->handle
  202. : 0,
  203. slot, mSlots[slot].mGraphicBuffer->handle);
  204. // Hang onto the pointer so that it isn't freed in the call to
  205. // releaseBufferLocked() if we're in shared buffer mode and both buffers are
  206. // the same.
  207. std::shared_ptr<Image> nextTextureBuffer;
  208. {
  209. std::lock_guard<std::mutex> lock(mImagesMutex);
  210. nextTextureBuffer = mImages[slot];
  211. }
  212. // release old buffer
  213. if (mCurrentTexture != BufferQueue::INVALID_BUFFER_SLOT) {
  214. if (pendingRelease == nullptr) {
  215. status_t status =
  216. releaseBufferLocked(mCurrentTexture, mCurrentTextureBuffer->graphicBuffer());
  217. if (status < NO_ERROR) {
  218. BLC_LOGE("updateAndRelease: failed to release buffer: %s (%d)", strerror(-status),
  219. status);
  220. err = status;
  221. // keep going, with error raised [?]
  222. }
  223. } else {
  224. pendingRelease->currentTexture = mCurrentTexture;
  225. pendingRelease->graphicBuffer = mCurrentTextureBuffer->graphicBuffer();
  226. pendingRelease->isPending = true;
  227. }
  228. }
  229. // Update the BufferLayerConsumer state.
  230. mCurrentTexture = slot;
  231. mCurrentTextureBuffer = nextTextureBuffer;
  232. mCurrentCrop = item.mCrop;
  233. mCurrentTransform = item.mTransform;
  234. mCurrentScalingMode = item.mScalingMode;
  235. mCurrentTimestamp = item.mTimestamp;
  236. mCurrentDataSpace = static_cast<ui::Dataspace>(item.mDataSpace);
  237. mCurrentHdrMetadata = item.mHdrMetadata;
  238. mCurrentFence = item.mFence;
  239. mCurrentFenceTime = item.mFenceTime;
  240. mCurrentFrameNumber = item.mFrameNumber;
  241. mCurrentTransformToDisplayInverse = item.mTransformToDisplayInverse;
  242. mCurrentSurfaceDamage = item.mSurfaceDamage;
  243. mCurrentApi = item.mApi;
  244. computeCurrentTransformMatrixLocked();
  245. return err;
  246. }
  247. status_t BufferLayerConsumer::bindTextureImageLocked() {
  248. ATRACE_CALL();
  249. if (mCurrentTextureBuffer != nullptr && mCurrentTextureBuffer->graphicBuffer() != nullptr) {
  250. return mRE.bindExternalTextureBuffer(mTexName, mCurrentTextureBuffer->graphicBuffer(),
  251. mCurrentFence);
  252. }
  253. return NO_INIT;
  254. }
  255. void BufferLayerConsumer::getTransformMatrix(float mtx[16]) {
  256. Mutex::Autolock lock(mMutex);
  257. memcpy(mtx, mCurrentTransformMatrix, sizeof(mCurrentTransformMatrix));
  258. }
  259. void BufferLayerConsumer::setFilteringEnabled(bool enabled) {
  260. Mutex::Autolock lock(mMutex);
  261. if (mAbandoned) {
  262. BLC_LOGE("setFilteringEnabled: BufferLayerConsumer is abandoned!");
  263. return;
  264. }
  265. bool needsRecompute = mFilteringEnabled != enabled;
  266. mFilteringEnabled = enabled;
  267. if (needsRecompute && mCurrentTextureBuffer == nullptr) {
  268. BLC_LOGD("setFilteringEnabled called with mCurrentTextureBuffer == nullptr");
  269. }
  270. if (needsRecompute && mCurrentTextureBuffer != nullptr) {
  271. computeCurrentTransformMatrixLocked();
  272. }
  273. }
  274. void BufferLayerConsumer::computeCurrentTransformMatrixLocked() {
  275. BLC_LOGV("computeCurrentTransformMatrixLocked");
  276. if (mCurrentTextureBuffer == nullptr || mCurrentTextureBuffer->graphicBuffer() == nullptr) {
  277. BLC_LOGD("computeCurrentTransformMatrixLocked: "
  278. "mCurrentTextureBuffer is nullptr");
  279. }
  280. GLConsumer::computeTransformMatrix(mCurrentTransformMatrix,
  281. mCurrentTextureBuffer == nullptr
  282. ? nullptr
  283. : mCurrentTextureBuffer->graphicBuffer(),
  284. getCurrentCropLocked(), mCurrentTransform,
  285. mFilteringEnabled);
  286. }
  287. nsecs_t BufferLayerConsumer::getTimestamp() {
  288. BLC_LOGV("getTimestamp");
  289. Mutex::Autolock lock(mMutex);
  290. return mCurrentTimestamp;
  291. }
  292. ui::Dataspace BufferLayerConsumer::getCurrentDataSpace() {
  293. BLC_LOGV("getCurrentDataSpace");
  294. Mutex::Autolock lock(mMutex);
  295. return mCurrentDataSpace;
  296. }
  297. const HdrMetadata& BufferLayerConsumer::getCurrentHdrMetadata() const {
  298. BLC_LOGV("getCurrentHdrMetadata");
  299. Mutex::Autolock lock(mMutex);
  300. return mCurrentHdrMetadata;
  301. }
  302. uint64_t BufferLayerConsumer::getFrameNumber() {
  303. BLC_LOGV("getFrameNumber");
  304. Mutex::Autolock lock(mMutex);
  305. return mCurrentFrameNumber;
  306. }
  307. bool BufferLayerConsumer::getTransformToDisplayInverse() const {
  308. Mutex::Autolock lock(mMutex);
  309. return mCurrentTransformToDisplayInverse;
  310. }
  311. const Region& BufferLayerConsumer::getSurfaceDamage() const {
  312. return mCurrentSurfaceDamage;
  313. }
  314. void BufferLayerConsumer::mergeSurfaceDamage(const Region& damage) {
  315. if (damage.bounds() == Rect::INVALID_RECT ||
  316. mCurrentSurfaceDamage.bounds() == Rect::INVALID_RECT) {
  317. mCurrentSurfaceDamage = Region::INVALID_REGION;
  318. } else {
  319. mCurrentSurfaceDamage |= damage;
  320. }
  321. }
  322. int BufferLayerConsumer::getCurrentApi() const {
  323. Mutex::Autolock lock(mMutex);
  324. return mCurrentApi;
  325. }
  326. sp<GraphicBuffer> BufferLayerConsumer::getCurrentBuffer(int* outSlot, sp<Fence>* outFence) const {
  327. Mutex::Autolock lock(mMutex);
  328. if (outSlot != nullptr) {
  329. *outSlot = mCurrentTexture;
  330. }
  331. if (outFence != nullptr) {
  332. *outFence = mCurrentFence;
  333. }
  334. return mCurrentTextureBuffer == nullptr ? nullptr : mCurrentTextureBuffer->graphicBuffer();
  335. }
  336. Rect BufferLayerConsumer::getCurrentCrop() const {
  337. Mutex::Autolock lock(mMutex);
  338. return getCurrentCropLocked();
  339. }
  340. Rect BufferLayerConsumer::getCurrentCropLocked() const {
  341. return (mCurrentScalingMode == NATIVE_WINDOW_SCALING_MODE_SCALE_CROP)
  342. ? GLConsumer::scaleDownCrop(mCurrentCrop, mDefaultWidth, mDefaultHeight)
  343. : mCurrentCrop;
  344. }
  345. uint32_t BufferLayerConsumer::getCurrentTransform() const {
  346. Mutex::Autolock lock(mMutex);
  347. return mCurrentTransform;
  348. }
  349. uint32_t BufferLayerConsumer::getCurrentScalingMode() const {
  350. Mutex::Autolock lock(mMutex);
  351. return mCurrentScalingMode;
  352. }
  353. sp<Fence> BufferLayerConsumer::getCurrentFence() const {
  354. Mutex::Autolock lock(mMutex);
  355. return mCurrentFence;
  356. }
  357. std::shared_ptr<FenceTime> BufferLayerConsumer::getCurrentFenceTime() const {
  358. Mutex::Autolock lock(mMutex);
  359. return mCurrentFenceTime;
  360. }
  361. status_t BufferLayerConsumer::doFenceWaitLocked() const {
  362. if (mCurrentFence->isValid()) {
  363. if (mRE.useWaitSync()) {
  364. base::unique_fd fenceFd(mCurrentFence->dup());
  365. if (fenceFd == -1) {
  366. BLC_LOGE("doFenceWait: error dup'ing fence fd: %d", errno);
  367. return -errno;
  368. }
  369. if (!mRE.waitFence(std::move(fenceFd))) {
  370. BLC_LOGE("doFenceWait: failed to wait on fence fd");
  371. return UNKNOWN_ERROR;
  372. }
  373. } else {
  374. status_t err = mCurrentFence->waitForever("BufferLayerConsumer::doFenceWaitLocked");
  375. if (err != NO_ERROR) {
  376. BLC_LOGE("doFenceWait: error waiting for fence: %d", err);
  377. return err;
  378. }
  379. }
  380. }
  381. return NO_ERROR;
  382. }
  383. void BufferLayerConsumer::freeBufferLocked(int slotIndex) {
  384. BLC_LOGV("freeBufferLocked: slotIndex=%d", slotIndex);
  385. std::lock_guard<std::mutex> lock(mImagesMutex);
  386. if (slotIndex == mCurrentTexture) {
  387. mCurrentTexture = BufferQueue::INVALID_BUFFER_SLOT;
  388. }
  389. mImages[slotIndex] = nullptr;
  390. ConsumerBase::freeBufferLocked(slotIndex);
  391. }
  392. void BufferLayerConsumer::onDisconnect() {
  393. sp<Layer> l = mLayer.promote();
  394. if (l.get()) {
  395. l->onDisconnect();
  396. }
  397. }
  398. void BufferLayerConsumer::onSidebandStreamChanged() {
  399. FrameAvailableListener* unsafeFrameAvailableListener = nullptr;
  400. {
  401. Mutex::Autolock lock(mFrameAvailableMutex);
  402. unsafeFrameAvailableListener = mFrameAvailableListener.unsafe_get();
  403. }
  404. sp<ContentsChangedListener> listener;
  405. { // scope for the lock
  406. Mutex::Autolock lock(mMutex);
  407. ALOG_ASSERT(unsafeFrameAvailableListener == mContentsChangedListener.unsafe_get());
  408. listener = mContentsChangedListener.promote();
  409. }
  410. if (listener != nullptr) {
  411. listener->onSidebandStreamChanged();
  412. }
  413. }
  414. void BufferLayerConsumer::onBufferAvailable(const BufferItem& item) {
  415. if (item.mGraphicBuffer != nullptr && item.mSlot != BufferQueue::INVALID_BUFFER_SLOT) {
  416. std::lock_guard<std::mutex> lock(mImagesMutex);
  417. const std::shared_ptr<Image>& oldImage = mImages[item.mSlot];
  418. if (oldImage == nullptr || oldImage->graphicBuffer() == nullptr ||
  419. oldImage->graphicBuffer()->getId() != item.mGraphicBuffer->getId()) {
  420. mImages[item.mSlot] = std::make_shared<Image>(item.mGraphicBuffer, mRE);
  421. }
  422. }
  423. }
  424. void BufferLayerConsumer::addAndGetFrameTimestamps(const NewFrameEventsEntry* newTimestamps,
  425. FrameEventHistoryDelta* outDelta) {
  426. sp<Layer> l = mLayer.promote();
  427. if (l.get()) {
  428. l->addAndGetFrameTimestamps(newTimestamps, outDelta);
  429. }
  430. }
  431. void BufferLayerConsumer::abandonLocked() {
  432. BLC_LOGV("abandonLocked");
  433. mCurrentTextureBuffer = nullptr;
  434. for (int i = 0; i < BufferQueue::NUM_BUFFER_SLOTS; i++) {
  435. std::lock_guard<std::mutex> lock(mImagesMutex);
  436. mImages[i] = nullptr;
  437. }
  438. ConsumerBase::abandonLocked();
  439. }
  440. status_t BufferLayerConsumer::setConsumerUsageBits(uint64_t usage) {
  441. return ConsumerBase::setConsumerUsageBits(usage | DEFAULT_USAGE_FLAGS);
  442. }
  443. void BufferLayerConsumer::dumpLocked(String8& result, const char* prefix) const {
  444. result.appendFormat("%smTexName=%d mCurrentTexture=%d\n"
  445. "%smCurrentCrop=[%d,%d,%d,%d] mCurrentTransform=%#x\n",
  446. prefix, mTexName, mCurrentTexture, prefix, mCurrentCrop.left,
  447. mCurrentCrop.top, mCurrentCrop.right, mCurrentCrop.bottom,
  448. mCurrentTransform);
  449. ConsumerBase::dumpLocked(result, prefix);
  450. }
  451. BufferLayerConsumer::Image::Image(const sp<GraphicBuffer>& graphicBuffer,
  452. renderengine::RenderEngine& engine)
  453. : mGraphicBuffer(graphicBuffer), mRE(engine) {
  454. mRE.cacheExternalTextureBuffer(mGraphicBuffer);
  455. }
  456. BufferLayerConsumer::Image::~Image() {
  457. if (mGraphicBuffer != nullptr) {
  458. ALOGV("Destroying buffer: %" PRId64, mGraphicBuffer->getId());
  459. mRE.unbindExternalTextureBuffer(mGraphicBuffer->getId());
  460. }
  461. }
  462. }; // namespace android