mirror of
https://gitee.com/openharmony/third_party_vulkan-loader
synced 2024-12-18 12:58:10 +00:00
tests: Add CreateImage method to Device class
This commit is contained in:
parent
3825f271a2
commit
270556ef4b
@ -10,6 +10,7 @@ SET(COMMON
|
||||
SET(COMMON_CPP
|
||||
xglgpu.cpp
|
||||
xgldevice.cpp
|
||||
xglimage.cpp
|
||||
)
|
||||
|
||||
include_directories(
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user