mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
1682f0b760
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
40 lines
949 B
C++
40 lines
949 B
C++
/*
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/ByteBuffer.h>
|
|
#include <LibGfx/Forward.h>
|
|
#include <LibWeb/HTML/HTMLElement.h>
|
|
|
|
namespace Web::HTML {
|
|
|
|
class HTMLCanvasElement final : public HTMLElement {
|
|
public:
|
|
using WrapperType = Bindings::HTMLCanvasElementWrapper;
|
|
|
|
HTMLCanvasElement(DOM::Document&, QualifiedName);
|
|
virtual ~HTMLCanvasElement() override;
|
|
|
|
const Gfx::Bitmap* bitmap() const { return m_bitmap; }
|
|
Gfx::Bitmap* bitmap() { return m_bitmap; }
|
|
bool create_bitmap();
|
|
|
|
CanvasRenderingContext2D* get_context(String type);
|
|
|
|
unsigned width() const;
|
|
unsigned height() const;
|
|
|
|
String to_data_url(const String& type, Optional<double> quality) const;
|
|
|
|
private:
|
|
virtual RefPtr<Layout::Node> create_layout_node() override;
|
|
|
|
RefPtr<Gfx::Bitmap> m_bitmap;
|
|
RefPtr<CanvasRenderingContext2D> m_context;
|
|
};
|
|
|
|
}
|