diff options
Diffstat (limited to 'libs/gui/include/gui/Surface.h')
-rw-r--r-- | libs/gui/include/gui/Surface.h | 64 |
1 files changed, 6 insertions, 58 deletions
diff --git a/libs/gui/include/gui/Surface.h b/libs/gui/include/gui/Surface.h index e5403512a9..49c83da319 100644 --- a/libs/gui/include/gui/Surface.h +++ b/libs/gui/include/gui/Surface.h @@ -18,7 +18,6 @@ #define ANDROID_GUI_SURFACE_H #include <gui/BufferQueueDefs.h> -#include <gui/FrameTimelineInfo.h> #include <gui/HdrMetadata.h> #include <gui/IGraphicBufferProducer.h> #include <gui/IProducerListener.h> @@ -31,7 +30,6 @@ #include <utils/RefBase.h> #include <shared_mutex> -#include <unordered_set> namespace android { @@ -69,6 +67,7 @@ class Surface : public ANativeObjectBase<ANativeWindow, Surface, RefBase> { public: + /* * creates a Surface from the given IGraphicBufferProducer (which concrete * implementation is a BufferQueue). @@ -83,15 +82,9 @@ public: * * the controlledByApp flag indicates that this Surface (producer) is * controlled by the application. This flag is used at connect time. - * - * Pass in the SurfaceControlHandle to store a weak reference to the layer - * that the Surface was created from. This handle can be used to create a - * child surface without using the IGBP to identify the layer. This is used - * for surfaces created by the BlastBufferQueue whose IGBP is created on the - * client and cannot be verified in SF. */ - explicit Surface(const sp<IGraphicBufferProducer>& bufferProducer, bool controlledByApp = false, - const sp<IBinder>& surfaceControlHandle = nullptr); + explicit Surface(const sp<IGraphicBufferProducer>& bufferProducer, + bool controlledByApp = false); /* getIGraphicBufferProducer() returns the IGraphicBufferProducer this * Surface was created with. Usually it's an error to use the @@ -99,8 +92,6 @@ public: */ sp<IGraphicBufferProducer> getIGraphicBufferProducer() const; - sp<IBinder> getSurfaceControlHandle() const; - /* convenience function to check that the given surface is non NULL as * well as its IGraphicBufferProducer */ static bool isValid(const sp<Surface>& surface) { @@ -128,7 +119,7 @@ public: * delay during dequeueBuffer. If there are already the maximum number of * buffers allocated, this function has no effect. */ - virtual void allocateBuffers(); + void allocateBuffers(); /* Sets the generation number on the IGraphicBufferProducer and updates the * generation number on any buffers attached to the Surface after this call. @@ -187,9 +178,7 @@ public: status_t getUniqueId(uint64_t* outId) const; status_t getConsumerUsage(uint64_t* outUsage) const; - virtual status_t setFrameRate(float frameRate, int8_t compatibility, - int8_t changeFrameRateStrategy); - virtual status_t setFrameTimelineInfo(const FrameTimelineInfo& info); + status_t setFrameRate(float frameRate, int8_t compatibility); protected: virtual ~Surface(); @@ -275,8 +264,7 @@ private: int dispatchAddQueueInterceptor(va_list args); int dispatchAddQueryInterceptor(va_list args); int dispatchGetLastQueuedBuffer(va_list args); - int dispatchGetLastQueuedBuffer2(va_list args); - int dispatchSetFrameTimelineInfo(va_list args); + bool transformToDisplayInverse(); protected: virtual int dequeueBuffer(ANativeWindowBuffer** buffer, int* fenceFd); @@ -333,7 +321,6 @@ public: virtual int connect( int api, bool reportBufferRemoval, const sp<SurfaceListener>& sListener); - virtual void destroy(); // When client connects to Surface with reportBufferRemoval set to true, any buffers removed // from this Surface will be collected and returned here. Once this method returns, these @@ -347,23 +334,6 @@ public: static status_t attachAndQueueBufferWithDataspace(Surface* surface, sp<GraphicBuffer> buffer, ui::Dataspace dataspace); - // Batch version of dequeueBuffer, cancelBuffer and queueBuffer - // Note that these batched operations are not supported when shared buffer mode is being used. - struct BatchBuffer { - ANativeWindowBuffer* buffer = nullptr; - int fenceFd = -1; - }; - virtual int dequeueBuffers(std::vector<BatchBuffer>* buffers); - virtual int cancelBuffers(const std::vector<BatchBuffer>& buffers); - - struct BatchQueuedBuffer { - ANativeWindowBuffer* buffer = nullptr; - int fenceFd = -1; - nsecs_t timestamp = NATIVE_WINDOW_TIMESTAMP_AUTO; - }; - virtual int queueBuffers( - const std::vector<BatchQueuedBuffer>& buffers); - protected: enum { NUM_BUFFER_SLOTS = BufferQueueDefs::NUM_BUFFER_SLOTS }; enum { DEFAULT_FORMAT = PIXEL_FORMAT_RGBA_8888 }; @@ -393,14 +363,6 @@ protected: void freeAllBuffers(); int getSlotFromBufferLocked(android_native_buffer_t* buffer) const; - void getDequeueBufferInputLocked(IGraphicBufferProducer::DequeueBufferInput* dequeueInput); - - void getQueueBufferInputLocked(android_native_buffer_t* buffer, int fenceFd, nsecs_t timestamp, - IGraphicBufferProducer::QueueBufferInput* out); - - void onBufferQueuedLocked(int slot, sp<Fence> fence, - const IGraphicBufferProducer::QueueBufferOutput& output); - struct BufferSlot { sp<GraphicBuffer> buffer; Region dirtyRegion; @@ -489,8 +451,6 @@ protected: // mTransformHint is the transform probably applied to buffers of this // window. this is only a hint, actual transform may differ. uint32_t mTransformHint; - virtual uint32_t getTransformHint() const { return mTransformHint; } - bool transformToDisplayInverse() const; // mProducerControlledByApp whether this buffer producer is controlled // by the application @@ -578,25 +538,13 @@ protected: bool mEnableFrameTimestamps = false; std::unique_ptr<ProducerFrameEventHistory> mFrameEventHistory; - // Reference to the SurfaceFlinger layer that was used to create this - // surface. This is only populated when the Surface is created from - // a BlastBufferQueue. - sp<IBinder> mSurfaceControlHandle; - bool mReportRemovedBuffers = false; std::vector<sp<GraphicBuffer>> mRemovedBuffers; int mMaxBufferCount; sp<IProducerListener> mListenerProxy; - - // Get and flush the buffers of given slots, if the buffer in the slot - // is currently dequeued then it won't be flushed and won't be returned - // in outBuffers. status_t getAndFlushBuffersFromSlots(const std::vector<int32_t>& slots, std::vector<sp<GraphicBuffer>>* outBuffers); - - // Buffers that are successfully dequeued/attached and handed to clients - std::unordered_set<int> mDequeuedSlots; }; } // namespace android |