~hikiko/mir/mir.unity8-desktop-session

« back to all changes in this revision

Viewing changes to tests/integration-tests/client/test_client_render.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Daniel van Vugt, Ubuntu daily release
  • Date: 2014-01-08 02:04:38 UTC
  • mfrom: (1.1.54)
  • Revision ID: package-import@ubuntu.com-20140108020438-ikbu7qqm9v2l026y
Tags: 0.1.3+14.04.20140108-0ubuntu1
[ Daniel van Vugt ]
* Preparing for release 0.1.3

[ Ubuntu daily release ]
* Automatic snapshot from revision 1170

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include "mir/graphics/buffer_properties.h"
22
22
#include "mir/graphics/buffer_initializer.h"
23
 
#include "src/server/graphics/android/buffer.h"
 
23
#include "src/platform/graphics/android/buffer.h"
24
24
#include "mir/graphics/android/native_buffer.h"
25
 
#include "src/server/graphics/android/android_graphic_buffer_allocator.h"
 
25
#include "src/platform/graphics/android/android_graphic_buffer_allocator.h"
26
26
 
27
27
#include "mir_test_framework/cross_process_sync.h"
28
28
#include "mir_test/draw/android_graphics.h"
143
143
        auto native_display = mir_connection_get_egl_native_display(connection);
144
144
        auto egl_display = eglGetDisplay(native_display);
145
145
        eglInitialize(egl_display, &major, &minor);
146
 
        eglChooseConfig(egl_display, attribs, &egl_config, 1, &n); 
 
146
        eglChooseConfig(egl_display, attribs, &egl_config, 1, &n);
147
147
 
148
 
        auto mir_surface = create_mir_surface(connection, egl_display, egl_config); 
 
148
        auto mir_surface = create_mir_surface(connection, egl_display, egl_config);
149
149
        auto native_window = static_cast<EGLNativeWindowType>(
150
 
            mir_surface_get_egl_native_window(mir_surface)); 
151
 
    
 
150
            mir_surface_get_egl_native_window(mir_surface));
 
151
 
152
152
        egl_surface = eglCreateWindowSurface(egl_display, egl_config, native_window, NULL);
153
153
        context = eglCreateContext(egl_display, egl_config, EGL_NO_CONTEXT, context_attribs);
154
154
        eglMakeCurrent(egl_display, egl_surface, egl_surface, context);
192
192
        auto initializer = std::make_shared<mg::NullBufferInitializer>();
193
193
        allocator = std::make_shared<mga::AndroidGraphicBufferAllocator> (initializer);
194
194
        auto size = geom::Size{test_width, test_height};
195
 
        surface_pf = geom::PixelFormat::abgr_8888;
 
195
        surface_pf = mir_pixel_format_abgr_8888;
196
196
        last_posted = allocator->alloc_buffer_platform(size, surface_pf, mga::BufferUsage::use_hardware);
197
197
        client_buffer = allocator->alloc_buffer_platform(size, surface_pf, mga::BufferUsage::use_hardware);
198
198
    }
205
205
        response->mutable_id()->set_value(13);
206
206
        response->set_width(test_width);
207
207
        response->set_height(test_height);
208
 
        surface_pf = geom::PixelFormat(request->pixel_format());
 
208
        surface_pf = MirPixelFormat(request->pixel_format());
209
209
        response->set_pixel_format(request->pixel_format());
210
210
        response->mutable_buffer()->set_buffer_id(client_buffer->id().as_uint32_t());
211
211
 
260
260
 
261
261
    uint32_t red_value_for_surface()
262
262
    {
263
 
        if ((surface_pf == geom::PixelFormat::abgr_8888) || (surface_pf == geom::PixelFormat::xbgr_8888))
 
263
        if ((surface_pf == mir_pixel_format_abgr_8888) || (surface_pf == mir_pixel_format_xbgr_8888))
264
264
            return 0xFF0000FF;
265
265
 
266
 
        if ((surface_pf == geom::PixelFormat::argb_8888) || (surface_pf == geom::PixelFormat::xrgb_8888))
 
266
        if ((surface_pf == mir_pixel_format_argb_8888) || (surface_pf == mir_pixel_format_xrgb_8888))
267
267
            return 0xFFFF0000;
268
268
 
269
269
        return 0x0;
291
291
    std::shared_ptr<mg::Buffer> client_buffer;
292
292
    std::shared_ptr<mg::Buffer> last_posted;
293
293
    std::mutex buffer_mutex;
294
 
    geom::PixelFormat surface_pf;
 
294
    MirPixelFormat surface_pf;
295
295
};
296
296
 
297
297
}