Loading include/gui/BufferItem.h +5 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <EGL/eglext.h> #include <ui/Rect.h> #include <ui/Region.h> #include <system/graphics.h> Loading Loading @@ -106,6 +107,10 @@ class BufferItem : public Flattenable<BufferItem> { // Indicates this buffer must be transformed by the inverse transform of the screen // it is displayed onto. This is applied after mTransform. bool mTransformToDisplayInverse; // Describes the portion of the surface that has been modified since the // previous frame Region mSurfaceDamage; }; } // namespace android Loading include/gui/IGraphicBufferProducer.h +6 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <ui/Fence.h> #include <ui/GraphicBuffer.h> #include <ui/Rect.h> #include <ui/Region.h> namespace android { // ---------------------------------------------------------------------------- Loading Loading @@ -281,7 +282,7 @@ public: : timestamp(timestamp), isAutoTimestamp(isAutoTimestamp), dataSpace(dataSpace), crop(crop), scalingMode(scalingMode), transform(transform), stickyTransform(sticky), async(async), fence(fence) { } async(async), fence(fence), surfaceDamage() { } inline void deflate(int64_t* outTimestamp, bool* outIsAutoTimestamp, android_dataspace* outDataSpace, Rect* outCrop, int* outScalingMode, Loading @@ -306,6 +307,9 @@ public: status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const; status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count); const Region& getSurfaceDamage() const { return surfaceDamage; } void setSurfaceDamage(const Region& damage) { surfaceDamage = damage; } private: int64_t timestamp; int isAutoTimestamp; Loading @@ -316,6 +320,7 @@ public: uint32_t stickyTransform; int async; sp<Fence> fence; Region surfaceDamage; }; // QueueBufferOutput must be a POD structure Loading include/gui/Surface.h +8 −1 Original line number Diff line number Diff line Loading @@ -147,6 +147,7 @@ private: int dispatchUnlockAndPost(va_list args); int dispatchSetSidebandStream(va_list args); int dispatchSetBuffersDataSpace(va_list args); int dispatchSetSurfaceDamage(va_list args); protected: virtual int dequeueBuffer(ANativeWindowBuffer** buffer, int* fenceFd); Loading @@ -171,6 +172,7 @@ protected: virtual int setBuffersDataSpace(android_dataspace dataSpace); virtual int setCrop(Rect const* rect); virtual int setUsage(uint32_t reqUsage); virtual void setSurfaceDamage(android_native_rect_t* rects, size_t numRects); public: virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds); Loading Loading @@ -296,7 +298,12 @@ private: sp<GraphicBuffer> mPostedBuffer; bool mConnectedToCpu; // must be accessed from lock/unlock thread only // In the lock/unlock context, this reflects the region that the producer // wished to update and whether the Surface was able to copy the previous // buffer back to allow a partial update. // // In the dequeue/queue context, this reflects the surface damage (the // damage since the last frame) passed in by the producer. Region mDirtyRegion; }; Loading include/ui/Rect.h +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ class Rect : public ARect, public LightFlattenablePod<Rect> public: typedef ARect::value_type value_type; static const Rect INVALID_RECT; // we don't provide copy-ctor and operator= on purpose // because we want the compiler generated versions Loading include/ui/Region.h +2 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ class String8; class Region : public LightFlattenable<Region> { public: static const Region INVALID_REGION; Region(); Region(const Region& rhs); explicit Region(const Rect& rhs); Loading Loading
include/gui/BufferItem.h +5 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <EGL/eglext.h> #include <ui/Rect.h> #include <ui/Region.h> #include <system/graphics.h> Loading Loading @@ -106,6 +107,10 @@ class BufferItem : public Flattenable<BufferItem> { // Indicates this buffer must be transformed by the inverse transform of the screen // it is displayed onto. This is applied after mTransform. bool mTransformToDisplayInverse; // Describes the portion of the surface that has been modified since the // previous frame Region mSurfaceDamage; }; } // namespace android Loading
include/gui/IGraphicBufferProducer.h +6 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <ui/Fence.h> #include <ui/GraphicBuffer.h> #include <ui/Rect.h> #include <ui/Region.h> namespace android { // ---------------------------------------------------------------------------- Loading Loading @@ -281,7 +282,7 @@ public: : timestamp(timestamp), isAutoTimestamp(isAutoTimestamp), dataSpace(dataSpace), crop(crop), scalingMode(scalingMode), transform(transform), stickyTransform(sticky), async(async), fence(fence) { } async(async), fence(fence), surfaceDamage() { } inline void deflate(int64_t* outTimestamp, bool* outIsAutoTimestamp, android_dataspace* outDataSpace, Rect* outCrop, int* outScalingMode, Loading @@ -306,6 +307,9 @@ public: status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const; status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count); const Region& getSurfaceDamage() const { return surfaceDamage; } void setSurfaceDamage(const Region& damage) { surfaceDamage = damage; } private: int64_t timestamp; int isAutoTimestamp; Loading @@ -316,6 +320,7 @@ public: uint32_t stickyTransform; int async; sp<Fence> fence; Region surfaceDamage; }; // QueueBufferOutput must be a POD structure Loading
include/gui/Surface.h +8 −1 Original line number Diff line number Diff line Loading @@ -147,6 +147,7 @@ private: int dispatchUnlockAndPost(va_list args); int dispatchSetSidebandStream(va_list args); int dispatchSetBuffersDataSpace(va_list args); int dispatchSetSurfaceDamage(va_list args); protected: virtual int dequeueBuffer(ANativeWindowBuffer** buffer, int* fenceFd); Loading @@ -171,6 +172,7 @@ protected: virtual int setBuffersDataSpace(android_dataspace dataSpace); virtual int setCrop(Rect const* rect); virtual int setUsage(uint32_t reqUsage); virtual void setSurfaceDamage(android_native_rect_t* rects, size_t numRects); public: virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds); Loading Loading @@ -296,7 +298,12 @@ private: sp<GraphicBuffer> mPostedBuffer; bool mConnectedToCpu; // must be accessed from lock/unlock thread only // In the lock/unlock context, this reflects the region that the producer // wished to update and whether the Surface was able to copy the previous // buffer back to allow a partial update. // // In the dequeue/queue context, this reflects the surface damage (the // damage since the last frame) passed in by the producer. Region mDirtyRegion; }; Loading
include/ui/Rect.h +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ class Rect : public ARect, public LightFlattenablePod<Rect> public: typedef ARect::value_type value_type; static const Rect INVALID_RECT; // we don't provide copy-ctor and operator= on purpose // because we want the compiler generated versions Loading
include/ui/Region.h +2 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ class String8; class Region : public LightFlattenable<Region> { public: static const Region INVALID_REGION; Region(); Region(const Region& rhs); explicit Region(const Rect& rhs); Loading