Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
brcmbuffer.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include "brcmbuffer.h"
5
6#include <EGL/eglext.h>
7
8#include <EGL/eglext_brcm.h>
9
10QT_BEGIN_NAMESPACE
11
12BrcmBuffer::BrcmBuffer(struct ::wl_client *client, uint32_t id, const QSize &size, EGLint *data, size_t count)
13 : QtWaylandServer::wl_buffer(client, id, 1)
14 , m_handle(count)
15 , m_size(size)
16{
17 for (size_t i = 0; i < count; ++i)
18 m_handle[i] = data[i];
19}
20
21BrcmBuffer::~BrcmBuffer()
22{
23 static PFNEGLDESTROYGLOBALIMAGEBRCMPROC eglDestroyGlobalImage =
24 (PFNEGLDESTROYGLOBALIMAGEBRCMPROC) eglGetProcAddress("eglDestroyGlobalImageBRCM");
25 eglDestroyGlobalImage(handle());
26}
27
28void BrcmBuffer::buffer_destroy_resource(Resource *)
29{
30 delete this;
31}
32
33void BrcmBuffer::buffer_destroy(Resource *resource)
34{
35 wl_resource_destroy(resource->handle);
36}
37
38QT_END_NAMESPACE