blob: dc004871798f4cce709d5010a5d8afca5a45ce48 [file] [log] [blame]
Chia-I Wuf1405182017-11-27 11:29:21 -08001/*
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
17#ifndef ANDROID_BUFFERLAYERCONSUMER_H
18#define ANDROID_BUFFERLAYERCONSUMER_H
19
Chia-I Wuf1405182017-11-27 11:29:21 -080020#include <gui/BufferQueueDefs.h>
21#include <gui/ConsumerBase.h>
Courtney Goeltzenleuchter9bad0d72017-12-19 12:34:34 -070022#include <gui/HdrMetadata.h>
Chia-I Wuf1405182017-11-27 11:29:21 -080023
24#include <ui/FenceTime.h>
25#include <ui/GraphicBuffer.h>
Peiyong Lin34beb7a2018-03-28 11:57:12 -070026#include <ui/GraphicTypes.h>
Chia-I Wu67dcc692017-11-27 14:51:06 -080027#include <ui/Region.h>
Chia-I Wuf1405182017-11-27 11:29:21 -080028
29#include <utils/String8.h>
30#include <utils/Vector.h>
31#include <utils/threads.h>
32
33namespace android {
34// ----------------------------------------------------------------------------
35
Chia-I Wuda5c7302017-11-27 14:51:06 -080036class DispSync;
Chia-I Wuc75c44d2017-11-27 14:32:57 -080037class Layer;
Chia-I Wuf1405182017-11-27 11:29:21 -080038class String8;
39
Peiyong Lin833074a2018-08-28 11:53:54 -070040namespace renderengine {
Lloyd Pique144e1162017-12-20 16:44:52 -080041class RenderEngine;
42class Image;
Peiyong Lin833074a2018-08-28 11:53:54 -070043} // namespace renderengine
Lloyd Pique144e1162017-12-20 16:44:52 -080044
Chia-I Wuf1405182017-11-27 11:29:21 -080045/*
46 * BufferLayerConsumer consumes buffers of graphics data from a BufferQueue,
Chia-I Wu221b5922017-12-14 13:59:16 -080047 * and makes them available to RenderEngine as a texture.
Chia-I Wuf1405182017-11-27 11:29:21 -080048 *
Chia-I Wu221b5922017-12-14 13:59:16 -080049 * A typical usage pattern is to call updateTexImage() when a new frame is
50 * desired. If a new frame is available, the frame is latched. If not, the
51 * previous contents are retained. The texture is attached and updated after
52 * bindTextureImage() is called.
Chia-I Wuf1405182017-11-27 11:29:21 -080053 *
Chia-I Wu221b5922017-12-14 13:59:16 -080054 * All calls to updateTexImage must be made with RenderEngine being current.
55 * The texture is attached to the TEXTURE_EXTERNAL texture target.
Chia-I Wuf1405182017-11-27 11:29:21 -080056 */
57class BufferLayerConsumer : public ConsumerBase {
58public:
Chia-I Wuda5c7302017-11-27 14:51:06 -080059 static const status_t BUFFER_REJECTED = UNKNOWN_ERROR + 8;
60
61 class BufferRejecter {
62 friend class BufferLayerConsumer;
63 virtual bool reject(const sp<GraphicBuffer>& buf, const BufferItem& item) = 0;
64
65 protected:
66 virtual ~BufferRejecter() {}
67 };
68
Chia-I Wufd257f82017-11-27 14:51:06 -080069 struct ContentsChangedListener : public FrameAvailableListener {
70 virtual void onSidebandStreamChanged() = 0;
71 };
Chia-I Wuf1405182017-11-27 11:29:21 -080072
Chia-I Wu221b5922017-12-14 13:59:16 -080073 // BufferLayerConsumer constructs a new BufferLayerConsumer object. The
74 // tex parameter indicates the name of the RenderEngine texture to which
75 // images are to be streamed.
Peiyong Lin833074a2018-08-28 11:53:54 -070076 BufferLayerConsumer(const sp<IGraphicBufferConsumer>& bq, renderengine::RenderEngine& engine,
Lloyd Pique144e1162017-12-20 16:44:52 -080077 uint32_t tex, Layer* layer);
Chia-I Wuf1405182017-11-27 11:29:21 -080078
Chia-I Wufd257f82017-11-27 14:51:06 -080079 // Sets the contents changed listener. This should be used instead of
80 // ConsumerBase::setFrameAvailableListener().
81 void setContentsChangedListener(const wp<ContentsChangedListener>& listener);
82
Chia-I Wuda5c7302017-11-27 14:51:06 -080083 nsecs_t computeExpectedPresent(const DispSync& dispSync);
84
Chia-I Wuf1405182017-11-27 11:29:21 -080085 // updateTexImage acquires the most recently queued buffer, and sets the
86 // image contents of the target texture to it.
87 //
Chia-I Wu221b5922017-12-14 13:59:16 -080088 // This call may only be made while RenderEngine is current.
Chia-I Wuf1405182017-11-27 11:29:21 -080089 //
Chia-I Wu221b5922017-12-14 13:59:16 -080090 // This calls doFenceWait to ensure proper synchronization unless native
91 // fence is supported.
Chia-I Wuda5c7302017-11-27 14:51:06 -080092 //
Chia-I Wu221b5922017-12-14 13:59:16 -080093 // Unlike the GLConsumer version, this version takes a functor that may be
94 // used to reject the newly acquired buffer. It also does not bind the
95 // RenderEngine texture until bindTextureImage is called.
Chia-I Wuda5c7302017-11-27 14:51:06 -080096 status_t updateTexImage(BufferRejecter* rejecter, const DispSync& dispSync, bool* autoRefresh,
Alec Mouri86770e52018-09-24 22:40:58 +000097 bool* queuedBuffer, uint64_t maxFrameNumber,
98 const sp<Fence>& releaseFence);
Chia-I Wuf1405182017-11-27 11:29:21 -080099
Chia-I Wu0cb75ac2017-11-27 15:56:04 -0800100 // See BufferLayerConsumer::bindTextureImageLocked().
101 status_t bindTextureImage();
102
Chia-I Wuf1405182017-11-27 11:29:21 -0800103 // setReleaseFence stores a fence that will signal when the current buffer
104 // is no longer being read. This fence will be returned to the producer
105 // when the current buffer is released by updateTexImage(). Multiple
106 // fences can be set for a given buffer; they will be merged into a single
107 // union fence.
Chia-I Wuda5c7302017-11-27 14:51:06 -0800108 void setReleaseFence(const sp<Fence>& fence);
109
110 bool releasePendingBuffer();
Chia-I Wuf1405182017-11-27 11:29:21 -0800111
Chia-I Wu0cb75ac2017-11-27 15:56:04 -0800112 sp<Fence> getPrevFinalReleaseFence() const;
113
Chia-I Wu221b5922017-12-14 13:59:16 -0800114 // See GLConsumer::getTransformMatrix.
Chia-I Wuf1405182017-11-27 11:29:21 -0800115 void getTransformMatrix(float mtx[16]);
116
Chia-I Wuf1405182017-11-27 11:29:21 -0800117 // getTimestamp retrieves the timestamp associated with the texture image
118 // set by the most recent call to updateTexImage.
119 //
120 // The timestamp is in nanoseconds, and is monotonically increasing. Its
121 // other semantics (zero point, etc) are source-dependent and should be
122 // documented by the source.
123 int64_t getTimestamp();
124
125 // getDataSpace retrieves the DataSpace associated with the texture image
126 // set by the most recent call to updateTexImage.
Peiyong Lin34beb7a2018-03-28 11:57:12 -0700127 ui::Dataspace getCurrentDataSpace();
Chia-I Wuf1405182017-11-27 11:29:21 -0800128
Courtney Goeltzenleuchter9bad0d72017-12-19 12:34:34 -0700129 // getCurrentHdrMetadata retrieves the HDR metadata associated with the
130 // texture image set by the most recent call to updateTexImage.
131 const HdrMetadata& getCurrentHdrMetadata() const;
132
Chia-I Wuf1405182017-11-27 11:29:21 -0800133 // getFrameNumber retrieves the frame number associated with the texture
134 // image set by the most recent call to updateTexImage.
135 //
136 // The frame number is an incrementing counter set to 0 at the creation of
137 // the BufferQueue associated with this consumer.
138 uint64_t getFrameNumber();
139
Chia-I Wu67dcc692017-11-27 14:51:06 -0800140 bool getTransformToDisplayInverse() const;
141
142 // must be called from SF main thread
143 const Region& getSurfaceDamage() const;
144
Chia-I Wu5c6e4632018-01-11 08:54:38 -0800145 // getCurrentApi retrieves the API which queues the current buffer.
146 int getCurrentApi() const;
147
Chia-I Wu221b5922017-12-14 13:59:16 -0800148 // See GLConsumer::setDefaultBufferSize.
Chia-I Wuf1405182017-11-27 11:29:21 -0800149 status_t setDefaultBufferSize(uint32_t width, uint32_t height);
150
151 // setFilteringEnabled sets whether the transform matrix should be computed
152 // for use with bilinear filtering.
153 void setFilteringEnabled(bool enabled);
154
155 // getCurrentBuffer returns the buffer associated with the current image.
156 // When outSlot is not nullptr, the current buffer slot index is also
157 // returned.
158 sp<GraphicBuffer> getCurrentBuffer(int* outSlot = nullptr) const;
159
Chia-I Wuf1405182017-11-27 11:29:21 -0800160 // getCurrentCrop returns the cropping rectangle of the current buffer.
161 Rect getCurrentCrop() const;
162
163 // getCurrentTransform returns the transform of the current buffer.
164 uint32_t getCurrentTransform() const;
165
166 // getCurrentScalingMode returns the scaling mode of the current buffer.
167 uint32_t getCurrentScalingMode() const;
168
169 // getCurrentFence returns the fence indicating when the current buffer is
170 // ready to be read from.
171 sp<Fence> getCurrentFence() const;
172
173 // getCurrentFence returns the FenceTime indicating when the current
174 // buffer is ready to be read from.
175 std::shared_ptr<FenceTime> getCurrentFenceTime() const;
176
177 // setConsumerUsageBits overrides the ConsumerBase method to OR
178 // DEFAULT_USAGE_FLAGS to usage.
179 status_t setConsumerUsageBits(uint64_t usage);
180
Chia-I Wuf1405182017-11-27 11:29:21 -0800181protected:
182 // abandonLocked overrides the ConsumerBase method to clear
183 // mCurrentTextureImage in addition to the ConsumerBase behavior.
184 virtual void abandonLocked();
185
186 // dumpLocked overrides the ConsumerBase method to dump BufferLayerConsumer-
187 // specific info in addition to the ConsumerBase behavior.
188 virtual void dumpLocked(String8& result, const char* prefix) const;
189
190 // acquireBufferLocked overrides the ConsumerBase method to update the
Chia-I Wu6748db42017-12-01 10:53:53 -0800191 // mImages array in addition to the ConsumerBase behavior.
Chia-I Wuf1405182017-11-27 11:29:21 -0800192 virtual status_t acquireBufferLocked(BufferItem* item, nsecs_t presentWhen,
193 uint64_t maxFrameNumber = 0) override;
194
Chia-I Wu6748db42017-12-01 10:53:53 -0800195 bool canUseImageCrop(const Rect& crop) const;
196
Chia-I Wuf1405182017-11-27 11:29:21 -0800197 struct PendingRelease {
Chia-I Wu6aff69b2017-11-27 14:08:48 -0800198 PendingRelease() : isPending(false), currentTexture(-1), graphicBuffer() {}
Chia-I Wuf1405182017-11-27 11:29:21 -0800199
200 bool isPending;
201 int currentTexture;
202 sp<GraphicBuffer> graphicBuffer;
Chia-I Wuf1405182017-11-27 11:29:21 -0800203 };
204
205 // This releases the buffer in the slot referenced by mCurrentTexture,
206 // then updates state to refer to the BufferItem, which must be a
207 // newly-acquired buffer. If pendingRelease is not null, the parameters
208 // which would have been passed to releaseBufferLocked upon the successful
209 // completion of the method will instead be returned to the caller, so that
210 // it may call releaseBufferLocked itself later.
211 status_t updateAndReleaseLocked(const BufferItem& item,
Alec Mouri86770e52018-09-24 22:40:58 +0000212 PendingRelease* pendingRelease = nullptr,
213 const sp<Fence>& releaseFence = Fence::NO_FENCE);
Chia-I Wuf1405182017-11-27 11:29:21 -0800214
Chia-I Wu6748db42017-12-01 10:53:53 -0800215 // Binds mTexName and the current buffer to TEXTURE_EXTERNAL target. Uses
Chia-I Wuf1405182017-11-27 11:29:21 -0800216 // mCurrentTexture if it's set, mCurrentTextureImage if not. If the
Chia-I Wu3498e3c2017-12-01 10:19:38 -0800217 // bind succeeds, this calls doFenceWait.
Chia-I Wuf1405182017-11-27 11:29:21 -0800218 status_t bindTextureImageLocked();
219
Chia-I Wuf1405182017-11-27 11:29:21 -0800220private:
Peiyong Lin833074a2018-08-28 11:53:54 -0700221 // Image is a utility class for tracking and creating renderengine::Images. There
Chia-I Wuf1405182017-11-27 11:29:21 -0800222 // is primarily just one image per slot, but there is also special cases:
Chia-I Wuf1405182017-11-27 11:29:21 -0800223 // - After freeBuffer, we must still keep the current image/buffer
Peiyong Lin833074a2018-08-28 11:53:54 -0700224 // Reference counting renderengine::Images lets us handle all these cases easily while
225 // also only creating new renderengine::Images from buffers when required.
Chia-I Wu6748db42017-12-01 10:53:53 -0800226 class Image : public LightRefBase<Image> {
Chia-I Wuf1405182017-11-27 11:29:21 -0800227 public:
Peiyong Lin833074a2018-08-28 11:53:54 -0700228 Image(sp<GraphicBuffer> graphicBuffer, renderengine::RenderEngine& engine);
Chia-I Wuf1405182017-11-27 11:29:21 -0800229
Chia-I Wu6748db42017-12-01 10:53:53 -0800230 Image(const Image& rhs) = delete;
231 Image& operator=(const Image& rhs) = delete;
Chia-I Wuf1405182017-11-27 11:29:21 -0800232
Peiyong Lin833074a2018-08-28 11:53:54 -0700233 // createIfNeeded creates an renderengine::Image if we haven't created one yet.
Krzysztof Kosiński7108c312018-06-27 19:12:54 -0700234 status_t createIfNeeded();
Chia-I Wuf1405182017-11-27 11:29:21 -0800235
236 const sp<GraphicBuffer>& graphicBuffer() { return mGraphicBuffer; }
237 const native_handle* graphicBufferHandle() {
Peiyong Lin566a3b42018-01-09 18:22:43 -0800238 return mGraphicBuffer == nullptr ? nullptr : mGraphicBuffer->handle;
Chia-I Wuf1405182017-11-27 11:29:21 -0800239 }
240
Peiyong Lin833074a2018-08-28 11:53:54 -0700241 const renderengine::Image& image() const { return *mImage; }
Chia-I Wu6748db42017-12-01 10:53:53 -0800242
Chia-I Wuf1405182017-11-27 11:29:21 -0800243 private:
244 // Only allow instantiation using ref counting.
Chia-I Wu6748db42017-12-01 10:53:53 -0800245 friend class LightRefBase<Image>;
Lloyd Pique144e1162017-12-20 16:44:52 -0800246 virtual ~Image();
Chia-I Wuf1405182017-11-27 11:29:21 -0800247
248 // mGraphicBuffer is the buffer that was used to create this image.
249 sp<GraphicBuffer> mGraphicBuffer;
250
Chia-I Wu6748db42017-12-01 10:53:53 -0800251 // mImage is the image created from mGraphicBuffer.
Peiyong Lin833074a2018-08-28 11:53:54 -0700252 std::unique_ptr<renderengine::Image> mImage;
Chia-I Wu6748db42017-12-01 10:53:53 -0800253 bool mCreated;
254 int32_t mCropWidth;
255 int32_t mCropHeight;
Chia-I Wuf1405182017-11-27 11:29:21 -0800256 };
257
258 // freeBufferLocked frees up the given buffer slot. If the slot has been
Chia-I Wu221b5922017-12-14 13:59:16 -0800259 // initialized this will release the reference to the GraphicBuffer in
Peiyong Lin833074a2018-08-28 11:53:54 -0700260 // that slot and destroy the renderengine::Image in that slot. Otherwise it has no
Chia-I Wu221b5922017-12-14 13:59:16 -0800261 // effect.
Chia-I Wuf1405182017-11-27 11:29:21 -0800262 //
263 // This method must be called with mMutex locked.
264 virtual void freeBufferLocked(int slotIndex);
265
Chia-I Wuc75c44d2017-11-27 14:32:57 -0800266 // IConsumerListener interface
267 void onDisconnect() override;
Chia-I Wufd257f82017-11-27 14:51:06 -0800268 void onSidebandStreamChanged() override;
Chia-I Wuc75c44d2017-11-27 14:32:57 -0800269 void addAndGetFrameTimestamps(const NewFrameEventsEntry* newTimestamps,
270 FrameEventHistoryDelta* outDelta) override;
271
Chia-I Wuf1405182017-11-27 11:29:21 -0800272 // computeCurrentTransformMatrixLocked computes the transform matrix for the
273 // current texture. It uses mCurrentTransform and the current GraphicBuffer
274 // to compute this matrix and stores it in mCurrentTransformMatrix.
Peiyong Lin566a3b42018-01-09 18:22:43 -0800275 // mCurrentTextureImage must not be nullptr.
Chia-I Wuf1405182017-11-27 11:29:21 -0800276 void computeCurrentTransformMatrixLocked();
277
Chia-I Wu3498e3c2017-12-01 10:19:38 -0800278 // doFenceWaitLocked inserts a wait command into the RenderEngine command
279 // stream to ensure that it is safe for future RenderEngine commands to
Chia-I Wuf1405182017-11-27 11:29:21 -0800280 // access the current texture buffer.
Chia-I Wu3498e3c2017-12-01 10:19:38 -0800281 status_t doFenceWaitLocked() const;
Chia-I Wuf1405182017-11-27 11:29:21 -0800282
283 // syncForReleaseLocked performs the synchronization needed to release the
Chia-I Wu3498e3c2017-12-01 10:19:38 -0800284 // current slot from RenderEngine. If needed it will set the current
285 // slot's fence to guard against a producer accessing the buffer before
286 // the outstanding accesses have completed.
Alec Mouri86770e52018-09-24 22:40:58 +0000287 status_t syncForReleaseLocked(const sp<Fence>& releaseFence);
Chia-I Wuf1405182017-11-27 11:29:21 -0800288
Chia-I Wuf1405182017-11-27 11:29:21 -0800289 // The default consumer usage flags that BufferLayerConsumer always sets on its
290 // BufferQueue instance; these will be OR:d with any additional flags passed
291 // from the BufferLayerConsumer user. In particular, BufferLayerConsumer will always
292 // consume buffers as hardware textures.
293 static const uint64_t DEFAULT_USAGE_FLAGS = GraphicBuffer::USAGE_HW_TEXTURE;
294
Chia-I Wu6748db42017-12-01 10:53:53 -0800295 // mCurrentTextureImage is the Image/buffer of the current texture. It's
Chia-I Wuf1405182017-11-27 11:29:21 -0800296 // possible that this buffer is not associated with any buffer slot, so we
297 // must track it separately in order to support the getCurrentBuffer method.
Chia-I Wu6748db42017-12-01 10:53:53 -0800298 sp<Image> mCurrentTextureImage;
Chia-I Wuf1405182017-11-27 11:29:21 -0800299
300 // mCurrentCrop is the crop rectangle that applies to the current texture.
301 // It gets set each time updateTexImage is called.
302 Rect mCurrentCrop;
303
304 // mCurrentTransform is the transform identifier for the current texture. It
305 // gets set each time updateTexImage is called.
306 uint32_t mCurrentTransform;
307
308 // mCurrentScalingMode is the scaling mode for the current texture. It gets
309 // set each time updateTexImage is called.
310 uint32_t mCurrentScalingMode;
311
312 // mCurrentFence is the fence received from BufferQueue in updateTexImage.
313 sp<Fence> mCurrentFence;
314
315 // The FenceTime wrapper around mCurrentFence.
316 std::shared_ptr<FenceTime> mCurrentFenceTime{FenceTime::NO_FENCE};
317
318 // mCurrentTransformMatrix is the transform matrix for the current texture.
319 // It gets computed by computeTransformMatrix each time updateTexImage is
320 // called.
321 float mCurrentTransformMatrix[16];
322
323 // mCurrentTimestamp is the timestamp for the current texture. It
324 // gets set each time updateTexImage is called.
325 int64_t mCurrentTimestamp;
326
327 // mCurrentDataSpace is the dataspace for the current texture. It
328 // gets set each time updateTexImage is called.
Peiyong Lin34beb7a2018-03-28 11:57:12 -0700329 ui::Dataspace mCurrentDataSpace;
Chia-I Wuf1405182017-11-27 11:29:21 -0800330
Courtney Goeltzenleuchter9bad0d72017-12-19 12:34:34 -0700331 // mCurrentHdrMetadata is the HDR metadata for the current texture. It
332 // gets set each time updateTexImage is called.
333 HdrMetadata mCurrentHdrMetadata;
334
Chia-I Wuf1405182017-11-27 11:29:21 -0800335 // mCurrentFrameNumber is the frame counter for the current texture.
336 // It gets set each time updateTexImage is called.
337 uint64_t mCurrentFrameNumber;
338
Chia-I Wu67dcc692017-11-27 14:51:06 -0800339 // Indicates this buffer must be transformed by the inverse transform of the screen
340 // it is displayed onto. This is applied after BufferLayerConsumer::mCurrentTransform.
341 // This must be set/read from SurfaceFlinger's main thread.
342 bool mCurrentTransformToDisplayInverse;
343
344 // The portion of this surface that has changed since the previous frame
345 Region mCurrentSurfaceDamage;
346
Chia-I Wu5c6e4632018-01-11 08:54:38 -0800347 int mCurrentApi;
348
Chia-I Wuf1405182017-11-27 11:29:21 -0800349 uint32_t mDefaultWidth, mDefaultHeight;
350
351 // mFilteringEnabled indicates whether the transform matrix is computed for
352 // use with bilinear filtering. It defaults to true and is changed by
353 // setFilteringEnabled().
354 bool mFilteringEnabled;
355
Peiyong Lin833074a2018-08-28 11:53:54 -0700356 renderengine::RenderEngine& mRE;
Chia-I Wu9f2db772017-11-30 21:06:50 -0800357
Chia-I Wu221b5922017-12-14 13:59:16 -0800358 // mTexName is the name of the RenderEngine texture to which streamed
359 // images will be bound when bindTexImage is called. It is set at
360 // construction time.
Chia-I Wuc91077c2017-11-27 13:32:04 -0800361 const uint32_t mTexName;
Chia-I Wuf1405182017-11-27 11:29:21 -0800362
Chia-I Wuc75c44d2017-11-27 14:32:57 -0800363 // The layer for this BufferLayerConsumer
364 const wp<Layer> mLayer;
365
Chia-I Wufd257f82017-11-27 14:51:06 -0800366 wp<ContentsChangedListener> mContentsChangedListener;
367
Chia-I Wu6748db42017-12-01 10:53:53 -0800368 // mImages stores the buffers that have been allocated by the BufferQueue
Chia-I Wuf1405182017-11-27 11:29:21 -0800369 // for each buffer slot. It is initialized to null pointers, and gets
370 // filled in with the result of BufferQueue::acquire when the
371 // client dequeues a buffer from a
372 // slot that has not yet been used. The buffer allocated to a slot will also
373 // be replaced if the requested buffer usage or geometry differs from that
374 // of the buffer allocated to a slot.
Chia-I Wu6748db42017-12-01 10:53:53 -0800375 sp<Image> mImages[BufferQueueDefs::NUM_BUFFER_SLOTS];
Chia-I Wuf1405182017-11-27 11:29:21 -0800376
377 // mCurrentTexture is the buffer slot index of the buffer that is currently
Chia-I Wu221b5922017-12-14 13:59:16 -0800378 // bound to the RenderEngine texture. It is initialized to INVALID_BUFFER_SLOT,
Chia-I Wuf1405182017-11-27 11:29:21 -0800379 // indicating that no buffer slot is currently bound to the texture. Note,
380 // however, that a value of INVALID_BUFFER_SLOT does not necessarily mean
381 // that no buffer is bound to the texture. A call to setBufferCount will
382 // reset mCurrentTexture to INVALID_BUFFER_SLOT.
383 int mCurrentTexture;
Chia-I Wuda5c7302017-11-27 14:51:06 -0800384
385 // A release that is pending on the receipt of a new release fence from
386 // presentDisplay
387 PendingRelease mPendingRelease;
Chia-I Wuf1405182017-11-27 11:29:21 -0800388};
389
390// ----------------------------------------------------------------------------
391}; // namespace android
392
393#endif // ANDROID_BUFFERLAYERCONSUMER_H