diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-05-31 23:14:12 -0700 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-06-01 15:38:01 -0700 |
commit | 5ff9d6e31ba391b3630fbfc0db1ca8da486e1b9f (patch) | |
tree | 5d463062de5537feb940572faeebf9f53a76f37e /test | |
parent | 8b37a0704c7c20b1664fee3dfcc79139982a1ce7 (diff) | |
download | qtlocation-mapboxgl-5ff9d6e31ba391b3630fbfc0db1ca8da486e1b9f.tar.gz |
[core] Reuse RasterBucket for ImageSource
Diffstat (limited to 'test')
-rw-r--r-- | test/gl/bucket.test.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/gl/bucket.test.cpp b/test/gl/bucket.test.cpp index b291816562..ee9ea54414 100644 --- a/test/gl/bucket.test.cpp +++ b/test/gl/bucket.test.cpp @@ -3,9 +3,11 @@ #include <mbgl/renderer/buckets/circle_bucket.hpp> #include <mbgl/renderer/buckets/fill_bucket.hpp> #include <mbgl/renderer/buckets/line_bucket.hpp> +#include <mbgl/renderer/buckets/raster_bucket.hpp> #include <mbgl/renderer/buckets/symbol_bucket.hpp> #include <mbgl/renderer/bucket_parameters.hpp> #include <mbgl/style/layers/symbol_layer_properties.hpp> +#include <mbgl/gl/context.hpp> #include <mbgl/map/mode.hpp> @@ -36,3 +38,17 @@ TEST(Buckets, SymbolBucket) { ASSERT_FALSE(bucket.hasTextData()); ASSERT_FALSE(bucket.hasCollisionBoxData()); } + +TEST(Buckets, RasterBucket) { + gl::Context context; + UnassociatedImage rgba({ 1, 1 }); + + RasterBucket bucket = { std::move(rgba) }; + ASSERT_TRUE(bucket.needsUpload()); + + bucket.upload(context); + ASSERT_FALSE(bucket.needsUpload()); + + bucket.clear(); + ASSERT_TRUE(bucket.needsUpload()); +} |