summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/ImageDecoding.cpp
blob: fc2aefee4e4c0814cfdd79336e615685c37cbc5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
 * Copyright (c) 2022, Dex♪ <dexes.ttp@gmail.com>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <LibWeb/ImageDecoding.h>

namespace Web::ImageDecoding {

static RefPtr<Decoder> s_decoder;

Decoder::Decoder() = default;

Decoder::~Decoder() = default;

void Decoder::initialize(RefPtr<Decoder>&& decoder)
{
    s_decoder = move(decoder);
}

Decoder& Decoder::the()
{
    if (!s_decoder) [[unlikely]] {
        dbgln("Web::ImageDecoding::Decoder was not initialized!");
        VERIFY_NOT_REACHED();
    }
    return *s_decoder;
}

}