mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 11:45:06 +00:00
Meta+Services: Make clang-format-10 clean
This commit is contained in:
parent
42dd0675c0
commit
934d4d4033
8 changed files with 32 additions and 30 deletions
|
@ -45,7 +45,7 @@ class ClientConnection;
|
||||||
class BufferQueue : public RefCounted<BufferQueue> {
|
class BufferQueue : public RefCounted<BufferQueue> {
|
||||||
public:
|
public:
|
||||||
explicit BufferQueue(ClientConnection&);
|
explicit BufferQueue(ClientConnection&);
|
||||||
~BufferQueue() {}
|
~BufferQueue() { }
|
||||||
|
|
||||||
bool is_full() const { return m_queue.size() >= 3; }
|
bool is_full() const { return m_queue.size() >= 3; }
|
||||||
void enqueue(NonnullRefPtr<Audio::Buffer>&&);
|
void enqueue(NonnullRefPtr<Audio::Buffer>&&);
|
||||||
|
@ -102,10 +102,10 @@ public:
|
||||||
private:
|
private:
|
||||||
RefPtr<Audio::Buffer> m_current;
|
RefPtr<Audio::Buffer> m_current;
|
||||||
Queue<NonnullRefPtr<Audio::Buffer>> m_queue;
|
Queue<NonnullRefPtr<Audio::Buffer>> m_queue;
|
||||||
int m_position{ 0 };
|
int m_position { 0 };
|
||||||
int m_remaining_samples{ 0 };
|
int m_remaining_samples { 0 };
|
||||||
int m_played_samples{ 0 };
|
int m_played_samples { 0 };
|
||||||
bool m_paused{ false };
|
bool m_paused { false };
|
||||||
WeakPtr<ClientConnection> m_client;
|
WeakPtr<ClientConnection> m_client;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -132,10 +132,10 @@ private:
|
||||||
|
|
||||||
LibThread::Thread m_sound_thread;
|
LibThread::Thread m_sound_thread;
|
||||||
|
|
||||||
bool m_muted{ false };
|
bool m_muted { false };
|
||||||
int m_main_volume{ 100 };
|
int m_main_volume { 100 };
|
||||||
|
|
||||||
u8* m_zero_filled_buffer{ nullptr };
|
u8* m_zero_filled_buffer { nullptr };
|
||||||
|
|
||||||
void mix();
|
void mix();
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,10 +24,10 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <ImageDecoder/ClientConnection.h>
|
||||||
#include <LibCore/EventLoop.h>
|
#include <LibCore/EventLoop.h>
|
||||||
#include <LibCore/LocalServer.h>
|
#include <LibCore/LocalServer.h>
|
||||||
#include <LibIPC/ClientConnection.h>
|
#include <LibIPC/ClientConnection.h>
|
||||||
#include <ImageDecoder/ClientConnection.h>
|
|
||||||
|
|
||||||
int main(int, char**)
|
int main(int, char**)
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,7 +35,7 @@ static String parse_dns_name(const u8* data, size_t& offset, size_t max_offset,
|
||||||
class [[gnu::packed]] DNSRecordWithoutName
|
class [[gnu::packed]] DNSRecordWithoutName
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DNSRecordWithoutName() {}
|
DNSRecordWithoutName() { }
|
||||||
|
|
||||||
u16 type() const { return m_type; }
|
u16 type() const { return m_type; }
|
||||||
u16 record_class() const { return m_class; }
|
u16 record_class() const { return m_class; }
|
||||||
|
|
|
@ -27,10 +27,10 @@
|
||||||
#include <LibCore/EventLoop.h>
|
#include <LibCore/EventLoop.h>
|
||||||
#include <LibCore/LocalServer.h>
|
#include <LibCore/LocalServer.h>
|
||||||
#include <LibIPC/ClientConnection.h>
|
#include <LibIPC/ClientConnection.h>
|
||||||
|
#include <ProtocolServer/ClientConnection.h>
|
||||||
#include <ProtocolServer/GeminiProtocol.h>
|
#include <ProtocolServer/GeminiProtocol.h>
|
||||||
#include <ProtocolServer/HttpProtocol.h>
|
#include <ProtocolServer/HttpProtocol.h>
|
||||||
#include <ProtocolServer/HttpsProtocol.h>
|
#include <ProtocolServer/HttpsProtocol.h>
|
||||||
#include <ProtocolServer/ClientConnection.h>
|
|
||||||
|
|
||||||
int main(int, char**)
|
int main(int, char**)
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,7 +58,7 @@ private:
|
||||||
painter.fill_rect(rect(), palette().button());
|
painter.fill_rect(rect(), palette().button());
|
||||||
painter.draw_line({ 0, 1 }, { width() - 1, 1 }, palette().threed_highlight());
|
painter.draw_line({ 0, 1 }, { width() - 1, 1 }, palette().threed_highlight());
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void did_layout() override
|
virtual void did_layout() override
|
||||||
{
|
{
|
||||||
WindowList::the().for_each_window([&](auto& window) {
|
WindowList::the().for_each_window([&](auto& window) {
|
||||||
|
|
|
@ -36,15 +36,14 @@ WindowList& WindowList::the()
|
||||||
|
|
||||||
Window* WindowList::find_parent(const Window& window)
|
Window* WindowList::find_parent(const Window& window)
|
||||||
{
|
{
|
||||||
if (!window.parent_identifier().is_valid())
|
if (!window.parent_identifier().is_valid())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
for (auto& it : m_windows)
|
for (auto& it : m_windows) {
|
||||||
{
|
auto& w = *it.value;
|
||||||
auto& w = *it.value;
|
if (w.identifier() == window.parent_identifier())
|
||||||
if (w.identifier() == window.parent_identifier())
|
return &w;
|
||||||
return &w;
|
}
|
||||||
}
|
return nullptr;
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Window* WindowList::window(const WindowIdentifier& identifier)
|
Window* WindowList::window(const WindowIdentifier& identifier)
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "WindowIdentifier.h"
|
#include "WindowIdentifier.h"
|
||||||
#include <AK/String.h>
|
|
||||||
#include <AK/HashMap.h>
|
#include <AK/HashMap.h>
|
||||||
|
#include <AK/String.h>
|
||||||
#include <LibGUI/Button.h>
|
#include <LibGUI/Button.h>
|
||||||
#include <LibGfx/Rect.h>
|
#include <LibGfx/Rect.h>
|
||||||
|
|
||||||
|
|
|
@ -213,9 +213,12 @@ void Compositor::compose()
|
||||||
};
|
};
|
||||||
|
|
||||||
auto prepare_transparency_rect = [&](const Gfx::IntRect& rect) {
|
auto prepare_transparency_rect = [&](const Gfx::IntRect& rect) {
|
||||||
|
// clang-format off
|
||||||
|
// FIXME: clang-format gets confused here. Why?
|
||||||
// This function may be called multiple times with the same
|
// This function may be called multiple times with the same
|
||||||
// rect as we walk the window stack from back to front. However,
|
// rect as we walk the window stack from back to front. However,
|
||||||
// there should be no overlaps with flush_rects
|
// there should be no overlaps with flush_rects
|
||||||
|
// clang-format on
|
||||||
#ifdef COMPOSE_DEBUG
|
#ifdef COMPOSE_DEBUG
|
||||||
dbg() << " -> flush transparent: " << rect;
|
dbg() << " -> flush transparent: " << rect;
|
||||||
#endif
|
#endif
|
||||||
|
@ -227,7 +230,7 @@ void Compositor::compose()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!have_rect) {
|
if (!have_rect) {
|
||||||
flush_transparent_rects.add(rect);
|
flush_transparent_rects.add(rect);
|
||||||
check_restore_cursor_back(rect);
|
check_restore_cursor_back(rect);
|
||||||
|
@ -293,7 +296,7 @@ void Compositor::compose()
|
||||||
painter.add_clip_rect(intersected_rect);
|
painter.add_clip_rect(intersected_rect);
|
||||||
#ifdef COMPOSE_DEBUG
|
#ifdef COMPOSE_DEBUG
|
||||||
dbg() << " render frame: " << intersected_rect;
|
dbg() << " render frame: " << intersected_rect;
|
||||||
#endif
|
#endif
|
||||||
window.frame().paint(painter);
|
window.frame().paint(painter);
|
||||||
return IterationDecision::Continue;
|
return IterationDecision::Continue;
|
||||||
});
|
});
|
||||||
|
@ -468,7 +471,7 @@ void Compositor::compose()
|
||||||
back_painter.blit(dnd_rect.top_left(), *wm.dnd_bitmap(), wm.dnd_bitmap()->rect());
|
back_painter.blit(dnd_rect.top_left(), *wm.dnd_bitmap(), wm.dnd_bitmap()->rect());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
dirty_screen_rects.for_each_intersected(dnd_rect, [&](const Gfx::IntRect& render_rect) {
|
dirty_screen_rects.for_each_intersected(dnd_rect, [&](const Gfx::IntRect& render_rect) {
|
||||||
Gfx::PainterStateSaver saver(back_painter);
|
Gfx::PainterStateSaver saver(back_painter);
|
||||||
back_painter.add_clip_rect(render_rect);
|
back_painter.add_clip_rect(render_rect);
|
||||||
|
@ -557,7 +560,7 @@ void Compositor::invalidate_screen()
|
||||||
void Compositor::invalidate_screen(const Gfx::IntRect& screen_rect)
|
void Compositor::invalidate_screen(const Gfx::IntRect& screen_rect)
|
||||||
{
|
{
|
||||||
m_dirty_screen_rects.add(screen_rect.intersected(Screen::the().rect()));
|
m_dirty_screen_rects.add(screen_rect.intersected(Screen::the().rect()));
|
||||||
|
|
||||||
if (m_invalidated_any)
|
if (m_invalidated_any)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -741,13 +744,13 @@ bool Compositor::draw_geometry_label(Gfx::IntRect& geometry_label_rect)
|
||||||
void Compositor::draw_cursor(const Gfx::IntRect& cursor_rect)
|
void Compositor::draw_cursor(const Gfx::IntRect& cursor_rect)
|
||||||
{
|
{
|
||||||
auto& wm = WindowManager::the();
|
auto& wm = WindowManager::the();
|
||||||
|
|
||||||
if (!m_cursor_back_bitmap || m_cursor_back_bitmap->size() != cursor_rect.size()) {
|
if (!m_cursor_back_bitmap || m_cursor_back_bitmap->size() != cursor_rect.size()) {
|
||||||
m_cursor_back_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::RGB32, cursor_rect.size());
|
m_cursor_back_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::RGB32, cursor_rect.size());
|
||||||
m_cursor_back_painter = make<Gfx::Painter>(*m_cursor_back_bitmap);
|
m_cursor_back_painter = make<Gfx::Painter>(*m_cursor_back_bitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_cursor_back_painter->blit({0, 0}, *m_back_bitmap, wm.active_cursor().rect().translated(cursor_rect.location()).intersected(Screen::the().rect()));
|
m_cursor_back_painter->blit({ 0, 0 }, *m_back_bitmap, wm.active_cursor().rect().translated(cursor_rect.location()).intersected(Screen::the().rect()));
|
||||||
auto& back_painter = *m_back_painter;
|
auto& back_painter = *m_back_painter;
|
||||||
back_painter.blit(cursor_rect.location(), wm.active_cursor().bitmap(), wm.active_cursor().rect());
|
back_painter.blit(cursor_rect.location(), wm.active_cursor().bitmap(), wm.active_cursor().rect());
|
||||||
|
|
||||||
|
@ -951,7 +954,7 @@ void Compositor::recompute_occlusions()
|
||||||
transparency_wallpaper_rects.clear();
|
transparency_wallpaper_rects.clear();
|
||||||
return IterationDecision::Continue;
|
return IterationDecision::Continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
transparency_wallpaper_rects = visible_rects.intersected(transparency_rects);
|
transparency_wallpaper_rects = visible_rects.intersected(transparency_rects);
|
||||||
|
|
||||||
auto remaining_visible = visible_rects.shatter(transparency_wallpaper_rects);
|
auto remaining_visible = visible_rects.shatter(transparency_wallpaper_rects);
|
||||||
|
@ -965,7 +968,7 @@ void Compositor::recompute_occlusions()
|
||||||
|
|
||||||
#ifdef OCCLUSIONS_DEBUG
|
#ifdef OCCLUSIONS_DEBUG
|
||||||
for (auto& r : m_opaque_wallpaper_rects.rects())
|
for (auto& r : m_opaque_wallpaper_rects.rects())
|
||||||
dbg() << " wallpaper opaque: " << r;
|
dbg() << " wallpaper opaque: " << r;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wm.for_each_visible_window_from_back_to_front([&](Window& w) {
|
wm.for_each_visible_window_from_back_to_front([&](Window& w) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue