mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:37:45 +00:00
Big, possibly complete sweep of naming changes.
This commit is contained in:
parent
27fa09aee4
commit
ffab6897aa
93 changed files with 830 additions and 885 deletions
|
@ -14,7 +14,7 @@ void Font::initialize()
|
|||
Font& Font::default_font()
|
||||
{
|
||||
if (!s_default_font)
|
||||
s_default_font = adopt(*new Font(DEFAULT_FONT_NAME::glyphs, DEFAULT_FONT_NAME::glyph_width, DEFAULT_FONT_NAME::glyph_height, DEFAULT_FONT_NAME::first_glyph, DEFAULT_FONT_NAME::last_glyph)).leakRef();
|
||||
s_default_font = adopt(*new Font(DEFAULT_FONT_NAME::glyphs, DEFAULT_FONT_NAME::glyph_width, DEFAULT_FONT_NAME::glyph_height, DEFAULT_FONT_NAME::first_glyph, DEFAULT_FONT_NAME::last_glyph)).leak_ref();
|
||||
return *s_default_font;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ Font::Font(const char* const* glyphs, byte glyph_width, byte glyph_height, byte
|
|||
m_error_bitmap = CharacterBitmap::create_from_ascii(DEFAULT_FONT_NAME::error_glyph, m_glyph_width, m_glyph_height);
|
||||
for (unsigned ch = 0; ch < 256; ++ch) {
|
||||
if (ch < m_first_glyph || ch > m_last_glyph) {
|
||||
m_bitmaps[ch] = m_error_bitmap.copyRef();
|
||||
m_bitmaps[ch] = m_error_bitmap.copy_ref();
|
||||
continue;
|
||||
}
|
||||
const char* data = m_glyphs[(unsigned)ch - m_first_glyph];
|
||||
|
|
|
@ -16,12 +16,12 @@ RetainPtr<GraphicsBitmap> GraphicsBitmap::create(Process& process, const Size& s
|
|||
GraphicsBitmap::GraphicsBitmap(Process& process, const Size& size)
|
||||
: m_size(size)
|
||||
, m_pitch(size.width() * sizeof(RGBA32))
|
||||
, m_client_process(process.makeWeakPtr())
|
||||
, m_client_process(process.make_weak_ptr())
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
size_t size_in_bytes = size.width() * size.height() * sizeof(RGBA32);
|
||||
auto vmo = VMObject::create_anonymous(size_in_bytes);
|
||||
m_client_region = process.allocate_region_with_vmo(LinearAddress(), size_in_bytes, vmo.copyRef(), 0, "GraphicsBitmap (client)", true, true);
|
||||
m_client_region = process.allocate_region_with_vmo(LinearAddress(), size_in_bytes, vmo.copy_ref(), 0, "GraphicsBitmap (client)", true, true);
|
||||
m_client_region->set_shared(true);
|
||||
m_client_region->commit();
|
||||
auto& server = WSMessageLoop::the().server_process();
|
||||
|
|
|
@ -199,9 +199,9 @@ void Painter::draw_text(const Rect& rect, const String& text, TextAlignment alig
|
|||
int text_width = text.length() * font().glyph_width();
|
||||
point = { rect.right() - text_width, rect.center().y() - (font().glyph_height() / 2) };
|
||||
} else if (alignment == TextAlignment::Center) {
|
||||
int textWidth = text.length() * font().glyph_width();
|
||||
int text_width = text.length() * font().glyph_width();
|
||||
point = rect.center();
|
||||
point.move_by(-(textWidth / 2), -(font().glyph_height() / 2));
|
||||
point.move_by(-(text_width / 2), -(font().glyph_height() / 2));
|
||||
} else {
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
@ -283,14 +283,14 @@ void Painter::draw_line(const Point& p1, const Point& p2, Color color)
|
|||
const double dy = point2.y() - point1.y();
|
||||
const double delta_error = fabs(dy / dx);
|
||||
double error = 0;
|
||||
const double yStep = dy == 0 ? 0 : (dy > 0 ? 1 : -1);
|
||||
const double y_step = dy == 0 ? 0 : (dy > 0 ? 1 : -1);
|
||||
|
||||
int y = point1.y();
|
||||
for (int x = point1.x(); x <= point2.x(); ++x) {
|
||||
m_target->scanline(y)[x] = color.value();
|
||||
error += delta_error;
|
||||
if (error >= 0.5) {
|
||||
y = (double)y + yStep;
|
||||
y = (double)y + y_step;
|
||||
error -= 1.0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue