Apply Chromium style fixes.
This addresses several minor code quality issues that are validated
in Chromium, but not yet applied to ANGLE:
* constructors and destructors must be defined out-of-line
* auto is not allowed for simple pointer types
* use override everywhere instead of virtual
* virtual functions must also be defined out-of-line
Slightly reduces binary size for me (~2k on Win, 150k on Linux).
Bug: angleproject:1569
Change-Id: I073ca3365188caf5f29fb28d9eb207903c1843e6
Reviewed-on: https://chromium-review.googlesource.com/779959
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Program.h b/src/libANGLE/Program.h
index 0b50e15..9c815ec 100644
--- a/src/libANGLE/Program.h
+++ b/src/libANGLE/Program.h
@@ -178,10 +178,9 @@
// This small structure encapsulates binding sampler uniforms to active GL textures.
struct SamplerBinding
{
- SamplerBinding(GLenum textureTypeIn, size_t elementCount, bool unreferenced)
- : textureType(textureTypeIn), boundTextureUnits(elementCount, 0), unreferenced(unreferenced)
- {
- }
+ SamplerBinding(GLenum textureTypeIn, size_t elementCount, bool unreferenced);
+ SamplerBinding(const SamplerBinding &other);
+ ~SamplerBinding();
// Necessary for retrieving active textures from the GL state.
GLenum textureType;
@@ -218,14 +217,10 @@
struct ImageBinding
{
- ImageBinding(size_t count) : boundImageUnits(count, 0) {}
- ImageBinding(GLuint imageUnit, size_t count)
- {
- for (size_t index = 0; index < count; ++index)
- {
- boundImageUnits.push_back(imageUnit + static_cast<GLuint>(index));
- }
- }
+ ImageBinding(size_t count);
+ ImageBinding(GLuint imageUnit, size_t count);
+ ImageBinding(const ImageBinding &other);
+ ~ImageBinding();
std::vector<GLuint> boundImageUnits;
};
@@ -588,6 +583,8 @@
class Bindings final : angle::NonCopyable
{
public:
+ Bindings();
+ ~Bindings();
void bindLocation(GLuint index, const std::string &name);
int getBinding(const std::string &name) const;
@@ -616,7 +613,7 @@
using MergedVaryings = std::map<std::string, VaryingRef>;
private:
- ~Program();
+ ~Program() override;
void unlink();