5 #include "gtest/gtest.h"
9 #include "flutter/fml/logging.h"
11 #include "flutter/shell/platform/linux/testing/fl_test_gtk_logs.h"
12 #include "flutter/shell/platform/linux/testing/mock_renderer.h"
14 TEST(FlRendererTest, RestoresGLState) {
15 constexpr
int kWidth = 100;
16 constexpr
int kHeight = 100;
18 flutter::testing::fl_ensure_gtk_init();
21 g_autoptr(FlMockRenderer) renderer = fl_mock_renderer_new();
22 g_autoptr(FlBackingStoreProvider) backing_store_provider =
28 FlutterBackingStore backing_store;
29 backing_store.type = kFlutterBackingStoreTypeOpenGL;
30 backing_store.open_gl.framebuffer.user_data = backing_store_provider;
33 layer.type = kFlutterLayerContentTypeBackingStore;
34 layer.backing_store = &backing_store;
35 layer.offset = {0, 0};
36 layer.size = {kWidth, kHeight};
38 std::array<const FlutterLayer*, 1> layers = {&layer};
40 constexpr GLuint kFakeTextureName = 123;
41 glBindTexture(GL_TEXTURE_2D, kFakeTextureName);
47 GLuint texture_2d_binding;
48 glGetIntegerv(GL_TEXTURE_BINDING_2D,
49 reinterpret_cast<GLint*
>(&texture_2d_binding));
50 EXPECT_EQ(texture_2d_binding, kFakeTextureName);
52 g_object_ref_sink(view);
60 TEST(FlRendererTest, RefreshRate) {
61 flutter::testing::fl_ensure_gtk_init();
63 g_autoptr(FlMockRenderer) renderer =
66 gdouble result_refresh_rate =