88#include " HWDevice.h"
99
1010#include < EGL/eglplatform.h>
11+ #include < igl/Macros.h>
1112#include < igl/opengl/egl/Context.h>
1213#include < igl/opengl/egl/Device.h>
1314
1415namespace igl ::opengl::egl {
1516
1617std::unique_ptr<IContext> HWDevice::createContext (Result* outResult) const {
18+ IGL_PROFILER_FUNCTION_COLOR (IGL_PROFILER_COLOR_CREATE );
1719 Result::setOk (outResult);
1820 return std::make_unique<Context>(IGL_EGL_NULL_WINDOW );
1921}
2022
2123std::unique_ptr<IContext> HWDevice::createContext (EGLNativeWindowType nativeWindow,
2224 Result* outResult) const {
25+ IGL_PROFILER_FUNCTION_COLOR (IGL_PROFILER_COLOR_CREATE );
2326 return std::make_unique<Context>(nativeWindow);
2427}
2528
2629std::unique_ptr<IContext> HWDevice::createContext (BackendVersion backendVersion,
2730 EGLNativeWindowType nativeWindow,
2831 Result* outResult) const {
32+ IGL_PROFILER_FUNCTION_COLOR (IGL_PROFILER_COLOR_CREATE );
2933 return std::make_unique<Context>(backendVersion, nativeWindow);
3034}
3135
3236std::unique_ptr<IContext> HWDevice::createOffscreenContext (size_t width,
3337 size_t height,
3438 Result* outResult) const {
39+ IGL_PROFILER_FUNCTION_COLOR (IGL_PROFILER_COLOR_CREATE );
3540 Result::setOk (outResult);
3641 return std::make_unique<Context>(width, height);
3742}
3843
3944// @fb-only
4045std::unique_ptr<opengl::Device> HWDevice::createWithContext (std::unique_ptr<IContext> context,
4146 Result* outResult) const {
47+ IGL_PROFILER_FUNCTION_COLOR (IGL_PROFILER_COLOR_CREATE );
4248 Result::setOk (outResult);
4349 if (context == nullptr ) {
4450 Result::setResult (outResult, Result::Code::ArgumentInvalid, " context is null" );
@@ -50,6 +56,7 @@ std::unique_ptr<opengl::Device> HWDevice::createWithContext(std::unique_ptr<ICon
5056// @fb-only
5157std::unique_ptr<opengl::Device> HWDevice::create (EGLNativeWindowType nativeWindow,
5258 Result* outResult) const {
59+ IGL_PROFILER_FUNCTION_COLOR (IGL_PROFILER_COLOR_CREATE );
5360 auto context = createContext (nativeWindow, outResult);
5461 if (context == nullptr ) {
5562 return nullptr ;
0 commit comments