From 6b172110e6571360786155754ae1f511727fda0a Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 14 Nov 2024 15:40:07 -0800 Subject: [PATCH] [Impeller] libImpeller: Add a warning about OpenGL state being trampled. (flutter/engine#56599) --- engine/src/flutter/impeller/toolkit/interop/impeller.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/engine/src/flutter/impeller/toolkit/interop/impeller.h b/engine/src/flutter/impeller/toolkit/interop/impeller.h index aed8a8beb1..fe1b3bb980 100644 --- a/engine/src/flutter/impeller/toolkit/interop/impeller.h +++ b/engine/src/flutter/impeller/toolkit/interop/impeller.h @@ -689,6 +689,14 @@ void ImpellerSurfaceRelease(ImpellerSurface IMPELLER_NULLABLE surface); /// @brief Draw a display list onto the surface. The same display list can /// be drawn multiple times to different surfaces. /// +/// @warning In the OpenGL backend, Impeller will not make an effort to +/// preserve the OpenGL state that is current in the context. +/// Embedders that perform additional OpenGL operations in the +/// context should expect the reset state after control transitions +/// back to them. Key state to watch out for would be the viewports, +/// stencil rects, test toggles, resource (texture, framebuffer, +/// buffer) bindings, etc... +/// /// @param[in] surface The surface to draw the display list to. /// @param[in] display_list The display list to draw onto the surface. ///