mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibGfx: Use same order for macOS and Vulkan specific code
No functional changes.
This commit is contained in:
committed by
Alexander Kalenik
parent
4fbeea6482
commit
1d81c4d8eb
@@ -9,14 +9,14 @@
|
||||
#include <AK/Noncopyable.h>
|
||||
#include <AK/RefCounted.h>
|
||||
|
||||
#ifdef AK_OS_MACOS
|
||||
# include <LibGfx/MetalContext.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_VULKAN
|
||||
# include <LibGfx/VulkanContext.h>
|
||||
#endif
|
||||
|
||||
#ifdef AK_OS_MACOS
|
||||
# include <LibGfx/MetalContext.h>
|
||||
#endif
|
||||
|
||||
class GrDirectContext;
|
||||
class SkSurface;
|
||||
|
||||
@@ -30,11 +30,11 @@ class SkiaBackendContext : public RefCounted<SkiaBackendContext> {
|
||||
|
||||
public:
|
||||
#ifdef USE_VULKAN
|
||||
static RefPtr<SkiaBackendContext> create_vulkan_context(Gfx::VulkanContext&);
|
||||
static RefPtr<SkiaBackendContext> create_vulkan_context(VulkanContext&);
|
||||
#endif
|
||||
|
||||
#ifdef AK_OS_MACOS
|
||||
static RefPtr<Gfx::SkiaBackendContext> create_metal_context(MetalContext&);
|
||||
static RefPtr<SkiaBackendContext> create_metal_context(MetalContext&);
|
||||
#endif
|
||||
|
||||
SkiaBackendContext() { }
|
||||
|
||||
@@ -29,14 +29,6 @@ TraversableNavigable::TraversableNavigable(GC::Ref<Page> page)
|
||||
: Navigable(page)
|
||||
, m_session_history_traversal_queue(vm().heap().allocate<SessionHistoryTraversalQueue>())
|
||||
{
|
||||
#ifdef AK_OS_MACOS
|
||||
auto display_list_player_type = page->client().display_list_player_type();
|
||||
if (display_list_player_type == DisplayListPlayerType::SkiaGPUIfAvailable)
|
||||
auto metal_context = Gfx::get_metal_context();
|
||||
m_skia_backend_context = Gfx::SkiaBackendContext::create_metal_context(*metal_context);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_VULKAN
|
||||
auto display_list_player_type = page->client().display_list_player_type();
|
||||
if (display_list_player_type == DisplayListPlayerType::SkiaGPUIfAvailable) {
|
||||
@@ -49,6 +41,13 @@ TraversableNavigable::TraversableNavigable(GC::Ref<Page> page)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef AK_OS_MACOS
|
||||
auto display_list_player_type = page->client().display_list_player_type();
|
||||
if (display_list_player_type == DisplayListPlayerType::SkiaGPUIfAvailable)
|
||||
auto metal_context = Gfx::get_metal_context();
|
||||
m_skia_backend_context = Gfx::SkiaBackendContext::create_metal_context(*metal_context);
|
||||
#endif
|
||||
}
|
||||
|
||||
TraversableNavigable::~TraversableNavigable() = default;
|
||||
@@ -1402,19 +1401,19 @@ void TraversableNavigable::paint(DevicePixelRect const& content_rect, Painting::
|
||||
|
||||
switch (page().client().display_list_player_type()) {
|
||||
case DisplayListPlayerType::SkiaGPUIfAvailable: {
|
||||
#ifdef AK_OS_MACOS
|
||||
if (m_skia_backend_context && is<Painting::IOSurfaceBackingStore>(target)) {
|
||||
auto& iosurface_backing_store = static_cast<Painting::IOSurfaceBackingStore&>(target);
|
||||
auto painting_surface = Gfx::PaintingSurface::wrap_iosurface(iosurface_backing_store.iosurface_handle(), *m_skia_backend_context);
|
||||
Painting::DisplayListPlayerSkia player(*m_skia_backend_context, painting_surface);
|
||||
#ifdef USE_VULKAN
|
||||
if (m_skia_backend_context) {
|
||||
Painting::DisplayListPlayerSkia player(*m_skia_backend_context, target.bitmap());
|
||||
player.execute(*display_list);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_VULKAN
|
||||
if (m_skia_backend_context) {
|
||||
Painting::DisplayListPlayerSkia player(*m_skia_backend_context, target.bitmap());
|
||||
#ifdef AK_OS_MACOS
|
||||
if (m_skia_backend_context && is<Painting::IOSurfaceBackingStore>(target)) {
|
||||
auto& iosurface_backing_store = static_cast<Painting::IOSurfaceBackingStore&>(target);
|
||||
auto painting_surface = Gfx::PaintingSurface::wrap_iosurface(iosurface_backing_store.iosurface_handle(), *m_skia_backend_context);
|
||||
Painting::DisplayListPlayerSkia player(*m_skia_backend_context, painting_surface);
|
||||
player.execute(*display_list);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
#include <LibWeb/Painting/DisplayListPlayerSkia.h>
|
||||
#include <LibWeb/StorageAPI/StorageShed.h>
|
||||
|
||||
#ifdef AK_OS_MACOS
|
||||
# include <LibGfx/MetalContext.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_VULKAN
|
||||
# include <LibGfx/VulkanContext.h>
|
||||
#endif
|
||||
|
||||
#ifdef AK_OS_MACOS
|
||||
# include <LibGfx/MetalContext.h>
|
||||
#endif
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/document-sequences.html#traversable-navigable
|
||||
|
||||
Reference in New Issue
Block a user