Repository: google/filament
File: filament/backend/include/backend/platforms/OpenGLPlatform.h (C/C++)

Code before:
    virtual bool setExternalImage(void* UTILS_NONNULL externalImage,
            ExternalTexture* UTILS_NONNULL texture) noexcept;

    virtual bool setExternalImage(ExternalImageHandleRef externalImage,
            ExternalTexture* UTILS_NONNULL texture) noexcept;
    /** @}*/

    /**
     * The method allows platforms to convert a user-supplied external image object into a new type
     * (e.g. HardwareBuffer => EGLImage). The default implementation returns source.
     * @param source Image to transform.
     * @return Transformed image.
     */
    virtual AcquiredImage transformAcquiredImage(AcquiredImage source) noexcept;

    // --------------------------------------------------------------------------------------------

    /**
     * Returns true if additional OpenGL contexts can be created. Default: false.
     * @return true if additional OpenGL contexts can be created.
     * @see createContext
     */
    virtual bool isExtraContextSupported() const noexcept;

    /**
     * Creates an OpenGL context with the same configuration with the main context and makes it
     * current to the current thread. Must not be called from the main driver thread.
     * createContext() is only supported if isExtraContextSupported() returns true.
     * These additional contexts will be automatically terminated in terminate.
     *
     * @param shared whether the new context is shared with the main context.
     * @see isExtraContextSupported()
     * @see terminate()
     */
    virtual void createContext(bool shared);

    /**
     * Detach and destroy the current context if any and releases all resources associated to
     * this thread. This must be called from the same thread where createContext() was called.
     */
    virtual void releaseContext() noexcept;
};

} // namespace filament

#endif // TNT_FILAMENT_BACKEND_PRIVATE_OPENGLPLATFORM_H


Review comment (suggestion):
```suggestion
     * Creates an OpenGL context with the same configuration as the main context and makes it
```

nit: "as" is the clearest term to use here

Code after:
    virtual bool setExternalImage(void* UTILS_NONNULL externalImage,
            ExternalTexture* UTILS_NONNULL texture) noexcept;

    virtual bool setExternalImage(ExternalImageHandleRef externalImage,
            ExternalTexture* UTILS_NONNULL texture) noexcept;
    /** @}*/

    /**
     * The method allows platforms to convert a user-supplied external image object into a new type
     * (e.g. HardwareBuffer => EGLImage). The default implementation returns source.
     * @param source Image to transform.
     * @return Transformed image.
     */
    virtual AcquiredImage transformAcquiredImage(AcquiredImage source) noexcept;

    // --------------------------------------------------------------------------------------------

    /**
     * Returns true if additional OpenGL contexts can be created. Default: false.
     * @return true if additional OpenGL contexts can be created.
     * @see createContext
     */
    virtual bool isExtraContextSupported() const noexcept;

    /**
     * Creates an OpenGL context with the same configuration as the main context and makes it
     * current to the current thread. Must not be called from the main driver thread.
     * createContext() is only supported if isExtraContextSupported() returns true.
     * These additional contexts will be automatically terminated in terminate.
     *
     * @param shared whether the new context is shared with the main context.
     * @see isExtraContextSupported()
     * @see terminate()
     */
    virtual void createContext(bool shared);

    /**
     * Detach and destroy the current context if any and releases all resources associated to
     * this thread. This must be called from the same thread where createContext() was called.
     */
    virtual void releaseContext() noexcept;
};

} // namespace filament

#endif // TNT_FILAMENT_BACKEND_PRIVATE_OPENGLPLATFORM_H