tests: Add CreateImage method to Device class

This commit is contained in:
Courtney Goeltzenleuchter 2014-09-01 16:36:49 -06:00
parent 3825f271a2
commit 270556ef4b
3 changed files with 20 additions and 1 deletions

View File

@ -10,6 +10,7 @@ SET(COMMON
SET(COMMON_CPP
xglgpu.cpp
xgldevice.cpp
xglimage.cpp
)
include_directories(

View 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;
}

View 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;