[chromium-style] Fixup a few chromium-style issues.
This CL fixes a few missing overrides and updates some `auto`'s to have a `*` on them. Bug: dawn:1405 Change-Id: I621cd35fb10d8308a5831db11c22a3595e52e295 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89120 Reviewed-by: Ben Clayton <bclayton@google.com> Auto-Submit: Dan Sinclair <dsinclair@chromium.org> Commit-Queue: Dan Sinclair <dsinclair@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
abd1840550
commit
d84daed72c
|
@ -33,7 +33,7 @@ class DeviceBase;
|
||||||
class AdapterBase : public RefCounted {
|
class AdapterBase : public RefCounted {
|
||||||
public:
|
public:
|
||||||
AdapterBase(InstanceBase* instance, wgpu::BackendType backend);
|
AdapterBase(InstanceBase* instance, wgpu::BackendType backend);
|
||||||
virtual ~AdapterBase() = default;
|
~AdapterBase() override = default;
|
||||||
|
|
||||||
MaybeError Initialize();
|
MaybeError Initialize();
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ class InstanceBase final : public RefCounted {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
InstanceBase() = default;
|
InstanceBase() = default;
|
||||||
~InstanceBase() = default;
|
~InstanceBase() override = default;
|
||||||
|
|
||||||
InstanceBase(const InstanceBase& other) = delete;
|
InstanceBase(const InstanceBase& other) = delete;
|
||||||
InstanceBase& operator=(const InstanceBase& other) = delete;
|
InstanceBase& operator=(const InstanceBase& other) = delete;
|
||||||
|
|
|
@ -154,7 +154,7 @@ SyncScopeResourceUsage SyncScopeUsageTracker::AcquireSyncScopeUsage() {
|
||||||
result.textureUsages.push_back(std::move(usage));
|
result.textureUsages.push_back(std::move(usage));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& it : mExternalTextureUsages) {
|
for (auto* const it : mExternalTextureUsages) {
|
||||||
result.externalTextures.push_back(it);
|
result.externalTextures.push_back(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Device;
|
||||||
class VulkanInstance : public RefCounted {
|
class VulkanInstance : public RefCounted {
|
||||||
public:
|
public:
|
||||||
static ResultOrError<Ref<VulkanInstance>> Create(const InstanceBase* instance, ICD icd);
|
static ResultOrError<Ref<VulkanInstance>> Create(const InstanceBase* instance, ICD icd);
|
||||||
~VulkanInstance();
|
~VulkanInstance() override;
|
||||||
|
|
||||||
const VulkanFunctions& GetFunctions() const;
|
const VulkanFunctions& GetFunctions() const;
|
||||||
VkInstance GetVkInstance() const;
|
VkInstance GetVkInstance() const;
|
||||||
|
|
|
@ -45,7 +45,7 @@ class DescriptorSetAllocator : public ObjectBase {
|
||||||
private:
|
private:
|
||||||
DescriptorSetAllocator(BindGroupLayout* layout,
|
DescriptorSetAllocator(BindGroupLayout* layout,
|
||||||
std::map<VkDescriptorType, uint32_t> descriptorCountPerType);
|
std::map<VkDescriptorType, uint32_t> descriptorCountPerType);
|
||||||
~DescriptorSetAllocator();
|
~DescriptorSetAllocator() override;
|
||||||
|
|
||||||
MaybeError AllocateDescriptorPool();
|
MaybeError AllocateDescriptorPool();
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace dawn::native::vulkan {
|
||||||
class ResourceHeap : public ResourceHeapBase {
|
class ResourceHeap : public ResourceHeapBase {
|
||||||
public:
|
public:
|
||||||
ResourceHeap(VkDeviceMemory memory, size_t memoryType);
|
ResourceHeap(VkDeviceMemory memory, size_t memoryType);
|
||||||
~ResourceHeap() = default;
|
~ResourceHeap() override = default;
|
||||||
|
|
||||||
VkDeviceMemory GetMemory() const;
|
VkDeviceMemory GetMemory() const;
|
||||||
size_t GetMemoryType() const;
|
size_t GetMemoryType() const;
|
||||||
|
|
|
@ -790,7 +790,7 @@ extern template class ExpectBetweenColors<RGBA8>;
|
||||||
|
|
||||||
class CustomTextureExpectation : public Expectation {
|
class CustomTextureExpectation : public Expectation {
|
||||||
public:
|
public:
|
||||||
virtual ~CustomTextureExpectation() = default;
|
~CustomTextureExpectation() override = default;
|
||||||
virtual uint32_t DataSize() = 0;
|
virtual uint32_t DataSize() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
class OpArrayLengthTest : public DawnTest {
|
class OpArrayLengthTest : public DawnTest {
|
||||||
protected:
|
protected:
|
||||||
void SetUp() {
|
void SetUp() override {
|
||||||
DawnTest::SetUp();
|
DawnTest::SetUp();
|
||||||
|
|
||||||
// Create buffers of various size to check the length() implementation
|
// Create buffers of various size to check the length() implementation
|
||||||
|
|
|
@ -45,7 +45,7 @@ struct RCTestDerived : public RCTest {
|
||||||
// Test that RCs start with one ref, and removing it destroys the object.
|
// Test that RCs start with one ref, and removing it destroys the object.
|
||||||
TEST(RefCounted, StartsWithOneRef) {
|
TEST(RefCounted, StartsWithOneRef) {
|
||||||
bool deleted = false;
|
bool deleted = false;
|
||||||
auto test = new RCTest(&deleted);
|
auto* test = new RCTest(&deleted);
|
||||||
|
|
||||||
test->Release();
|
test->Release();
|
||||||
EXPECT_TRUE(deleted);
|
EXPECT_TRUE(deleted);
|
||||||
|
@ -54,7 +54,7 @@ TEST(RefCounted, StartsWithOneRef) {
|
||||||
// Test adding refs keep the RC alive.
|
// Test adding refs keep the RC alive.
|
||||||
TEST(RefCounted, AddingRefKeepsAlive) {
|
TEST(RefCounted, AddingRefKeepsAlive) {
|
||||||
bool deleted = false;
|
bool deleted = false;
|
||||||
auto test = new RCTest(&deleted);
|
auto* test = new RCTest(&deleted);
|
||||||
|
|
||||||
test->Reference();
|
test->Reference();
|
||||||
test->Release();
|
test->Release();
|
||||||
|
|
|
@ -19,7 +19,7 @@ class Placeholder : public RefCounted {
|
||||||
explicit Placeholder(int* alive) : mAlive(alive) { ++*mAlive; }
|
explicit Placeholder(int* alive) : mAlive(alive) { ++*mAlive; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
~Placeholder() { --*mAlive; }
|
~Placeholder() override { --*mAlive; }
|
||||||
|
|
||||||
int* const mAlive;
|
int* const mAlive;
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,7 +41,7 @@ TEST(ToBackend, Pointers) {
|
||||||
MyAdapter* adapter = new MyAdapter;
|
MyAdapter* adapter = new MyAdapter;
|
||||||
const AdapterBase* base = adapter;
|
const AdapterBase* base = adapter;
|
||||||
|
|
||||||
auto backendAdapter = ToBackend(base);
|
auto* backendAdapter = ToBackend(base);
|
||||||
static_assert(std::is_same<decltype(backendAdapter), const MyAdapter*>::value);
|
static_assert(std::is_same<decltype(backendAdapter), const MyAdapter*>::value);
|
||||||
ASSERT_EQ(adapter, backendAdapter);
|
ASSERT_EQ(adapter, backendAdapter);
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ TEST(ToBackend, Pointers) {
|
||||||
MyAdapter* adapter = new MyAdapter;
|
MyAdapter* adapter = new MyAdapter;
|
||||||
AdapterBase* base = adapter;
|
AdapterBase* base = adapter;
|
||||||
|
|
||||||
auto backendAdapter = ToBackend(base);
|
auto* backendAdapter = ToBackend(base);
|
||||||
static_assert(std::is_same<decltype(backendAdapter), MyAdapter*>::value);
|
static_assert(std::is_same<decltype(backendAdapter), MyAdapter*>::value);
|
||||||
ASSERT_EQ(adapter, backendAdapter);
|
ASSERT_EQ(adapter, backendAdapter);
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,7 @@ WGPUDevice ValidationTest::CreateTestDevice() {
|
||||||
// static
|
// static
|
||||||
void ValidationTest::OnDeviceError(WGPUErrorType type, const char* message, void* userdata) {
|
void ValidationTest::OnDeviceError(WGPUErrorType type, const char* message, void* userdata) {
|
||||||
ASSERT(type != WGPUErrorType_NoError);
|
ASSERT(type != WGPUErrorType_NoError);
|
||||||
auto self = static_cast<ValidationTest*>(userdata);
|
auto* self = static_cast<ValidationTest*>(userdata);
|
||||||
self->mDeviceErrorMessage = message;
|
self->mDeviceErrorMessage = message;
|
||||||
|
|
||||||
ASSERT_TRUE(self->mExpectError) << "Got unexpected device error: " << message;
|
ASSERT_TRUE(self->mExpectError) << "Got unexpected device error: " << message;
|
||||||
|
@ -243,7 +243,7 @@ void ValidationTest::OnDeviceError(WGPUErrorType type, const char* message, void
|
||||||
void ValidationTest::OnDeviceLost(WGPUDeviceLostReason reason,
|
void ValidationTest::OnDeviceLost(WGPUDeviceLostReason reason,
|
||||||
const char* message,
|
const char* message,
|
||||||
void* userdata) {
|
void* userdata) {
|
||||||
auto self = static_cast<ValidationTest*>(userdata);
|
auto* self = static_cast<ValidationTest*>(userdata);
|
||||||
if (self->mExpectDestruction) {
|
if (self->mExpectDestruction) {
|
||||||
EXPECT_EQ(reason, WGPUDeviceLostReason_Destroyed);
|
EXPECT_EQ(reason, WGPUDeviceLostReason_Destroyed);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -48,7 +48,7 @@ void* WireDeserializeAllocator::GetSpace(size_t size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WireDeserializeAllocator::Reset() {
|
void WireDeserializeAllocator::Reset() {
|
||||||
for (auto allocation : mAllocations) {
|
for (auto* allocation : mAllocations) {
|
||||||
free(allocation);
|
free(allocation);
|
||||||
}
|
}
|
||||||
mAllocations.clear();
|
mAllocations.clear();
|
||||||
|
|
|
@ -28,7 +28,7 @@ class NoopCommandSerializer final : public CommandSerializer {
|
||||||
return &gNoopCommandSerializer;
|
return &gNoopCommandSerializer;
|
||||||
}
|
}
|
||||||
|
|
||||||
~NoopCommandSerializer() = default;
|
~NoopCommandSerializer() override = default;
|
||||||
|
|
||||||
size_t GetMaximumAllocationSize() const final { return 0; }
|
size_t GetMaximumAllocationSize() const final { return 0; }
|
||||||
void* GetCmdSpace(size_t size) final { return nullptr; }
|
void* GetCmdSpace(size_t size) final { return nullptr; }
|
||||||
|
|
|
@ -254,7 +254,7 @@ bool Device::OnCreateComputePipelineAsyncCallback(uint64_t requestSerial,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pipelineAllocation =
|
auto* pipelineAllocation =
|
||||||
client->ComputePipelineAllocator().GetObject(request.pipelineObjectID);
|
client->ComputePipelineAllocator().GetObject(request.pipelineObjectID);
|
||||||
|
|
||||||
// If the return status is a failure we should give a null pipeline to the callback and
|
// If the return status is a failure we should give a null pipeline to the callback and
|
||||||
|
@ -305,7 +305,8 @@ bool Device::OnCreateRenderPipelineAsyncCallback(uint64_t requestSerial,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pipelineAllocation = client->RenderPipelineAllocator().GetObject(request.pipelineObjectID);
|
auto* pipelineAllocation =
|
||||||
|
client->RenderPipelineAllocator().GetObject(request.pipelineObjectID);
|
||||||
|
|
||||||
// If the return status is a failure we should give a null pipeline to the callback and
|
// If the return status is a failure we should give a null pipeline to the callback and
|
||||||
// free the allocation.
|
// free the allocation.
|
||||||
|
|
Loading…
Reference in New Issue