Commit b4efc051 by Jamie Madill Committed by Commit Bot

Enable -Wdeprecated-copy.

This is another warning turned on in Skia. It enforces an explicit copy assignment operator in some implicitly-generated cases. It caught one potential error in SubresourceUpdate. Bug: skia:7647 Change-Id: Ia501f619cf7f3d2e8647cdbbda2936f51f9721ba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2381953 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 5fde632c
......@@ -145,6 +145,7 @@ config("extra_warnings") {
cflags += [
"-Wbad-function-cast",
"-Wconditional-uninitialized",
"-Wdeprecated-copy",
"-Wextra-semi-stmt",
"-Wfloat-conversion",
"-Winconsistent-missing-destructor-override",
......
......@@ -137,6 +137,8 @@ Extensions::Extensions() = default;
Extensions::Extensions(const Extensions &other) = default;
Extensions &Extensions::operator=(const Extensions &other) = default;
std::vector<std::string> Extensions::getStrings() const
{
std::vector<std::string> extensionStrings;
......@@ -1048,6 +1050,8 @@ TypePrecision::TypePrecision() = default;
TypePrecision::TypePrecision(const TypePrecision &other) = default;
TypePrecision &TypePrecision::operator=(const TypePrecision &other) = default;
void TypePrecision::setIEEEFloat()
{
range = {{127, 127}};
......
......@@ -95,6 +95,8 @@ struct Extensions
Extensions();
Extensions(const Extensions &other);
Extensions &operator=(const Extensions &other);
// Generate a vector of supported extension strings
std::vector<std::string> getStrings() const;
......@@ -696,6 +698,8 @@ struct TypePrecision
TypePrecision();
TypePrecision(const TypePrecision &other);
TypePrecision &operator=(const TypePrecision &other);
void setIEEEFloat();
void setTwosComplementInt(unsigned int bits);
void setSimulatedFloat(unsigned int range, unsigned int precision);
......
......@@ -51,6 +51,8 @@ ClipPlaneParameters::ClipPlaneParameters(bool enabled, const angle::Vector4 &equ
ClipPlaneParameters::ClipPlaneParameters(const ClipPlaneParameters &other) = default;
ClipPlaneParameters &ClipPlaneParameters::operator=(const ClipPlaneParameters &other) = default;
GLES1State::GLES1State()
: mGLState(nullptr),
mVertexArrayEnabled(false),
......
......@@ -135,6 +135,7 @@ struct ClipPlaneParameters
ClipPlaneParameters();
ClipPlaneParameters(bool enabled, const angle::Vector4 &equation);
ClipPlaneParameters(const ClipPlaneParameters &other);
ClipPlaneParameters &operator=(const ClipPlaneParameters &other);
bool enabled;
angle::Vector4 equation;
......
......@@ -143,6 +143,8 @@ SamplerState::SamplerState()
SamplerState::SamplerState(const SamplerState &other) = default;
SamplerState &SamplerState::operator=(const SamplerState &other) = default;
// static
SamplerState SamplerState::CreateDefaultForTarget(TextureType type)
{
......
......@@ -251,6 +251,8 @@ class SamplerState final
SamplerState();
SamplerState(const SamplerState &other);
SamplerState &operator=(const SamplerState &other);
static SamplerState CreateDefaultForTarget(TextureType type);
GLenum getMinFilter() const { return mMinFilter; }
......
......@@ -359,6 +359,8 @@ InternalFormat::InternalFormat()
InternalFormat::InternalFormat(const InternalFormat &other) = default;
InternalFormat &InternalFormat::operator=(const InternalFormat &other) = default;
bool InternalFormat::isLUMA() const
{
return ((redBits + greenBits + blueBits + depthBits + stencilBits) == 0 &&
......
......@@ -136,6 +136,7 @@ struct InternalFormat
{
InternalFormat();
InternalFormat(const InternalFormat &other);
InternalFormat &operator=(const InternalFormat &other);
GLuint computePixelBytes(GLenum formatType) const;
......
......@@ -5127,6 +5127,25 @@ ImageHelper::SubresourceUpdate::SubresourceUpdate(const SubresourceUpdate &other
}
}
ImageHelper::SubresourceUpdate &ImageHelper::SubresourceUpdate::operator=(
const SubresourceUpdate &other)
{
updateSource = other.updateSource;
if (updateSource == UpdateSource::Clear)
{
clear = other.clear;
}
else if (updateSource == UpdateSource::Buffer)
{
buffer = other.buffer;
}
else
{
image = other.image;
}
return *this;
}
void ImageHelper::SubresourceUpdate::release(RendererVk *renderer)
{
if (updateSource == UpdateSource::Image)
......
......@@ -1594,6 +1594,8 @@ class ImageHelper final : public Resource, public angle::Subject
const gl::ImageIndex &imageIndex);
SubresourceUpdate(const SubresourceUpdate &other);
SubresourceUpdate &operator=(const SubresourceUpdate &other);
void release(RendererVk *renderer);
bool isUpdateToLayerLevel(uint32_t layerIndex, uint32_t levelIndexGL) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment