This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +51
-3
lines changed
impeller/renderer/backend/gles Expand file tree Collapse file tree 5 files changed +51
-3
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ impeller_component("gles_unittests") {
15
15
testonly = true
16
16
sources = [
17
17
" test/capabilities_unittests.cc" ,
18
+ " test/formats_gles_unittests.cc" ,
18
19
" test/mock_gles.cc" ,
19
20
" test/mock_gles.h" ,
20
21
" test/mock_gles_unittests.cc" ,
Original file line number Diff line number Diff line change 6
6
7
7
namespace impeller {
8
8
9
- //
9
+ std::string DebugToFramebufferError (int status) {
10
+ switch (status) {
11
+ case GL_FRAMEBUFFER_UNDEFINED:
12
+ return " GL_FRAMEBUFFER_UNDEFINED" ;
13
+ case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
14
+ return " GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT" ;
15
+ case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
16
+ return " GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT" ;
17
+ case GL_FRAMEBUFFER_UNSUPPORTED:
18
+ return " GL_FRAMEBUFFER_UNSUPPORTED" ;
19
+ case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
20
+ return " GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE" ;
21
+ default :
22
+ return " Unknown error code: " + std::to_string (status);
23
+ }
24
+ }
10
25
11
26
} // namespace impeller
Original file line number Diff line number Diff line change @@ -194,4 +194,6 @@ constexpr std::optional<GLenum> ToTextureTarget(TextureType type) {
194
194
FML_UNREACHABLE ();
195
195
}
196
196
197
+ std::string DebugToFramebufferError (int status);
198
+
197
199
} // namespace impeller
Original file line number Diff line number Diff line change @@ -193,8 +193,10 @@ struct RenderPassData {
193
193
}
194
194
}
195
195
196
- if (gl.CheckFramebufferStatus (GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) {
197
- VALIDATION_LOG << " Could not create a complete frambuffer." ;
196
+ auto status = gl.CheckFramebufferStatus (GL_FRAMEBUFFER);
197
+ if (status != GL_FRAMEBUFFER_COMPLETE) {
198
+ VALIDATION_LOG << " Could not create a complete frambuffer: "
199
+ << DebugToFramebufferError (status);
198
200
return false ;
199
201
}
200
202
}
Original file line number Diff line number Diff line change
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/testing/testing.h" // IWYU pragma: keep
6
+ #include " gtest/gtest.h"
7
+ #include " impeller/renderer/backend/gles/formats_gles.h"
8
+
9
+ namespace impeller {
10
+ namespace testing {
11
+
12
+ TEST (FormatsGLES, CanFormatFramebufferErrorMessage) {
13
+ ASSERT_EQ (DebugToFramebufferError (GL_FRAMEBUFFER_UNDEFINED),
14
+ " GL_FRAMEBUFFER_UNDEFINED" );
15
+ ASSERT_EQ (DebugToFramebufferError (GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT),
16
+ " GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT" );
17
+ ASSERT_EQ (
18
+ DebugToFramebufferError (GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT),
19
+ " GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT" );
20
+ ASSERT_EQ (DebugToFramebufferError (GL_FRAMEBUFFER_UNSUPPORTED),
21
+ " GL_FRAMEBUFFER_UNSUPPORTED" );
22
+ ASSERT_EQ (DebugToFramebufferError (GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE),
23
+ " GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE" );
24
+ ASSERT_EQ (DebugToFramebufferError (0 ), " Unknown error code: 0" );
25
+ }
26
+
27
+ } // namespace testing
28
+ } // namespace impeller
You can’t perform that action at this time.
0 commit comments