Mir

Merge lp:~kdub/mir/eglimage-from-mirbuffer-android into lp:mir

Proposed by Kevin DuBois on 2016-09-15
Status: Merged
Approved by: Kevin DuBois on 2016-09-26
Approved revision: 3711
Merged at revision: 3715
Proposed branch: lp:~kdub/mir/eglimage-from-mirbuffer-android
Merge into: lp:mir
Prerequisite: lp:~kdub/mir/nested-native-buffer
Diff against target: 649 lines (+154/-98)
19 files modified
src/client/mir_buffer_api.cpp (+18/-0)
src/client/symbols.map (+1/-0)
src/include/client/mir/client_buffer.h (+4/-0)
src/include/client/mir_toolkit/mir_buffer_private.h (+51/-0)
src/platforms/android/client/buffer.cpp (+13/-0)
src/platforms/android/client/buffer.h (+1/-0)
src/platforms/eglstream-kms/client/client_buffer.cpp (+5/-0)
src/platforms/eglstream-kms/client/client_buffer.h (+1/-0)
src/platforms/mesa/client/client_buffer.cpp (+5/-0)
src/platforms/mesa/client/client_buffer.h (+1/-0)
src/server/graphics/nested/buffer.cpp (+22/-18)
src/server/graphics/nested/buffer.h (+0/-3)
src/server/graphics/nested/egl_image_factory.h (+0/-50)
src/server/graphics/nested/native_buffer.h (+4/-0)
tests/include/mir/test/doubles/mock_client_buffer.h (+1/-0)
tests/include/mir/test/doubles/null_client_buffer.h (+1/-0)
tests/include/mir/test/doubles/stub_client_buffer.h (+1/-0)
tests/unit-tests/client/test_aging_buffer.cpp (+5/-0)
tests/unit-tests/platforms/nested/test_buffer.cpp (+20/-27)
To merge this branch: bzr merge lp:~kdub/mir/eglimage-from-mirbuffer-android
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve on 2016-09-26
Brandon Schaefer (community) Approve on 2016-09-26
Alexandros Frantzis (community) 2016-09-15 Approve on 2016-09-26
Review via email: mp+305868@code.launchpad.net

Commit Message

add a private helper that the nested server can use to glean the parameters to use for eglCreateImage() so that MirBuffers can be uploaded as textures.

We have the current hole in the MirBufferStream and MirBuffer interfaces that uploading a buffer as a texture is difficult and platform dependent. (see below for platform considerations).

We have the future hole in the define-our-own-platform (a.k.a. MirRenderSurface) that we're not sure how we'll support eglCreateImage for our platform. (which just needs some more discussion)

The nested server needs a way to upload a MirBuffer now for the nested-passthrough work. This MP provides the functionality now via this private helper function (so the nested platform doesn't have to know the android/mesa/eglstreams details). Once the MirRenderSurface transition is complete, we can just use the standard way to do this for the "mir egl platform", and remove this helper code.

Platform considerations:
On android we should be using ANDROID_image_native_buffer, and we have to get the actual ANativeBuffer pointer, so that refcounting on that object can work correctly. Some android platforms might work with KHR_image_pixmap, but this is tagged as legacy in the android code base (https://android.googlesource.com/platform/frameworks/native/+/master/include/ui/ANativeObjectBase.h#28), so I wouldn't expect it to work. On mesa, we can use KHR_image_pixmap or EXT_image_dma_buf_import, with the latter being more flexible. These need the gbm_bo or the prime_fd, and we have to bind MIR_SERVER_EGL_OPENGL_API to use them.

Description of the Change

add a private helper that the nested server can use to glean the parameters to use for eglCreateImage() so that MirBuffers can be uploaded as textures.

We have the current hole in the MirBufferStream and MirBuffer interfaces that uploading a buffer as a texture is difficult and platform dependent. (see below for platform considerations).

We have the future hole in the define-our-own-platform (a.k.a. MirRenderSurface) that we're not sure how we'll support eglCreateImage for our platform. (which just needs some more discussion)

The nested server needs a way to upload a MirBuffer now for the nested-passthrough work. This MP provides the functionality now via this private helper function (so the nested platform doesn't have to know the android/mesa/eglstreams details). Once the MirRenderSurface transition is complete, we can just use the standard way to do this for the "mir egl platform", and remove this helper code.

Platform considerations:
On android we should be using ANDROID_image_native_buffer, and we have to get the actual ANativeBuffer pointer, so that refcounting on that object can work correctly. Some android platforms might work with KHR_image_pixmap, but this is tagged as legacy in the android code base (https://android.googlesource.com/platform/frameworks/native/+/master/include/ui/ANativeObjectBase.h#28), so I wouldn't expect it to work. On mesa, we can use KHR_image_pixmap or EXT_image_dma_buf_import, with the latter being more flexible. These need the gbm_bo or the prime_fd, and we have to bind MIR_SERVER_EGL_OPENGL_API to use them.

To post a comment you must log in.
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3709
https://mir-jenkins.ubuntu.com/job/mir-ci/1735/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/2172/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2235
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2226
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2226
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2226
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2200/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2200
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2200/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2200
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2200/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2200
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2200/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2200
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2200/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1735/rebuild

review: Needs Fixing (continuous-integration)
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3709
https://mir-jenkins.ubuntu.com/job/mir-ci/1745/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/2186/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2249
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2240
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2240
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2240
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2214/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2214/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2214
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2214/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2214
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2214/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2214
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2214/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1745/rebuild

review: Needs Fixing (continuous-integration)
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3710
https://mir-jenkins.ubuntu.com/job/mir-ci/1747/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/2188
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2251
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2242
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2242
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2242
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2216
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2216/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2216
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2216/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2216
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2216/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2216
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2216/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2216
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2216/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1747/rebuild

review: Approve (continuous-integration)
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3711
https://mir-jenkins.ubuntu.com/job/mir-ci/1788/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/2238
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2301
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2292
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2292
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2292
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2266
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2266/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2266
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2266/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2266
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2266/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2266
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2266/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2266
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2266/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1788/rebuild

review: Approve (continuous-integration)
Alexandros Frantzis (afrantzis) wrote :

OK.

review: Approve
Brandon Schaefer (brandontschaefer) wrote :

lgtm (just one inline comment)

review: Approve
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://mir-jenkins.ubuntu.com/job/mir-autolanding/608/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/2273/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/648/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2336
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2327
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2327
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2327
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2301/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2301
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2301/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2301
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2301/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2301
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2301/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2301
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2301/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Kevin DuBois (kdub) wrote :
Mir CI Bot (mir-ci-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/client/mir_buffer_api.cpp'
2--- src/client/mir_buffer_api.cpp 2016-08-23 16:18:08 +0000
3+++ src/client/mir_buffer_api.cpp 2016-09-22 18:18:34 +0000
4@@ -18,12 +18,14 @@
5
6 #include "mir_toolkit/mir_presentation_chain.h"
7 #include "mir_toolkit/mir_buffer.h"
8+#include "mir_toolkit/mir_buffer_private.h"
9 #include "presentation_chain.h"
10 #include "mir_connection.h"
11 #include "buffer.h"
12 #include "mir/require.h"
13 #include "mir/uncaught.h"
14 #include "mir/require.h"
15+#include "mir/client_buffer.h"
16 #include <stdexcept>
17 #include <boost/throw_exception.hpp>
18
19@@ -217,3 +219,19 @@
20 {
21 MIR_LOG_UNCAUGHT_EXCEPTION(ex);
22 }
23+
24+void mir_buffer_egl_image_parameters(
25+ MirBuffer* b, EGLenum* type, EGLClientBuffer* client_buffer, EGLint** attr)
26+try
27+{
28+ mir::require(b);
29+ mir::require(type);
30+ mir::require(client_buffer);
31+ mir::require(attr);
32+ auto buffer = reinterpret_cast<mcl::Buffer*>(b);
33+ buffer->client_buffer()->egl_image_creation_parameters(type, client_buffer, attr);
34+}
35+catch (std::exception const& ex)
36+{
37+ MIR_LOG_UNCAUGHT_EXCEPTION(ex);
38+}
39
40=== modified file 'src/client/symbols.map'
41--- src/client/symbols.map 2016-09-19 09:05:08 +0000
42+++ src/client/symbols.map 2016-09-22 18:18:34 +0000
43@@ -384,6 +384,7 @@
44 mir_buffer_get_buffer_usage;
45 mir_buffer_is_valid;
46 mir_buffer_get_error_message;
47+ mir_buffer_egl_image_parameters;
48 local:
49 *;
50 } MIR_CLIENT_DETAIL_9v19;
51
52=== modified file 'src/include/client/mir/client_buffer.h'
53--- src/include/client/mir/client_buffer.h 2016-08-01 07:24:32 +0000
54+++ src/include/client/mir/client_buffer.h 2016-09-22 18:18:34 +0000
55@@ -29,6 +29,8 @@
56 #include <memory>
57 #include <chrono>
58
59+#include <EGL/egl.h>
60+#include <EGL/eglext.h>
61 /**
62 * \addtogroup mir_toolkit
63 * @{
64@@ -72,6 +74,8 @@
65 virtual void set_fence(MirNativeFence, MirBufferAccess) = 0;
66 virtual MirNativeFence get_fence() const = 0;
67 virtual bool wait_fence(MirBufferAccess, std::chrono::nanoseconds timeout) = 0;
68+ virtual void egl_image_creation_parameters(EGLenum*, EGLClientBuffer*, EGLint**) = 0;
69+
70 protected:
71 ClientBuffer() = default;
72 ClientBuffer(ClientBuffer const&) = delete;
73
74=== added file 'src/include/client/mir_toolkit/mir_buffer_private.h'
75--- src/include/client/mir_toolkit/mir_buffer_private.h 1970-01-01 00:00:00 +0000
76+++ src/include/client/mir_toolkit/mir_buffer_private.h 2016-09-22 18:18:34 +0000
77@@ -0,0 +1,51 @@
78+/*
79+ * Copyright © 2016 Canonical Ltd.
80+ *
81+ * This program is free software: you can redistribute it and/or modify it
82+ * under the terms of the GNU Lesser General Public License version 3,
83+ * as published by the Free Software Foundation.
84+ *
85+ * This program is distributed in the hope that it will be useful,
86+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
87+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
88+ * GNU Lesser General Public License for more details.
89+ *
90+ * You should have received a copy of the GNU Lesser General Public License
91+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
92+ *
93+ */
94+
95+#ifndef MIR_TOOLKIT_MIR_BUFFER_PRIVATE_H_
96+#define MIR_TOOLKIT_MIR_BUFFER_PRIVATE_H_
97+
98+#include <EGL/egl.h>
99+#include <EGL/eglext.h>
100+#include <mir_toolkit/client_types_nbs.h>
101+
102+#ifdef __cplusplus
103+/**
104+ * \addtogroup mir_toolkit
105+ * @{
106+ */
107+extern "C" {
108+#endif
109+
110+/** Suggest parameters to use with EGLCreateImage for a given MirBuffer
111+ *
112+ * \param [in] buffer The buffer
113+ * \param [out] target The target to use
114+ * \param [out] client_buffer The EGLClientBuffer to use
115+ * \param [out] attrs The attributes to use
116+ **/
117+void mir_buffer_egl_image_parameters(
118+ MirBuffer* buffer,
119+ EGLenum* target,
120+ EGLClientBuffer* client_buffer,
121+ EGLint** attrs);
122+
123+#ifdef __cplusplus
124+}
125+/**@}*/
126+#endif
127+
128+#endif // MIR_TOOLKIT_MIR_BUFFER_PRIVATE_H_
129
130=== modified file 'src/platforms/android/client/buffer.cpp'
131--- src/platforms/android/client/buffer.cpp 2016-08-01 07:24:32 +0000
132+++ src/platforms/android/client/buffer.cpp 2016-09-22 18:18:34 +0000
133@@ -107,6 +107,19 @@
134 return native_buffer->anwb();
135 }
136
137+void mcla::Buffer::egl_image_creation_parameters(
138+ EGLenum* type, EGLClientBuffer* client_buffer, EGLint** attr)
139+{
140+ static EGLint image_attrs[] =
141+ {
142+ EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
143+ EGL_NONE
144+ };
145+ *type = EGL_NATIVE_BUFFER_ANDROID;
146+ *client_buffer = native_buffer->anwb();
147+ *attr = image_attrs;
148+}
149+
150 void mcla::Buffer::set_fence(MirNativeFence fence, MirBufferAccess access)
151 {
152 if (!fence)
153
154=== modified file 'src/platforms/android/client/buffer.h'
155--- src/platforms/android/client/buffer.h 2016-09-19 04:16:15 +0000
156+++ src/platforms/android/client/buffer.h 2016-09-22 18:18:34 +0000
157@@ -54,6 +54,7 @@
158 void set_fence(MirNativeFence, MirBufferAccess) override;
159 MirNativeFence get_fence() const override;
160 bool wait_fence(MirBufferAccess, std::chrono::nanoseconds timeout) override;
161+ void egl_image_creation_parameters(EGLenum*, EGLClientBuffer*, EGLint**) override;
162
163 Buffer(const Buffer&) = delete;
164 Buffer& operator=(const Buffer&) = delete;
165
166=== modified file 'src/platforms/eglstream-kms/client/client_buffer.cpp'
167--- src/platforms/eglstream-kms/client/client_buffer.cpp 2016-09-19 04:16:15 +0000
168+++ src/platforms/eglstream-kms/client/client_buffer.cpp 2016-09-22 18:18:34 +0000
169@@ -165,3 +165,8 @@
170 {
171 return true;
172 }
173+
174+void mcle::ClientBuffer::egl_image_creation_parameters(EGLenum*, EGLClientBuffer*, EGLint**)
175+{
176+ BOOST_THROW_EXCEPTION(std::invalid_argument("not implemented yet"));
177+}
178
179=== modified file 'src/platforms/eglstream-kms/client/client_buffer.h'
180--- src/platforms/eglstream-kms/client/client_buffer.h 2016-09-19 04:16:15 +0000
181+++ src/platforms/eglstream-kms/client/client_buffer.h 2016-09-22 18:18:34 +0000
182@@ -55,6 +55,7 @@
183 void set_fence(MirNativeFence, MirBufferAccess);
184 MirNativeFence get_fence() const;
185 bool wait_fence(MirBufferAccess, std::chrono::nanoseconds timeout);
186+ void egl_image_creation_parameters(EGLenum*, EGLClientBuffer*, EGLint**);
187
188 private:
189 std::shared_ptr<graphics::eglstream::NativeBuffer> const creation_package;
190
191=== modified file 'src/platforms/mesa/client/client_buffer.cpp'
192--- src/platforms/mesa/client/client_buffer.cpp 2016-09-19 04:16:15 +0000
193+++ src/platforms/mesa/client/client_buffer.cpp 2016-09-22 18:18:34 +0000
194@@ -169,3 +169,8 @@
195 {
196 return true;
197 }
198+
199+void mclm::ClientBuffer::egl_image_creation_parameters(EGLenum*, EGLClientBuffer*, EGLint**)
200+{
201+ BOOST_THROW_EXCEPTION(std::invalid_argument("not implemented yet"));
202+}
203
204=== modified file 'src/platforms/mesa/client/client_buffer.h'
205--- src/platforms/mesa/client/client_buffer.h 2016-09-19 04:16:15 +0000
206+++ src/platforms/mesa/client/client_buffer.h 2016-09-22 18:18:34 +0000
207@@ -57,6 +57,7 @@
208 void set_fence(MirNativeFence, MirBufferAccess);
209 MirNativeFence get_fence() const;
210 bool wait_fence(MirBufferAccess, std::chrono::nanoseconds timeout);
211+ void egl_image_creation_parameters(EGLenum*, EGLClientBuffer*, EGLint**);
212
213 private:
214 std::shared_ptr<BufferFileOps> const buffer_file_ops;
215
216=== modified file 'src/server/graphics/nested/buffer.cpp'
217--- src/server/graphics/nested/buffer.cpp 2016-09-19 09:05:08 +0000
218+++ src/server/graphics/nested/buffer.cpp 2016-09-22 18:18:34 +0000
219@@ -22,7 +22,6 @@
220 #include "mir_toolkit/mir_buffer.h"
221 #include "host_connection.h"
222 #include "buffer.h"
223-#include "egl_image_factory.h"
224 #include "native_buffer.h"
225
226 #include <map>
227@@ -47,12 +46,10 @@
228 TextureAccess(
229 mgn::Buffer& buffer,
230 std::shared_ptr<mgn::NativeBuffer> const& native_buffer,
231- std::shared_ptr<mgn::HostConnection> const& connection,
232- std::shared_ptr<mgn::EglImageFactory> const& factory) :
233+ std::shared_ptr<mgn::HostConnection> const& connection) :
234 buffer(buffer),
235 native_buffer(native_buffer),
236- connection(connection),
237- factory(factory)
238+ connection(connection)
239 {
240 }
241
242@@ -71,8 +68,18 @@
243 auto it = egl_image_map.find(resources);
244 if (it == egl_image_map.end())
245 {
246- static const EGLint image_attrs[] = { EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE };
247- auto i = factory->create_egl_image_from(*native_buffer, resources.first, image_attrs);
248+ auto ext = extensions;
249+ auto display = resources.first;
250+ auto hints = native_buffer->egl_image_creation_hints();
251+ auto i = EGLImageUPtr{
252+ new EGLImageKHR(ext.eglCreateImageKHR(
253+ display, EGL_NO_CONTEXT,
254+ std::get<0>(hints), std::get<1>(hints), std::get<2>(hints))),
255+ [ext, display](EGLImageKHR* image)
256+ {
257+ ext.eglDestroyImageKHR(display, image); delete image;
258+ }
259+ };
260 image = *i;
261 egl_image_map[resources] = std::move(i);
262 }
263@@ -81,7 +88,7 @@
264 image = *(it->second);
265 }
266
267- egl_extensions.glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image);
268+ extensions.glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image);
269 }
270
271 void gl_bind_to_texture() override
272@@ -98,10 +105,10 @@
273 std::shared_ptr<mgn::NativeBuffer> const native_buffer;
274 std::shared_ptr<mgn::HostConnection> const connection;
275 private:
276- std::shared_ptr<mgn::EglImageFactory> const factory;
277- mg::EGLExtensions egl_extensions;
278+ mg::EGLExtensions extensions;
279 typedef std::pair<EGLDisplay, EGLContext> ImageResources;
280- std::map<ImageResources, std::unique_ptr<EGLImageKHR>> egl_image_map;
281+ typedef std::unique_ptr<EGLImageKHR, std::function<void(EGLImageKHR*)>> EGLImageUPtr;
282+ std::map<ImageResources, EGLImageUPtr> egl_image_map;
283 };
284
285 class PixelAndTextureAccess :
286@@ -112,9 +119,8 @@
287 PixelAndTextureAccess(
288 mgn::Buffer& buffer,
289 std::shared_ptr<mgn::NativeBuffer> const& native_buffer,
290- std::shared_ptr<mgn::HostConnection> const& connection,
291- std::shared_ptr<mgn::EglImageFactory> const& factory) :
292- TextureAccess(buffer, native_buffer, connection, factory),
293+ std::shared_ptr<mgn::HostConnection> const& connection) :
294+ TextureAccess(buffer, native_buffer, connection),
295 stride_(geom::Stride{native_buffer->get_graphics_region().stride})
296 {
297 }
298@@ -157,19 +163,17 @@
299 std::shared_ptr<mg::NativeBufferBase> mgn::Buffer::create_native_base(mg::BufferUsage const usage)
300 {
301 if (usage == mg::BufferUsage::software)
302- return std::make_shared<PixelAndTextureAccess>(*this, buffer, connection, factory);
303+ return std::make_shared<PixelAndTextureAccess>(*this, buffer, connection);
304 else if (usage == mg::BufferUsage::hardware)
305- return std::make_shared<TextureAccess>(*this, buffer, connection, factory);
306+ return std::make_shared<TextureAccess>(*this, buffer, connection);
307 else
308 BOOST_THROW_EXCEPTION(std::invalid_argument("usage not supported when creating nested::Buffer"));
309 }
310
311 mgn::Buffer::Buffer(
312 std::shared_ptr<HostConnection> const& connection,
313- std::shared_ptr<EglImageFactory> const& factory,
314 mg::BufferProperties const& properties) :
315 connection(connection),
316- factory(factory),
317 buffer(connection->create_buffer(properties)),
318 native_base(create_native_base(properties.usage))
319 {
320
321=== modified file 'src/server/graphics/nested/buffer.h'
322--- src/server/graphics/nested/buffer.h 2016-09-19 09:05:08 +0000
323+++ src/server/graphics/nested/buffer.h 2016-09-22 18:18:34 +0000
324@@ -33,14 +33,12 @@
325 namespace nested
326 {
327 class HostConnection;
328-class EglImageFactory;
329 class NativeBuffer;
330 class Buffer : public BufferBasic
331 {
332 public:
333 Buffer(
334 std::shared_ptr<HostConnection> const& connection,
335- std::shared_ptr<EglImageFactory> const& factory,
336 BufferProperties const& properties);
337
338 std::shared_ptr<graphics::NativeBuffer> native_buffer_handle() const override;
339@@ -52,7 +50,6 @@
340 std::shared_ptr<NativeBufferBase> create_native_base(BufferUsage const usage);
341
342 std::shared_ptr<HostConnection> const connection;
343- std::shared_ptr<EglImageFactory> const factory;
344 std::shared_ptr<NativeBuffer> buffer;
345 std::shared_ptr<NativeBufferBase> const native_base;
346 };
347
348=== removed file 'src/server/graphics/nested/egl_image_factory.h'
349--- src/server/graphics/nested/egl_image_factory.h 2016-09-19 09:05:08 +0000
350+++ src/server/graphics/nested/egl_image_factory.h 1970-01-01 00:00:00 +0000
351@@ -1,50 +0,0 @@
352-/*
353- * Copyright © 2016 Canonical Ltd.
354- *
355- * This program is free software: you can redistribute it and/or modify it
356- * under the terms of the GNU General Public License version 3,
357- * as published by the Free Software Foundation.
358- *
359- * This program is distributed in the hope that it will be useful,
360- * but WITHOUT ANY WARRANTY; without even the implied warranty of
361- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
362- * GNU General Public License for more details.
363- *
364- * You should have received a copy of the GNU General Public License
365- * along with this program. If not, see <http://www.gnu.org/licenses/>.
366- *
367- * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
368- */
369-
370-#ifndef MIR_GRAPHICS_NESTED_EGL_IMAGE_FACTORY_H_
371-#define MIR_GRAPHICS_NESTED_EGL_IMAGE_FACTORY_H_
372-
373-#include "mir_toolkit/client_types_nbs.h"
374-#include <EGL/egl.h>
375-#include <EGL/eglext.h>
376-#include <memory>
377-
378-namespace mir
379-{
380-namespace graphics
381-{
382-namespace nested
383-{
384-
385-class NativeBuffer;
386-class EglImageFactory
387-{
388-public:
389- virtual ~EglImageFactory() = default;
390- virtual std::unique_ptr<EGLImageKHR> create_egl_image_from(
391- NativeBuffer& buffer, EGLDisplay display, EGLint const* attrs) const = 0;
392-protected:
393- EglImageFactory() = default;
394- EglImageFactory(EglImageFactory const&) = delete;
395- EglImageFactory& operator=(EglImageFactory const&) = delete;
396-};
397-
398-}
399-}
400-}
401-#endif /* MIR_GRAPHICS_NESTED_EGL_IMAGE_FACTORY_H_ */
402
403=== modified file 'src/server/graphics/nested/native_buffer.h'
404--- src/server/graphics/nested/native_buffer.h 2016-09-08 17:03:46 +0000
405+++ src/server/graphics/nested/native_buffer.h 2016-09-22 18:18:34 +0000
406@@ -24,6 +24,9 @@
407 #include "mir_toolkit/client_types_nbs.h"
408 #include "mir_toolkit/client_types.h"
409 #include "mir_toolkit/mir_native_buffer.h"
410+#include <EGL/egl.h>
411+#include <EGL/eglext.h>
412+#include <tuple>
413 #include <chrono>
414
415 namespace mir
416@@ -42,6 +45,7 @@
417 virtual MirGraphicsRegion get_graphics_region() = 0;
418 virtual geometry::Size size() const = 0;
419 virtual MirPixelFormat format() const = 0;
420+ virtual std::tuple<EGLenum, EGLClientBuffer, EGLint*> egl_image_creation_hints() const = 0;
421 protected:
422 NativeBuffer() = default;
423 NativeBuffer(NativeBuffer const&) = delete;
424
425=== modified file 'tests/include/mir/test/doubles/mock_client_buffer.h'
426--- tests/include/mir/test/doubles/mock_client_buffer.h 2016-08-01 07:24:32 +0000
427+++ tests/include/mir/test/doubles/mock_client_buffer.h 2016-09-22 18:18:34 +0000
428@@ -47,6 +47,7 @@
429 MOCK_METHOD2(set_fence, void(MirNativeFence, MirBufferAccess));
430 MOCK_CONST_METHOD0(get_fence, MirNativeFence());
431 MOCK_METHOD2(wait_fence, bool(MirBufferAccess, std::chrono::nanoseconds));
432+ MOCK_METHOD3(egl_image_creation_parameters, void(EGLenum*, EGLClientBuffer*, EGLint**));
433 int age_{0};
434 };
435 }
436
437=== modified file 'tests/include/mir/test/doubles/null_client_buffer.h'
438--- tests/include/mir/test/doubles/null_client_buffer.h 2016-08-01 07:24:32 +0000
439+++ tests/include/mir/test/doubles/null_client_buffer.h 2016-09-22 18:18:34 +0000
440@@ -57,6 +57,7 @@
441 void set_fence(MirNativeFence, MirBufferAccess) {}
442 MirNativeFence get_fence() const { return nullptr; }
443 bool wait_fence(MirBufferAccess, std::chrono::nanoseconds) { return true; }
444+ void egl_image_creation_parameters(EGLenum*, EGLClientBuffer*, EGLint**) {}
445 };
446
447 }
448
449=== modified file 'tests/include/mir/test/doubles/stub_client_buffer.h'
450--- tests/include/mir/test/doubles/stub_client_buffer.h 2016-08-24 02:09:08 +0000
451+++ tests/include/mir/test/doubles/stub_client_buffer.h 2016-09-22 18:18:34 +0000
452@@ -82,6 +82,7 @@
453 void set_fence(MirNativeFence, MirBufferAccess) override {}
454 MirNativeFence get_fence() const override { return nullptr; }
455 bool wait_fence(MirBufferAccess, std::chrono::nanoseconds) override { return true; }
456+ void egl_image_creation_parameters(EGLenum*, EGLClientBuffer*, EGLint**) {}
457
458 std::shared_ptr<MirBufferPackage> const package;
459 geometry::Size size_;
460
461=== modified file 'tests/unit-tests/client/test_aging_buffer.cpp'
462--- tests/unit-tests/client/test_aging_buffer.cpp 2016-08-10 10:43:39 +0000
463+++ tests/unit-tests/client/test_aging_buffer.cpp 2016-09-22 18:18:34 +0000
464@@ -83,6 +83,11 @@
465 {
466 exit(1);
467 }
468+
469+ void egl_image_creation_parameters(EGLenum*, EGLClientBuffer*, EGLint**) override
470+ {
471+ exit(1);
472+ }
473 };
474
475 TEST(MirClientAgingBufferTest, buffer_age_starts_at_zero)
476
477=== modified file 'tests/unit-tests/platforms/nested/test_buffer.cpp'
478--- tests/unit-tests/platforms/nested/test_buffer.cpp 2016-09-19 09:05:08 +0000
479+++ tests/unit-tests/platforms/nested/test_buffer.cpp 2016-09-22 18:18:34 +0000
480@@ -18,7 +18,6 @@
481
482 #include "src/server/graphics/nested/native_buffer.h"
483 #include "src/server/graphics/nested/buffer.h"
484-#include "src/server/graphics/nested/egl_image_factory.h"
485 #include "src/client/buffer.h"
486 #include "mir/graphics/buffer_properties.h"
487 #include "mir/test/doubles/stub_host_connection.h"
488@@ -45,12 +44,6 @@
489 using namespace testing;
490 namespace
491 {
492-struct MockEglImageFactory : mgn::EglImageFactory
493-{
494- MOCK_CONST_METHOD3(create_egl_image_from,
495- std::unique_ptr<EGLImageKHR>(mgn::NativeBuffer&, EGLDisplay, EGLint const*));
496-};
497-
498 struct MockNativeBuffer : mgn::NativeBuffer
499 {
500 MOCK_CONST_METHOD0(client_handle, MirBuffer*());
501@@ -59,6 +52,7 @@
502 MOCK_CONST_METHOD0(size, geom::Size());
503 MOCK_CONST_METHOD0(format, MirPixelFormat());
504 MOCK_METHOD2(sync, void(MirBufferAccess, std::chrono::nanoseconds));
505+ MOCK_CONST_METHOD0(egl_image_creation_hints, std::tuple<EGLenum, EGLClientBuffer, EGLint*>());
506 };
507
508 struct MockHostConnection : mtd::StubHostConnection
509@@ -92,8 +86,6 @@
510 stride_with_padding, sw_properties.format, reinterpret_cast<char*>(&data)
511 };
512
513- MockEglImageFactory mock_image_factory;
514-
515 NiceMock<mtd::MockGL> mock_gl;
516 NiceMock<mtd::MockEGL> mock_egl;
517 };
518@@ -103,18 +95,18 @@
519 {
520 EXPECT_CALL(mock_connection, create_buffer(sw_properties))
521 .WillOnce(Return(client_buffer));
522- mgn::Buffer buffer(mt::fake_shared(mock_connection), mt::fake_shared(mock_image_factory), sw_properties);
523+ mgn::Buffer buffer(mt::fake_shared(mock_connection), sw_properties);
524 }
525
526 TEST_F(NestedBuffer, generates_valid_id)
527 {
528- mgn::Buffer buffer(mt::fake_shared(mock_connection), mt::fake_shared(mock_image_factory), sw_properties);
529+ mgn::Buffer buffer(mt::fake_shared(mock_connection), sw_properties);
530 EXPECT_THAT(buffer.id().as_value(), Gt(0));
531 }
532
533 TEST_F(NestedBuffer, has_correct_properties)
534 {
535- mgn::Buffer buffer(mt::fake_shared(mock_connection), mt::fake_shared(mock_image_factory), sw_properties);
536+ mgn::Buffer buffer(mt::fake_shared(mock_connection), sw_properties);
537 EXPECT_THAT(buffer.size(), Eq(sw_properties.size));
538 EXPECT_THAT(buffer.pixel_format(), Eq(sw_properties.format));
539 }
540@@ -123,13 +115,13 @@
541 {
542
543 {
544- mgn::Buffer buffer(mt::fake_shared(mock_connection), mt::fake_shared(mock_image_factory), sw_properties);
545+ mgn::Buffer buffer(mt::fake_shared(mock_connection), sw_properties);
546 EXPECT_THAT(dynamic_cast<mrs::PixelSource*>(buffer.native_buffer_base()), Ne(nullptr));
547 EXPECT_THAT(dynamic_cast<mrg::TextureSource*>(buffer.native_buffer_base()), Ne(nullptr));
548 }
549
550 {
551- mgn::Buffer buffer(mt::fake_shared(mock_connection), mt::fake_shared(mock_image_factory), hw_properties);
552+ mgn::Buffer buffer(mt::fake_shared(mock_connection), hw_properties);
553 EXPECT_THAT(dynamic_cast<mrs::PixelSource*>(buffer.native_buffer_base()), Eq(nullptr));
554 EXPECT_THAT(dynamic_cast<mrg::TextureSource*>(buffer.native_buffer_base()), Ne(nullptr));
555 }
556@@ -145,7 +137,7 @@
557 };
558
559 unsigned int new_data = 0x11111111;
560- mgn::Buffer buffer(mt::fake_shared(mock_connection), mt::fake_shared(mock_image_factory), sw_properties);
561+ mgn::Buffer buffer(mt::fake_shared(mock_connection), sw_properties);
562
563 EXPECT_CALL(*client_buffer, get_graphics_region())
564 .WillOnce(Return(region));
565@@ -157,7 +149,7 @@
566
567 TEST_F(NestedBuffer, checks_for_null_vaddr)
568 {
569- mgn::Buffer buffer(mt::fake_shared(mock_connection), mt::fake_shared(mock_image_factory), sw_properties);
570+ mgn::Buffer buffer(mt::fake_shared(mock_connection), sw_properties);
571
572 MirGraphicsRegion region { 1, 1, 1, sw_properties.format, nullptr };
573 EXPECT_CALL(*client_buffer, get_graphics_region())
574@@ -175,7 +167,7 @@
575 TEST_F(NestedBuffer, throws_if_incorrect_sizing)
576 {
577 auto too_large_size = 4 * sizeof(data);
578- mgn::Buffer buffer(mt::fake_shared(mock_connection), mt::fake_shared(mock_image_factory), sw_properties);
579+ mgn::Buffer buffer(mt::fake_shared(mock_connection), sw_properties);
580 auto pixel_source = dynamic_cast<mir::renderer::software::PixelSource*>(buffer.native_buffer_base());
581 ASSERT_THAT(pixel_source, Ne(nullptr));
582 EXPECT_THROW({
583@@ -186,7 +178,7 @@
584 TEST_F(NestedBuffer, reads_from_region)
585 {
586 unsigned int read_data = 0x11111111;
587- mgn::Buffer buffer(mt::fake_shared(mock_connection), mt::fake_shared(mock_image_factory), sw_properties);
588+ mgn::Buffer buffer(mt::fake_shared(mock_connection), sw_properties);
589
590 EXPECT_CALL(*client_buffer, get_graphics_region())
591 .WillOnce(Return(region));
592@@ -200,11 +192,10 @@
593
594 TEST_F(NestedBuffer, binds_to_texture)
595 {
596- EGLint const expected_image_attrs[] = { EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE };
597- EXPECT_CALL(mock_image_factory, create_egl_image_from(Ref(*client_buffer), mock_egl.fake_egl_display, mtd::AttrMatches(expected_image_attrs)))
598- .WillRepeatedly(InvokeWithoutArgs([] { return std::make_unique<EGLImageKHR>(); }));
599+ ON_CALL(*client_buffer, egl_image_creation_hints())
600+ .WillByDefault(Return(std::tuple<EGLenum, EGLClientBuffer, EGLint*>{}));
601
602- mgn::Buffer buffer(mt::fake_shared(mock_connection), mt::fake_shared(mock_image_factory), hw_properties);
603+ mgn::Buffer buffer(mt::fake_shared(mock_connection), hw_properties);
604 auto native_base = buffer.native_buffer_base();
605 ASSERT_THAT(native_base, Ne(nullptr));
606 auto texture_source = dynamic_cast<mir::renderer::gl::TextureSource*>(native_base);
607@@ -212,6 +203,7 @@
608
609 EXPECT_CALL(mock_egl, eglGetCurrentDisplay());
610 EXPECT_CALL(mock_egl, eglGetCurrentContext());
611+ EXPECT_CALL(mock_egl, eglCreateImageKHR(_,_,_,_,_));
612 EXPECT_CALL(*client_buffer, sync(mir_read, _));
613 EXPECT_CALL(mock_egl, glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, _));
614
615@@ -220,10 +212,12 @@
616
617 TEST_F(NestedBuffer, just_makes_one_bind_per_display_context_pair)
618 {
619+ ON_CALL(*client_buffer, egl_image_creation_hints())
620+ .WillByDefault(Return(std::tuple<EGLenum, EGLClientBuffer, EGLint*>{}));
621 int fake_context1 = 113;
622 int fake_context2 = 114;
623
624- mgn::Buffer buffer(mt::fake_shared(mock_connection), mt::fake_shared(mock_image_factory), hw_properties);
625+ mgn::Buffer buffer(mt::fake_shared(mock_connection), hw_properties);
626 auto texture_source = dynamic_cast<mir::renderer::gl::TextureSource*>(buffer.native_buffer_base());
627 ASSERT_THAT(texture_source, Ne(nullptr));
628
629@@ -234,9 +228,8 @@
630 .WillOnce(Return(&fake_context1))
631 .WillOnce(Return(&fake_context1))
632 .WillOnce(Return(&fake_context2));
633- EXPECT_CALL(mock_image_factory, create_egl_image_from(_, _, _))
634- .Times(2)
635- .WillRepeatedly(InvokeWithoutArgs([] { return std::make_unique<EGLImageKHR>(); }));
636+ EXPECT_CALL(mock_egl, eglCreateImageKHR(_,_,_,_,_))
637+ .Times(2);
638 EXPECT_CALL(mock_egl, glEGLImageTargetTexture2DOES(_, _))
639 .Times(3);
640
641@@ -247,7 +240,7 @@
642
643 TEST_F(NestedBuffer, has_correct_stride)
644 {
645- mgn::Buffer buffer(mt::fake_shared(mock_connection), mt::fake_shared(mock_image_factory), sw_properties);
646+ mgn::Buffer buffer(mt::fake_shared(mock_connection), sw_properties);
647 auto pixel_source = dynamic_cast<mir::renderer::software::PixelSource*>(buffer.native_buffer_base());
648 ASSERT_THAT(pixel_source, Ne(nullptr));
649 EXPECT_THAT(pixel_source->stride().as_int(), Eq(stride_with_padding));

Subscribers

People subscribed via source and target branches