[gtk+/wip/otte/vulkan: 18/28] vulkan: Store width/height of GskVulkanImage
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/vulkan: 18/28] vulkan: Store width/height of GskVulkanImage
- Date: Fri, 9 Dec 2016 06:28:34 +0000 (UTC)
commit 4264062798f3dbaa49b88539661732d5efe6b173
Author: Benjamin Otte <otte redhat com>
Date: Thu Dec 8 20:46:02 2016 +0100
vulkan: Store width/height of GskVulkanImage
This is to enable lazy framebuffer creation later.
gsk/gskvulkanimage.c | 16 ++++++++++++++++
gsk/gskvulkanimageprivate.h | 2 ++
2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/gsk/gskvulkanimage.c b/gsk/gskvulkanimage.c
index f57c5d5..9ba7451 100644
--- a/gsk/gskvulkanimage.c
+++ b/gsk/gskvulkanimage.c
@@ -12,6 +12,8 @@ struct _GskVulkanImage
GdkVulkanContext *vulkan;
+ gsize width;
+ gsize height;
VkImage vk_image;
VkImageView vk_image_view;
@@ -34,6 +36,8 @@ gsk_vulkan_image_new (GdkVulkanContext *context,
self = g_object_new (GSK_TYPE_VULKAN_IMAGE, NULL);
self->vulkan = g_object_ref (context);
+ self->width = width;
+ self->height = height;
GSK_VK_CHECK (vkCreateImage, gdk_vulkan_context_get_device (context),
&(VkImageCreateInfo) {
@@ -360,6 +364,18 @@ gsk_vulkan_image_init (GskVulkanImage *self)
{
}
+gsize
+gsk_vulkan_image_get_width (GskVulkanImage *self)
+{
+ return self->width;
+}
+
+gsize
+gsk_vulkan_image_get_height (GskVulkanImage *self)
+{
+ return self->height;
+}
+
VkImage
gsk_vulkan_image_get_image (GskVulkanImage *self)
{
diff --git a/gsk/gskvulkanimageprivate.h b/gsk/gskvulkanimageprivate.h
index a706a41..9b02893 100644
--- a/gsk/gskvulkanimageprivate.h
+++ b/gsk/gskvulkanimageprivate.h
@@ -16,6 +16,8 @@ GskVulkanImage * gsk_vulkan_image_new_from_data (GdkVulk
gsize height,
gsize stride);
+gsize gsk_vulkan_image_get_width (GskVulkanImage *self);
+gsize gsk_vulkan_image_get_height (GskVulkanImage *self);
VkImage gsk_vulkan_image_get_image (GskVulkanImage *self);
VkImageView gsk_vulkan_image_get_image_view (GskVulkanImage *self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]