Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 841abed6 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

clean-ups, remove warnings, fix includes.

Test: built and run
Bug: none

Change-Id: I505df89e2263952d90fae432c5eaa7d00056c6f0
parent d08aec40
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -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
+0 −5
Original line number Diff line number Diff line
@@ -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,
+7 −16
Original line number Diff line number Diff line
@@ -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
+3 −3
Original line number Diff line number Diff line
@@ -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));