diff options
author | 2017-02-10 16:15:34 -0800 | |
---|---|---|
committer | 2017-02-10 16:24:01 -0800 | |
commit | 841abed655e96e51506ae6a78e6b4dab6740bfd7 (patch) | |
tree | 6356328730270e342e96fd11034d791b702b04a2 | |
parent | d08aec40b48e4bbfd841a42dbd67fe362a3697b3 (diff) |
clean-ups, remove warnings, fix includes.
Test: built and run
Bug: none
Change-Id: I505df89e2263952d90fae432c5eaa7d00056c6f0
-rw-r--r-- | include/gui/GraphicBufferAlloc.h | 17 | ||||
-rw-r--r-- | include/ui/GraphicBuffer.h | 5 | ||||
-rw-r--r-- | libs/gui/GraphicBufferAlloc.cpp | 23 | ||||
-rw-r--r-- | libs/ui/GraphicBuffer.cpp | 6 |
4 files changed, 21 insertions, 30 deletions
diff --git a/include/gui/GraphicBufferAlloc.h b/include/gui/GraphicBufferAlloc.h index 9e189076f2..54c9829484 100644 --- a/include/gui/GraphicBufferAlloc.h +++ b/include/gui/GraphicBufferAlloc.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_SF_GRAPHIC_BUFFER_ALLOC_H -#define ANDROID_SF_GRAPHIC_BUFFER_ALLOC_H +#ifndef ANDROID_GUI_GRAPHIC_BUFFER_ALLOC_H +#define ANDROID_GUI_GRAPHIC_BUFFER_ALLOC_H #include <stdint.h> #include <sys/types.h> @@ -25,10 +25,16 @@ #include <utils/Errors.h> namespace android { -// --------------------------------------------------------------------------- class GraphicBuffer; +/* + * Concrete implementation of the IGraphicBufferAlloc interface. + * + * This can create GraphicBuffer instance across processes. This is mainly used + * by surfaceflinger. + */ + class GraphicBufferAlloc : public BnGraphicBufferAlloc { public: GraphicBufferAlloc(); @@ -40,7 +46,6 @@ public: }; -// --------------------------------------------------------------------------- -}; // namespace android +} // namespace android -#endif // ANDROID_SF_GRAPHIC_BUFFER_ALLOC_H +#endif // ANDROID_GUI_GRAPHIC_BUFFER_ALLOC_H diff --git a/include/ui/GraphicBuffer.h b/include/ui/GraphicBuffer.h index 95ca0f347b..759c9ec647 100644 --- a/include/ui/GraphicBuffer.h +++ b/include/ui/GraphicBuffer.h @@ -76,11 +76,6 @@ public: GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, uint32_t inUsage, std::string requestorName = "<Unknown>"); - // creates w * h buffer with a layer count - GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, - uint32_t inLayerCount, uint32_t inUsage, - std::string requestorName = "<Unknown>"); - // creates w * h buffer with a layer count using gralloc1 GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, uint32_t inLayerCount, uint64_t inProducerUsage, diff --git a/libs/gui/GraphicBufferAlloc.cpp b/libs/gui/GraphicBufferAlloc.cpp index f2d367711a..cc7d403040 100644 --- a/libs/gui/GraphicBufferAlloc.cpp +++ b/libs/gui/GraphicBufferAlloc.cpp @@ -15,21 +15,15 @@ ** limitations under the License. */ -#include <log/log.h> +#include <gui/GraphicBufferAlloc.h> -#include <ui/GraphicBuffer.h> +#include <log/log.h> -#include <gui/GraphicBufferAlloc.h> -// ---------------------------------------------------------------------------- namespace android { -// ---------------------------------------------------------------------------- -GraphicBufferAlloc::GraphicBufferAlloc() { -} - -GraphicBufferAlloc::~GraphicBufferAlloc() { -} +GraphicBufferAlloc::GraphicBufferAlloc() = default; +GraphicBufferAlloc::~GraphicBufferAlloc() = default; sp<GraphicBuffer> GraphicBufferAlloc::createGraphicBuffer(uint32_t width, uint32_t height, PixelFormat format, uint32_t layerCount, @@ -44,15 +38,12 @@ sp<GraphicBuffer> GraphicBufferAlloc::createGraphicBuffer(uint32_t width, if (err == NO_MEMORY) { GraphicBuffer::dumpAllocationsToSystemLog(); } - ALOGE("GraphicBufferAlloc::createGraphicBuffer(w=%u, h=%u, lc=%u) " - "failed (%s), handle=%p", + ALOGE("GraphicBufferAlloc::createGraphicBuffer(w=%u, h=%u, lc=%u) failed (%s), handle=%p", width, height, layerCount, strerror(-err), graphicBuffer->handle); - return 0; + graphicBuffer.clear(); } return graphicBuffer; } -// ---------------------------------------------------------------------------- -}; // namespace android -// ---------------------------------------------------------------------------- +} // namespace android diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp index 5ef95ec965..b54442667f 100644 --- a/libs/ui/GraphicBuffer.cpp +++ b/libs/ui/GraphicBuffer.cpp @@ -50,8 +50,8 @@ GraphicBuffer::GraphicBuffer() height = stride = format = - layerCount = usage = 0; + layerCount = 0; handle = NULL; } @@ -64,8 +64,8 @@ GraphicBuffer::GraphicBuffer(uint32_t inWidth, uint32_t inHeight, height = stride = format = - layerCount = usage = 0; + layerCount = 0; handle = NULL; mInitCheck = initSize(inWidth, inHeight, inFormat, 1, inUsage, inUsage, std::move(requestorName)); @@ -81,8 +81,8 @@ GraphicBuffer::GraphicBuffer(uint32_t inWidth, uint32_t inHeight, height = stride = format = - layerCount = usage = 0; + layerCount = 0; handle = NULL; mInitCheck = initSize(inWidth, inHeight, inFormat, inLayerCount, producerUsage, consumerUsage, std::move(requestorName)); |