Commit graph

1249 commits

Author SHA1 Message Date
Ray Strode
92bf5acfa2 [frame-buffer] implement new activate/deactivate methods
We basically just do what we were doing before
implicitly on VT switch, explicitly on activate
and deactivate.
2009-11-28 00:24:59 -05:00
Ray Strode
9f2b4b418a [drm] implement new activate/deactivate methods
We basically just do what we were doing before on
implicitly on VT switch, explicitly on activate
and deactivate.

We also don't scan out the splash to the fbcon
on unmap if the renderer is inactive.
2009-11-28 00:24:59 -05:00
Ray Strode
40f685be7c [renderer] Add new activate and deactivate methods
The point of these methods are to put the renderer in
and out of a state where it is no longer going to
be on screen.

This should cause flush calls to be no-ops and device
specific locks should be dropped.

These methods will be necessary to keep plymouth running
while X is getting started up.
2009-11-28 00:24:58 -05:00
Ray Strode
8bb69cd875 [main] only set keyboard on splash if available
There may be cases where there is no keyboard set.
2009-11-28 00:24:58 -05:00
Ray Strode
1fa4f91a61 [main] make keyboard removal idempotent 2009-11-28 00:24:58 -05:00
Ray Strode
3ab7b2c54e [main] drop stray debugging remnant 2009-11-27 23:40:44 -05:00
Charlie Brej
20e86525c9 [script] Remove some debug code
Testing with it replying random strings to make sure the error cases were
caught. Code accidentally left in.
2009-11-24 23:03:19 +00:00
Charlie Brej
f11988e500 [script] Add string library and the first function "CharAt"
Currently the strings must be manually told to adopt from the library functions
by using String("string").function(). This is temporary and later it should be
possible to apply functions directly to strings.

CharAt gives the a single character string at the index specified. The first
character is at index zero. Characters beyon the end are empty strings, and
errors return NULL. This can be used thusly:

str = "something";
letter = String(str).CharAt(7); # letter = "n"
letter = String(str).CharAt(12); # letter = ""
letter = String(str).CharAt("foo"); # letter = NULL
2009-11-24 22:46:27 +00:00
Charlie Brej
230c0ee847 [script] Use a region to collate all updated areas
Previously, refresh, each sprite would refresh its old area, then its new area.
This, combined with situations where there are many sprites caused the area to
be redrawn many times, each time redrawing each overlapping sprite data.

Now we add all areas which need to be refreshed to a region and this makes a
smaller set of rectangles to refresh, and these are not overlapping.

Also uses the freeze display updates, which should work better now.
2009-11-23 00:41:02 +00:00
Charlie Brej
fea30a08ab [rectangle] Add exact overlap detection
If the width and X position of the two rectangles is the same, we can merge
them together. The new set of exact overlaps detects this and determines the
direction the rectangle should be extended.

The region code now uses this. WARNING, when expanding rectangles, these have
to be merged with the other rectangles down the list as there may be overlap.
2009-11-23 00:23:22 +00:00
Charlie Brej
aea6de4788 [rectangle] Rewrite rectangle_find_overlap function
The previous version had a flaw where it would find the rectangles overlapping
if they spanned a range in one axis. Despite them having no overlap in the
other axis.

Because this version has strange (although correct) behaviour when dealing with
empty rectangles, region only calls the overlap function when both rectangles
are not-empty.

The issue is if an empty rectangle sits on the edge of a full rectangle, the
function reports (possibly correctly) that the edge is overlapped by the empty
rectangle. The region code then nudges the rectangle down one space and
subtracts one from the empty rectangle height. This creates a rectangle with
negative height (bad thing).

If the other version can be fixed I will put it back, but this one is also
useful for the combining two rectangles of equal width.
2009-11-22 23:53:48 +00:00
Charlie Brej
9df80dc483 [region] Remove element only after processing
Now that we cannot rely on the next_node element. We must finish processing the
entry before removing it. Easiest way is to recurse and remove after return.
2009-11-22 22:53:12 +00:00
Charlie Brej
b7c34f1857 [region] Break circular dependency using an extra variable
new_area->width depends on new_area->x and vice versa. Break the dependency by
adding a temp variable.
2009-11-22 22:47:40 +00:00
Charlie Brej
dc11571049 [region] Couple more minor bugs in rectangle merge
Also one redundant line. I think this code was never used in anger. There is a
major bug in the rectangle collision code which makes this detection ad-hoc.
2009-11-22 22:42:13 +00:00
Charlie Brej
645452c099 [region] Overlap top right edge lower rectangle starts right of the old
Probably a typo in the original version.
2009-11-22 22:30:58 +00:00
Charlie Brej
fe46fb8803 [region] Free rectangle if empty
Previously we just returned and did not free.
2009-11-22 22:27:40 +00:00
Charlie Brej
3f2e0b1b22 [region] Do not prefetch next rectangle node while processing list
If we fetch the next node while working on the current node, recursing down the
list may remove the next node. Just to be double sure, we recurse direct to
next node so the current is not damaged.
2009-11-22 22:21:49 +00:00
Charlie Brej
338ed12168 [region] Clarify the testing code
The grids show which parts were not covered, or over covered.
2009-11-22 22:12:58 +00:00
Charlie Brej
f506b1e54d [region] Added test program
This examines the behaviour for correct behavious and performance.
2009-11-22 21:42:12 +00:00
Charlie Brej
6cdb6e330a [script] Fix typo in SetBackgroundBottomColor function name
This is in the compatibility wrappers so it didn't effect anything..
2009-11-22 21:19:52 +00:00
Charlie Brej
d876853867 [x11] Force refresh area to start at 0,0
The x and y values, in area element, were used to determine the position of the
window on the screen. With the x and y not at 0, the full redraw not working
correctly on the second head.
2009-11-21 22:35:55 +00:00
Charlie Brej
57fb558046 [script] Add text to image capability
Enables scripts to display test by converting it into an image. This can then
be shown using a sprite. Function takes a string and the value of the three
colors (red green blue).

new_image = Image.Text("text we want", 1.0, 0.0, 0.0); // gives red text image
2009-11-21 17:45:41 +00:00
Charlie Brej
2dbac8e942 [script] Migrate from image to pixel buffer
The script image is now a pixel buffer. This allows some clever possibilities:
We can now implement text to image.
We can compose images by drawing on them, and record the areas which changed to
avoid refreshing the whole thing.
2009-11-21 16:30:34 +00:00
Charlie Brej
fdfdd822fa [pixel-buffer] Move resize and rotate function from image to pixel buffer
There are comparability versions in image, but these are now deprecated.
2009-11-21 15:51:17 +00:00
Charlie Brej
1056a62695 [image] Allow converting an image to a pixel buffer
A pixel buffer is a much more useful object to manipulate. The image should
only be used when loading from files and never manipulating.
2009-11-21 14:10:23 +00:00
Charlie Brej
481b39155d [fade-throbber] Initialise views before animating
Only run the call to animation after all views are initialised. No visible
changes but this is more correct.
2009-11-21 12:52:48 +00:00
Charlie Brej
74ac719031 [fade-throbber] Move some operations from view to plugin start animation
There were timeouts called once for each view and the first view would cause
is_animating to be set which would stop other views from initialising.
2009-11-21 12:45:45 +00:00
Charlie Brej
ef82eb9a61 [fade-throbber] Move logo opacity value to individual views
When the logo opacity was plugin wide, one view would change its logo, and the
others would not bother. This prevented the logo form showing up on the second
screen.
2009-11-21 12:35:09 +00:00
Charlie Brej
58a28b3eeb [image] Use a pixel buffer to hold the image size and data
The image structure now contains a pixel buffer which holds the data. Some
functions are still within image for compatibility during the migration.
2009-11-19 23:55:22 +00:00
Charlie Brej
c0f5615e24 [image] Remove fd from the image structure
The fd element was only used within the load function so did not need to be in
the structure. Also removes the open and close file functions. Their contents
is inlined.
This is the last cleanup before merging with pixel-buffer.
2009-11-19 23:21:22 +00:00
Charlie Brej
4ae19c65af [image] Remove image layout structure
Simplifies the image structure to make it more similar to the pixel-buffer
2009-11-19 22:47:54 +00:00
Charlie Brej
a903cd4808 [image] Remove size from the image structure
Size was never used. Also removes the ply_image_get_size function.
Clean-up in preparation for merging with pixel-buffer.
2009-11-18 23:13:39 +00:00
Ray Strode
310b58922c Revert "[script] free views before nullifying event loop"
This reverts commit a93b6525b3.

It has unpleasant side-effects, and the real problem was fixed
in the last view commits.

Analysis from Charlie.
2009-11-18 16:51:20 -05:00
Ray Strode
63c94dfc6d [event-loop] Restart front of pending timeout list after dispatch
This is in case a timeout handler invalidates the list while being
dispatched.
2009-11-18 16:32:09 -05:00
Ray Strode
030a3a27a7 [event-loop] Remove pending timeout before dispatching
This way if the timeout handler removes itself, we don't
double-free and crash.  This is a better fix for

commit 79baa323e6
2009-11-18 16:26:03 -05:00
Ray Strode
b243f0c0bd Revert "[event-loop] Don't crash by running removed timeouts"
This reverts commit 79baa323e6.

It wasn't really the right way to fix the original problem.

Now we end up in a case where timeouts can still run after
stop_watching_for_timeout is called on them.  This can cause
crashes.

We need to instead fix the problem in a different way.
2009-11-18 16:24:23 -05:00
Ray Strode
a93b6525b3 [script] free views before nullifying event loop
If we don't do this then a timeout will get scheduled
by view_stop_animation.
2009-11-17 19:06:09 -05:00
Ray Strode
5a306e0b13 [event-loop] add some time out debugging statements
Now we report if code tries to remove a non-existing timeout,
or if there are multiple existing timeouts for the same
handler removed.
2009-11-17 18:39:30 -05:00
Charlie Brej
8debba60b0 [label] Operate with display set to NULL
Performing a ply_label_show with the display set to NULL allows the label to be
drawn any pixel buffer and not perform any redraw events.
2009-11-17 22:46:32 +00:00
Charlie Brej
bfaa5e9742 [label] Clean up dirty area on change of text or position
When the text or the position is changed, label will call draw events on areas
which were previously drawn on.

The two-step plugin is updated with the new method.
2009-11-17 22:03:41 +00:00
Charlie Brej
469578a974 [two-step] Add support for showing message text
Display the message text passed using the message plymouth command. This is
separate from the password prompt text.
2009-11-16 23:34:45 +00:00
Charlie Brej
7a003c41a6 [animation] Make sure we do not access frames beyond the end of the animation
Small bug which would try to access the animation frame beyond the end of the
array. Only occurs when doing a redraw after the animation has completed
(e.g. password dialog).
2009-11-16 23:24:20 +00:00
Ray Strode
d009c99eaa [region] Add missing break statement
This meant that in some cases the region was getting trimmed to
aggresively.
2009-11-14 23:20:18 -05:00
Charlie Brej
d6b55c6801 [image] Optimise interpolate and rotate routines.
These are small optimisation to: terminate interpolation early when operating
on fully transparent regions and do rotations by pre-computing the step size
rather than calling cos/sin/atan. These use around 30% fewer instructions on
general images.
2009-11-14 21:38:11 +00:00
Ray Strode
e0d482a7cb Revert "fasdf"
This reverts commit 92dd3083d0.
I have no idea why I commited that or pushed it.
2009-11-13 22:21:40 -05:00
Ray Strode
808e129fd1 [drm] Don't remove drm fb's that we don't know
When we access to the kernel console's fb, we don't own
it and shouldn't remove it.

Spotted by Scott James Remnant.
2009-11-12 12:48:54 -05:00
Ray Strode
a750b43584 [console] Fix ioctl call
it was doing if (!ioctl ... < 0).  Spotted by
Scott James Remnant
2009-11-12 09:15:57 -05:00
Ray Strode
fa912fbf5d [console] remove stray semicolon 2009-11-12 09:10:12 -05:00
Ray Strode
92dd3083d0 fasdf 2009-11-10 17:42:05 -05:00
Ray Strode
a30ec0193e Force terminal into raw mode on every write call
This is a76c5bc4b7 but for
text plugins.
2009-11-10 15:05:59 -05:00