Loading include/gui/GraphicBufferAlloc.h +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ public: virtual ~GraphicBufferAlloc(); virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t width, uint32_t height, PixelFormat format, uint32_t usage, status_t* error); std::string requestorName, status_t* error) override; }; Loading include/gui/IGraphicBufferAlloc.h +10 −3 Original line number Diff line number Diff line Loading @@ -21,14 +21,15 @@ #include <sys/types.h> #include <binder/IInterface.h> #include <ui/GraphicBuffer.h> #include <ui/PixelFormat.h> #include <utils/RefBase.h> #include <string> namespace android { // ---------------------------------------------------------------------------- class GraphicBuffer; class IGraphicBufferAlloc : public IInterface { public: Loading @@ -37,7 +38,13 @@ public: /* Create a new GraphicBuffer for the client to use. */ virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, status_t* error) = 0; PixelFormat format, uint32_t usage, std::string requestorName, status_t* error) = 0; sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, status_t* error) { return createGraphicBuffer(w, h, format, usage, "<Unknown>", error); } }; // ---------------------------------------------------------------------------- Loading include/ui/GraphicBuffer.h +3 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #include <utils/Flattenable.h> #include <utils/RefBase.h> #include <string> struct ANativeWindowBuffer; Loading Loading @@ -73,7 +74,7 @@ public: // creates w * h buffer GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, uint32_t inUsage); uint32_t inUsage, std::string requestorName = "<Unknown>"); // create a buffer from an existing handle GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, Loading Loading @@ -159,7 +160,7 @@ private: const GraphicBuffer& operator = (const GraphicBuffer& rhs) const; status_t initSize(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, uint32_t inUsage); uint32_t inUsage, std::string requestorName); void free_handle(); Loading include/ui/GraphicBufferAllocator.h +2 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public: status_t allocate(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, buffer_handle_t* handle, uint32_t* stride, uint64_t graphicBufferId); uint64_t graphicBufferId, std::string requestorName); status_t free(buffer_handle_t handle); Loading @@ -76,6 +76,7 @@ private: PixelFormat format; uint32_t usage; size_t size; std::string requestorName; }; static Mutex sLock; Loading libs/gui/BufferQueueProducer.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -496,7 +496,8 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot, status_t error; BQ_LOGV("dequeueBuffer: allocating a new buffer for slot %d", *outSlot); sp<GraphicBuffer> graphicBuffer(mCore->mAllocator->createGraphicBuffer( width, height, format, usage, &error)); width, height, format, usage, {mConsumerName.string(), mConsumerName.size()}, &error)); { // Autolock scope Mutex::Autolock lock(mCore->mMutex); Loading Loading @@ -1262,7 +1263,8 @@ void BufferQueueProducer::allocateBuffers(uint32_t width, uint32_t height, for (size_t i = 0; i < newBufferCount; ++i) { status_t result = NO_ERROR; sp<GraphicBuffer> graphicBuffer(mCore->mAllocator->createGraphicBuffer( allocWidth, allocHeight, allocFormat, allocUsage, &result)); allocWidth, allocHeight, allocFormat, allocUsage, {mConsumerName.string(), mConsumerName.size()}, &result)); if (result != NO_ERROR) { BQ_LOGE("allocateBuffers: failed to allocate buffer (%u x %u, format" " %u, usage %u)", width, height, format, usage); Loading Loading
include/gui/GraphicBufferAlloc.h +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ public: virtual ~GraphicBufferAlloc(); virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t width, uint32_t height, PixelFormat format, uint32_t usage, status_t* error); std::string requestorName, status_t* error) override; }; Loading
include/gui/IGraphicBufferAlloc.h +10 −3 Original line number Diff line number Diff line Loading @@ -21,14 +21,15 @@ #include <sys/types.h> #include <binder/IInterface.h> #include <ui/GraphicBuffer.h> #include <ui/PixelFormat.h> #include <utils/RefBase.h> #include <string> namespace android { // ---------------------------------------------------------------------------- class GraphicBuffer; class IGraphicBufferAlloc : public IInterface { public: Loading @@ -37,7 +38,13 @@ public: /* Create a new GraphicBuffer for the client to use. */ virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, status_t* error) = 0; PixelFormat format, uint32_t usage, std::string requestorName, status_t* error) = 0; sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, status_t* error) { return createGraphicBuffer(w, h, format, usage, "<Unknown>", error); } }; // ---------------------------------------------------------------------------- Loading
include/ui/GraphicBuffer.h +3 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #include <utils/Flattenable.h> #include <utils/RefBase.h> #include <string> struct ANativeWindowBuffer; Loading Loading @@ -73,7 +74,7 @@ public: // creates w * h buffer GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, uint32_t inUsage); uint32_t inUsage, std::string requestorName = "<Unknown>"); // create a buffer from an existing handle GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, Loading Loading @@ -159,7 +160,7 @@ private: const GraphicBuffer& operator = (const GraphicBuffer& rhs) const; status_t initSize(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, uint32_t inUsage); uint32_t inUsage, std::string requestorName); void free_handle(); Loading
include/ui/GraphicBufferAllocator.h +2 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public: status_t allocate(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, buffer_handle_t* handle, uint32_t* stride, uint64_t graphicBufferId); uint64_t graphicBufferId, std::string requestorName); status_t free(buffer_handle_t handle); Loading @@ -76,6 +76,7 @@ private: PixelFormat format; uint32_t usage; size_t size; std::string requestorName; }; static Mutex sLock; Loading
libs/gui/BufferQueueProducer.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -496,7 +496,8 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot, status_t error; BQ_LOGV("dequeueBuffer: allocating a new buffer for slot %d", *outSlot); sp<GraphicBuffer> graphicBuffer(mCore->mAllocator->createGraphicBuffer( width, height, format, usage, &error)); width, height, format, usage, {mConsumerName.string(), mConsumerName.size()}, &error)); { // Autolock scope Mutex::Autolock lock(mCore->mMutex); Loading Loading @@ -1262,7 +1263,8 @@ void BufferQueueProducer::allocateBuffers(uint32_t width, uint32_t height, for (size_t i = 0; i < newBufferCount; ++i) { status_t result = NO_ERROR; sp<GraphicBuffer> graphicBuffer(mCore->mAllocator->createGraphicBuffer( allocWidth, allocHeight, allocFormat, allocUsage, &result)); allocWidth, allocHeight, allocFormat, allocUsage, {mConsumerName.string(), mConsumerName.size()}, &result)); if (result != NO_ERROR) { BQ_LOGE("allocateBuffers: failed to allocate buffer (%u x %u, format" " %u, usage %u)", width, height, format, usage); Loading