mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +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
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_SOURCE_DIR ${SERENITY_SOURCE_DIR}/Userland/Services/WebContent/)
|
||||||
|
|
||||||
set(WEBCONTENT_SOURCES
|
set(WEBCONTENT_SOURCES
|
||||||
|
@ -77,6 +78,11 @@ if (HAVE_PULSEAUDIO)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (LINUX)
|
if (HAS_ACCELERATED_GRAPHICS)
|
||||||
|
target_compile_definitions(WebContent PRIVATE HAS_ACCELERATED_GRAPHICS)
|
||||||
target_link_libraries(WebContent PRIVATE LibAccelGfx)
|
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()
|
endif()
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
include(accelerated_graphics)
|
||||||
|
|
||||||
serenity_component(
|
serenity_component(
|
||||||
WebContent
|
WebContent
|
||||||
TARGETS WebContent
|
TARGETS WebContent
|
||||||
|
@ -30,3 +32,8 @@ set(GENERATED_SOURCES
|
||||||
serenity_bin(WebContent)
|
serenity_bin(WebContent)
|
||||||
target_link_libraries(WebContent PRIVATE LibCore LibFileSystem LibIPC LibGfx LibAudio LibImageDecoderClient LibJS LibWebView LibWeb LibLocale LibMain)
|
target_link_libraries(WebContent PRIVATE LibCore LibFileSystem LibIPC LibGfx LibAudio LibImageDecoderClient LibJS LibWebView LibWeb LibLocale LibMain)
|
||||||
link_with_locale_data(WebContent)
|
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);
|
document->paintable()->paint_all_phases(context);
|
||||||
|
|
||||||
if (s_use_gpu_painter) {
|
if (s_use_gpu_painter) {
|
||||||
#ifdef AK_OS_LINUX
|
#ifdef HAS_ACCELERATED_GRAPHICS
|
||||||
Web::Painting::PaintingCommandExecutorGPU painting_command_executor(target);
|
Web::Painting::PaintingCommandExecutorGPU painting_command_executor(target);
|
||||||
recording_painter.execute(painting_command_executor);
|
recording_painter.execute(painting_command_executor);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue