@@ -263,6 +263,12 @@ class Surface
263263 virtual status_t setFrameRate (float frameRate, int8_t compatibility,
264264 int8_t changeFrameRateStrategy);
265265 virtual status_t setFrameTimelineInfo (uint64_t frameNumber, const FrameTimelineInfo& info);
266+ // Returns whether this surface holds the mouse cursor.
267+ bool isForCursor () const { return mIsForCursor ; }
268+ // Sets whether this surface holds the mouse cursor.
269+ void setIsForCursor (bool isForCursor) { mIsForCursor = isForCursor; }
270+
271+ static bool IsCursorPlaneCompatibilitySupported ();
266272
267273#if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BQ_EXTENDEDALLOCATE)
268274 /* *
@@ -598,7 +604,7 @@ class Surface
598604 HdrMetadata mHdrMetadata ;
599605
600606 // mHdrMetadataIsSet is a bitfield to track which HDR metadata has been set.
601- // Prevent Surface from resetting HDR metadata that was set on a bufer when
607+ // Prevent Surface from resetting HDR metadata that was set on a buffer when
602608 // HDR metadata is not set on this Surface.
603609 uint32_t mHdrMetadataIsSet {0 };
604610
@@ -753,6 +759,11 @@ class Surface
753759
754760 // Buffers that are successfully dequeued/attached and handed to clients
755761 std::unordered_set<int > mDequeuedSlots ;
762+
763+ // Indicates whether this surface holds the mouse cursor, and subsequently determines whether
764+ // the GRALLOC_USAGE_CURSOR usage flag should be set on the buffer created when this surface is
765+ // locked.
766+ bool mIsForCursor = false ;
756767};
757768
758769} // namespace android
0 commit comments