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
5
#include "
flutter/impeller/playground/playground_test.h
"
6
#include "
flutter/impeller/renderer/backend/gles/context_gles.h
"
7
#include "
flutter/impeller/renderer/backend/gles/surface_gles.h
"
8
#include "
flutter/impeller/renderer/backend/gles/texture_gles.h
"
9
#include "
flutter/testing/testing.h
"
10
11
namespace
impeller::testing
{
12
13
using
SurfaceGLESTest
=
PlaygroundTest
;
14
INSTANTIATE_OPENGLES_PLAYGROUND_SUITE
(
SurfaceGLESTest
);
15
16
TEST_P
(
SurfaceGLESTest
, CanWrapNonZeroFBO) {
17
const
GLuint fbo = 1988;
18
auto
surface
=
19
SurfaceGLES::WrapFBO
(GetContext(), []() {
return
true
; }, fbo,
20
PixelFormat::kR8G8B8A8UNormInt
, {100, 100});
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
impeller::BackendCast< TextureGLES, Texture >::Cast
static TextureGLES & Cast(Texture &base)
Definition
backend_cast.h:13
impeller::PlaygroundTest
Definition
playground_test.h:22
impeller::SurfaceGLES::WrapFBO
static std::unique_ptr< Surface > WrapFBO(const std::shared_ptr< Context > &context, SwapCallback swap_callback, GLuint fbo, PixelFormat color_format, ISize fbo_size)
Definition
surface_gles.cc:14
surface
VkSurfaceKHR surface
Definition
main.cc:65
texture
FlTexture * texture
Definition
mock_texture_registrar.cc:24
impeller::testing
Definition
allocation_size_unittests.cc:8
impeller::testing::TEST_P
TEST_P(AiksTest, DrawAtlasNoColor)
Definition
aiks_dl_atlas_unittests.cc:59
impeller::PixelFormat::kR8G8B8A8UNormInt
@ kR8G8B8A8UNormInt
playground_test.h
INSTANTIATE_OPENGLES_PLAYGROUND_SUITE
#define INSTANTIATE_OPENGLES_PLAYGROUND_SUITE(playground)
Definition
playground_test.h:86
context_gles.h
surface_gles.h
testing.h
texture_gles.h
impeller
renderer
backend
gles
test
surface_gles_unittests.cc
Generated on Thu Nov 6 2025 16:11:23 for Flutter Engine by
1.9.8