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

Commit f543e5a7 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

Remove useless GraphicBuffer() constructor

Test: compiled & run
Bug: 36869708


Change-Id: I83d80a1cde28671135b7716a434c503aeefcec46
parent 53ed7bfc
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -72,6 +72,9 @@ public:
        USAGE_CURSOR            = GRALLOC_USAGE_CURSOR,
    };

    static sp<GraphicBuffer> from(ANativeWindowBuffer *);


    // Create a GraphicBuffer to be unflatten'ed into or be reallocated.
    GraphicBuffer();

@@ -133,9 +136,6 @@ public:
    GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat,
            uint32_t inUsage, std::string requestorName = "<Unknown>");

    // create a buffer from an existing ANativeWindowBuffer
    GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership);

    // return status
    status_t initCheck() const;

@@ -232,10 +232,6 @@ private:
    GraphicBufferMapper& mBufferMapper;
    ssize_t mInitCheck;

    // If we're wrapping another buffer then this reference will make sure it
    // doesn't get freed.
    sp<ANativeWindowBuffer> mWrappedBuffer;

    uint64_t mId;

    // Stores the generation number of this buffer. If this number does not
+1 −1
Original line number Diff line number Diff line
@@ -490,7 +490,7 @@ void produceOneFrame(const sp<ANativeWindow>& anw,

    ASSERT_TRUE(anb != NULL);

    sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
    sp<GraphicBuffer> buf(GraphicBuffer::from(anb));

    *stride = buf->getStride();
    uint8_t* img = NULL;
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ void produceOneRGBA8Frame(const sp<ANativeWindow>& anw) {
            &anb));
    ASSERT_TRUE(anb != NULL);

    sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
    sp<GraphicBuffer> buf(GraphicBuffer::from(anb));

    uint8_t* img = NULL;
    ASSERT_EQ(NO_ERROR, buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN,
+2 −2
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ TEST_F(SurfaceTextureFBOTest, BlitFromCpuFilledBufferToFbo) {
            &anb));
    ASSERT_TRUE(anb != NULL);

    sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
    sp<GraphicBuffer> buf(GraphicBuffer::from(anb));

    // Fill the buffer with green
    uint8_t* img = NULL;
@@ -65,7 +65,7 @@ TEST_F(SurfaceTextureFBOTest, BlitFromCpuFilledBufferToFbo) {
                &anb));
        ASSERT_TRUE(anb != NULL);

        buf = new GraphicBuffer(anb, false);
        buf = GraphicBuffer::from(anb);

        // Fill the buffer with red
        ASSERT_EQ(NO_ERROR, buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN,
+4 −4
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferNpot) {
            &anb));
    ASSERT_TRUE(anb != NULL);

    sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
    sp<GraphicBuffer> buf(GraphicBuffer::from(anb));

    // Fill the buffer with the a checkerboard pattern
    uint8_t* img = NULL;
@@ -92,7 +92,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferPow2) {
            &anb));
    ASSERT_TRUE(anb != NULL);

    sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
    sp<GraphicBuffer> buf(GraphicBuffer::from(anb));

    // Fill the buffer with the a checkerboard pattern
    uint8_t* img = NULL;
@@ -157,7 +157,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferWithCrop) {
                &anb));
        ASSERT_TRUE(anb != NULL);

        sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
        sp<GraphicBuffer> buf(GraphicBuffer::from(anb));

        uint8_t* img = NULL;
        buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img));
@@ -238,7 +238,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BuffersRepeatedly) {
                    return false;
                }

                sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
                sp<GraphicBuffer> buf(GraphicBuffer::from(anb));

                const int yuvTexOffsetY = 0;
                int stride = buf->getStride();
Loading