Flutter Engine
 
Loading...
Searching...
No Matches
surface_gles_unittests.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
10
11namespace impeller::testing {
12
15
16TEST_P(SurfaceGLESTest, CanWrapNonZeroFBO) {
17 const GLuint fbo = 1988;
18 auto surface =
19 SurfaceGLES::WrapFBO(GetContext(), []() { return true; }, fbo,
21 ASSERT_TRUE(!!surface);
22 ASSERT_TRUE(surface->IsValid());
23 ASSERT_TRUE(surface->GetRenderTarget().HasColorAttachment(0));
24 const auto& texture = TextureGLES::Cast(
25 *(surface->GetRenderTarget().GetColorAttachment(0).texture));
26 auto wrapped = texture.GetFBO();
27 ASSERT_TRUE(wrapped.has_value());
28 // NOLINTNEXTLINE(bugprone-unchecked-optional-access)
29 ASSERT_EQ(wrapped.value(), fbo);
30}
31
32} // namespace impeller::testing
static TextureGLES & Cast(Texture &base)
static std::unique_ptr< Surface > WrapFBO(const std::shared_ptr< Context > &context, SwapCallback swap_callback, GLuint fbo, PixelFormat color_format, ISize fbo_size)
VkSurfaceKHR surface
Definition main.cc:65
FlTexture * texture
TEST_P(AiksTest, DrawAtlasNoColor)
#define INSTANTIATE_OPENGLES_PLAYGROUND_SUITE(playground)