]> git.sesse.net Git - movit/blobdiff - dither_effect_test.cpp
Remove some unneeded conversions from ResampleEffect. Speeds up texture generation...
[movit] / dither_effect_test.cpp
index 6fd46dbf402feba053183e16790157602dd91277..a604fac87bcad3f53cf371516df32c10ac29fb10 100644 (file)
@@ -1,12 +1,18 @@
 // Unit tests for DitherEffect.
+//
+// Note: Dithering of multiple outputs is tested (somewhat weakly)
+// in YCbCrConversionEffectTest.
 
-#include <GL/glew.h>
+#include <epoxy/gl.h>
 #include <math.h>
 
 #include "effect_chain.h"
 #include "gtest/gtest.h"
 #include "image_format.h"
 #include "test_util.h"
+#include "util.h"
+
+namespace movit {
 
 TEST(DitherEffectTest, NoDitherOnExactValues) {
        const int size = 4;
@@ -26,8 +32,11 @@ TEST(DitherEffectTest, NoDitherOnExactValues) {
        unsigned char out_data[size * size];
 
        EffectChainTester tester(data, size, size, FORMAT_GRAYSCALE, COLORSPACE_sRGB, GAMMA_LINEAR, GL_RGBA8);
+       check_error();
        tester.get_chain()->set_dither_bits(8);
+       check_error();
        tester.run(out_data, GL_RED, COLORSPACE_sRGB, GAMMA_LINEAR);
+       check_error();
 
        expect_equal(expected_data, out_data, size, size);
 }
@@ -55,3 +64,5 @@ TEST(DitherEffectTest, SinusoidBelowOneLevelComesThrough) {
 
        EXPECT_NEAR(amplitude, sum / (size * 255.0f), 1.1e-5);
 }
+
+}  // namespace movit