diff --git a/Ladybird/WebContent/CMakeLists.txt b/Ladybird/WebContent/CMakeLists.txt index a400238108..2ac635007a 100644 --- a/Ladybird/WebContent/CMakeLists.txt +++ b/Ladybird/WebContent/CMakeLists.txt @@ -1,3 +1,4 @@ +include(accelerated_graphics) set(WEBCONTENT_SOURCE_DIR ${SERENITY_SOURCE_DIR}/Userland/Services/WebContent/) set(WEBCONTENT_SOURCES @@ -77,6 +78,11 @@ if (HAVE_PULSEAUDIO) endif() endif() -if (LINUX) +if (HAS_ACCELERATED_GRAPHICS) + target_compile_definitions(WebContent PRIVATE HAS_ACCELERATED_GRAPHICS) target_link_libraries(WebContent PRIVATE LibAccelGfx) + if (TARGET webcontent) + target_compile_definitions(webcontent PRIVATE HAS_ACCELERATED_GRAPHICS) + target_link_libraries(webcontent PRIVATE LibAccelGfx) + endif() endif() diff --git a/Userland/Services/WebContent/CMakeLists.txt b/Userland/Services/WebContent/CMakeLists.txt index 88095dc73b..02d8729284 100644 --- a/Userland/Services/WebContent/CMakeLists.txt +++ b/Userland/Services/WebContent/CMakeLists.txt @@ -1,3 +1,5 @@ +include(accelerated_graphics) + serenity_component( WebContent TARGETS WebContent @@ -30,3 +32,8 @@ set(GENERATED_SOURCES serenity_bin(WebContent) target_link_libraries(WebContent PRIVATE LibCore LibFileSystem LibIPC LibGfx LibAudio LibImageDecoderClient LibJS LibWebView LibWeb LibLocale LibMain) link_with_locale_data(WebContent) + +if (HAS_ACCELERATED_GRAPHICS) + target_compile_definitions(WebContent PRIVATE HAS_ACCELERATED_GRAPHICS) + target_link_libraries(WebContent PRIVATE LibAccelGfx) +endif() diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp index b33b3cf684..16fe226a90 100644 --- a/Userland/Services/WebContent/PageHost.cpp +++ b/Userland/Services/WebContent/PageHost.cpp @@ -157,7 +157,7 @@ void PageHost::paint(Web::DevicePixelRect const& content_rect, Gfx::Bitmap& targ document->paintable()->paint_all_phases(context); if (s_use_gpu_painter) { -#ifdef AK_OS_LINUX +#ifdef HAS_ACCELERATED_GRAPHICS Web::Painting::PaintingCommandExecutorGPU painting_command_executor(target); recording_painter.execute(painting_command_executor); #endif