Make dawn_wire a shared library

Also moves the TerribleCommandBuffer to utils:: because it isn't part of
the implementation of the wire, renames dawn::wire to dawn_wire, moves
src/wire to src/dawn_wire and puts the interface of dawn_wire in
src/include/dawn_wire.
This commit is contained in:
Corentin Wallez
2018-07-26 15:07:57 +02:00
committed by Corentin Wallez
parent 012c149fd9
commit bdc867713a
18 changed files with 154 additions and 112 deletions

View File

@@ -17,11 +17,11 @@
#include "common/Assert.h"
#include "common/Constants.h"
#include "common/Math.h"
#include "dawn_wire/Wire.h"
#include "utils/BackendBinding.h"
#include "utils/DawnHelpers.h"
#include "utils/SystemUtils.h"
#include "wire/TerribleCommandBuffer.h"
#include "wire/Wire.h"
#include "utils/TerribleCommandBuffer.h"
#include <iostream>
#include "GLFW/glfw3.h"
@@ -145,15 +145,15 @@ void DawnTest::SetUp() {
dawnProcTable procs;
if (gTestUsesWire) {
mC2sBuf = new dawn::wire::TerribleCommandBuffer();
mS2cBuf = new dawn::wire::TerribleCommandBuffer();
mC2sBuf = new utils::TerribleCommandBuffer();
mS2cBuf = new utils::TerribleCommandBuffer();
mWireServer = dawn::wire::NewServerCommandHandler(backendDevice, backendProcs, mS2cBuf);
mWireServer = dawn_wire::NewServerCommandHandler(backendDevice, backendProcs, mS2cBuf);
mC2sBuf->SetHandler(mWireServer);
dawnDevice clientDevice;
dawnProcTable clientProcs;
mWireClient = dawn::wire::NewClientDevice(&clientProcs, &clientDevice, mC2sBuf);
mWireClient = dawn_wire::NewClientDevice(&clientProcs, &clientDevice, mC2sBuf);
mS2cBuf->SetHandler(mWireClient);
procs = clientProcs;

View File

@@ -66,16 +66,16 @@ std::ostream& operator<<(std::ostream& stream, BackendType backend);
namespace utils {
class BackendBinding;
class TerribleCommandBuffer;
}
namespace detail {
class Expectation;
}
namespace dawn { namespace wire {
namespace dawn_wire {
class CommandHandler;
class TerribleCommandBuffer;
}} // namespace dawn::wire
} // namespace dawn_wire
class DawnTest : public ::testing::TestWithParam<BackendType> {
public:
@@ -118,10 +118,10 @@ class DawnTest : public ::testing::TestWithParam<BackendType> {
private:
// Things used to set up testing through the Wire.
dawn::wire::CommandHandler* mWireServer = nullptr;
dawn::wire::CommandHandler* mWireClient = nullptr;
dawn::wire::TerribleCommandBuffer* mC2sBuf = nullptr;
dawn::wire::TerribleCommandBuffer* mS2cBuf = nullptr;
dawn_wire::CommandHandler* mWireServer = nullptr;
dawn_wire::CommandHandler* mWireClient = nullptr;
utils::TerribleCommandBuffer* mC2sBuf = nullptr;
utils::TerribleCommandBuffer* mS2cBuf = nullptr;
void FlushWire();
// MapRead buffers used to get data for the expectations

View File

@@ -16,11 +16,11 @@
#include "mock/mock_dawn.h"
#include "common/Assert.h"
#include "wire/TerribleCommandBuffer.h"
#include "wire/Wire.h"
#include "dawn_wire/Wire.h"
#include "utils/TerribleCommandBuffer.h"
using namespace testing;
using namespace dawn::wire;
using namespace dawn_wire;
// Definition of a "Lambda predicate matcher" for GMock to allow checking deep structures
// are passed correctly by the wire.
@@ -138,8 +138,8 @@ class WireTestsBase : public Test {
}
EXPECT_CALL(api, DeviceTick(_)).Times(AnyNumber());
mS2cBuf = new TerribleCommandBuffer();
mC2sBuf = new TerribleCommandBuffer(mWireServer);
mS2cBuf = new utils::TerribleCommandBuffer();
mC2sBuf = new utils::TerribleCommandBuffer(mWireServer);
mWireServer = NewServerCommandHandler(mockDevice, mockProcs, mS2cBuf);
mC2sBuf->SetHandler(mWireServer);
@@ -181,8 +181,8 @@ class WireTestsBase : public Test {
CommandHandler* mWireServer = nullptr;
CommandHandler* mWireClient = nullptr;
TerribleCommandBuffer* mS2cBuf = nullptr;
TerribleCommandBuffer* mC2sBuf = nullptr;
utils::TerribleCommandBuffer* mS2cBuf = nullptr;
utils::TerribleCommandBuffer* mC2sBuf = nullptr;
};
class WireTests : public WireTestsBase {