您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wl_surface_commit函数代码示例

51自学网 2021-06-03 10:00:30
  C++
这篇教程C++ wl_surface_commit函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中wl_surface_commit函数的典型用法代码示例。如果您正苦于以下问题:C++ wl_surface_commit函数的具体用法?C++ wl_surface_commit怎么用?C++ wl_surface_commit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了wl_surface_commit函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: gst_wl_window_render

voidgst_wl_window_render (GstWlWindow * window, GstWlBuffer * buffer,    const GstVideoInfo * info){  if (G_UNLIKELY (info)) {    window->video_width =        gst_util_uint64_scale_int_round (info->width, info->par_n, info->par_d);    window->video_height = info->height;    wl_subsurface_set_sync (window->video_subsurface);    gst_wl_window_resize_video_surface (window, FALSE);    gst_wl_window_set_opaque (window, info);  }  if (G_LIKELY (buffer))    gst_wl_buffer_attach (buffer, window->video_surface_wrapper);  else    wl_surface_attach (window->video_surface_wrapper, NULL, 0, 0);  wl_surface_damage (window->video_surface_wrapper, 0, 0,      window->video_rectangle.w, window->video_rectangle.h);  wl_surface_commit (window->video_surface_wrapper);  if (G_UNLIKELY (info)) {    /* commit also the parent (area_surface) in order to change     * the position of the video_subsurface */    wl_surface_damage (window->area_surface_wrapper, 0, 0,        window->render_rectangle.w, window->render_rectangle.h);    wl_surface_commit (window->area_surface_wrapper);    wl_subsurface_set_desync (window->video_subsurface);  }  wl_display_flush (window->display->display);}
开发者ID:MaZderMind,项目名称:gst-plugins-bad,代码行数:34,


示例2: render_frame

void render_frame(struct swaynag *swaynag) {	if (!swaynag->run_display) {		return;	}	cairo_surface_t *recorder = cairo_recording_surface_create(			CAIRO_CONTENT_COLOR_ALPHA, NULL);	cairo_t *cairo = cairo_create(recorder);	cairo_save(cairo);	cairo_set_operator(cairo, CAIRO_OPERATOR_CLEAR);	cairo_paint(cairo);	cairo_restore(cairo);	uint32_t height = render_to_cairo(cairo, swaynag);	if (height != swaynag->height) {		zwlr_layer_surface_v1_set_size(swaynag->layer_surface, 0, height);		zwlr_layer_surface_v1_set_exclusive_zone(swaynag->layer_surface,				height);		wl_surface_commit(swaynag->surface);		wl_display_roundtrip(swaynag->display);	} else {		swaynag->current_buffer = get_next_buffer(swaynag->shm,				swaynag->buffers,				swaynag->width * swaynag->scale,				swaynag->height * swaynag->scale);		if (!swaynag->current_buffer) {			sway_log(SWAY_DEBUG, "Failed to get buffer. Skipping frame.");			goto cleanup;		}		cairo_t *shm = swaynag->current_buffer->cairo;		cairo_save(shm);		cairo_set_operator(shm, CAIRO_OPERATOR_CLEAR);		cairo_paint(shm);		cairo_restore(shm);		cairo_set_source_surface(shm, recorder, 0.0, 0.0);		cairo_paint(shm);		wl_surface_set_buffer_scale(swaynag->surface, swaynag->scale);		wl_surface_attach(swaynag->surface,				swaynag->current_buffer->buffer, 0, 0);		wl_surface_damage(swaynag->surface, 0, 0,				swaynag->width, swaynag->height);		wl_surface_commit(swaynag->surface);		wl_display_roundtrip(swaynag->display);	}cleanup:	cairo_surface_destroy(recorder);	cairo_destroy(cairo);}
开发者ID:bakunowski,项目名称:sway,代码行数:50,


示例3: gst_mfx_window_wayland_resize

static gbooleangst_mfx_window_wayland_resize (GstMfxWindow * window, guint width, guint height){  GstMfxWindowWaylandPrivate *const priv =      GST_MFX_WINDOW_WAYLAND_GET_PRIVATE (window);  GstMfxDisplayWaylandPrivate *const priv_display =      GST_MFX_DISPLAY_WAYLAND_GET_PRIVATE (GST_MFX_WINDOW_DISPLAY (window));  GST_DEBUG ("resize window, new size %ux%u", width, height);  GST_MFX_DISPLAY_LOCK (GST_MFX_WINDOW_DISPLAY (window));#ifdef USE_WESTON_4_0  if (priv->wp_viewport)    wp_viewport_set_destination (priv->wp_viewport, width, height);#else  if (priv->viewport)    wl_viewport_set_destination (priv->viewport, width, height);#endif  wl_surface_damage (priv->surface, 0, 0, width, height);  wl_surface_commit (priv->surface);  if (priv->opaque_region)    wl_region_destroy (priv->opaque_region);  priv->opaque_region = wl_compositor_create_region (priv_display->compositor);  wl_region_add (priv->opaque_region, 0, 0, width, height);  GST_MFX_DISPLAY_UNLOCK (GST_MFX_WINDOW_DISPLAY (window));  return TRUE;}
开发者ID:01org,项目名称:gstreamer-media-SDK,代码行数:33,


示例4: pointer_handle_enter

static voidpointer_handle_enter(void *data, struct wl_pointer *pointer,		     uint32_t serial, struct wl_surface *surface,		     wl_fixed_t sx, wl_fixed_t sy){	struct display *display = data;	struct wl_buffer *buffer;	struct wl_cursor *cursor = display->default_cursor;	struct wl_cursor_image *image;	if (display->window->fullscreen)		wl_pointer_set_cursor(pointer, serial, NULL, 0, 0);	else if (cursor) {		image = display->default_cursor->images[0];		buffer = wl_cursor_image_get_buffer(image);		wl_pointer_set_cursor(pointer, serial,				      display->cursor_surface,				      image->hotspot_x,				      image->hotspot_y);		wl_surface_attach(display->cursor_surface, buffer, 0, 0);		wl_surface_damage(display->cursor_surface, 0, 0,				  image->width, image->height);		wl_surface_commit(display->cursor_surface);	}}
开发者ID:rzr,项目名称:weston,代码行数:25,


示例5: gst_wl_window_set_render_rectangle

voidgst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y,    gint w, gint h){  g_return_if_fail (window != NULL);  window->render_rectangle.x = x;  window->render_rectangle.y = y;  window->render_rectangle.w = w;  window->render_rectangle.h = h;  /* position the area inside the parent - needs a parent commit to apply */  if (window->area_subsurface)    wl_subsurface_set_position (window->area_subsurface, x, y);  /* change the size of the area */  if (window->area_viewport)    wp_viewport_set_destination (window->area_viewport, w, h);  gst_wl_window_update_borders (window);  if (window->video_width != 0) {    wl_subsurface_set_sync (window->video_subsurface);    gst_wl_window_resize_video_surface (window, TRUE);  }  wl_surface_damage (window->area_surface_wrapper, 0, 0, w, h);  wl_surface_commit (window->area_surface_wrapper);  if (window->video_width != 0)    wl_subsurface_set_desync (window->video_subsurface);}
开发者ID:MaZderMind,项目名称:gst-plugins-bad,代码行数:32,


示例6: render_last_buffer

/* must be called with the render lock */static voidrender_last_buffer (GstWaylandSink * sink){  GstWlMeta *meta;  struct wl_surface *surface;  struct wl_callback *callback;  meta = gst_buffer_get_wl_meta (sink->last_buffer);  surface = gst_wl_window_get_wl_surface (sink->window);  g_atomic_int_set (&sink->redraw_pending, TRUE);  callback = wl_surface_frame (surface);  wl_callback_add_listener (callback, &frame_callback_listener, sink);  /* Here we essentially add a reference to the buffer. This represents   * the fact that the compositor is using the buffer and it should   * not return back to the pool and be reused until the compositor   * releases it. The release is handled internally in the pool */  gst_wayland_compositor_acquire_buffer (meta->pool, sink->last_buffer);  wl_surface_attach (surface, meta->wbuffer, 0, 0);  wl_surface_damage (surface, 0, 0, sink->window->surface_width,      sink->window->surface_height);  wl_surface_commit (surface);  wl_display_flush (sink->display->display);}
开发者ID:Lachann,项目名称:gst-plugins-bad,代码行数:28,


示例7: wl_compositor_create_surface

void WaylandWindow::init(){//     mClient = WaylandClient::getInstance();//     mSurface = AndroidRuntime::getWaylandClient()->surface();//wl_compositor_create_surface(mClient->getCompositor());    mSurface = wl_compositor_create_surface(WaylandClient::getInstance().getCompositor());//     mShellSurface = AndroidRuntime::getWaylandClient()->shellSurface();// wl_shell_get_shell_surface(mClient->getShell(), mSurface);    mShellSurface = wl_shell_get_shell_surface(WaylandClient::getInstance().getShell(), mSurface);    if (mShellSurface) {        wl_shell_surface_add_listener(mShellSurface, &mShellSurfaceListener, this);        wl_shell_surface_set_toplevel(mShellSurface);    } else {       ALOGW("wl_shell_get_shell_surface FAILED /n");       return;    }    wl_surface_set_user_data(mSurface, this);    wl_shell_surface_set_title(mShellSurface, "android");    wl_surface_commit(mSurface);    mNative = wl_egl_window_create(mSurface, mWidth, mHeight);    if (mNative == NULL) {        ALOGW("wl_egl_window_create FAILED /n");        return;    } else {        ALOGW("wl_egl_window_create succeded, resulting in %p /n", mNative);    }}
开发者ID:CSRedRat,项目名称:shashlik,代码行数:27,


示例8: redraw

static voidredraw(void *data, struct wl_callback *callback, uint32_t time){	struct window *window = data;	struct buffer *buffer;	buffer = window_next_buffer(window);	if (!buffer) {		fprintf(stderr,			!callback ? "Failed to create the first buffer./n" :			"Both buffers busy at redraw(). Server bug?/n");		abort();	}	/* XXX: would be nice to draw something that changes here... */	wl_surface_attach(window->surface, buffer->buffer, 0, 0);	wl_surface_damage(window->surface, 0, 0, window->width, window->height);	if (callback)		wl_callback_destroy(callback);	window->callback = wl_surface_frame(window->surface);	wl_callback_add_listener(window->callback, &frame_listener, window);	wl_surface_commit(window->surface);	buffer->busy = 1;}
开发者ID:ChristophHaag,项目名称:weston,代码行数:27,


示例9: createShellSurface

static GLFWbool createShellSurface(_GLFWwindow* window){    window->wl.shellSurface = wl_shell_get_shell_surface(_glfw.wl.shell,                                                         window->wl.surface);    if (!window->wl.shellSurface)        return GLFW_FALSE;    wl_shell_surface_add_listener(window->wl.shellSurface,                                  &shellSurfaceListener,                                  window);    if (window->wl.title)        wl_shell_surface_set_title(window->wl.shellSurface, window->wl.title);    if (window->monitor)    {        wl_shell_surface_set_fullscreen(            window->wl.shellSurface,            WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,            0,            window->monitor->wl.output);    }    else if (window->wl.maximized)    {        wl_shell_surface_set_maximized(window->wl.shellSurface, NULL);    }    else    {        wl_shell_surface_set_toplevel(window->wl.shellSurface);    }    wl_surface_commit(window->wl.surface);    return GLFW_TRUE;}
开发者ID:mcleary,项目名称:glfw,代码行数:35,


示例10: gst_wl_window_resize_video_surface

static voidgst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit){  GstVideoRectangle src, res;  /* center the video_subsurface inside area_subsurface */  src.w = window->video_width;  src.h = window->video_height;  gst_video_sink_center_rect (src, window->render_rectangle, &res, TRUE);  wl_subsurface_set_position (window->video_subsurface, res.x, res.y);  wl_viewport_set_destination (window->video_viewport, res.w, res.h);  if (commit) {    wl_surface_damage (window->video_surface, 0, 0, res.w, res.h);    wl_surface_commit (window->video_surface);  }  if (gst_wl_window_is_toplevel (window)) {    struct wl_region *region;    region = wl_compositor_create_region (window->display->compositor);    wl_region_add(region, 0, 0, window->render_rectangle.w, window->render_rectangle.h);    wl_surface_set_input_region (window->area_surface, region);    wl_region_destroy (region);  }  /* this is saved for use in wl_surface_damage */  window->surface_width = res.w;  window->surface_height = res.h;}
开发者ID:jledet,项目名称:gst-plugins-bad,代码行数:31,


示例11: setCursor

static void setCursor(const char* name){    struct wl_buffer* buffer;    struct wl_cursor* cursor;    struct wl_cursor_image* image;    struct wl_surface* surface = _glfw.wl.cursorSurface;    cursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme,                                        name);    if (!cursor)    {        _glfwInputError(GLFW_PLATFORM_ERROR,                        "Wayland: Standard cursor not found");        return;    }    image = cursor->images[0];    if (!image)        return;    buffer = wl_cursor_image_get_buffer(image);    if (!buffer)        return;    wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointerSerial,                          surface,                          image->hotspot_x,                          image->hotspot_y);    wl_surface_attach(surface, buffer, 0, 0);    wl_surface_damage(surface, 0, 0,                      image->width, image->height);    wl_surface_commit(surface);}
开发者ID:christopherp,项目名称:glfw,代码行数:32,


示例12: redraw

static voidredraw(void *data, struct wl_callback *callback, uint32_t time){	struct window *window = data;	struct buffer *buffer;	buffer = window_next_buffer(window);	if (!buffer) {		fprintf(stderr,			!callback ? "Failed to create the first buffer./n" :			"Both buffers busy at redraw(). Server bug?/n");		abort();	}	paint_pixels(buffer->shm_data, 20, window->width, window->height, time);	wl_surface_attach(window->surface, buffer->buffer, 0, 0);	wl_surface_damage(window->surface,			  20, 20, window->width - 40, window->height - 40);	if (callback)		wl_callback_destroy(callback);	window->callback = wl_surface_frame(window->surface);	wl_callback_add_listener(window->callback, &frame_listener, window);	wl_surface_commit(window->surface);	buffer->busy = 1;}
开发者ID:ErwanDouaille,项目名称:westonHack,代码行数:28,


示例13: malloc

struct window *window_setup(struct registry *registry, uint32_t width, uint32_t height, bool shell_surface) {	struct window *window = malloc(sizeof(struct window));	memset(window, 0, sizeof(struct window));	window->width = width;	window->height = height;	window->registry = registry;	window->surface = wl_compositor_create_surface(registry->compositor);	if (shell_surface) {		window->shell_surface = wl_shell_get_shell_surface(registry->shell, window->surface);		wl_shell_surface_add_listener(window->shell_surface, &surface_listener, window);		wl_shell_surface_set_toplevel(window->shell_surface);	}	if (registry->pointer) {		wl_pointer_add_listener(registry->pointer, &pointer_listener, window);	}	window->cursor.cursor_theme = wl_cursor_theme_load("default", 32, registry->shm); // TODO: let you customize this	window->cursor.cursor = wl_cursor_theme_get_cursor(window->cursor.cursor_theme, "left_ptr");	window->cursor.surface = wl_compositor_create_surface(registry->compositor);	struct wl_cursor_image *image = window->cursor.cursor->images[0];	struct wl_buffer *cursor_buf = wl_cursor_image_get_buffer(image);	wl_surface_attach(window->cursor.surface, cursor_buf, 0, 0);	wl_surface_damage(window->cursor.surface, 0, 0, image->width, image->height);	wl_surface_commit(window->cursor.surface);	return window;}
开发者ID:hooplaaa,项目名称:sway,代码行数:29,


示例14: wl_callback_done

static void wl_callback_done(void* data, struct wl_callback* callback, uint32_t time){	wlfWindow* window = data;	wlfBuffer* buffer;	struct wl_shm_pool* shm_pool;	void* shm_data;	void* free_data;	int fd;	int fdt;	if (!window->buffers[0].busy)		buffer = &window->buffers[0];	else if (!window->buffers[1].busy)		buffer = &window->buffers[1];	else		return;	if (!buffer->buffer) {		fd = shm_open("/wlfreerdp_shm", O_CREAT | O_RDWR, 0666);		fdt = ftruncate(fd, window->width * window->height * 4);		if (fdt != 0)		{			WLog_ERR(TAG, "window_redraw: could not allocate memory");			close(fd);			return;		}		shm_data = mmap(NULL, window->width * window->height * 4, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);		if (shm_data == MAP_FAILED)		{			WLog_ERR(TAG, "window_redraw: failed to memory map buffer");			close(fd);			return;		}		shm_pool = wl_shm_create_pool(window->display->shm, fd, window->width * window->height * 4);		buffer->buffer = wl_shm_pool_create_buffer(shm_pool, 0, window->width, window->height, window->width* 4, WL_SHM_FORMAT_XRGB8888);		wl_buffer_add_listener(buffer->buffer, &wl_buffer_listener, buffer);		wl_shm_pool_destroy(shm_pool);		shm_unlink("/wlfreerdp_shm");		close(fd);		free_data = buffer->shm_data;		buffer->shm_data = shm_data;		munmap(free_data, window->width * window->height * 4);	}	 /* this is the real surface data */	memcpy(buffer->shm_data, (void*) window->data, window->width * window->height * 4);	wl_surface_attach(window->surface, buffer->buffer, 0, 0);	wl_surface_damage(window->surface, 0, 0, window->width, window->height);	if (callback) wl_callback_destroy(callback);	window->callback = wl_surface_frame(window->surface);	wl_callback_add_listener(window->callback, &wl_callback_listener, window);	wl_surface_commit(window->surface);	buffer->busy = TRUE;}
开发者ID:AMV007,项目名称:FreeRDP,代码行数:59,


示例15: lock

void WaylandNativeWindow::finishSwap(){    int ret = 0;    lock();    WaylandNativeWindowBuffer *wnb = queue.front();    if (!wnb) {        wnb = m_lastBuffer;    } else {        queue.pop_front();    }    assert(wnb);    m_lastBuffer = wnb;    wnb->busy = 1;    ret = readQueue(false);    if (this->frame_callback) {        do {            ret = readQueue(true);        } while (this->frame_callback && ret != -1);    }    if (ret < 0) {        HYBRIS_TRACE_END("wayland-platform", "queueBuffer_wait_for_frame_callback", "-%p", wnb);        return;    }    if (wnb->wlbuffer == NULL)    {        wnb->wlbuffer_from_native_handle(m_android_wlegl, m_display, wl_queue);        TRACE("%p add listener with %p inside", wnb, wnb->wlbuffer);        wl_buffer_add_listener(wnb->wlbuffer, &wl_buffer_listener, this);        wl_proxy_set_queue((struct wl_proxy *) wnb->wlbuffer, this->wl_queue);    }    if (m_swap_interval > 0) {        this->frame_callback = wl_surface_frame(m_window->surface);        wl_callback_add_listener(this->frame_callback, &frame_listener, this);        wl_proxy_set_queue((struct wl_proxy *) this->frame_callback, this->wl_queue);    }    wl_surface_attach(m_window->surface, wnb->wlbuffer, 0, 0);    wl_surface_damage(m_window->surface, 0, 0, wnb->width, wnb->height);    wl_surface_commit(m_window->surface);    // Some compositors, namely Weston, queue buffer release events instead    // of sending them immediately.  If a frame event is used, this should    // not be a problem.  Without a frame event, we need to send a sync    // request to ensure that they get flushed.    wl_callback_destroy(wl_display_sync(m_display));    wl_display_flush(m_display);    fronted.push_back(wnb);    m_window->attached_width = wnb->width;    m_window->attached_height = wnb->height;    m_damage_rects = NULL;    m_damage_n_rects = 0;    unlock();}
开发者ID:aosp-hybris,项目名称:libhybris,代码行数:58,


示例16: create_window

static voidcreate_window() {    buffer = create_buffer();    wl_surface_attach(surface, buffer, 0, 0);    //wl_surface_damage(surface, 0, 0, WIDTH, HEIGHT);    wl_surface_commit(surface);}
开发者ID:darkenk,项目名称:wayland-test,代码行数:9,


示例17: hello_bind_buffer

void hello_bind_buffer(struct wl_buffer *buffer,    struct wl_shell_surface *shell_surface){    struct wl_surface *surface;    surface = wl_shell_surface_get_user_data(shell_surface);    wl_surface_attach(surface, buffer, 0, 0);    wl_surface_commit(surface);}
开发者ID:fooishbar,项目名称:hello_wayland,代码行数:9,


示例18: TRACE

int WaylandNativeWindow::postBuffer(ANativeWindowBuffer* buffer){    TRACE("");    WaylandNativeWindowBuffer *wnb = NULL;    lock();    std::list<WaylandNativeWindowBuffer *>::iterator it = post_registered.begin();    for (; it != post_registered.end(); it++)    {        if ((*it)->other == buffer)        {            wnb = (*it);            break;        }    }    unlock();    if (!wnb)    {        wnb = new WaylandNativeWindowBuffer(buffer);        wnb->common.incRef(&wnb->common);        buffer->common.incRef(&buffer->common);    }    int ret = 0;    lock();    wnb->busy = 1;    ret = readQueue(false);    unlock();    if (ret < 0) {        return ret;    }    lock();    if (wnb->wlbuffer == NULL)    {        wnb->wlbuffer_from_native_handle(m_android_wlegl, m_display, wl_queue);        TRACE("%p add listener with %p inside", wnb, wnb->wlbuffer);        wl_buffer_add_listener(wnb->wlbuffer, &wl_buffer_listener, this);        wl_proxy_set_queue((struct wl_proxy *) wnb->wlbuffer, this->wl_queue);        post_registered.push_back(wnb);    }    TRACE("%p DAMAGE AREA: %dx%d", wnb, wnb->width, wnb->height);    wl_surface_attach(m_window->surface, wnb->wlbuffer, 0, 0);    wl_surface_damage(m_window->surface, 0, 0, wnb->width, wnb->height);    wl_surface_commit(m_window->surface);    wl_display_flush(m_display);    posted.push_back(wnb);    unlock();    return NO_ERROR;}
开发者ID:aosp-hybris,项目名称:libhybris,代码行数:56,


示例19: window_render

int window_render(struct window *window) {	window->frame_cb = wl_surface_frame(window->surface);	wl_callback_add_listener(window->frame_cb, &listener, window);	wl_surface_damage(window->surface, 0, 0, window->buffer->width, window->buffer->height);	wl_surface_attach(window->surface, window->buffer->buffer, 0, 0);	wl_surface_commit(window->surface);	return 1;}
开发者ID:hooplaaa,项目名称:sway,代码行数:10,


示例20: lock

int WaylandNativeWindow::queueBuffer(BaseNativeWindowBuffer* buffer, int fenceFd){    WaylandNativeWindowBuffer *backbuf = (WaylandNativeWindowBuffer *) buffer;    int ret = 0;    lock();    backbuf->busy = 2;    unlock();    while (this->frame_callback && ret != -1)     	ret = wl_display_dispatch_queue(m_display, this->wl_queue);        if (ret < 0)	return ret;    lock();    this->frame_callback = wl_surface_frame(m_window->surface);    wl_callback_add_listener(this->frame_callback, &frame_listener, this);    wl_proxy_set_queue((struct wl_proxy *) this->frame_callback, this->wl_queue);    if (backbuf->wlbuffer == NULL)	    {	    struct wl_array ints;	    int *ints_data;	    struct android_wlegl_handle *wlegl_handle;	    buffer_handle_t handle;			    handle = backbuf->handle;	    wl_array_init(&ints);	    ints_data = (int*) wl_array_add(&ints, handle->numInts*sizeof(int));	    memcpy(ints_data, handle->data + handle->numFds, handle->numInts*sizeof(int));	    wlegl_handle = android_wlegl_create_handle(m_android_wlegl, handle->numFds, &ints);	    wl_array_release(&ints);	    for (int i = 0; i < handle->numFds; i++) {		android_wlegl_handle_add_fd(wlegl_handle, handle->data[i]);	    }	    backbuf->wlbuffer = android_wlegl_create_buffer(m_android_wlegl,			backbuf->width, backbuf->height, backbuf->stride,			backbuf->format, backbuf->usage, wlegl_handle);	    android_wlegl_handle_destroy(wlegl_handle);	    backbuf->common.incRef(&backbuf->common);	    TRACE("Add listener for %p with %p inside", backbuf, backbuf->wlbuffer);	    wl_buffer_add_listener(backbuf->wlbuffer, &wl_buffer_listener, this);	    wl_proxy_set_queue((struct wl_proxy *) backbuf->wlbuffer,				this->wl_queue);    }    wl_surface_attach(m_window->surface, backbuf->wlbuffer, 0, 0);     wl_surface_damage(m_window->surface, 0, 0, backbuf->width, backbuf->height);    wl_surface_commit(m_window->surface);    fronted.push_back(backbuf);        unlock();    return NO_ERROR;}
开发者ID:kgunn,项目名称:libhybris,代码行数:55,


示例21: Display

static void Display(vout_display_t *vd, picture_t *pic){    vout_display_sys_t *sys = vd->sys;    struct wl_display *display = sys->embed->display.wl;    struct wl_surface *surface = sys->embed->handle.wl;    wl_surface_commit(surface);    wl_display_roundtrip_queue(display, sys->eventq);    (void) pic;}
开发者ID:videolan,项目名称:vlc,代码行数:11,


示例22: clutter_wayland_handle_pointer_enter

static voidclutter_wayland_handle_pointer_enter (void *data,                                      struct wl_pointer *pointer,                                      uint32_t serial,                                      struct wl_surface *surface,                                      wl_fixed_t x, wl_fixed_t y){  ClutterInputDeviceWayland *device = data;  ClutterStageCogl          *stage_cogl;  ClutterEvent              *event;  ClutterBackend            *backend;  ClutterBackendWayland     *backend_wayland;  stage_cogl = wl_surface_get_user_data (surface);  device->pointer_focus = stage_cogl;  _clutter_input_device_set_stage (CLUTTER_INPUT_DEVICE (device),       stage_cogl->wrapper);  event = clutter_event_new (CLUTTER_ENTER);  event->crossing.stage = stage_cogl->wrapper;  event->crossing.time = 0; /* ?! */  event->crossing.x = wl_fixed_to_double(x);  event->crossing.y = wl_fixed_to_double(y);  event->crossing.source = CLUTTER_ACTOR (stage_cogl->wrapper);  event->crossing.device = CLUTTER_INPUT_DEVICE (device);  device->x = event->crossing.x;  device->y = event->crossing.y;  _clutter_event_push (event, FALSE);  /* Set the cursor to the cursor loaded at backend initialisation */  backend = clutter_get_default_backend ();  backend_wayland = CLUTTER_BACKEND_WAYLAND (backend);  wl_pointer_set_cursor (pointer,                         serial,                         backend_wayland->cursor_surface,                         backend_wayland->cursor_x,                         backend_wayland->cursor_y);  wl_surface_attach (backend_wayland->cursor_surface,                     backend_wayland->cursor_buffer,                     0,                     0);  wl_surface_damage (backend_wayland->cursor_surface,                     0,                     0,                     32, /* XXX: FFS */                     32);  wl_surface_commit (backend_wayland->cursor_surface);}
开发者ID:ChrisCummins,项目名称:clutter,代码行数:53,


示例23: setOpaqueRegion

// Makes the surface considered as XRGB instead of ARGB.static void setOpaqueRegion(_GLFWwindow* window){    struct wl_region* region;    region = wl_compositor_create_region(_glfw.wl.compositor);    if (!region)        return;    wl_region_add(region, 0, 0, window->wl.width, window->wl.height);    wl_surface_set_opaque_region(window->wl.surface, region);    wl_surface_commit(window->wl.surface);    wl_region_destroy(region);}
开发者ID:mcleary,项目名称:glfw,代码行数:14,


示例24: wl_surface_frame

void QWaylandWindow::damage(const QRect &rect){    //We have to do sync stuff before calling damage, or we might    //get a frame callback before we get the timestamp    if (!mWaitingForFrameSync) {        mFrameCallback = wl_surface_frame(mSurface);        wl_callback_add_listener(mFrameCallback,&QWaylandWindow::callbackListener,this);        mWaitingForFrameSync = true;    }    wl_surface_damage(mSurface,                      rect.x(), rect.y(), rect.width(), rect.height());    wl_surface_commit(mSurface);}
开发者ID:Distrotech,项目名称:qtwayland,代码行数:14,


示例25: wl_egl_window_resize

	void XdevLWindowWayland::setSize(const XdevLWindowSize& size) {		XdevLWindowImpl::setSize(size);		wl_egl_window_resize(m_egl.m_eglWindow, size.width, size.height, 0, 0);		glClear(GL_COLOR_BUFFER_BIT);		eglSwapBuffers(m_egl.m_eglDisplay, m_egl.m_eglSurface);		wl_region* region = wl_compositor_create_region(m_compositor);		wl_region_add(region, 0, 0, size.width, size.height);		wl_surface_set_opaque_region(m_surface, region);		wl_region_destroy(region);		wl_surface_commit(m_surface);	}
开发者ID:houzhenggang,项目名称:XdevLSDK,代码行数:15,


示例26: touch_paint

static voidtouch_paint(struct touch *touch, int32_t x, int32_t y, int32_t id){	uint32_t *p, c;	static const uint32_t colors[] = {		0xffff0000,		0xffffff00,		0xff0000ff,		0xffff00ff,		0xff00ff00,		0xff00ffff,	};	if (id < (int32_t) ARRAY_LENGTH(colors))		c = colors[id];	else		c = 0xffffffff;	if (x < 2 || x >= touch->width - 2 ||	    y < 2 || y >= touch->height - 2)		return;	p = (uint32_t *) touch->data + (x - 2) + (y - 2) * touch->width;	p[2] = c;	p += touch->width;	p[1] = c;	p[2] = c;	p[3] = c;	p += touch->width;	p[0] = c;	p[1] = c;	p[2] = c;	p[3] = c;	p[4] = c;	p += touch->width;	p[1] = c;	p[2] = c;	p[3] = c;	p += touch->width;	p[2] = c;	wl_surface_attach(touch->surface, touch->buffer, 0, 0);	wl_surface_damage(touch->surface, x - 2, y - 2, 5, 5);	/* todo: We could queue up more damage before committing, if there	 * are more input events to handle.	 */	wl_surface_commit(touch->surface);}
开发者ID:RAOF,项目名称:weston,代码行数:48,


示例27: pointer_enter

static void pointer_enter(void *data,    struct wl_pointer *wl_pointer,    uint32_t serial, struct wl_surface *surface,    wl_fixed_t surface_x, wl_fixed_t surface_y){    struct pointer_data *pointer_data;    pointer_data = wl_pointer_get_user_data(wl_pointer);    pointer_data->target_surface = surface;    wl_surface_attach(pointer_data->surface,        pointer_data->buffer, 0, 0);    wl_surface_commit(pointer_data->surface);    wl_pointer_set_cursor(wl_pointer, serial,        pointer_data->surface, pointer_data->hot_spot_x,        pointer_data->hot_spot_y);}
开发者ID:fooishbar,项目名称:hello_wayland,代码行数:16,


示例28: wl_callback_destroy

	void XdevLWindowWayland::onPaint() {		wl_callback_destroy(m_frameCallback);		XdevLWindowPosition position = getPosition();		XdevLWindowSize size = getSize();		wl_surface_damage(m_surface, position.x, position.y, size.width, size.height);		paint_pixels();		m_frameCallback = wl_surface_frame(m_surface);		wl_surface_attach(m_surface, m_buffer, 0, 0);		wl_callback_add_listener(m_frameCallback, &frame_listener, this);		wl_surface_commit(m_surface);	}
开发者ID:houzhenggang,项目名称:XdevLSDK,代码行数:16,



注:本文中的wl_surface_commit函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ wl_surface_destroy函数代码示例
C++ wl_surface_attach函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。