Index: uspace/lib/gfx/include/gfx/bitmap.h
===================================================================
--- uspace/lib/gfx/include/gfx/bitmap.h	(revision 78a71936030962dcd5ed19c056644d59e3c7d9d1)
+++ uspace/lib/gfx/include/gfx/bitmap.h	(revision dcc4cb3152f122ace8fc51e1d0531a67547d1b8d)
@@ -43,6 +43,6 @@
 
 extern errno_t gfx_bitmap_create(gfx_context_t *, gfx_bitmap_params_t *,
-     gfx_bitmap_alloc_t *, gfx_bitmap_t **);
-extern errno_t gfx_bitmap_delete(gfx_bitmap_t *);
+    gfx_bitmap_alloc_t *, gfx_bitmap_t **);
+extern errno_t gfx_bitmap_destroy(gfx_bitmap_t *);
 extern errno_t gfx_bitmap_render(gfx_bitmap_t *, gfx_rect_t *, gfx_coord2_t *);
 extern errno_t gfx_bitmap_get_alloc(gfx_bitmap_t *, gfx_bitmap_alloc_t *);
Index: uspace/lib/gfx/include/types/gfx/ops/context.h
===================================================================
--- uspace/lib/gfx/include/types/gfx/ops/context.h	(revision 78a71936030962dcd5ed19c056644d59e3c7d9d1)
+++ uspace/lib/gfx/include/types/gfx/ops/context.h	(revision dcc4cb3152f122ace8fc51e1d0531a67547d1b8d)
@@ -52,14 +52,12 @@
 	errno_t (*fill_rect)(void *, gfx_rect_t *);
 	/** Create bitmap */
-	errno_t (*bitmap_create)(void *, gfx_bitmap_params_t *, void *,
-	    gfx_bitmap_t **);
-	/** Delete bitmap */
-	errno_t (*bitmap_delete)(void *, gfx_bitmap_t *);
+	errno_t (*bitmap_create)(void *, gfx_bitmap_params_t *,
+	    gfx_bitmap_alloc_t *, void **);
+	/** Destroy bitmap */
+	errno_t (*bitmap_destroy)(void *);
 	/** Render bitmap */
-	errno_t (*bitmap_render)(void *, gfx_bitmap_t *, gfx_rect_t *,
-	    gfx_coord2_t *);
+	errno_t (*bitmap_render)(void *, gfx_rect_t *, gfx_coord2_t *);
 	/** Get bitmap allocation info */
-	errno_t (*bitmap_get_alloc)(void *, gfx_bitmap_t *,
-	    gfx_bitmap_alloc_t *);
+	errno_t (*bitmap_get_alloc)(void *, gfx_bitmap_alloc_t *);
 } gfx_context_ops_t;
 
Index: uspace/lib/gfx/meson.build
===================================================================
--- uspace/lib/gfx/meson.build	(revision 78a71936030962dcd5ed19c056644d59e3c7d9d1)
+++ uspace/lib/gfx/meson.build	(revision dcc4cb3152f122ace8fc51e1d0531a67547d1b8d)
@@ -1,4 +1,4 @@
 #
-# Copyright (c) 2015 Jiri Svoboda
+# Copyright (c) 2019 Jiri Svoboda
 # All rights reserved.
 #
@@ -35,4 +35,5 @@
 
 test_src = files(
+	'test/bitmap.c',
 	'test/color.c',
 	'test/main.c',
Index: uspace/lib/gfx/src/bitmap.c
===================================================================
--- uspace/lib/gfx/src/bitmap.c	(revision 78a71936030962dcd5ed19c056644d59e3c7d9d1)
+++ uspace/lib/gfx/src/bitmap.c	(revision dcc4cb3152f122ace8fc51e1d0531a67547d1b8d)
@@ -55,8 +55,23 @@
     gfx_bitmap_alloc_t *alloc, gfx_bitmap_t **rbitmap)
 {
-	return gc->ops->bitmap_create(gc->arg, params, alloc, rbitmap);
+	void *bm_priv;
+	gfx_bitmap_t *bitmap;
+	errno_t rc;
+
+	bitmap = calloc(1, sizeof(gfx_bitmap_t));
+	if (bitmap == NULL)
+		return ENOMEM;
+
+	rc = gc->ops->bitmap_create(gc->arg, params, alloc, &bm_priv);
+	if (rc != EOK)
+		return rc;
+
+	bitmap->gc = gc;
+	bitmap->gc_priv = bm_priv;
+	*rbitmap = bitmap;
+	return EOK;
 }
 
-/** Delete bitmap from graphics context.
+/** Destroy bitmap from graphics context.
  *
  * @param bitmap Bitmap
@@ -64,7 +79,14 @@
  * @return EOK on success, EIO if grahic device connection was lost
  */
-errno_t gfx_bitmap_delete(gfx_bitmap_t *bitmap)
+errno_t gfx_bitmap_destroy(gfx_bitmap_t *bitmap)
 {
-	return bitmap->gc->ops->bitmap_delete(bitmap->gc->arg, bitmap);
+	errno_t rc;
+
+	rc = bitmap->gc->ops->bitmap_destroy(bitmap->gc_priv);
+	if (rc != EOK)
+		return rc;
+
+	free(bitmap);
+	return EOK;
 }
 
@@ -80,6 +102,5 @@
     gfx_coord2_t *offs)
 {
-	return bitmap->gc->ops->bitmap_render(bitmap->gc->arg, bitmap,
-	    srect, offs);
+	return bitmap->gc->ops->bitmap_render(bitmap->gc_priv, srect, offs);
 }
 
@@ -93,6 +114,5 @@
 errno_t gfx_bitmap_get_alloc(gfx_bitmap_t *bitmap, gfx_bitmap_alloc_t *alloc)
 {
-	return bitmap->gc->ops->bitmap_get_alloc(bitmap->gc->arg, bitmap,
-	    alloc);
+	return bitmap->gc->ops->bitmap_get_alloc(bitmap->gc_priv, alloc);
 }
 
Index: uspace/lib/gfx/test/bitmap.c
===================================================================
--- uspace/lib/gfx/test/bitmap.c	(revision dcc4cb3152f122ace8fc51e1d0531a67547d1b8d)
+++ uspace/lib/gfx/test/bitmap.c	(revision dcc4cb3152f122ace8fc51e1d0531a67547d1b8d)
@@ -0,0 +1,238 @@
+/*
+ * Copyright (c) 2019 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <gfx/bitmap.h>
+#include <gfx/context.h>
+#include <mem.h>
+#include <pcut/pcut.h>
+#include <stdbool.h>
+
+PCUT_INIT;
+
+PCUT_TEST_SUITE(bitmap);
+
+static errno_t testgc_bitmap_create(void *, gfx_bitmap_params_t *,
+    gfx_bitmap_alloc_t *, void **);
+static errno_t testgc_bitmap_destroy(void *);
+static errno_t testgc_bitmap_render(void *, gfx_rect_t *, gfx_coord2_t *);
+static errno_t testgc_bitmap_get_alloc(void *, gfx_bitmap_alloc_t *);
+
+static gfx_context_ops_t ops = {
+	.bitmap_create = testgc_bitmap_create,
+	.bitmap_destroy = testgc_bitmap_destroy,
+	.bitmap_render = testgc_bitmap_render,
+	.bitmap_get_alloc = testgc_bitmap_get_alloc
+};
+
+typedef struct {
+	bool bm_created;
+	bool bm_destroyed;
+	gfx_bitmap_params_t bm_params;
+	void *bm_pixels;
+	gfx_rect_t bm_srect;
+	gfx_coord2_t bm_offs;
+	bool bm_rendered;
+	bool bm_got_alloc;
+} test_gc_t;
+
+typedef struct {
+	test_gc_t *tgc;
+	gfx_bitmap_alloc_t alloc;
+	bool myalloc;
+} testgc_bitmap_t;
+
+enum {
+	alloc_pitch = 42,
+	alloc_off0 = 33
+};
+
+PCUT_TEST(create_destroy)
+{
+	errno_t rc;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+	gfx_bitmap_params_t params;
+	gfx_bitmap_t *bitmap = NULL;
+
+	memset(&tgc, 0, sizeof(tgc));
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	params.rect.p0.x = 1;
+	params.rect.p0.y = 2;
+	params.rect.p1.x = 3;
+	params.rect.p1.y = 4;
+
+	rc = gfx_bitmap_create(gc, &params, NULL, &bitmap);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(bitmap);
+	PCUT_ASSERT_TRUE(tgc.bm_created);
+	PCUT_ASSERT_EQUALS(params.rect.p0.x, tgc.bm_params.rect.p0.x);
+	PCUT_ASSERT_EQUALS(params.rect.p0.y, tgc.bm_params.rect.p0.y);
+	PCUT_ASSERT_EQUALS(params.rect.p1.x, tgc.bm_params.rect.p1.x);
+	PCUT_ASSERT_EQUALS(params.rect.p1.y, tgc.bm_params.rect.p1.y);
+
+	rc = gfx_bitmap_destroy(bitmap);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_TRUE(tgc.bm_destroyed);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+PCUT_TEST(render)
+{
+	errno_t rc;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+	gfx_bitmap_params_t params;
+	gfx_bitmap_t *bitmap = NULL;
+	gfx_rect_t srect;
+	gfx_coord2_t offs;
+
+	memset(&tgc, 0, sizeof(tgc));
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = gfx_bitmap_create(gc, &params, NULL, &bitmap);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	srect.p0.x = 1;
+	srect.p0.y = 2;
+	srect.p1.x = 3;
+	srect.p1.y = 4;
+	offs.x = 5;
+	offs.y = 6;
+
+	rc = gfx_bitmap_render(bitmap, &srect, &offs);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_TRUE(tgc.bm_rendered);
+	PCUT_ASSERT_EQUALS(srect.p0.x, tgc.bm_srect.p0.x);
+	PCUT_ASSERT_EQUALS(srect.p0.y, tgc.bm_srect.p0.y);
+	PCUT_ASSERT_EQUALS(srect.p1.x, tgc.bm_srect.p1.x);
+	PCUT_ASSERT_EQUALS(srect.p1.y, tgc.bm_srect.p1.y);
+	PCUT_ASSERT_EQUALS(offs.x, tgc.bm_offs.x);
+	PCUT_ASSERT_EQUALS(offs.y, tgc.bm_offs.y);
+
+	rc = gfx_bitmap_destroy(bitmap);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+PCUT_TEST(get_alloc)
+{
+	errno_t rc;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+	gfx_bitmap_params_t params;
+	gfx_bitmap_t *bitmap = NULL;
+	gfx_bitmap_alloc_t alloc;
+
+	memset(&tgc, 0, sizeof(tgc));
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = gfx_bitmap_create(gc, &params, NULL, &bitmap);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = gfx_bitmap_get_alloc(bitmap, &alloc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_TRUE(tgc.bm_got_alloc);
+	PCUT_ASSERT_EQUALS(alloc_pitch, alloc.pitch);
+	PCUT_ASSERT_EQUALS(alloc_off0, alloc.off0);
+	PCUT_ASSERT_EQUALS(tgc.bm_pixels, alloc.pixels);
+
+	rc = gfx_bitmap_destroy(bitmap);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+static errno_t testgc_bitmap_create(void *arg, gfx_bitmap_params_t *params,
+    gfx_bitmap_alloc_t *alloc, void **rbm)
+{
+	test_gc_t *tgc = (test_gc_t *) arg;
+	testgc_bitmap_t *tbm;
+
+	tbm = calloc(1, sizeof(testgc_bitmap_t));
+	if (tbm == NULL)
+		return ENOMEM;
+
+	if (alloc == NULL) {
+		tbm->alloc.pitch = alloc_pitch;
+		tbm->alloc.off0 = alloc_off0;
+		tbm->alloc.pixels = calloc(1, 420);
+		tbm->myalloc = true;
+		if (tbm->alloc.pixels == NULL) {
+			free(tbm);
+			return ENOMEM;
+		}
+	} else {
+		tbm->alloc = *alloc;
+	}
+
+	tbm->tgc = tgc;
+	tgc->bm_created = true;
+	tgc->bm_params = *params;
+	tgc->bm_pixels = tbm->alloc.pixels;
+	*rbm = (void *)tbm;
+	return EOK;
+}
+
+static errno_t testgc_bitmap_destroy(void *bm)
+{
+	testgc_bitmap_t *tbm = (testgc_bitmap_t *)bm;
+	if (tbm->myalloc)
+		free(tbm->alloc.pixels);
+	tbm->tgc->bm_destroyed = true;
+	free(tbm);
+	return EOK;
+}
+
+static errno_t testgc_bitmap_render(void *bm, gfx_rect_t *srect,
+    gfx_coord2_t *offs)
+{
+	testgc_bitmap_t *tbm = (testgc_bitmap_t *)bm;
+	tbm->tgc->bm_rendered = true;
+	tbm->tgc->bm_srect = *srect;
+	tbm->tgc->bm_offs = *offs;
+	return EOK;
+}
+
+static errno_t testgc_bitmap_get_alloc(void *bm, gfx_bitmap_alloc_t *alloc)
+{
+	testgc_bitmap_t *tbm = (testgc_bitmap_t *)bm;
+	*alloc = tbm->alloc;
+	tbm->tgc->bm_got_alloc = true;
+	return EOK;
+}
+
+PCUT_EXPORT(bitmap);
Index: uspace/lib/gfx/test/main.c
===================================================================
--- uspace/lib/gfx/test/main.c	(revision 78a71936030962dcd5ed19c056644d59e3c7d9d1)
+++ uspace/lib/gfx/test/main.c	(revision dcc4cb3152f122ace8fc51e1d0531a67547d1b8d)
@@ -31,4 +31,5 @@
 PCUT_INIT;
 
+PCUT_IMPORT(bitmap);
 PCUT_IMPORT(color);
 PCUT_IMPORT(render);
