]> git.sesse.net Git - movit/commitdiff
Use C++11 override everywhere it is appropriate.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 23 Nov 2017 17:50:14 +0000 (18:50 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 23 Nov 2017 17:50:14 +0000 (18:50 +0100)
39 files changed:
alpha_division_effect.h
alpha_multiplication_effect.h
blur_effect.h
colorspace_conversion_effect.h
complex_modulate_effect.h
deconvolution_sharpen_effect.h
deinterlace_effect.h
diffusion_effect.h
dither_effect.h
effect_chain.cpp
effect_chain_test.cpp
fft_convolution_effect.h
fft_input.h
fft_pass_effect.h
flat_input.h
gamma_compression_effect.h
gamma_expansion_effect.h
glow_effect.h
input.h
lift_gamma_gain_effect.h
luma_mix_effect.h
mirror_effect.h
mix_effect.h
multiply_effect.h
overlay_effect.h
padding_effect.h
resample_effect.h
resize_effect.h
sandbox_effect.h
saturation_effect.h
slice_effect.h
unsharp_mask_effect.h
vignette_effect.h
white_balance_effect.h
ycbcr_422interleaved_input.h
ycbcr_422interleaved_input_test.cpp
ycbcr_conversion_effect.h
ycbcr_input.h
ycbcr_input_test.cpp

index 2fd90820615269edad7a7655030c69d57ea01398..92581710c0c739c418dbc342683f85be10b4e03a 100644 (file)
@@ -12,9 +12,9 @@ namespace movit {
 class AlphaDivisionEffect : public Effect {
 public:
        AlphaDivisionEffect() {}
-       virtual std::string effect_type_id() const { return "AlphaDivisionEffect"; }
-       std::string output_fragment_shader();
-       virtual bool one_to_one_sampling() const { return true; }
+       std::string effect_type_id() const override { return "AlphaDivisionEffect"; }
+       std::string output_fragment_shader() override;
+       bool one_to_one_sampling() const override { return true; }
 };
 
 }  // namespace movit
index f342719c5987b0e3304e5b0782811829b3680faa..85f08f87d1fac288ee87c2371579e2c38137671b 100644 (file)
@@ -12,9 +12,9 @@ namespace movit {
 class AlphaMultiplicationEffect : public Effect {
 public:
        AlphaMultiplicationEffect() {}
-       virtual std::string effect_type_id() const { return "AlphaMultiplicationEffect"; }
-       std::string output_fragment_shader();
-       virtual bool one_to_one_sampling() const { return true; }
+       std::string effect_type_id() const override { return "AlphaMultiplicationEffect"; }
+       std::string output_fragment_shader() override;
+       bool one_to_one_sampling() const override { return true; }
 };
 
 }  // namespace movit
index 69bd663cd27b9b518497a35998d06a6a5260d93e..6224ac36c5110b7b892cfd4d86fa8f7e526576b9 100644 (file)
@@ -31,26 +31,26 @@ class BlurEffect : public Effect {
 public:
        BlurEffect();
 
-       virtual std::string effect_type_id() const { return "BlurEffect"; }
+       std::string effect_type_id() const override { return "BlurEffect"; }
 
        // We want this for the same reason as ResizeEffect; we could end up scaling
        // down quite a lot.
-       virtual bool needs_texture_bounce() const { return true; }
-       virtual bool needs_mipmaps() const { return true; }
-       virtual bool needs_srgb_primaries() const { return false; }
+       bool needs_texture_bounce() const override { return true; }
+       bool needs_mipmaps() const override { return true; }
+       bool needs_srgb_primaries() const override { return false; }
 
-       virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height);
+       void inform_input_size(unsigned input_num, unsigned width, unsigned height) override;
 
-       virtual std::string output_fragment_shader() {
+       std::string output_fragment_shader() override {
                assert(false);
        }
-       virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) {
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override {
                assert(false);
        }
 
-       virtual void rewrite_graph(EffectChain *graph, Node *self);
-       virtual bool set_float(const std::string &key, float value);
-       virtual bool set_int(const std::string &key, int value);
+       void rewrite_graph(EffectChain *graph, Node *self) override;
+       bool set_float(const std::string &key, float value) override;
+       bool set_int(const std::string &key, int value) override;
        
 private:
        void update_radius();
@@ -67,33 +67,33 @@ public:
        // so that it can make reasonable decisions for both blur passes.
        SingleBlurPassEffect(BlurEffect *parent);
        virtual ~SingleBlurPassEffect();
-       virtual std::string effect_type_id() const { return "SingleBlurPassEffect"; }
+       std::string effect_type_id() const override { return "SingleBlurPassEffect"; }
 
-       std::string output_fragment_shader();
+       std::string output_fragment_shader() override;
 
-       virtual bool needs_texture_bounce() const { return true; }
-       virtual bool needs_mipmaps() const { return true; }
-       virtual bool needs_srgb_primaries() const { return false; }
-       virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
+       bool needs_texture_bounce() const override { return true; }
+       bool needs_mipmaps() const override { return true; }
+       bool needs_srgb_primaries() const override { return false; }
+       AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
 
-       virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height) {
+       void inform_input_size(unsigned input_num, unsigned width, unsigned height) override {
                if (parent != nullptr) {
                        parent->inform_input_size(input_num, width, height);
                }
        }
-       virtual bool changes_output_size() const { return true; }
-       virtual bool sets_virtual_output_size() const { return true; }
-       virtual bool one_to_one_sampling() const { return false; }  // Can sample outside the border.
+       bool changes_output_size() const override { return true; }
+       bool sets_virtual_output_size() const override { return true; }
+       bool one_to_one_sampling() const override { return false; }  // Can sample outside the border.
 
-       virtual void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const {
+       void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const override {
                *width = this->width;
                *height = this->height;
                *virtual_width = this->virtual_width;
                *virtual_height = this->virtual_height;
        }
 
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
-       void clear_gl_state();
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
+       void clear_gl_state() override;
        
        enum Direction { HORIZONTAL = 0, VERTICAL = 1 };
 
index 92bad1f7d7eb1ec5f7c65633d8eda34856d2e212..d8754654d6d2b5023fa669197c617389cb40933a 100644 (file)
@@ -23,12 +23,12 @@ private:
        friend class EffectChain;
 
 public:
-       virtual std::string effect_type_id() const { return "ColorspaceConversionEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "ColorspaceConversionEffect"; }
+       std::string output_fragment_shader() override;
 
-       virtual bool needs_srgb_primaries() const { return false; }
-       virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
-       virtual bool one_to_one_sampling() const { return true; }
+       bool needs_srgb_primaries() const override { return false; }
+       AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
+       bool one_to_one_sampling() const override { return true; }
 
        // Get a conversion matrix from the given color space to XYZ.
        static Eigen::Matrix3d get_xyz_matrix(Colorspace space);
index 335c90010754cbe197b5bf9fe58c33a2e2b1f553..45f8dde4c400f5ecc745d6d8bf1acbddacbe4bbb 100644 (file)
@@ -33,23 +33,23 @@ class EffectChain;
 class ComplexModulateEffect : public Effect {
 public:
        ComplexModulateEffect();
-       virtual std::string effect_type_id() const { return "ComplexModulateEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "ComplexModulateEffect"; }
+       std::string output_fragment_shader() override;
 
        // Technically we only need texture bounce for the second input
        // (to be allowed to mess with its sampler state), but there's
        // no way of expressing that currently.
-       virtual bool needs_texture_bounce() const { return true; }
-       virtual bool changes_output_size() const { return true; }
-       virtual bool sets_virtual_output_size() const { return false; }
+       bool needs_texture_bounce() const override { return true; }
+       bool changes_output_size() const override { return true; }
+       bool sets_virtual_output_size() const override { return false; }
 
-       virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height);
-       virtual void get_output_size(unsigned *width, unsigned *height,
-                                    unsigned *virtual_width, unsigned *virtual_height) const;
-       virtual unsigned num_inputs() const { return 2; }
-       virtual void inform_added(EffectChain *chain) { this->chain = chain; }
+       void inform_input_size(unsigned input_num, unsigned width, unsigned height) override;
+       void get_output_size(unsigned *width, unsigned *height,
+                            unsigned *virtual_width, unsigned *virtual_height) const override;
+       unsigned num_inputs() const override { return 2; }
+       void inform_added(EffectChain *chain) override { this->chain = chain; }
 
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
 
 private:
        EffectChain *chain;
index c2ccbcb608ccd7916d7bf3763712bef2b06bc348..d7800dff71ce944571d3463a7b34df7b5b8c7f7b 100644 (file)
@@ -31,20 +31,20 @@ class DeconvolutionSharpenEffect : public Effect {
 public:
        DeconvolutionSharpenEffect();
        virtual ~DeconvolutionSharpenEffect();
-       virtual std::string effect_type_id() const { return "DeconvolutionSharpenEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "DeconvolutionSharpenEffect"; }
+       std::string output_fragment_shader() override;
 
        // Samples a lot of times from its input.
-       virtual bool needs_texture_bounce() const { return true; }
+       bool needs_texture_bounce() const override { return true; }
 
-       virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height)
+       void inform_input_size(unsigned input_num, unsigned width, unsigned height) override
        {
                this->width = width;
                this->height = height;
        }
 
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
-       virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
+       AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
 
 private:
        // Input size.
index 5841f86767a512ef904766b841a46321c1616894..773d6ad2e315716ae26a0bdc922be56500136ae2 100644 (file)
@@ -64,15 +64,15 @@ class DeinterlaceComputeEffect;
 class DeinterlaceEffect : public Effect {
 public:
        DeinterlaceEffect();
-       virtual std::string effect_type_id() const { return "DeinterlaceEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "DeinterlaceEffect"; }
+       std::string output_fragment_shader() override;
 
        // Replaces itself with DeinterlaceComputeEffect if compute shaders are supported.
        // Otherwise, does nothing.
-       void rewrite_graph(EffectChain *graph, Node *self);
-       bool set_int(const std::string &key, int value);
+       void rewrite_graph(EffectChain *graph, Node *self) override;
+       bool set_int(const std::string &key, int value) override;
 
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
 
        // First = before previous, second = previous, third = current,
        // fourth = next, fifth = after next. These are treated symmetrically,
@@ -80,15 +80,15 @@ public:
        //
        // Note that if you have interlaced _frames_ and not _fields_, you will
        // need to pull them apart first, for instance with SliceEffect.
-       virtual unsigned num_inputs() const { return 5; }
-       virtual bool needs_texture_bounce() const { return true; }
-       virtual bool changes_output_size() const { return true; }
+       unsigned num_inputs() const override { return 5; }
+       bool needs_texture_bounce() const override { return true; }
+       bool changes_output_size() const override { return true; }
 
-       virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
+       AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
 
-       virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height);
-       virtual void get_output_size(unsigned *width, unsigned *height,
-                                    unsigned *virtual_width, unsigned *virtual_height) const;
+       void inform_input_size(unsigned input_num, unsigned width, unsigned height) override;
+       void get_output_size(unsigned *width, unsigned *height,
+                            unsigned *virtual_width, unsigned *virtual_height) const override;
 
        enum FieldPosition { TOP = 0, BOTTOM = 1 };
 
@@ -136,22 +136,22 @@ private:
 class DeinterlaceComputeEffect : public Effect {
 public:
        DeinterlaceComputeEffect();
-       virtual std::string effect_type_id() const { return "DeinterlaceComputeEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "DeinterlaceComputeEffect"; }
+       std::string output_fragment_shader() override;
 
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
 
-       virtual unsigned num_inputs() const { return 5; }
-       virtual bool changes_output_size() const { return true; }
-       virtual bool is_compute_shader() const { return true; }
-       virtual void get_compute_dimensions(unsigned output_width, unsigned output_height,
-                                           unsigned *x, unsigned *y, unsigned *z) const;
+       unsigned num_inputs() const override { return 5; }
+       bool changes_output_size() const override { return true; }
+       bool is_compute_shader() const override { return true; }
+       void get_compute_dimensions(unsigned output_width, unsigned output_height,
+                                   unsigned *x, unsigned *y, unsigned *z) const override;
 
-       virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
+       AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
 
-       virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height);
-       virtual void get_output_size(unsigned *width, unsigned *height,
-                                    unsigned *virtual_width, unsigned *virtual_height) const;
+       void inform_input_size(unsigned input_num, unsigned width, unsigned height) override;
+       void get_output_size(unsigned *width, unsigned *height,
+                            unsigned *virtual_width, unsigned *virtual_height) const override;
 
        enum FieldPosition { TOP = 0, BOTTOM = 1 };
 
index 77625ae439568b8fb6f043b5da796ddad067490d..253126eb9f78b298d2691f128111a4763d3f4ff7 100644 (file)
@@ -29,15 +29,15 @@ class DiffusionEffect : public Effect {
 public:
        DiffusionEffect();
        ~DiffusionEffect();
-       virtual std::string effect_type_id() const { return "DiffusionEffect"; }
+       std::string effect_type_id() const override { return "DiffusionEffect"; }
 
-       virtual void rewrite_graph(EffectChain *graph, Node *self);
-       virtual bool set_float(const std::string &key, float value);
+       void rewrite_graph(EffectChain *graph, Node *self) override;
+       bool set_float(const std::string &key, float value) override;
        
-       virtual std::string output_fragment_shader() {
+       std::string output_fragment_shader() override {
                assert(false);
        }
-       virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) {
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override {
                assert(false);
        }
 
@@ -52,12 +52,12 @@ private:
 class OverlayMatteEffect : public Effect {
 public:
        OverlayMatteEffect();
-       virtual std::string effect_type_id() const { return "OverlayMatteEffect"; }
-       std::string output_fragment_shader();
-       virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
+       std::string effect_type_id() const override { return "OverlayMatteEffect"; }
+       std::string output_fragment_shader() override;
+       AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
 
-       unsigned num_inputs() const { return 2; }
-       virtual bool one_to_one_sampling() const { return true; }
+       unsigned num_inputs() const override { return 2; }
+       bool one_to_one_sampling() const override { return true; }
 
 private:
        float blurred_mix_amount;
index 921a1ef5e1130ca6184e401fe06e8b267b4c67e2..71bb6d35723d3a19b3ca91be4175f5af5bcb0e1b 100644 (file)
@@ -59,16 +59,16 @@ private:
 
 public:
        ~DitherEffect();
-       virtual std::string effect_type_id() const { return "DitherEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "DitherEffect"; }
+       std::string output_fragment_shader() override;
 
        // Note that if we did error diffusion, we'd actually want to diffuse the
        // premultiplied error. However, we need to do dithering in the same
        // space as quantization, whether that be pre- or postmultiply.
-       virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
-       virtual bool one_to_one_sampling() const { return true; }
+       AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
+       bool one_to_one_sampling() const override { return true; }
 
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
 
 private:
        void update_texture(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
index c9d746fbafaa390b5cc17437348df0f77e82e87f..23156cb2db604422a7b3ecf66f24f345cac36a8c 100644 (file)
@@ -38,8 +38,8 @@ namespace {
 class IdentityEffect : public Effect {
 public:
        IdentityEffect() {}
-       virtual string effect_type_id() const { return "IdentityEffect"; }
-       string output_fragment_shader() { return read_file("identity.frag"); }
+       string effect_type_id() const override { return "IdentityEffect"; }
+       string output_fragment_shader() override { return read_file("identity.frag"); }
 };
 
 }  // namespace
index 63f574be615d2bb80ccbadfd9b56328173470db3..92fe52b1ecfcd0974ecf5e252f0de6b538b5beaf 100644 (file)
@@ -42,8 +42,8 @@ TEST(EffectChainTest, EmptyChain) {
 class IdentityEffect : public Effect {
 public:
        IdentityEffect() {}
-       virtual string effect_type_id() const { return "IdentityEffect"; }
-       string output_fragment_shader() { return read_file("identity.frag"); }
+       string effect_type_id() const override { return "IdentityEffect"; }
+       string output_fragment_shader() override { return read_file("identity.frag"); }
 };
 
 TEST(EffectChainTest, Identity) {
@@ -63,10 +63,10 @@ TEST(EffectChainTest, Identity) {
 class BouncingIdentityEffect : public Effect {
 public:
        BouncingIdentityEffect() {}
-       virtual string effect_type_id() const { return "IdentityEffect"; }
-       string output_fragment_shader() { return read_file("identity.frag"); }
-       bool needs_texture_bounce() const { return true; }
-       AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
+       string effect_type_id() const override { return "IdentityEffect"; }
+       string output_fragment_shader() override { return read_file("identity.frag"); }
+       bool needs_texture_bounce() const override { return true; }
+       AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
 };
 
 TEST(EffectChainTest, TextureBouncePreservesIdentity) {
@@ -122,12 +122,12 @@ TEST(EffectChainTest, TopLeftOrigin) {
 class InvertEffect : public Effect {
 public:
        InvertEffect() {}
-       virtual string effect_type_id() const { return "InvertEffect"; }
-       string output_fragment_shader() { return read_file("invert_effect.frag"); }
+       string effect_type_id() const override { return "InvertEffect"; }
+       string output_fragment_shader() override { return read_file("invert_effect.frag"); }
 
        // A real invert would actually care about its alpha,
        // but in this unit test, it only complicates things.
-       virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
+       AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
 };
 
 // Like IdentityEffect, but rewrites itself out of the loop,
@@ -137,9 +137,9 @@ template<class T>
 class RewritingEffect : public Effect {
 public:
        RewritingEffect() : effect(new T()), replaced_node(nullptr) {}
-       virtual string effect_type_id() const { return "RewritingEffect[" + effect->effect_type_id() + "]"; }
-       string output_fragment_shader() { EXPECT_TRUE(false); return read_file("identity.frag"); }
-       virtual void rewrite_graph(EffectChain *graph, Node *self) {
+       string effect_type_id() const override { return "RewritingEffect[" + effect->effect_type_id() + "]"; }
+       string output_fragment_shader() override { EXPECT_TRUE(false); return read_file("identity.frag"); }
+       void rewrite_graph(EffectChain *graph, Node *self) override {
                replaced_node = graph->add_node(effect);
                graph->replace_receiver(self, replaced_node);
                graph->replace_sender(self, replaced_node);
@@ -235,7 +235,7 @@ public:
            : FlatInput(format, pixel_format, type, width, height),
              overridden_color_space(format.color_space),
              overridden_gamma_curve(format.gamma_curve) {}
-       virtual string effect_type_id() const { return "UnknownColorspaceInput"; }
+       string effect_type_id() const override { return "UnknownColorspaceInput"; }
 
        void set_color_space(Colorspace colorspace) {
                overridden_color_space = colorspace;
@@ -243,8 +243,8 @@ public:
        void set_gamma_curve(GammaCurve gamma_curve) {
                overridden_gamma_curve = gamma_curve;
        }
-       Colorspace get_color_space() const { return overridden_color_space; }
-       GammaCurve get_gamma_curve() const { return overridden_gamma_curve; }
+       Colorspace get_color_space() const override { return overridden_color_space; }
+       GammaCurve get_gamma_curve() const override { return overridden_gamma_curve; }
 
 private:
        Colorspace overridden_color_space;
@@ -420,15 +420,14 @@ TEST(EffectChainTest, NoAlphaConversionsWhenPremultipliedAlphaNotNeeded) {
 class BlueInput : public Input {
 public:
        BlueInput() { register_int("needs_mipmaps", &needs_mipmaps); }
-       virtual string effect_type_id() const { return "IdentityEffect"; }
-       string output_fragment_shader() { return read_file("blue.frag"); }
-       virtual AlphaHandling alpha_handling() const { return OUTPUT_BLANK_ALPHA; }
-       virtual void finalize() {}
-       virtual bool can_output_linear_gamma() const { return true; }
-       virtual unsigned get_width() const { return 1; }
-       virtual unsigned get_height() const { return 1; }
-       virtual Colorspace get_color_space() const { return COLORSPACE_sRGB; }
-       virtual GammaCurve get_gamma_curve() const { return GAMMA_LINEAR; }
+       string effect_type_id() const override { return "IdentityEffect"; }
+       string output_fragment_shader() override { return read_file("blue.frag"); }
+       AlphaHandling alpha_handling() const override { return OUTPUT_BLANK_ALPHA; }
+       bool can_output_linear_gamma() const override { return true; }
+       unsigned get_width() const override { return 1; }
+       unsigned get_height() const override { return 1; }
+       Colorspace get_color_space() const override { return COLORSPACE_sRGB; }
+       GammaCurve get_gamma_curve() const override { return GAMMA_LINEAR; }
 
 private:
        int needs_mipmaps;
@@ -439,9 +438,9 @@ private:
 class RewritingToBlueInput : public Input {
 public:
        RewritingToBlueInput() : blue_node(nullptr) { register_int("needs_mipmaps", &needs_mipmaps); }
-       virtual string effect_type_id() const { return "RewritingToBlueInput"; }
-       string output_fragment_shader() { EXPECT_TRUE(false); return read_file("identity.frag"); }
-       virtual void rewrite_graph(EffectChain *graph, Node *self) {
+       string effect_type_id() const override { return "RewritingToBlueInput"; }
+       string output_fragment_shader() override { EXPECT_TRUE(false); return read_file("identity.frag"); }
+       void rewrite_graph(EffectChain *graph, Node *self) override {
                Node *blue_node = graph->add_node(new BlueInput());
                graph->replace_receiver(self, blue_node);
                graph->replace_sender(self, blue_node);
@@ -452,13 +451,12 @@ public:
 
        // Dummy values that we need to implement because we inherit from Input.
        // Same as BlueInput.
-       virtual AlphaHandling alpha_handling() const { return OUTPUT_BLANK_ALPHA; }
-       virtual void finalize() {}
-       virtual bool can_output_linear_gamma() const { return true; }
-       virtual unsigned get_width() const { return 1; }
-       virtual unsigned get_height() const { return 1; }
-       virtual Colorspace get_color_space() const { return COLORSPACE_sRGB; }
-       virtual GammaCurve get_gamma_curve() const { return GAMMA_LINEAR; }
+       AlphaHandling alpha_handling() const override { return OUTPUT_BLANK_ALPHA; }
+       bool can_output_linear_gamma() const override { return true; }
+       unsigned get_width() const override { return 1; }
+       unsigned get_height() const override { return 1; }
+       Colorspace get_color_space() const override { return COLORSPACE_sRGB; }
+       GammaCurve get_gamma_curve() const override { return GAMMA_LINEAR; }
 
        Node *blue_node;
 
@@ -490,9 +488,9 @@ TEST(EffectChainTest, NoAlphaConversionsWithBlankAlpha) {
 class BlankAlphaPreservingEffect : public Effect {
 public:
        BlankAlphaPreservingEffect() {}
-       virtual string effect_type_id() const { return "BlankAlphaPreservingEffect"; }
-       string output_fragment_shader() { return read_file("identity.frag"); }
-       virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
+       string effect_type_id() const override { return "BlankAlphaPreservingEffect"; }
+       string output_fragment_shader() override { return read_file("identity.frag"); }
+       AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
 };
 
 TEST(EffectChainTest, NoAlphaConversionsWithBlankAlphaPreservingEffect) {
@@ -549,16 +547,16 @@ TEST(EffectChainTest, AlphaConversionsWithNonBlankAlphaPreservingEffect) {
 class MipmapNeedingEffect : public Effect {
 public:
        MipmapNeedingEffect() {}
-       virtual bool needs_mipmaps() const { return true; }
+       bool needs_mipmaps() const override { return true; }
 
        // To be allowed to mess with the sampler state.
-       virtual bool needs_texture_bounce() const { return true; }
+       bool needs_texture_bounce() const override { return true; }
 
-       virtual string effect_type_id() const { return "MipmapNeedingEffect"; }
-       string output_fragment_shader() { return read_file("mipmap_needing_effect.frag"); }
-       virtual void inform_added(EffectChain *chain) { this->chain = chain; }
+       string effect_type_id() const override { return "MipmapNeedingEffect"; }
+       string output_fragment_shader() override { return read_file("mipmap_needing_effect.frag"); }
+       void inform_added(EffectChain *chain) override { this->chain = chain; }
 
-       void set_gl_state(GLuint glsl_program_num, const string& prefix, unsigned *sampler_num)
+       void set_gl_state(GLuint glsl_program_num, const string& prefix, unsigned *sampler_num) override
        {
                Node *self = chain->find_node_for_effect(this);
                glActiveTexture(chain->get_input_sampler(self, 0));
@@ -629,8 +627,8 @@ public:
        NonMipmapCapableInput(ImageFormat format, MovitPixelFormat pixel_format, GLenum type, unsigned width, unsigned height)
                : FlatInput(format, pixel_format, type, width, height) {}
 
-       virtual bool can_supply_mipmaps() const { return false; }
-       bool set_int(const std::string& key, int value) {
+       bool can_supply_mipmaps() const override { return false; }
+       bool set_int(const std::string& key, int value) override {
                if (key == "needs_mipmaps") {
                        assert(value == 0);
                }
@@ -761,10 +759,10 @@ TEST(EffectChainTest, ResizeDownByFourThenUpByFour) {
 class AddEffect : public Effect {
 public:
        AddEffect() {}
-       virtual string effect_type_id() const { return "AddEffect"; }
-       string output_fragment_shader() { return read_file("add.frag"); }
-       virtual unsigned num_inputs() const { return 2; }
-       virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
+       string effect_type_id() const override { return "AddEffect"; }
+       string output_fragment_shader() override { return read_file("add.frag"); }
+       unsigned num_inputs() const override { return 2; }
+       AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
 };
 
 // Constructs the graph
@@ -937,12 +935,12 @@ TEST(EffectChainTest, EffectUsedTwiceOnlyGetsOneColorspaceConversion) {
 class SizeStoringEffect : public BouncingIdentityEffect {
 public:
        SizeStoringEffect() : input_width(-1), input_height(-1) {}
-       virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height) {
+       void inform_input_size(unsigned input_num, unsigned width, unsigned height) override {
                assert(input_num == 0);
                input_width = width;
                input_height = height;
        }
-       virtual string effect_type_id() const { return "SizeStoringEffect"; }
+       string effect_type_id() const override { return "SizeStoringEffect"; }
 
        int input_width, input_height;
 };
@@ -1063,13 +1061,13 @@ public:
                  height(height),
                  virtual_width(virtual_width),
                  virtual_height(virtual_height) {}
-       virtual string effect_type_id() const { return "VirtualResizeEffect"; }
-       string output_fragment_shader() { return read_file("identity.frag"); }
+       string effect_type_id() const override { return "VirtualResizeEffect"; }
+       string output_fragment_shader() override { return read_file("identity.frag"); }
 
-       virtual bool changes_output_size() const { return true; }
+       bool changes_output_size() const override { return true; }
 
-       virtual void get_output_size(unsigned *width, unsigned *height,
-                                    unsigned *virtual_width, unsigned *virtual_height) const {
+       void get_output_size(unsigned *width, unsigned *height,
+                            unsigned *virtual_width, unsigned *virtual_height) const override {
                *width = this->width;
                *height = this->height;
                *virtual_width = this->virtual_width;
@@ -1111,17 +1109,17 @@ class NonVirtualResizeEffect : public VirtualResizeEffect {
 public:
        NonVirtualResizeEffect(int width, int height)
                : VirtualResizeEffect(width, height, width, height) {}
-       virtual string effect_type_id() const { return "NonVirtualResizeEffect"; }
-       virtual bool sets_virtual_output_size() const { return false; }
+       string effect_type_id() const override { return "NonVirtualResizeEffect"; }
+       bool sets_virtual_output_size() const override { return false; }
 };
 
 // An effect that promises one-to-one sampling (unlike IdentityEffect).
 class OneToOneEffect : public Effect {
 public:
        OneToOneEffect() {}
-       virtual string effect_type_id() const { return "OneToOneEffect"; }
-       string output_fragment_shader() { return read_file("identity.frag"); }
-       virtual bool one_to_one_sampling() const { return true; }
+       string effect_type_id() const override { return "OneToOneEffect"; }
+       string output_fragment_shader() override { return read_file("identity.frag"); }
+       bool one_to_one_sampling() const override { return true; }
 };
 
 TEST(EffectChainTest, NoBounceWithOneToOneSampling) {
@@ -1263,8 +1261,8 @@ TEST(EffectChainTest, IdentityWithOwnPool) {
 class PrintfingBlueEffect : public Effect {
 public:
        PrintfingBlueEffect() {}
-       virtual string effect_type_id() const { return "PrintfingBlueEffect"; }
-       string output_fragment_shader() {
+       string effect_type_id() const override { return "PrintfingBlueEffect"; }
+       string output_fragment_shader() override {
                stringstream ss;
                ss.imbue(locale("C"));
                ss.precision(8);
@@ -1308,9 +1306,9 @@ TEST(EffectChainTest, StringStreamLocalesWork) {
 class IdentityComputeEffect : public Effect {
 public:
        IdentityComputeEffect() {}
-       virtual string effect_type_id() const { return "IdentityComputeEffect"; }
-       virtual bool is_compute_shader() const { return true; }
-       string output_fragment_shader() { return read_file("identity.comp"); }
+       string effect_type_id() const override { return "IdentityComputeEffect"; }
+       bool is_compute_shader() const override { return true; }
+       string output_fragment_shader() override { return read_file("identity.comp"); }
 };
 
 class WithAndWithoutComputeShaderTest : public testing::TestWithParam<string> {
@@ -1343,19 +1341,19 @@ TEST(EffectChainTest, sRGBIntermediate) {
 class PassThroughEffect : public IdentityEffect {
 public:
        PassThroughEffect() {}
-       virtual string effect_type_id() const { return "PassThroughEffect"; }
-       virtual bool needs_linear_light() const { return false; }
-       AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
+       string effect_type_id() const override { return "PassThroughEffect"; }
+       bool needs_linear_light() const override { return false; }
+       AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
 };
 
 // Same, just also bouncing.
 class BouncingPassThroughEffect : public BouncingIdentityEffect {
 public:
        BouncingPassThroughEffect() {}
-       virtual string effect_type_id() const { return "BouncingPassThroughEffect"; }
-       virtual bool needs_linear_light() const { return false; }
-       bool needs_texture_bounce() const { return true; }
-       AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
+       string effect_type_id() const override { return "BouncingPassThroughEffect"; }
+       bool needs_linear_light() const override { return false; }
+       bool needs_texture_bounce() const override { return true; }
+       AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
 };
 
 TEST(EffectChainTest, Linear10bitIntermediateAccuracy) {
@@ -1443,11 +1441,11 @@ TEST(EffectChainTest, SquareRootIntermediateIsTurnedOffForNonLinearData) {
 class RecordingIdentityEffect : public Effect {
 public:
        RecordingIdentityEffect() {}
-       virtual string effect_type_id() const { return "RecordingIdentityEffect"; }
-       string output_fragment_shader() { return read_file("identity.frag"); }
+       string effect_type_id() const override { return "RecordingIdentityEffect"; }
+       string output_fragment_shader() override { return read_file("identity.frag"); }
 
        GLuint last_glsl_program_num;
-       void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num)
+       void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num) override
        {
                last_glsl_program_num = glsl_program_num;
        }
index e19a804d604c4097c4031719fbf6d40cc138329c..cbd0120d2755efe49e216f8eafade27f673481f3 100644 (file)
@@ -86,9 +86,9 @@ class FFTConvolutionEffect : public Effect {
 public:
        FFTConvolutionEffect(int input_width, int input_height, int convolve_width, int convolve_height);
        ~FFTConvolutionEffect();
-       virtual std::string effect_type_id() const { return "FFTConvolutionEffect"; }
-       std::string output_fragment_shader() { assert(false); }
-       virtual void rewrite_graph(EffectChain *graph, Node *self);
+       std::string effect_type_id() const override { return "FFTConvolutionEffect"; }
+       std::string output_fragment_shader() override { assert(false); }
+       void rewrite_graph(EffectChain *graph, Node *self) override;
 
        // See FFTInput::set_pixel_data().
        void set_convolution_kernel(const float *pixel_data)
index 472a218a7f892cc7bb1ceccef1726eab811ca4d3..0e36ecaae86039bcf1672cb069c9b675da78bd9e 100644 (file)
@@ -32,23 +32,23 @@ public:
        FFTInput(unsigned width, unsigned height);
        ~FFTInput();
 
-       virtual std::string effect_type_id() const { return "FFTInput"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "FFTInput"; }
+       std::string output_fragment_shader() override;
 
        // FFTs the data and uploads the texture if it has changed since last time.
-       void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num);
+       void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num) override;
 
-       unsigned get_width() const { return fft_width; }
-       unsigned get_height() const { return fft_height; }
+       unsigned get_width() const override { return fft_width; }
+       unsigned get_height() const override { return fft_height; }
 
        // Strictly speaking, FFT data doesn't have any colorspace or gamma;
        // these values are the Movit standards for “do nothing”.
-       Colorspace get_color_space() const { return COLORSPACE_sRGB; }
-       GammaCurve get_gamma_curve() const { return GAMMA_LINEAR; }
-       virtual AlphaHandling alpha_handling() const { return INPUT_AND_OUTPUT_PREMULTIPLIED_ALPHA; }
-       virtual bool is_single_texture() const { return true; }
-       virtual bool can_output_linear_gamma() const { return true; }
-       virtual bool can_supply_mipmaps() const { return false; }
+       Colorspace get_color_space() const override { return COLORSPACE_sRGB; }
+       GammaCurve get_gamma_curve() const override { return GAMMA_LINEAR; }
+       AlphaHandling alpha_handling() const override { return INPUT_AND_OUTPUT_PREMULTIPLIED_ALPHA; }
+       bool is_single_texture() const override { return true; }
+       bool can_output_linear_gamma() const override { return true; }
+       bool can_supply_mipmaps() const override { return false; }
 
        // Tells the input where to fetch the actual pixel data. Note that if you change
        // this data, you must either call set_pixel_data() again (using the same pointer
@@ -62,12 +62,12 @@ public:
 
        void invalidate_pixel_data();
 
-       virtual void inform_added(EffectChain *chain)
+       void inform_added(EffectChain *chain) override
        {
                resource_pool = chain->get_resource_pool();
        }
 
-       virtual bool set_int(const std::string& key, int value);
+       bool set_int(const std::string& key, int value) override;
 
 private:
        GLuint texture_num;
index 53428bd8d31a3f82360615a2ec20b0cac3653cd5..a09304d22f264cd53b1890db90ac217031881224 100644 (file)
@@ -63,7 +63,7 @@ class FFTPassEffect : public Effect {
 public:
        FFTPassEffect();
        ~FFTPassEffect();
-       virtual std::string effect_type_id() const {
+       std::string effect_type_id() const override {
                char buf[256];
                if (inverse) {
                        snprintf(buf, sizeof(buf), "IFFTPassEffect[%d]", (1 << pass_number));
@@ -72,9 +72,9 @@ public:
                }
                return buf;
        }
-       std::string output_fragment_shader();
+       std::string output_fragment_shader() override;
 
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
 
        // We don't actually change the output size, but this flag makes sure
        // that no other effect is chained after us. This is important since
@@ -83,24 +83,24 @@ public:
        // mode to GL_NEAREST, which other effects are not ready for; so, the
        // combination of these two flags guarantee that we're run entirely alone
        // in our own phase, which is exactly what we want.
-       virtual bool needs_texture_bounce() const { return true; }
-       virtual bool changes_output_size() const { return true; }
-       virtual bool sets_virtual_output_size() const { return false; }
+       bool needs_texture_bounce() const override { return true; }
+       bool changes_output_size() const override { return true; }
+       bool sets_virtual_output_size() const override { return false; }
 
-       virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height)
+       void inform_input_size(unsigned input_num, unsigned width, unsigned height) override
        {
                assert(input_num == 0);
                input_width = width;
                input_height = height;
        }
        
-       virtual void get_output_size(unsigned *width, unsigned *height,
-                                    unsigned *virtual_width, unsigned *virtual_height) const {
+       void get_output_size(unsigned *width, unsigned *height,
+                            unsigned *virtual_width, unsigned *virtual_height) const override {
                *width = *virtual_width = input_width;
                *height = *virtual_height = input_height;
        }
 
-       virtual void inform_added(EffectChain *chain) { this->chain = chain; }
+       void inform_added(EffectChain *chain) override { this->chain = chain; }
        
        enum Direction { INVALID = -1, HORIZONTAL = 0, VERTICAL = 1 };
 
index 06cc6ab1de270cb1476a86fdc5f27832446788c0..eb9fff34fe8184132d01121272e8f8a0fa6c0926 100644 (file)
@@ -22,9 +22,9 @@ public:
        FlatInput(ImageFormat format, MovitPixelFormat pixel_format, GLenum type, unsigned width, unsigned height);
        ~FlatInput();
 
-       virtual std::string effect_type_id() const { return "FlatInput"; }
+       std::string effect_type_id() const override { return "FlatInput"; }
 
-       virtual bool can_output_linear_gamma() const {
+       bool can_output_linear_gamma() const override {
                // On desktop OpenGL, there's also GL_SLUMINANCE8 which could give us
                // support for single-channel sRGB decoding, but it's not supported
                // on GLES, and we're already actively rewriting single-channel inputs
@@ -35,7 +35,7 @@ public:
                        (image_format.gamma_curve == GAMMA_LINEAR ||
                         image_format.gamma_curve == GAMMA_sRGB));
        }
-       virtual AlphaHandling alpha_handling() const {
+       AlphaHandling alpha_handling() const override {
                switch (pixel_format) {
                case FORMAT_RGBA_PREMULTIPLIED_ALPHA:
                        return INPUT_AND_OUTPUT_PREMULTIPLIED_ALPHA;
@@ -50,16 +50,16 @@ public:
                }
        }
 
-       std::string output_fragment_shader();
+       std::string output_fragment_shader() override;
 
        // Uploads the texture if it has changed since last time.
-       void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num);
+       void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num) override;
 
-       unsigned get_width() const { return width; }
-       unsigned get_height() const { return height; }
-       Colorspace get_color_space() const { return image_format.color_space; }
-       GammaCurve get_gamma_curve() const { return image_format.gamma_curve; }
-       virtual bool is_single_texture() const { return true; }
+       unsigned get_width() const override { return width; }
+       unsigned get_height() const override { return height; }
+       Colorspace get_color_space() const override { return image_format.color_space; }
+       GammaCurve get_gamma_curve() const override { return image_format.gamma_curve; }
+       bool is_single_texture() const override { return true; }
 
        // Tells the input where to fetch the actual pixel data. Note that if you change
        // this data, you must either call set_pixel_data() again (using the same pointer
@@ -149,7 +149,7 @@ public:
                this->owns_texture = false;
        }
 
-       virtual void inform_added(EffectChain *chain)
+       void inform_added(EffectChain *chain) override
        {
                resource_pool = chain->get_resource_pool();
        }
index d52291115ec0ae85e3cb16840eddf4892acd4040..f9c329728aee33cdcaed457aad2c19d92c69d662 100644 (file)
@@ -24,16 +24,16 @@ private:
        friend class EffectChain;
 
 public:
-       virtual std::string effect_type_id() const { return "GammaCompressionEffect"; }
-       std::string output_fragment_shader();
-       virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+       std::string effect_type_id() const override { return "GammaCompressionEffect"; }
+       std::string output_fragment_shader() override;
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
 
-       virtual bool needs_srgb_primaries() const { return false; }
-       virtual bool one_to_one_sampling() const { return true; }
+       bool needs_srgb_primaries() const override { return false; }
+       bool one_to_one_sampling() const override { return true; }
 
        // Actually needs postmultiplied input as well as outputting it.
        // EffectChain will take care of that.
-       virtual AlphaHandling alpha_handling() const { return OUTPUT_POSTMULTIPLIED_ALPHA; }
+       AlphaHandling alpha_handling() const override { return OUTPUT_POSTMULTIPLIED_ALPHA; }
 
 private:
        GammaCurve destination_curve;
index 429bd25c4f8cf55de6fa9e907e9be1abdf2db4c2..c4968b2f27cee43e6a5ffd579d2ff06c968199df 100644 (file)
@@ -24,17 +24,17 @@ private:
        friend class EffectChain;
 
 public:
-       virtual std::string effect_type_id() const { return "GammaExpansionEffect"; }
-       std::string output_fragment_shader();
-       virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+       std::string effect_type_id() const override { return "GammaExpansionEffect"; }
+       std::string output_fragment_shader() override;
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
 
-       virtual bool needs_linear_light() const { return false; }
-       virtual bool needs_srgb_primaries() const { return false; }
-       virtual bool one_to_one_sampling() const { return true; }
+       bool needs_linear_light() const override { return false; }
+       bool needs_srgb_primaries() const override { return false; }
+       bool one_to_one_sampling() const override { return true; }
 
        // Actually processes its input in a nonlinear fashion,
        // but does not touch alpha, and we are a special case anyway.
-       virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
+       AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
 
 private:
        GammaCurve source_curve;
index 02520d7bd9ad8f87f38dd9c4365f63be9e85851f..e1599998f74503feda82170eb505fe13e636bb11 100644 (file)
@@ -21,17 +21,17 @@ class Node;
 class GlowEffect : public Effect {
 public:
        GlowEffect();
-       virtual std::string effect_type_id() const { return "GlowEffect"; }
+       std::string effect_type_id() const override { return "GlowEffect"; }
 
-       virtual bool needs_srgb_primaries() const { return false; }
+       bool needs_srgb_primaries() const override { return false; }
 
-       virtual void rewrite_graph(EffectChain *graph, Node *self);
-       virtual bool set_float(const std::string &key, float value);
+       void rewrite_graph(EffectChain *graph, Node *self) override;
+       bool set_float(const std::string &key, float value) override;
 
-       virtual std::string output_fragment_shader() {
+       std::string output_fragment_shader() override {
                assert(false);
        }
-       virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) {
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override {
                assert(false);
        }
 
@@ -48,11 +48,11 @@ private:
 class HighlightCutoffEffect : public Effect {
 public:
        HighlightCutoffEffect();
-       virtual std::string effect_type_id() const { return "HighlightCutoffEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "HighlightCutoffEffect"; }
+       std::string output_fragment_shader() override;
        
-       virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
-       virtual bool one_to_one_sampling() const { return true; }
+       AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
+       bool one_to_one_sampling() const override { return true; }
 
 private:
        float cutoff;
diff --git a/input.h b/input.h
index 08f18da927c161b4ca5c778afee98d34f49b0768..6c9fca1a4050b8590ef4698c5863c90534029f3f 100644 (file)
--- a/input.h
+++ b/input.h
@@ -17,7 +17,7 @@ namespace movit {
 // including possibly uploading the texture if so required.
 class Input : public Effect {
 public:
-       virtual unsigned num_inputs() const { return 0; }
+       unsigned num_inputs() const override { return 0; }
 
        // Whether this input can deliver linear gamma directly if it's
        // asked to. (If so, set the parameter “output_linear_gamma”
index 7967448d935105e3de78a19c9b5ab07ef23a5137..19d9b2020af943a3f9eb3d90577a315e9de31e46 100644 (file)
@@ -30,12 +30,12 @@ namespace movit {
 class LiftGammaGainEffect : public Effect {
 public:
        LiftGammaGainEffect();
-       virtual std::string effect_type_id() const { return "LiftGammaGainEffect"; }
-       virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
-       virtual bool one_to_one_sampling() const { return true; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "LiftGammaGainEffect"; }
+       AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
+       bool one_to_one_sampling() const override { return true; }
+       std::string output_fragment_shader() override;
 
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
 
 private:
        RGBTriplet lift, gamma, gain;
index 3ff81bf6b1641794c2d6db379027d50f0737615e..fec402fd89dd53048844ec9f70b4358d80ed6772 100644 (file)
@@ -20,14 +20,14 @@ namespace movit {
 class LumaMixEffect : public Effect {
 public:
        LumaMixEffect();
-       virtual std::string effect_type_id() const { return "LumaMixEffect"; }
-       std::string output_fragment_shader();
-       virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
-
-       virtual bool needs_srgb_primaries() const { return false; }
-       virtual unsigned num_inputs() const { return 3; }
-       virtual bool one_to_one_sampling() const { return true; }
-       virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
+       std::string effect_type_id() const override { return "LumaMixEffect"; }
+       std::string output_fragment_shader() override;
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
+
+       bool needs_srgb_primaries() const override { return false; }
+       unsigned num_inputs() const override { return 3; }
+       bool one_to_one_sampling() const override { return true; }
+       AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
 
 private:
        float transition_width, progress;
index d9c3f717f9c776b75c83fe53b59653e29038863f..da3a7117601c342ca9150f66e18fe472258340dc 100644 (file)
@@ -12,13 +12,13 @@ namespace movit {
 class MirrorEffect : public Effect {
 public:
        MirrorEffect();
-       virtual std::string effect_type_id() const { return "MirrorEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "MirrorEffect"; }
+       std::string output_fragment_shader() override;
 
-       virtual bool needs_linear_light() const { return false; }
-       virtual bool needs_srgb_primaries() const { return false; }
-       virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
-       virtual bool one_to_one_sampling() const { return true; }
+       bool needs_linear_light() const override { return false; }
+       bool needs_srgb_primaries() const override { return false; }
+       AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
+       bool one_to_one_sampling() const override { return true; }
 };
 
 }  // namespace movit
index d891eb5212f7470d013553bc48a2b742d5a40f69..1305433d096a758bc701c5d233d855706dc170dd 100644 (file)
@@ -13,12 +13,12 @@ namespace movit {
 class MixEffect : public Effect {
 public:
        MixEffect();
-       virtual std::string effect_type_id() const { return "MixEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "MixEffect"; }
+       std::string output_fragment_shader() override;
 
-       virtual bool needs_srgb_primaries() const { return false; }
-       virtual unsigned num_inputs() const { return 2; }
-       virtual bool one_to_one_sampling() const { return true; }
+       bool needs_srgb_primaries() const override { return false; }
+       unsigned num_inputs() const override { return 2; }
+       bool one_to_one_sampling() const override { return true; }
 
        // TODO: In the common case where a+b=1, it would be useful to be able to set
        // alpha_handling() to INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK. However, right now
index c017e06c10d46444fb9bdbefc27a08ecdf4d8b9f..9e3542de65969fbbc084da7b267747d9b4132ea9 100644 (file)
@@ -16,9 +16,9 @@ namespace movit {
 class MultiplyEffect : public Effect {
 public:
        MultiplyEffect();
-       virtual std::string effect_type_id() const { return "MultiplyEffect"; }
-       std::string output_fragment_shader();
-       virtual bool one_to_one_sampling() const { return true; }
+       std::string effect_type_id() const override { return "MultiplyEffect"; }
+       std::string output_fragment_shader() override;
+       bool one_to_one_sampling() const override { return true; }
 
 private:
        RGBATuple factor;
index 40a6fff99e2a465f71cff654d8ae675495c08685..2f88d12caa3b1aa2cb6c3cdff9c6754bc08b1d77 100644 (file)
@@ -19,19 +19,19 @@ namespace movit {
 class OverlayEffect : public Effect {
 public:
        OverlayEffect();
-       virtual std::string effect_type_id() const { return "OverlayEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "OverlayEffect"; }
+       std::string output_fragment_shader() override;
 
-       virtual bool needs_srgb_primaries() const { return false; }
-       virtual unsigned num_inputs() const { return 2; }
-       virtual bool one_to_one_sampling() const { return true; }
+       bool needs_srgb_primaries() const override { return false; }
+       unsigned num_inputs() const override { return 2; }
+       bool one_to_one_sampling() const override { return true; }
 
        // Actually, if _either_ image has blank alpha, our output will have
        // blank alpha, too (this only tells the framework that having _both_
        // images with blank alpha would result in blank alpha).
        // However, understanding that would require changes
        // to EffectChain, so postpone that optimization for later.
-       virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
+       AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
 
 private:
        // If true, overlays input1 on top of input2 instead of vice versa.
index d922944f81703f5847cc21e36778bdecfba59e42..4925764eaa01e7596b35daed9d103c2d467ae0b4 100644 (file)
@@ -36,18 +36,18 @@ namespace movit {
 class PaddingEffect : public Effect {
 public:
        PaddingEffect();
-       virtual std::string effect_type_id() const { return "PaddingEffect"; }
-       std::string output_fragment_shader();
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+       std::string effect_type_id() const override { return "PaddingEffect"; }
+       std::string output_fragment_shader() override;
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
 
-       virtual bool needs_linear_light() const;
-       virtual bool needs_srgb_primaries() const;
-       virtual AlphaHandling alpha_handling() const;
+       bool needs_linear_light() const override;
+       bool needs_srgb_primaries() const override;
+       AlphaHandling alpha_handling() const override;
        
-       virtual bool changes_output_size() const { return true; }
-       virtual bool sets_virtual_output_size() const { return false; }
-       virtual void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const;
-       virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height);
+       bool changes_output_size() const override { return true; }
+       bool sets_virtual_output_size() const override { return false; }
+       void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const override;
+       void inform_input_size(unsigned input_num, unsigned width, unsigned height) override;
 
 private:
        RGBATuple border_color;
@@ -64,10 +64,10 @@ private:
 class IntegralPaddingEffect : public PaddingEffect {
 public:
        IntegralPaddingEffect();
-       virtual std::string effect_type_id() const { return "IntegralPaddingEffect"; }
-       virtual bool one_to_one_sampling() const { return true; }
-       virtual bool set_int(const std::string&, int value);
-       virtual bool set_float(const std::string &key, float value);
+       std::string effect_type_id() const override { return "IntegralPaddingEffect"; }
+       bool one_to_one_sampling() const override { return true; }
+       bool set_int(const std::string&, int value) override;
+       bool set_float(const std::string &key, float value) override;
 };
 
 }  // namespace movit
index 5906a3c44ca41f499b17340e3fcc36fdaec80dfc..4cde466c2d85de4a4b81bb5880399c197a11d63e 100644 (file)
@@ -51,24 +51,24 @@ public:
        ResampleEffect();
        ~ResampleEffect();
 
-       virtual std::string effect_type_id() const { return "ResampleEffect"; }
+       std::string effect_type_id() const override { return "ResampleEffect"; }
 
        // We want this for the same reason as ResizeEffect; we could end up scaling
        // down quite a lot.
-       virtual bool needs_texture_bounce() const { return true; }
-       virtual bool needs_srgb_primaries() const { return false; }
+       bool needs_texture_bounce() const override { return true; }
+       bool needs_srgb_primaries() const override { return false; }
 
-       virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height);
+       void inform_input_size(unsigned input_num, unsigned width, unsigned height) override;
 
-       virtual std::string output_fragment_shader() {
+       std::string output_fragment_shader() override {
                assert(false);
        }
-       virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) {
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override {
                assert(false);
        }
 
-       virtual void rewrite_graph(EffectChain *graph, Node *self);
-       virtual bool set_float(const std::string &key, float value);
+       void rewrite_graph(EffectChain *graph, Node *self) override;
+       bool set_float(const std::string &key, float value) override;
        
 private:
        void update_size();
@@ -92,29 +92,29 @@ public:
        // resolutions.
        SingleResamplePassEffect(ResampleEffect *parent);
        ~SingleResamplePassEffect();
-       virtual std::string effect_type_id() const { return "SingleResamplePassEffect"; }
+       std::string effect_type_id() const override { return "SingleResamplePassEffect"; }
 
-       std::string output_fragment_shader();
+       std::string output_fragment_shader() override;
 
-       virtual bool needs_texture_bounce() const { return true; }
-       virtual bool needs_srgb_primaries() const { return false; }
-       virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
+       bool needs_texture_bounce() const override { return true; }
+       bool needs_srgb_primaries() const override { return false; }
+       AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
 
-       virtual void inform_added(EffectChain *chain) { this->chain = chain; }
-       virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height) {
+       void inform_added(EffectChain *chain) override { this->chain = chain; }
+       void inform_input_size(unsigned input_num, unsigned width, unsigned height) override {
                if (parent != nullptr) {
                        parent->inform_input_size(input_num, width, height);
                }
        }
-       virtual bool changes_output_size() const { return true; }
-       virtual bool sets_virtual_output_size() const { return false; }
+       bool changes_output_size() const override { return true; }
+       bool sets_virtual_output_size() const override { return false; }
 
-       virtual void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const {
+       void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const override {
                *virtual_width = *width = this->output_width;
                *virtual_height = *height = this->output_height;
        }
 
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
        
        enum Direction { HORIZONTAL = 0, VERTICAL = 1 };
 
index 61efd8da19f4ad13096fd93bfa080af042495e4d..9d23806a3315a33b84da00f11d98bdfa11f0397e 100644 (file)
@@ -14,18 +14,18 @@ namespace movit {
 class ResizeEffect : public Effect {
 public:
        ResizeEffect();
-       virtual std::string effect_type_id() const { return "ResizeEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "ResizeEffect"; }
+       std::string output_fragment_shader() override;
 
        // We want processing done pre-filtering and mipmapped,
        // in case we need to scale down a lot.
-       virtual bool needs_texture_bounce() const { return true; }
-       virtual bool needs_mipmaps() const { return true; }
-       virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
+       bool needs_texture_bounce() const override { return true; }
+       bool needs_mipmaps() const override { return true; }
+       AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
 
-       virtual bool changes_output_size() const { return true; }
-       virtual bool sets_virtual_output_size() const { return false; }
-       virtual void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const;
+       bool changes_output_size() const override { return true; }
+       bool sets_virtual_output_size() const override { return false; }
+       void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const override;
 
 private:
        int width, height;
index 25c79920109cbbdbf1d0418c41566df863a037df..530511a3fb2ccb5fb5f64685b36b7f34089232b1 100644 (file)
@@ -18,10 +18,10 @@ namespace movit {
 class SandboxEffect : public Effect {
 public:
        SandboxEffect();
-       virtual std::string effect_type_id() const { return "SandboxEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "SandboxEffect"; }
+       std::string output_fragment_shader() override;
 
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
 
 private:
        float parm;
index bf975725f2c740404a7300b152fbe4b59a1a7061..7e108e8db48362528eb7f275f02cc026b1ebbd27 100644 (file)
@@ -16,10 +16,10 @@ namespace movit {
 class SaturationEffect : public Effect {
 public:
        SaturationEffect();
-       virtual std::string effect_type_id() const { return "SaturationEffect"; }
-       virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
-       virtual bool one_to_one_sampling() const { return true; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "SaturationEffect"; }
+       AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
+       bool one_to_one_sampling() const override { return true; }
+       std::string output_fragment_shader() override;
 
 private:
        float saturation;
index ef96dddcb1e8474a07f037862fd37afe4a41951a..9886df7e5c4e463b2c99cefc48b3d74d8987bed9 100644 (file)
@@ -20,17 +20,17 @@ namespace movit {
 class SliceEffect : public Effect {
 public:
        SliceEffect();
-       virtual std::string effect_type_id() const { return "SliceEffect"; }
-       std::string output_fragment_shader();
-       virtual bool needs_texture_bounce() const { return true; }
-       virtual bool changes_output_size() const { return true; }
-       virtual bool sets_virtual_output_size() const { return false; }
-       virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height);
-       virtual void get_output_size(unsigned *width, unsigned *height,
-                                    unsigned *virtual_width, unsigned *virtual_height) const;
-
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
-       virtual void inform_added(EffectChain *chain) { this->chain = chain; }
+       std::string effect_type_id() const override { return "SliceEffect"; }
+       std::string output_fragment_shader() override;
+       bool needs_texture_bounce() const override { return true; }
+       bool changes_output_size() const override { return true; }
+       bool sets_virtual_output_size() const override { return false; }
+       void inform_input_size(unsigned input_num, unsigned width, unsigned height) override;
+       void get_output_size(unsigned *width, unsigned *height,
+                            unsigned *virtual_width, unsigned *virtual_height) const override;
+
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
+       void inform_added(EffectChain *chain) override { this->chain = chain; }
        
        enum Direction { HORIZONTAL = 0, VERTICAL = 1 };
 
index 7a2052b5b4ef4e81c6dd0418ae524033381333e0..62b2bf61113d4769fd41f5e50d47f7808359823b 100644 (file)
@@ -26,17 +26,17 @@ class Node;
 class UnsharpMaskEffect : public Effect {
 public:
        UnsharpMaskEffect();
-       virtual std::string effect_type_id() const { return "UnsharpMaskEffect"; }
+       std::string effect_type_id() const override { return "UnsharpMaskEffect"; }
 
-       virtual bool needs_srgb_primaries() const { return false; }
+       bool needs_srgb_primaries() const override { return false; }
 
-       virtual void rewrite_graph(EffectChain *graph, Node *self);
-       virtual bool set_float(const std::string &key, float value);
+       void rewrite_graph(EffectChain *graph, Node *self) override;
+       bool set_float(const std::string &key, float value) override;
 
-       virtual std::string output_fragment_shader() {
+       std::string output_fragment_shader() override {
                assert(false);
        }
-       virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) {
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override {
                assert(false);
        }
 
index 926a5be0e0e5dd794c72b2ee0c7c507bedbee919..8a2229cfd0ffb8f502c4b7c3ead5638dc7718a0a 100644 (file)
@@ -14,15 +14,15 @@ namespace movit {
 class VignetteEffect : public Effect {
 public:
        VignetteEffect();
-       virtual std::string effect_type_id() const { return "VignetteEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "VignetteEffect"; }
+       std::string output_fragment_shader() override;
 
-       virtual bool needs_srgb_primaries() const { return false; }
-       virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
-       virtual bool one_to_one_sampling() const { return true; }
+       bool needs_srgb_primaries() const override { return false; }
+       AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
+       bool one_to_one_sampling() const override { return true; }
 
-       virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height);
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+       void inform_input_size(unsigned input_num, unsigned width, unsigned height) override;
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
 
 private:
        Point2D center;
index 2370847e966872746e0a75e967550bedd9979e45..cf2c58bce8a1f5a4f54f9f0596c2eaf9bece3ac6 100644 (file)
@@ -14,12 +14,12 @@ namespace movit {
 class WhiteBalanceEffect : public Effect {
 public:
        WhiteBalanceEffect();
-       virtual std::string effect_type_id() const { return "WhiteBalanceEffect"; }
-       virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
-       virtual bool one_to_one_sampling() const { return true; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "WhiteBalanceEffect"; }
+       AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
+       bool one_to_one_sampling() const override { return true; }
+       std::string output_fragment_shader() override;
 
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
 
 private:
        // The neutral color, in linear sRGB.
index a8c77738f752a32866f6b759ca2b564164f96c9a..88d12491a23d065d04ef6984ec3e810fc66859f3 100644 (file)
@@ -61,21 +61,21 @@ public:
                                 unsigned width, unsigned height);
        ~YCbCr422InterleavedInput();
 
-       virtual std::string effect_type_id() const { return "YCbCr422InterleavedInput"; }
+       std::string effect_type_id() const override { return "YCbCr422InterleavedInput"; }
 
-       virtual bool can_output_linear_gamma() const { return false; }
-       virtual AlphaHandling alpha_handling() const { return OUTPUT_BLANK_ALPHA; }
+       bool can_output_linear_gamma() const override { return false; }
+       AlphaHandling alpha_handling() const override { return OUTPUT_BLANK_ALPHA; }
 
-       std::string output_fragment_shader();
+       std::string output_fragment_shader() override;
 
        // Uploads the texture if it has changed since last time.
-       void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num);
+       void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num) override;
 
-       unsigned get_width() const { return width; }
-       unsigned get_height() const { return height; }
-       Colorspace get_color_space() const { return image_format.color_space; }
-       GammaCurve get_gamma_curve() const { return image_format.gamma_curve; }
-       virtual bool can_supply_mipmaps() const { return false; }
+       unsigned get_width() const override { return width; }
+       unsigned get_height() const override { return height; }
+       Colorspace get_color_space() const override { return image_format.color_space; }
+       GammaCurve get_gamma_curve() const override { return image_format.gamma_curve; }
+       bool can_supply_mipmaps() const override { return false; }
 
        // Tells the input where to fetch the actual pixel data. Note that if you change
        // this data, you must either call set_pixel_data() again (using the same pointer
@@ -97,19 +97,20 @@ public:
 
        void invalidate_pixel_data();
 
-       void set_pitch(unsigned pitch) {
+       void set_pitch(unsigned pitch)
+       {
                assert(pitch % ycbcr_format.chroma_subsampling_x == 0);
                pitches[CHANNEL_LUMA] = pitch;
                pitches[CHANNEL_CHROMA] = pitch / ycbcr_format.chroma_subsampling_x;
                invalidate_pixel_data();
        }
 
-       virtual void inform_added(EffectChain *chain)
+       void inform_added(EffectChain *chain) override
        {
                resource_pool = chain->get_resource_pool();
        }
 
-       bool set_int(const std::string& key, int value);
+       bool set_int(const std::string& key, int value) override;
 
 private:
        ImageFormat image_format;
index 59cc5305282c8a51c616c5d151b1c2adbe9fa223..0d2c3fcba4189d52b3fb9a83352fdb6032740098 100644 (file)
@@ -76,13 +76,13 @@ public:
                  height(height),
                  virtual_width(virtual_width),
                  virtual_height(virtual_height) {}
-       virtual string effect_type_id() const { return "VirtualResizeEffect"; }
-       string output_fragment_shader() { return read_file("identity.frag"); }
+       string effect_type_id() const override { return "VirtualResizeEffect"; }
+       string output_fragment_shader() override { return read_file("identity.frag"); }
 
-       virtual bool changes_output_size() const { return true; }
+       bool changes_output_size() const override { return true; }
 
-       virtual void get_output_size(unsigned *width, unsigned *height,
-                                    unsigned *virtual_width, unsigned *virtual_height) const {
+       void get_output_size(unsigned *width, unsigned *height,
+                            unsigned *virtual_width, unsigned *virtual_height) const override {
                *width = this->width;
                *height = this->height;
                *virtual_width = this->virtual_width;
index f57e5fa5f399a0457227838ebe43ffd23864fba4..ce456ceda7ebe06b0653bbbd341ad245be5865b4 100644 (file)
@@ -22,11 +22,11 @@ private:
        friend class EffectChain;
 
 public:
-       virtual std::string effect_type_id() const { return "YCbCrConversionEffect"; }
-       std::string output_fragment_shader();
-       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
-       virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
-       virtual bool one_to_one_sampling() const { return true; }
+       std::string effect_type_id() const override { return "YCbCrConversionEffect"; }
+       std::string output_fragment_shader() override;
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
+       AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
+       bool one_to_one_sampling() const override { return true; }
 
        // Should not be called by end users; call
        // EffectChain::change_ycbcr_output_format() instead.
index bb51049753215448bb899c68afd0b0eb7d343431..0d24a409342de2e4fbadc2d60f429b801e7620fb 100644 (file)
@@ -61,22 +61,22 @@ public:
                   GLenum type = GL_UNSIGNED_BYTE);
        ~YCbCrInput();
 
-       virtual std::string effect_type_id() const { return "YCbCrInput"; }
+       std::string effect_type_id() const override { return "YCbCrInput"; }
 
-       virtual bool can_output_linear_gamma() const { return false; }
-       virtual AlphaHandling alpha_handling() const { return OUTPUT_BLANK_ALPHA; }
+       bool can_output_linear_gamma() const override { return false; }
+       AlphaHandling alpha_handling() const override { return OUTPUT_BLANK_ALPHA; }
 
-       std::string output_fragment_shader();
+       std::string output_fragment_shader() override;
 
        // Uploads the texture if it has changed since last time.
-       void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num);
+       void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num) override;
 
-       unsigned get_width() const { return width; }
-       unsigned get_height() const { return height; }
-       Colorspace get_color_space() const { return image_format.color_space; }
-       GammaCurve get_gamma_curve() const { return image_format.gamma_curve; }
-       virtual bool can_supply_mipmaps() const { return ycbcr_input_splitting == YCBCR_INPUT_INTERLEAVED; }
-       virtual bool is_single_texture() const { return ycbcr_input_splitting == YCBCR_INPUT_INTERLEAVED; }
+       unsigned get_width() const override { return width; }
+       unsigned get_height() const override { return height; }
+       Colorspace get_color_space() const override { return image_format.color_space; }
+       GammaCurve get_gamma_curve() const override { return image_format.gamma_curve; }
+       bool can_supply_mipmaps() const override { return ycbcr_input_splitting == YCBCR_INPUT_INTERLEAVED; }
+       bool is_single_texture() const override { return ycbcr_input_splitting == YCBCR_INPUT_INTERLEAVED; }
 
        // Tells the input where to fetch the actual pixel data. Note that if you change
        // this data, you must either call set_pixel_data() again (using the same pointer
@@ -171,12 +171,12 @@ public:
        // set_width() / set_height() again after this.
        void change_ycbcr_format(const YCbCrFormat &ycbcr_format);
 
-       virtual void inform_added(EffectChain *chain)
+       void inform_added(EffectChain *chain) override
        {
                resource_pool = chain->get_resource_pool();
        }
 
-       bool set_int(const std::string& key, int value);
+       bool set_int(const std::string& key, int value) override;
 
 private:
        // Release the texture in the given channel if we have any, and it is owned by us.
index adfdeb95ca46c898d8bd0b75c1c1cf87d7675415..f90ffb7b642de294d778744a42b5df622cd788ae 100644 (file)
@@ -1004,16 +1004,16 @@ TEST(YCbCrInputTest, TenBitPlanar) {
 class MipmapNeedingEffect : public Effect {
 public:
        MipmapNeedingEffect() {}
-       virtual bool needs_mipmaps() const { return true; }
+       bool needs_mipmaps() const override { return true; }
 
        // To be allowed to mess with the sampler state.
-       virtual bool needs_texture_bounce() const { return true; }
+       bool needs_texture_bounce() const override { return true; }
 
-       virtual string effect_type_id() const { return "MipmapNeedingEffect"; }
-       string output_fragment_shader() { return read_file("mipmap_needing_effect.frag"); }
-       virtual void inform_added(EffectChain *chain) { this->chain = chain; }
+       string effect_type_id() const override { return "MipmapNeedingEffect"; }
+       string output_fragment_shader() override { return read_file("mipmap_needing_effect.frag"); }
+       void inform_added(EffectChain *chain) override { this->chain = chain; }
 
-       void set_gl_state(GLuint glsl_program_num, const string& prefix, unsigned *sampler_num)
+       void set_gl_state(GLuint glsl_program_num, const string& prefix, unsigned *sampler_num) override
        {
                Node *self = chain->find_node_for_effect(this);
                glActiveTexture(chain->get_input_sampler(self, 0));