Enable more warning needed for Skia to build with Dawn on Linux

The new warnings are:

 - -Wdeprecated-copy
 - -Winvalid-offsetof
 - -Wpessimizing-move

And the list of warnings was sorted alphabetically.

Bug: chromium:1072449
Change-Id: I9f3eecae645455c481ecc2e0be4df350e1453907
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20381
Reviewed-by: Zhenyao Mo <zmo@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2020-04-24 17:02:53 +00:00 committed by Commit Bot service account
parent 094d1d4c05
commit 00b90ea832
5 changed files with 25 additions and 7 deletions

View File

@ -425,9 +425,16 @@ namespace dawn_wire {
ObjectHandle::ObjectHandle(ObjectId id, ObjectGeneration generation)
: id(id), generation(generation) {
}
ObjectHandle::ObjectHandle(const volatile ObjectHandle& rhs)
: id(rhs.id), generation(rhs.generation) {
}
ObjectHandle& ObjectHandle::operator=(const volatile ObjectHandle& rhs) {
id = rhs.id;
generation = rhs.generation;
return *this;
}
ObjectHandle& ObjectHandle::AssignFrom(const ObjectHandle& rhs) {
id = rhs.id;
generation = rhs.generation;

View File

@ -27,7 +27,9 @@ namespace dawn_wire {
ObjectHandle();
ObjectHandle(ObjectId id, ObjectGeneration generation);
ObjectHandle(const volatile ObjectHandle& rhs);
ObjectHandle& operator=(const volatile ObjectHandle& rhs);
// MSVC has a bug where it thinks the volatile copy assignment is a duplicate.
// Workaround this by forwarding to a different function AssignFrom.

View File

@ -90,16 +90,19 @@ config("dawn_internal") {
# Enable more warnings that were found when using Dawn in other projects
if (is_clang) {
cflags = [
"-Wstrict-prototypes",
"-Winconsistent-missing-destructor-override",
"-Wshadow-field",
"-Wmissing-field-initializers",
"-Wcstring-format-directive",
"-Wtautological-unsigned-zero-compare",
"-Wreturn-std-move-in-c++11",
"-Wconditional-uninitialized",
"-Wcstring-format-directive",
"-Wc++11-narrowing",
"-Wdeprecated-copy",
"-Wextra-semi-stmt",
"-Winconsistent-missing-destructor-override",
"-Winvalid-offsetof",
"-Wmissing-field-initializers",
"-Wpessimizing-move",
"-Wreturn-std-move-in-c++11",
"-Wshadow-field",
"-Wstrict-prototypes",
"-Wtautological-unsigned-zero-compare",
]
}
}

View File

@ -176,6 +176,10 @@ namespace utils {
}
}
ComboRenderPassDescriptor::ComboRenderPassDescriptor(const ComboRenderPassDescriptor& other) {
*this = other;
}
const ComboRenderPassDescriptor& ComboRenderPassDescriptor::operator=(
const ComboRenderPassDescriptor& otherRenderPass) {
cDepthStencilAttachmentInfo = otherRenderPass.cDepthStencilAttachmentInfo;

View File

@ -59,6 +59,8 @@ namespace utils {
public:
ComboRenderPassDescriptor(std::initializer_list<wgpu::TextureView> colorAttachmentInfo,
wgpu::TextureView depthStencil = wgpu::TextureView());
ComboRenderPassDescriptor(const ComboRenderPassDescriptor& otherRenderPass);
const ComboRenderPassDescriptor& operator=(
const ComboRenderPassDescriptor& otherRenderPass);