Beispiel #1
0
struct ClientWithSurface client_with_surface(bool setup_surface_with_egl)
{
	struct ClientWithSurface cs;

	cs.client = sf_client_create();

	if (!cs.client) {
		printf("Problem creating client ... aborting now.");
		return cs;
	}

	static const size_t primary_display = 0;

	DestWidth = sf_get_display_width(primary_display);
	DestHeight = sf_get_display_height(primary_display);
	printf("Primary display width: %f, height: %f\n", DestWidth, DestHeight);

	SfSurfaceCreationParameters params = {
		0,
		0,
		DestWidth,
		DestHeight,
		-1, //PIXEL_FORMAT_RGBA_8888,
		15000,
		0.5f,
		setup_surface_with_egl, // Do not associate surface with egl, will be done by camera HAL
		"MediaCompatLayerTestSurface"
	};

	cs.surface = sf_surface_create(cs.client, &params);

	if (!cs.surface) {
		printf("Problem creating surface ... aborting now.");
		return cs;
	}

	sf_surface_make_current(cs.surface);

	return cs;
}
EGLNativeWindowType
SurfaceFlingerBackend::createWindow(int width, int height)
{
    SfSurfaceCreationParameters params = {
            0,
            0,
            width,
            height,
            HYBRIS_PIXEL_FORMAT_RGBA_8888, //PIXEL_FORMAT_RGBA_8888
            INT_MAX, //layer position
            1.0f, //opacity
            0, //create_egl_window_surface
            "qt5-qpa-plugin"
    };

    sf_surface = sf_surface_create(sf_client, &params);
    SF_PLUGIN_ASSERT_NOT_NULL(sf_surface);
    
    //sf_surface_make_current(sf_surface);
    
    return sf_surface_get_egl_native_window(sf_surface);
}