}
}
+std::shared_ptr<stSize> DSBufferTBMImpl::getSize()
+{
+ std::shared_ptr<stSize> bufferSize = std::make_shared<stSize>();
+ bufferSize->w = __width;
+ bufferSize->h = __height;
+
+ return bufferSize;
+}
+
tbm_format DSBufferTBMImpl::getTBMFormat(const IDSBuffer::Format &format)
{
tbm_format tformat = 0; // what is the error format?
void setClientDestroyed() override;
void ref() override;
void unref() override;
+ std::shared_ptr<stSize> getSize() override;
static tbm_format getTBMFormat(const IDSBuffer::Format &format);
static IDSBuffer::Format getBufferFormat(const tbm_format &tformat);
#ifndef __I_DS_BUFFER_H_
#define __I_DS_BUFFER_H_
+#include "DSCore.h"
+#include "DSStruct.h"
+
namespace display_server
{
virtual void setClientDestroyed() = 0;
virtual void ref() = 0;
virtual void unref() = 0;
+ virtual std::shared_ptr<stSize> getSize() = 0;
};
}
{
public:
void SetUp(void) override
- {}
+ {
+ setenv("XDG_RUNTIME_DIR", "/run", 1);
+ }
void TearDown(void) override
- {}
+ {
+ unsetenv("XDG_RUNTIME_DIR");
+ }
};
TEST_F(DSBufferTBMImplTest, CreateBuffer)
{
- std::unique_ptr<IDSBuffer> buffer = std::make_unique<DSBufferTBMImpl>(100, 100, IDSBuffer::FORMAT_ARGB8888);
+ std::unique_ptr<IDSBuffer> buffer = std::make_unique<DSBufferTBMImpl>(100, 200, IDSBuffer::FORMAT_ARGB8888);
EXPECT_TRUE(buffer.get() != nullptr);
+
+ std::shared_ptr<stSize> size = buffer->getSize();
+ EXPECT_TRUE(size->w == 100);
+ EXPECT_TRUE(size->h == 200);
}
TEST_F(DSBufferTBMImplTest, CreateBufferQueue)