diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-04-01 15:57:44 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-04-05 11:49:17 +0200 |
commit | a782a6d15b80dd83105604f3f779f6c83ba222e5 (patch) | |
tree | 62d83196baf28554cdd3144691b8210cc998af4a /test | |
parent | 865f8a6c03540e329ed6caef354799fb58b7ab6e (diff) | |
download | qtlocation-mapboxgl-a782a6d15b80dd83105604f3f779f6c83ba222e5.tar.gz |
[core] move BackendScope to gfx namespace
Diffstat (limited to 'test')
-rw-r--r-- | test/api/api_misuse.test.cpp | 2 | ||||
-rw-r--r-- | test/api/recycle_map.cpp | 2 | ||||
-rw-r--r-- | test/gl/bucket.test.cpp | 12 | ||||
-rw-r--r-- | test/gl/context.test.cpp | 3 | ||||
-rw-r--r-- | test/gl/object.test.cpp | 4 | ||||
-rw-r--r-- | test/map/map.test.cpp | 3 | ||||
-rw-r--r-- | test/renderer/backend_scope.test.cpp | 12 | ||||
-rw-r--r-- | test/util/offscreen_texture.test.cpp | 6 |
8 files changed, 23 insertions, 21 deletions
diff --git a/test/api/api_misuse.test.cpp b/test/api/api_misuse.test.cpp index cca47de69c..b65bdf9918 100644 --- a/test/api/api_misuse.test.cpp +++ b/test/api/api_misuse.test.cpp @@ -4,7 +4,7 @@ #include <mbgl/test/map_adapter.hpp> #include <mbgl/map/map_options.hpp> -#include <mbgl/renderer/backend_scope.hpp> +#include <mbgl/gfx/backend_scope.hpp> #include <mbgl/gl/headless_frontend.hpp> #include <mbgl/util/default_thread_pool.hpp> #include <mbgl/util/exception.hpp> diff --git a/test/api/recycle_map.cpp b/test/api/recycle_map.cpp index ac9de9b230..18cc9c00aa 100644 --- a/test/api/recycle_map.cpp +++ b/test/api/recycle_map.cpp @@ -4,7 +4,7 @@ #include <mbgl/gl/headless_frontend.hpp> #include <mbgl/map/map_options.hpp> -#include <mbgl/renderer/backend_scope.hpp> +#include <mbgl/gfx/backend_scope.hpp> #include <mbgl/style/layers/symbol_layer.hpp> #include <mbgl/style/sources/geojson_source.hpp> #include <mbgl/style/image.hpp> diff --git a/test/gl/bucket.test.cpp b/test/gl/bucket.test.cpp index 2be224382a..48cdc1c0f5 100644 --- a/test/gl/bucket.test.cpp +++ b/test/gl/bucket.test.cpp @@ -1,7 +1,7 @@ #include <mbgl/test/util.hpp> #include <mbgl/test/stub_geometry_tile_feature.hpp> -#include <mbgl/renderer/backend_scope.hpp> +#include <mbgl/gfx/backend_scope.hpp> #include <mbgl/renderer/buckets/circle_bucket.hpp> #include <mbgl/renderer/buckets/fill_bucket.hpp> #include <mbgl/renderer/buckets/line_bucket.hpp> @@ -44,7 +44,7 @@ PropertyMap properties; TEST(Buckets, CircleBucket) { HeadlessBackend backend({ 512, 256 }); - BackendScope scope { backend }; + gfx::BackendScope scope { backend }; gl::Context context; CircleBucket bucket { { {0, 0, 0}, MapMode::Static, 1.0, nullptr }, {} }; @@ -63,7 +63,7 @@ TEST(Buckets, CircleBucket) { TEST(Buckets, FillBucket) { HeadlessBackend backend({ 512, 256 }); - BackendScope scope { backend }; + gfx::BackendScope scope { backend }; style::Properties<>::PossiblyEvaluated layout; gl::Context context; @@ -82,7 +82,7 @@ TEST(Buckets, FillBucket) { TEST(Buckets, LineBucket) { HeadlessBackend backend({ 512, 256 }); - BackendScope scope { backend }; + gfx::BackendScope scope { backend }; style::LineLayoutProperties::PossiblyEvaluated layout; gl::Context context; @@ -106,7 +106,7 @@ TEST(Buckets, LineBucket) { TEST(Buckets, SymbolBucket) { HeadlessBackend backend({ 512, 256 }); - BackendScope scope { backend }; + gfx::BackendScope scope { backend }; style::SymbolLayoutProperties::PossiblyEvaluated layout; bool sdfIcons = false; @@ -140,7 +140,7 @@ TEST(Buckets, SymbolBucket) { TEST(Buckets, RasterBucket) { HeadlessBackend backend({ 512, 256 }); - BackendScope scope { backend }; + gfx::BackendScope scope { backend }; gl::Context context; PremultipliedImage rgba({ 1, 1 }); diff --git a/test/gl/context.test.cpp b/test/gl/context.test.cpp index 291813bd9a..14f7cd3a13 100644 --- a/test/gl/context.test.cpp +++ b/test/gl/context.test.cpp @@ -5,6 +5,7 @@ #include <mbgl/map/map.hpp> #include <mbgl/map/map_options.hpp> #include <mbgl/util/default_thread_pool.hpp> +#include <mbgl/gfx/backend_scope.hpp> #include <mbgl/gl/defines.hpp> #include <mbgl/gl/headless_frontend.hpp> #include <mbgl/storage/resource_options.hpp> @@ -103,8 +104,8 @@ TEST(GLContextMode, Shared) { { // Custom rendering outside of GL Native render loop. - BackendScope scope { *frontend.getBackend() }; frontend.getBackend()->bind(); + gfx::BackendScope scope { *frontend.getBackend() }; Shader paintShader(vertexShaderSource, fragmentShaderSource); Buffer triangleBuffer({ 0, 0.5, 0.5, -0.5, -0.5, -0.5 }); diff --git a/test/gl/object.test.cpp b/test/gl/object.test.cpp index a29b2ff958..5441c4c335 100644 --- a/test/gl/object.test.cpp +++ b/test/gl/object.test.cpp @@ -1,6 +1,6 @@ #include <mbgl/test/util.hpp> -#include <mbgl/renderer/backend_scope.hpp> +#include <mbgl/gfx/backend_scope.hpp> #include <mbgl/gl/headless_backend.hpp> #include <mbgl/gl/context.hpp> @@ -46,7 +46,7 @@ TEST(GLObject, Value) { TEST(GLObject, Store) { HeadlessBackend backend { { 256, 256 } }; - BackendScope scope { backend }; + gfx::BackendScope scope { backend }; gl::Context context; EXPECT_TRUE(context.empty()); diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp index be92890b07..41275df7f0 100644 --- a/test/map/map.test.cpp +++ b/test/map/map.test.cpp @@ -6,6 +6,7 @@ #include <mbgl/test/map_adapter.hpp> #include <mbgl/map/map_options.hpp> +#include <mbgl/gfx/backend_scope.hpp> #include <mbgl/gl/context.hpp> #include <mbgl/gl/headless_frontend.hpp> #include <mbgl/util/default_thread_pool.hpp> @@ -613,8 +614,8 @@ TEST(Map, AddLayer) { TEST(Map, WithoutVAOExtension) { MapTest<DefaultFileSource> test { ":memory:", "test/fixtures/api/assets" }; - BackendScope scope { *test.frontend.getBackend() }; test.frontend.getBackend()->getContext().disableVAOExtension = true; + gfx::BackendScope scope { *test.frontend.getBackend() }; test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json")); diff --git a/test/renderer/backend_scope.test.cpp b/test/renderer/backend_scope.test.cpp index 05b82695b2..e78c895ac8 100644 --- a/test/renderer/backend_scope.test.cpp +++ b/test/renderer/backend_scope.test.cpp @@ -1,7 +1,7 @@ #include <mbgl/test/util.hpp> #include <mbgl/renderer/renderer_backend.hpp> -#include <mbgl/renderer/backend_scope.hpp> +#include <mbgl/gfx/backend_scope.hpp> #include <functional> @@ -49,7 +49,7 @@ TEST(BackendScope, SingleScope) { backend.deactivateFunction = [&] { deactivated = true; }; { - BackendScope test { backend }; + gfx::BackendScope test { backend }; } ASSERT_TRUE(activated); @@ -67,10 +67,10 @@ TEST(BackendScope, NestedScopes) { backend.deactivateFunction = [&] { deactivated++; }; { - BackendScope outer { backend }; + gfx::BackendScope outer { backend }; ASSERT_EQ(1, activated); { - BackendScope inner { backend }; + gfx::BackendScope inner { backend }; ASSERT_EQ(1, activated); } ASSERT_EQ(0, deactivated); @@ -96,10 +96,10 @@ TEST(BackendScope, ChainedScopes) { backendB.deactivateFunction = [&] { activatedB = false; }; { - BackendScope scopeA { backendA }; + gfx::BackendScope scopeA { backendA }; ASSERT_TRUE(activatedA); { - BackendScope scopeB { backendB }; + gfx::BackendScope scopeB { backendB }; ASSERT_FALSE(activatedA); ASSERT_TRUE(activatedB); } diff --git a/test/util/offscreen_texture.test.cpp b/test/util/offscreen_texture.test.cpp index 887a1cdc00..91bae66ce3 100644 --- a/test/util/offscreen_texture.test.cpp +++ b/test/util/offscreen_texture.test.cpp @@ -1,12 +1,12 @@ #include <mbgl/test/util.hpp> #include <mbgl/platform/gl_functions.hpp> +#include <mbgl/gfx/backend_scope.hpp> #include <mbgl/gl/context.hpp> #include <mbgl/gl/texture.hpp> #include <mbgl/gl/defines.hpp> #include <mbgl/gl/renderable_resource.hpp> #include <mbgl/gl/headless_backend.hpp> -#include <mbgl/renderer/backend_scope.hpp> #include <mbgl/gl/offscreen_texture.hpp> @@ -15,7 +15,7 @@ using namespace mbgl::platform; TEST(OffscreenTexture, EmptyRed) { HeadlessBackend backend({ 512, 256 }); - BackendScope scope { backend }; + gfx::BackendScope scope { backend }; // Scissor test shouldn't leak after HeadlessBackend::bind(). MBGL_CHECK_ERROR(glScissor(64, 64, 128, 128)); @@ -77,8 +77,8 @@ struct Buffer { TEST(OffscreenTexture, RenderToTexture) { HeadlessBackend backend({ 512, 256 }); - BackendScope scope { backend }; auto& context = backend.getContext(); + gfx::BackendScope scope { backend }; MBGL_CHECK_ERROR(glEnable(GL_BLEND)); MBGL_CHECK_ERROR(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); |