Mir

Merge lp:~mir-team/mir/android-eliminate-libui-dependency into lp:~mir-team/mir/trunk

Proposed by Kevin DuBois
Status: Merged
Approved by: Alexandros Frantzis
Approved revision: no longer in the source branch.
Merged at revision: 502
Proposed branch: lp:~mir-team/mir/android-eliminate-libui-dependency
Merge into: lp:~mir-team/mir/trunk
Diff against target: 589 lines (+377/-74)
11 files modified
3rd_party/CMakeLists.txt (+4/-0)
3rd_party/android-deps/ui/FramebufferNativeWindow.h (+14/-16)
3rd_party/android-fbtype/CMakeLists.txt (+11/-0)
3rd_party/android-fbtype/FramebufferNativeWindow.cpp (+342/-0)
CMakeLists.txt (+0/-1)
cmake/FindAndroidUI.cmake (+0/-47)
src/client/CMakeLists.txt (+1/-1)
src/server/graphics/CMakeLists.txt (+1/-1)
src/server/graphics/android/CMakeLists.txt (+2/-2)
src/server/graphics/android/android_platform.cpp (+1/-5)
tests/CMakeLists.txt (+1/-1)
To merge this branch: bzr merge lp:~mir-team/mir/android-eliminate-libui-dependency
Reviewer Review Type Date Requested Status
Alexandros Frantzis (community) Approve
Alan Griffiths Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+153472@code.launchpad.net

Commit message

eliminate our depenendency on libui by (temporarily) porting FramebufferNativeWindow.

Description of the change

eliminate our depenendency on libui by (temporarily) porting FramebufferNativeWindow.

Porting the fb native window type we were using has many nice effects
1) our framebuffer deconstructs properly, which it wasn't before (makes us more responsive to ctrl-c on device)
2) we eliminate our dependency on libui
3) we reduce the amount of stuff operating over hybris
4) we make multithreaded-compositor branch landable for android

For what its worth, the MirNativeWindowType is in good enough shape (architecturally) to plug in a class that uses framebuffer windows. I chose to port over this class because I estimated the time it would take to create that class for MirNativeWindow would take longer than just a quick port, and I wanted to unblock alexandros's multithreaded compositor branch asap.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Looks sane (for imported code). But I'm not set up to prove it works (guess alf will tell me).

review: Approve
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Works well on Nexus 4.

I guess this also allows us to remove the static display workaround in tests/integration-tests/graphics/android/test_buffer_integration.cpp, right?

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '3rd_party/CMakeLists.txt'
2--- 3rd_party/CMakeLists.txt 2013-03-13 08:01:51 +0000
3+++ 3rd_party/CMakeLists.txt 2013-03-15 00:18:23 +0000
4@@ -24,6 +24,10 @@
5 set(MIR_INPUT_ANDROID_COMPILE_FLAGS ${MIR_INPUT_ANDROID_COMPILE_FLAGS}
6 PARENT_SCOPE)
7
8+if (MIR_PLATFORM STREQUAL "android")
9+ add_subdirectory(android-fbtype)
10+endif()
11+
12 if (NOT MIR_DISABLE_INPUT)
13 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/android-deps)
14 add_subdirectory(android-input)
15
16=== modified file '3rd_party/android-deps/ui/FramebufferNativeWindow.h'
17--- 3rd_party/android-deps/ui/FramebufferNativeWindow.h 2013-03-07 08:04:05 +0000
18+++ 3rd_party/android-deps/ui/FramebufferNativeWindow.h 2013-03-15 00:18:23 +0000
19@@ -33,10 +33,11 @@
20
21 #include <ui/egl/android_natives.h>
22
23+#include <mutex>
24+#include <condition_variable>
25+
26 #define NUM_FRAME_BUFFERS 2
27
28-extern "C" EGLNativeWindowType android_createDisplaySurface(void);
29-
30 // ---------------------------------------------------------------------------
31 namespace android {
32 // ---------------------------------------------------------------------------
33@@ -46,11 +47,7 @@
34
35 // ---------------------------------------------------------------------------
36
37-class FramebufferNativeWindow
38- : public EGLNativeBase<
39- ANativeWindow,
40- FramebufferNativeWindow,
41- LightRefBase<FramebufferNativeWindow> >
42+class FramebufferNativeWindow : public ANativeWindow
43 {
44 public:
45 FramebufferNativeWindow();
46@@ -66,24 +63,25 @@
47 // for debugging only
48 int getCurrentBufferIndex() const;
49
50+ ~FramebufferNativeWindow(); // this class cannot be overloaded
51+
52 private:
53- friend class LightRefBase<FramebufferNativeWindow>;
54- ~FramebufferNativeWindow(); // this class cannot be overloaded
55 static int setSwapInterval(ANativeWindow* window, int interval);
56- static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer);
57- static int lockBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
58- static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer);
59+ static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer, int*);
60+ static int dequeueBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer** buffer);
61+ static int lockBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer* buffer);
62+ static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer, int);
63+ static int queueBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer* buffer);
64 static int query(const ANativeWindow* window, int what, int* value);
65 static int perform(ANativeWindow* window, int operation, ...);
66
67 framebuffer_device_t* fbDev;
68 alloc_device_t* grDev;
69
70- sp<NativeBuffer> buffers[NUM_FRAME_BUFFERS];
71- sp<NativeBuffer> front;
72+ NativeBuffer* buffers[NUM_FRAME_BUFFERS];
73
74- mutable Mutex mutex;
75- Condition mCondition;
76+ std::mutex mutex;
77+ std::condition_variable mCondition;
78 int32_t mNumBuffers;
79 int32_t mNumFreeBuffers;
80 int32_t mBufferHead;
81
82=== added directory '3rd_party/android-fbtype'
83=== added file '3rd_party/android-fbtype/CMakeLists.txt'
84--- 3rd_party/android-fbtype/CMakeLists.txt 1970-01-01 00:00:00 +0000
85+++ 3rd_party/android-fbtype/CMakeLists.txt 2013-03-15 00:18:23 +0000
86@@ -0,0 +1,11 @@
87+# Don't be so strict on warnings etc as android code won't compile with them on.
88+# A *big* number of warnings would ensue. Therefore locally define CMAKE_CXX_FLAGS
89+# without things such as -Werror, -Wall, etc
90+STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
91+STRING(REGEX REPLACE "-W[^ ]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
92+
93+add_library(
94+ 3rd_party_fbtype STATIC
95+
96+ FramebufferNativeWindow.cpp
97+)
98
99=== added file '3rd_party/android-fbtype/FramebufferNativeWindow.cpp'
100--- 3rd_party/android-fbtype/FramebufferNativeWindow.cpp 1970-01-01 00:00:00 +0000
101+++ 3rd_party/android-fbtype/FramebufferNativeWindow.cpp 2013-03-15 00:18:23 +0000
102@@ -0,0 +1,342 @@
103+/*
104+**
105+** Copyright 2007 The Android Open Source Project
106+**
107+** Licensed under the Apache License Version 2.0(the "License");
108+** you may not use this file except in compliance with the License.
109+** You may obtain a copy of the License at
110+**
111+** http://www.apache.org/licenses/LICENSE-2.0
112+**
113+** Unless required by applicable law or agreed to in writing software
114+** distributed under the License is distributed on an "AS IS" BASIS
115+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
116+** See the License for the specific language governing permissions and
117+** limitations under the License.
118+*/
119+
120+//TODO: kdub remove this entire file and use mir native window types
121+
122+#define LOG_TAG "FramebufferNativeWindow"
123+#define SYNC_IOC_WAIT 0x40043E00
124+
125+#include <stdlib.h>
126+#include <stdio.h>
127+#include <string.h>
128+#include <errno.h>
129+#include <unistd.h>
130+#include <sys/ioctl.h>
131+
132+//#include <cutils/log.h>
133+//#include <cutils/atomic.h>
134+//#include <utils/threads.h>
135+#include <utils/RefBase.h>
136+
137+//#include <ui/ANativeObjectBase.h>
138+//#include <ui/Fence.h>
139+#include <ui/FramebufferNativeWindow.h>
140+#include <ui/Rect.h>
141+
142+#include <EGL/egl.h>
143+
144+#include <hardware/hardware.h>
145+#include <hardware/gralloc.h>
146+
147+// ----------------------------------------------------------------------------
148+namespace android {
149+// ----------------------------------------------------------------------------
150+
151+static void incRef(android_native_base_t*)
152+{
153+}
154+class NativeBuffer : public ANativeWindowBuffer
155+{
156+public:
157+
158+
159+ NativeBuffer(int w, int h, int f, int u) /*: BASE() */
160+ {
161+ ANativeWindowBuffer::width = w;
162+ ANativeWindowBuffer::height = h;
163+ ANativeWindowBuffer::format = f;
164+ ANativeWindowBuffer::usage = u;
165+
166+ common.incRef = incRef;
167+ common.decRef = incRef;
168+ }
169+ ~NativeBuffer() { }; // this class cannot be overloaded
170+};
171+
172+/*
173+ * This implements the (main) framebuffer management. This class is used
174+ * mostly by SurfaceFlinger, but also by command line GL application.
175+ *
176+ * In fact this is an implementation of ANativeWindow on top of
177+ * the framebuffer.
178+ *
179+ * Currently it is pretty simple, it manages only two buffers (the front and
180+ * back buffer).
181+ *
182+ */
183+
184+FramebufferNativeWindow::FramebufferNativeWindow()
185+ :/* BASE(), */ fbDev(0), grDev(0), mUpdateOnDemand(false)
186+{
187+ hw_module_t const* module;
188+
189+ if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module) == 0) {
190+ int err;
191+ int i;
192+ err = framebuffer_open(module, &fbDev);
193+
194+ err = gralloc_open(module, &grDev);
195+
196+ // bail out if we can't initialize the modules
197+ if (!fbDev || !grDev)
198+ return;
199+
200+ mUpdateOnDemand = (fbDev->setUpdateRect != 0);
201+
202+ mNumBuffers = 2; //fbDev->numFramebuffers;
203+
204+ mNumFreeBuffers = mNumBuffers;
205+ mBufferHead = mNumBuffers-1;
206+
207+ for (i = 0; i < mNumBuffers; i++)
208+ {
209+ buffers[i] = new NativeBuffer(
210+ fbDev->width, fbDev->height, fbDev->format, GRALLOC_USAGE_HW_FB);
211+ }
212+
213+ for (i = 0; i < mNumBuffers; i++)
214+ {
215+ err = grDev->alloc(grDev,
216+ fbDev->width, fbDev->height, fbDev->format,
217+ GRALLOC_USAGE_HW_FB, &buffers[i]->handle, &buffers[i]->stride);
218+
219+
220+ if (err)
221+ {
222+ mNumBuffers = i;
223+ mNumFreeBuffers = i;
224+ mBufferHead = mNumBuffers-1;
225+ break;
226+ }
227+ }
228+
229+ const_cast<uint32_t&>(ANativeWindow::flags) = fbDev->flags;
230+ const_cast<float&>(ANativeWindow::xdpi) = fbDev->xdpi;
231+ const_cast<float&>(ANativeWindow::ydpi) = fbDev->ydpi;
232+ const_cast<int&>(ANativeWindow::minSwapInterval) =
233+ fbDev->minSwapInterval;
234+ const_cast<int&>(ANativeWindow::maxSwapInterval) =
235+ fbDev->maxSwapInterval;
236+ }
237+
238+ common.incRef = incRef;
239+ common.decRef = incRef;
240+ ANativeWindow::setSwapInterval = setSwapInterval;
241+ ANativeWindow::dequeueBuffer = dequeueBuffer;
242+ ANativeWindow::queueBuffer = queueBuffer;
243+ ANativeWindow::query = query;
244+ ANativeWindow::perform = perform;
245+ ANativeWindow::cancelBuffer = NULL;
246+
247+ ANativeWindow::dequeueBuffer_DEPRECATED = dequeueBuffer_DEPRECATED;
248+ ANativeWindow::lockBuffer_DEPRECATED = lockBuffer_DEPRECATED;
249+ ANativeWindow::queueBuffer_DEPRECATED = queueBuffer_DEPRECATED;
250+}
251+
252+FramebufferNativeWindow::~FramebufferNativeWindow()
253+{
254+ if (grDev) {
255+ for(int i = 0; i < mNumBuffers; i++) {
256+ if (buffers[i] != NULL) {
257+ grDev->free(grDev, buffers[i]->handle);
258+ delete buffers[i];
259+ }
260+ }
261+ gralloc_close(grDev);
262+ }
263+
264+ if (fbDev) {
265+ framebuffer_close(fbDev);
266+ }
267+}
268+
269+status_t FramebufferNativeWindow::setUpdateRectangle(const Rect& r)
270+{
271+ if (!mUpdateOnDemand) {
272+ return INVALID_OPERATION;
273+ }
274+ return fbDev->setUpdateRect(fbDev, r.left, r.top, r.width(), r.height());
275+}
276+
277+status_t FramebufferNativeWindow::compositionComplete()
278+{
279+ if (fbDev->compositionComplete) {
280+ return fbDev->compositionComplete(fbDev);
281+ }
282+ return INVALID_OPERATION;
283+}
284+
285+int FramebufferNativeWindow::setSwapInterval(
286+ ANativeWindow* window, int interval)
287+{
288+ framebuffer_device_t* fb = static_cast<FramebufferNativeWindow*>(window)->fbDev;
289+ return fb->setSwapInterval(fb, interval);
290+}
291+
292+void FramebufferNativeWindow::dump(String8& result) {
293+ if (fbDev->common.version >= 1 && fbDev->dump) {
294+ const size_t SIZE = 4096;
295+ char buffer[SIZE];
296+
297+ fbDev->dump(fbDev, buffer, SIZE);
298+ result.append(buffer);
299+ }
300+}
301+
302+// only for debugging / logging
303+int FramebufferNativeWindow::getCurrentBufferIndex() const
304+{
305+ return 0;
306+}
307+
308+int FramebufferNativeWindow::dequeueBuffer_DEPRECATED(ANativeWindow* window,
309+ ANativeWindowBuffer** buffer)
310+{
311+ int fenceFd = -1;
312+ int result = dequeueBuffer(window, buffer, &fenceFd);
313+ return result;
314+}
315+
316+int FramebufferNativeWindow::dequeueBuffer(ANativeWindow* window,
317+ ANativeWindowBuffer** buffer, int* fenceFd)
318+{
319+ FramebufferNativeWindow* self = static_cast<FramebufferNativeWindow*>(window);
320+
321+ std::unique_lock<std::mutex> lk(self->mutex);
322+ while (self->mNumFreeBuffers < 2) {
323+ self->mCondition.wait(lk);
324+ }
325+
326+ framebuffer_device_t* fb = self->fbDev;
327+
328+ int index = self->mBufferHead++;
329+ if (self->mBufferHead >= self->mNumBuffers)
330+ self->mBufferHead = 0;
331+
332+ // get this buffer
333+ self->mNumFreeBuffers--;
334+ self->mCurrentBufferIndex = index;
335+
336+ *buffer = self->buffers[index];
337+ *fenceFd = -1;
338+
339+ return 0;
340+}
341+
342+int FramebufferNativeWindow::lockBuffer_DEPRECATED(ANativeWindow* window,
343+ ANativeWindowBuffer* buffer)
344+{
345+ return NO_ERROR;
346+}
347+
348+int FramebufferNativeWindow::queueBuffer_DEPRECATED(ANativeWindow* window,
349+ ANativeWindowBuffer* buffer)
350+{
351+ return queueBuffer(window, buffer, -1);
352+}
353+
354+int FramebufferNativeWindow::queueBuffer(ANativeWindow* window,
355+ ANativeWindowBuffer* buffer, int fenceFd)
356+{
357+ FramebufferNativeWindow* self = static_cast<FramebufferNativeWindow*>(window);
358+ std::unique_lock<std::mutex> lk(self->mutex);
359+
360+ framebuffer_device_t* fb = self->fbDev;
361+ buffer_handle_t handle = static_cast<NativeBuffer*>(buffer)->handle;
362+
363+ if (fenceFd > 0)
364+ {
365+ int timeout = -1;
366+ ioctl(fenceFd, SYNC_IOC_WAIT, &timeout);
367+ close(fenceFd);
368+ }
369+
370+ const int index = self->mCurrentBufferIndex;
371+ int res = fb->post(fb, handle);
372+ self->mNumFreeBuffers++;
373+ self->mCondition.notify_all();
374+ return res;
375+}
376+
377+int FramebufferNativeWindow::query(const ANativeWindow* window,
378+ int what, int* value)
379+{
380+ auto fbwin = const_cast<ANativeWindow*>(window);
381+ FramebufferNativeWindow* self = static_cast<FramebufferNativeWindow*>(fbwin);
382+ std::unique_lock<std::mutex> lk(self->mutex);
383+
384+ framebuffer_device_t* fb = self->fbDev;
385+ switch (what) {
386+ case NATIVE_WINDOW_WIDTH:
387+ *value = fb->width;
388+ return NO_ERROR;
389+ case NATIVE_WINDOW_HEIGHT:
390+ *value = fb->height;
391+ return NO_ERROR;
392+ case NATIVE_WINDOW_FORMAT:
393+ *value = fb->format;
394+ return NO_ERROR;
395+ case NATIVE_WINDOW_CONCRETE_TYPE:
396+ *value = NATIVE_WINDOW_FRAMEBUFFER;
397+ return NO_ERROR;
398+ case NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER:
399+ *value = 0;
400+ return NO_ERROR;
401+ case NATIVE_WINDOW_DEFAULT_WIDTH:
402+ *value = fb->width;
403+ return NO_ERROR;
404+ case NATIVE_WINDOW_DEFAULT_HEIGHT:
405+ *value = fb->height;
406+ return NO_ERROR;
407+ case NATIVE_WINDOW_TRANSFORM_HINT:
408+ *value = 0;
409+ return NO_ERROR;
410+ }
411+ *value = 0;
412+ return BAD_VALUE;
413+}
414+
415+int FramebufferNativeWindow::perform(ANativeWindow* window,
416+ int operation, ...)
417+{
418+ switch (operation) {
419+ case NATIVE_WINDOW_CONNECT:
420+ case NATIVE_WINDOW_DISCONNECT:
421+ case NATIVE_WINDOW_SET_USAGE:
422+ case NATIVE_WINDOW_SET_BUFFERS_GEOMETRY:
423+ case NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS:
424+ case NATIVE_WINDOW_SET_BUFFERS_FORMAT:
425+ case NATIVE_WINDOW_SET_BUFFERS_TRANSFORM:
426+ case NATIVE_WINDOW_API_CONNECT:
427+ case NATIVE_WINDOW_API_DISCONNECT:
428+ // TODO: we should implement these
429+ return NO_ERROR;
430+
431+ case NATIVE_WINDOW_LOCK:
432+ case NATIVE_WINDOW_UNLOCK_AND_POST:
433+ case NATIVE_WINDOW_SET_CROP:
434+ case NATIVE_WINDOW_SET_BUFFER_COUNT:
435+ case NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP:
436+ case NATIVE_WINDOW_SET_SCALING_MODE:
437+ return INVALID_OPERATION;
438+ }
439+ return NAME_NOT_FOUND;
440+}
441+
442+// ----------------------------------------------------------------------------
443+}; // namespace android
444+// ----------------------------------------------------------------------------
445
446=== modified file 'CMakeLists.txt'
447--- CMakeLists.txt 2013-03-14 05:44:41 +0000
448+++ CMakeLists.txt 2013-03-15 00:18:23 +0000
449@@ -142,7 +142,6 @@
450 add_definitions( -DANDROID )
451
452 find_package( LibHardware REQUIRED )
453- find_package( AndroidUI REQUIRED )
454
455 #ctest does not work for android, so turn test discovery off
456 set(DISABLE_GTEST_TEST_DISCOVERY ON)
457
458=== removed file 'cmake/FindAndroidUI.cmake'
459--- cmake/FindAndroidUI.cmake 2013-03-07 08:04:05 +0000
460+++ cmake/FindAndroidUI.cmake 1970-01-01 00:00:00 +0000
461@@ -1,47 +0,0 @@
462-# Variables defined by this module:
463-# LIBHARDWARE_FOUND
464-# LIBHARDWARE_INCLUDE_DIRS
465-# LIBHARDWARE_LIBRARIES
466-
467-INCLUDE(FindPackageHandleStandardArgs)
468-
469-find_path(ANDROID_UI_INCLUDE_DIR
470- NAMES ui/FramebufferNativeWindow.h
471- pixelflinger/pixelflinger.h
472- pixelflinger/format.h
473- cutils/atomic.h
474- utils/threads.h
475- utils/String8.h
476- utils/Errors.h
477- utils/RefBase.h
478- utils/Timers.h
479- utils/SharedBuffer.h
480- utils/Unicode.h
481- utils/TypeHelpers.h
482- utils/StrongPointer.h
483- ui/Rect.h
484- ui/Point.h
485- ui/egl/android_natives.h
486-
487- #we keep these headers in-tree, so search in-tree
488- NO_CMAKE_FIND_ROOT_PATH
489- )
490-
491-# we are using a hybris/chroot compile, so libui functions are linked via hybris.
492-# hybris currently (confusingly) compiles the symbols we need for libui.so into libEGL.so (this should be corrected in the hybris project)
493-if (EGL_FOUND)
494- set(ANDROID_UI_LIBRARY ${EGL_LIBRARIES})
495-else()
496- set(ANDROID_UI_LIBRARY)
497- set(LIBHARDWARE_FOUND false)
498-endif()
499-
500-set(ANDROID_UI_LIBRARIES ${ANDROID_UI_LIBRARY})
501-set(ANDROID_UI_INCLUDE_DIRS ${ANDROID_UI_INCLUDE_DIR})
502-
503-# handle the QUIETLY and REQUIRED arguments and set ANDROID_UI_FOUND to TRUE
504-# if all listed variables are TRUE
505-find_package_handle_standard_args(ANDROID_UI DEFAULT_MSG
506- ANDROID_UI_LIBRARY ANDROID_UI_INCLUDE_DIR)
507-
508-mark_as_advanced(ANDROID_UI_INCLUDE_DIR ANDROID_UI_LIBRARY )
509
510=== modified file 'src/client/CMakeLists.txt'
511--- src/client/CMakeLists.txt 2013-03-13 17:28:34 +0000
512+++ src/client/CMakeLists.txt 2013-03-15 00:18:23 +0000
513@@ -49,7 +49,7 @@
514 endif()
515
516 if( MIR_PLATFORM STREQUAL "android")
517-include_directories( ${LIBHARDWARE_INCLUDE_DIRS} ${ANDROID_UI_INCLUDE_DIRS})
518+include_directories(${LIBHARDWARE_INCLUDE_DIRS})
519 set(
520 CLIENT_SOURCES
521
522
523=== modified file 'src/server/graphics/CMakeLists.txt'
524--- src/server/graphics/CMakeLists.txt 2013-03-07 08:04:05 +0000
525+++ src/server/graphics/CMakeLists.txt 2013-03-15 00:18:23 +0000
526@@ -3,7 +3,7 @@
527 include_directories(${GLESv2_INCLUDE_DIRS})
528
529 if (MIR_PLATFORM STREQUAL "android")
530- include_directories( ${LIBHARDWARE_INCLUDE_DIRS} ${ANDROID_UI_INCLUDE_DIRS})
531+ include_directories(${LIBHARDWARE_INCLUDE_DIRS})
532 add_subdirectory(android/)
533 endif()
534
535
536=== modified file 'src/server/graphics/android/CMakeLists.txt'
537--- src/server/graphics/android/CMakeLists.txt 2013-03-07 08:04:05 +0000
538+++ src/server/graphics/android/CMakeLists.txt 2013-03-15 00:18:23 +0000
539@@ -1,6 +1,5 @@
540 include_directories(
541 ${LIBHARDWARE_INCLUDE_DIRS}
542- ${ANDROID_UI_INCLUDE_DIRS}
543 ${EGL_INCLUDE_DIRS}
544 ${GLESv2_INCLUDE_DIRS}
545 )
546@@ -21,8 +20,9 @@
547 mirplatformgraphics
548 mircompositor
549
550+ 3rd_party_fbtype
551+
552 ${LIBHARDWARE_LIBRARIES}
553- ${ANDROID_UI_LIBRARIES}
554 ${EGL_LDFLAGS} ${EGL_LIBRARIES}
555 ${GLESv2_LDFLAGS} ${GLESv2_LIBRARIES}
556 )
557
558=== modified file 'src/server/graphics/android/android_platform.cpp'
559--- src/server/graphics/android/android_platform.cpp 2013-03-07 08:04:05 +0000
560+++ src/server/graphics/android/android_platform.cpp 2013-03-15 00:18:23 +0000
561@@ -40,14 +40,10 @@
562 return std::make_shared<mga::AndroidBufferAllocator>();
563 }
564
565-/* note: gralloc seems to choke when this is opened/closed more than once per process. must investigate drivers further */
566 std::shared_ptr<mg::Display> mga::AndroidPlatform::create_display()
567 {
568- auto android_window = std::shared_ptr<ANativeWindow>(android_createDisplaySurface());
569- if (!android_window.get())
570- BOOST_THROW_EXCEPTION(std::runtime_error("could not open FB window"));
571+ auto android_window = std::make_shared< ::android::FramebufferNativeWindow>();
572 auto window = std::make_shared<mga::AndroidFramebufferWindow> (android_window);
573-
574 return std::make_shared<mga::AndroidDisplay>(window);
575 }
576
577
578=== modified file 'tests/CMakeLists.txt'
579--- tests/CMakeLists.txt 2013-03-13 07:41:46 +0000
580+++ tests/CMakeLists.txt 2013-03-15 00:18:23 +0000
581@@ -25,7 +25,7 @@
582 include_directories(${PROJECT_SOURCE_DIR}/include/test)
583
584 if (MIR_PLATFORM STREQUAL "android")
585- include_directories( ${LIBHARDWARE_INCLUDE_DIRS} ${ANDROID_UI_INCLUDE_DIRS})
586+ include_directories( ${LIBHARDWARE_INCLUDE_DIRS})
587 endif()
588
589 add_subdirectory(acceptance-tests/)

Subscribers

People subscribed via source and target branches