mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 18:17:23 +00:00
WebContent: Use the accelerated_graphics CMake helper
Instead of relying on AK_OS_LINUX, actually use the more accurate HAS_ACCELERATED_GRAPHICS define to figure out if we should try to use the generic LibAccelGfx GPU painter.
This commit is contained in:
parent
26e5c20cfa
commit
40363f54d8
Notes:
sideshowbarker
2024-07-17 02:08:15 +09:00
Author: https://github.com/ADKaster
Commit: 40363f54d8
Pull-request: https://github.com/SerenityOS/serenity/pull/21721
3 changed files with 15 additions and 2 deletions
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue