Commit Graph

13 Commits

Author SHA1 Message Date
Andreas Kling
cf58b76210 SharedGraphics: GraphicsBitmap::load_from_file() should be allowed to fail.
It's okay if it fails to load a bitmap in kernel space. Just return nullptr.
2019-02-08 16:49:05 +01:00
Andreas Kling
cda598c29c SharedGraphics: Allocate file-backed kernel GraphcisBitmaps in WindowServer. 2019-02-08 09:48:28 +01:00
Andreas Kling
887b4a7a1a Start working on a simple Launcher app.
Let GButton have an optional icon (GraphicsBitmap) that gets rendered in the
middle of the button if present.

Also add GraphicsBitmap::load_from_file() which allows mmap'ed RGBA32 files.
I wrote a little program to take "raw" files from GIMP and swizzle them into
the correct byte order.
2019-02-07 23:17:06 +01:00
Andreas Kling
41567c5bb9 Show the amount of memory in GraphicsBitmaps in /bin/top.
This seems like an extremely relevant metric to track.
2019-02-05 09:27:27 +01:00
Andreas Kling
ffab6897aa Big, possibly complete sweep of naming changes. 2019-01-31 17:31:23 +01:00
Andreas Kling
2dc9c86bad Kernel: Make Process a Weakable class.
Use this to fix a use-after-free in ~GraphicsBitmap(). We'd hit this when
the WindowServer was doing a deferred destruction of a WSWindow whose
backing store referred to a now-reaped Process.
2019-01-31 07:02:40 +01:00
Andreas Kling
bba21adae3 WindowServer: Rename WSEvent to WSMessage.
Also do the same for WSMessageLoop and WSMessageReceiver. More to come.
2019-01-26 05:28:02 +01:00
Andreas Kling
7cf3c7461c Refactor GUI rendering model to be two-phased.
Instead of clients painting whenever they feel like it, we now ask that they
paint in response to a paint message.

After finishing painting, clients notify the WindowServer about the rect(s)
they painted into and then flush eventually happens, etc.

This stuff leaves us with a lot of badly named things. Need to fix that.
2019-01-26 05:20:32 +01:00
Andreas Kling
aa24547e12 Kernel: Finally stop exposing Region members to the public. 2019-01-24 18:09:46 +01:00
Andreas Kling
2f2f28f212 Kernel: Refactor Region/PageDirectory ownership model.
Make PageDirectory retainable and have each Region co-own the PageDirectory
they're mapped into. When unmapped, Region has no associated PageDirectory.

This allows Region to automatically unmap itself when destroyed.
2019-01-22 05:06:22 +01:00
Andreas Kling
a47f33bed3 WindowServer: Map shared GraphicsBitmaps read-only on the server side. 2019-01-21 19:27:23 +01:00
Andreas Kling
76a2881793 Mark the two Regions used GraphicsBitmaps as explicitly shared.
This fixes a goofy problem where forking a GUI process would cowify the
GraphicsBitmap for everyone making a hue confusing mess.
2019-01-21 05:18:28 +01:00
Andreas Kling
7e5b81fe48 Make a SharedGraphics directory for classes shared between Kernel and LibGUI. 2019-01-19 23:22:46 +01:00