tests: Add CreateImage method to Device class
authorCourtney Goeltzenleuchter <courtney@LunarG.com>
Mon, 1 Sep 2014 22:36:49 +0000 (16:36 -0600)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Tue, 2 Sep 2014 00:02:12 +0000 (18:02 -0600)
tests/CMakeLists.txt
tests/xgldevice.cpp
tests/xgldevice.h

index 1fcbf071d1e2a7d2f454d10851c809b0e5f6a155..8eee0704723df6320fc34f6e81154573aab21c3a 100644 (file)
@@ -10,6 +10,7 @@ SET(COMMON
 SET(COMMON_CPP
     xglgpu.cpp
     xgldevice.cpp
+    xglimage.cpp
    )
 
 include_directories(
index e4097b756a28ee1e48cf19909db767d0b8ec2b7e..3a62832f6216fddae4a8ae032aa3c943c21d03f9 100644 (file)
@@ -1,5 +1,7 @@
-#include "gtest-1.7.0/include/gtest/gtest.h"
+
+
 #include "xgldevice.h"
+#include "xglimage.h"
 
 XglDevice::XglDevice(XGL_UINT id, XGL_PHYSICAL_GPU obj) :
     m_flags(0),
@@ -112,3 +114,15 @@ XGL_RESULT XglDevice::AllocAndBindGpuMemory(XGL_OBJECT obj, const std::string &o
 
     return err;
 }
+
+void XglDevice::CreateImage(XGL_UINT32 w, XGL_UINT32 h,
+                 XGL_FORMAT fmt, XGL_FLAGS usage,
+                 XglImage **pImage)
+{
+    XglImage *new_image;
+
+    new_image = new XglImage(this);
+    new_image->init(w, h, fmt, usage);
+
+    *pImage = new_image;
+}
index 14e2fd3432bba2e8bdaa01448cfcd3e48189f85d..ef715c36d83f1d7b487169dbf5f246815baf4924 100644 (file)
@@ -2,6 +2,7 @@
 #define XGLDEVICE_H
 
 #include "xglgpu.h"
+class XglImage;
 
 class XglDevice : public XglGpu
 {
@@ -16,6 +17,9 @@ public:
     void get_device_queue() {get_device_queue(XGL_QUEUE_TYPE_GRAPHICS, 0);}
     XGL_RESULT AllocAndBindGpuMemory(XGL_OBJECT obj, const std::string &objName, XGL_GPU_MEMORY *pMem);
 
+    void CreateImage(XGL_UINT32 w, XGL_UINT32 h,
+                     XGL_FORMAT fmt, XGL_FLAGS usage,
+                     XglImage **pImage);
 private:
     XGL_DEVICE m_xgl_device_object;
     uint32_t m_flags;