mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:57:45 +00:00
Optimize WindowManager::flush() with fast_dword_copy().
This commit is contained in:
parent
6b4e88b515
commit
edc827077e
5 changed files with 40 additions and 35 deletions
|
@ -7,36 +7,6 @@
|
|||
|
||||
#define DEBUG_WIDGET_UNDERDRAW
|
||||
|
||||
ALWAYS_INLINE void fast_dword_copy(dword* dest, const dword* src, size_t count)
|
||||
{
|
||||
#ifdef SERENITY
|
||||
asm volatile(
|
||||
"rep movsl\n"
|
||||
: "=S"(src), "=D"(dest)
|
||||
: "S"(src), "D"(dest), "c"(count)
|
||||
: "memory"
|
||||
);
|
||||
#else
|
||||
memcpy(dest, src, count * sizeof(dword));
|
||||
#endif
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void fast_dword_fill(dword* dest, dword value, size_t count)
|
||||
{
|
||||
#ifdef SERENITY
|
||||
asm volatile(
|
||||
"rep stosl\n"
|
||||
: "=D"(dest)
|
||||
: "D"(dest), "c"(count), "a"(value)
|
||||
: "memory"
|
||||
);
|
||||
#else
|
||||
for (size_t i = 0; x <= count; ++x) {
|
||||
dest[i] = value;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Painter::Painter(GraphicsBitmap& bitmap)
|
||||
{
|
||||
m_font = &Font::defaultFont();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue