Commit graph

71 commits

Author SHA1 Message Date
Ajay Dudani
07d9627d7c recovery: Handle EV_SW events
Change-Id: I29c13a941067cd1bbdced3bd67fd93293347d7b6
2015-02-10 16:28:07 -08:00
Ajay Dudani
9905f3a4ee recovery: Generate libminui dynamic library
Allow factory test images to use minui functionaltiy
by making use of libminui dynamic library.

Change-Id: I63e77420d5addbcc6eebeedc213f629085766b4c
2015-02-10 16:25:17 -08:00
Elliott Hughes
cd3c55ab40 Add missing includes.
Change-Id: I06ea08400efa511e627be37a4fd70fbdfadea2e6
2015-01-29 20:50:08 -08:00
Joey Pan
ba545d7e23 minui: avoid random screen frame at startup
Clear framebuffer at init.

[toddpoynor@google.com: forward port]
Change-Id: Ie98c7724cd974dcacef3e3559a6fe492864a5e72
2014-06-12 11:06:52 -07:00
Doug Zongker
eed6483638 am 0766cdf4: am d2fb4ed5: am d27aa76a: Merge "Support BGRA framebuffer"
* commit '0766cdf49acb77677864995e931eec391243505d':
  Support BGRA framebuffer
2014-05-13 22:24:06 +00:00
Daniel Leung
f766396d99 Support BGRA framebuffer
The re-designed recovery graphics code only supports RGB{_,X,A}
framebuffer, and this patch adds support for BGRA framebuffer.

Change-Id: I3780c8288088f497fa248f3492c54f43834a8598
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Reviewed-by: Jovanovic, Radivoje <radivoje.jovanovic@intel.com>
Reviewed-by: Parkinson, TimothyX L <timothyx.l.parkinson@intel.com>
Tested-by: Parkinson, TimothyX L <timothyx.l.parkinson@intel.com>
Reviewed-by: Boie, Andrew P <andrew.p.boie@intel.com>
Reviewed-by: Gumbel, Matthew K <matthew.k.gumbel@intel.com>
2014-05-13 15:00:40 -07:00
Greg Hackmann
64e7fcd925 am e9f9238a: am 1cd52423: am 1c2cf1db: Merge "recovery: minui: add adf backend"
* commit 'e9f9238af83f949dc000667356eba025e1241a2f':
  recovery: minui: add adf backend
2014-05-02 23:26:42 +00:00
Greg Hackmann
41909ddefb recovery: minui: add adf backend
Change-Id: I1ad97b5b62bddbcb1104fa0b4e54415b793a4194
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-04-25 15:47:34 -07:00
Doug Zongker
3e1cadc8f5 am 03008bc1: am aa4545b5: Merge "restore minui support for paletted images with < 8 bits"
* commit '03008bc1e89a780e382abe0567e709daecce92ff':
  restore minui support for paletted images with < 8 bits
2014-03-20 21:05:12 +00:00
Doug Zongker
577a130435 restore minui support for paletted images with < 8 bits
The PNG image loaders should support images that use palettes
requiring fewer than 8 bits.

Change-Id: Ibcb0ff6f04aea8de54b03c0efa7a79e9b3635146
2014-03-20 08:27:01 -07:00
Doug Zongker
7425d035ef am 47c7e365: am 130a7985: Merge "fix error log statement"
* commit '47c7e365071f75489604b2d0ba3109fe39bac1ef':
  fix error log statement
2014-03-18 00:02:38 +00:00
Doug Zongker
a388a76976 fix error log statement
We were printing the address of channels instead of the value there.

Change-Id: I652340c7c1a0abaf01af555e54d2c0366d21ad78
2014-03-17 16:51:47 -07:00
Doug Zongker
a68c517c62 am 80c1a386: resolved conflicts for merge of d90da130 to klp-modular-dev-plus-aosp
* commit '80c1a386d3f614919708b37986919ecaf74ee738':
  refactor image resource loading code in minui
2014-03-17 23:33:14 +00:00
Doug Zongker
a418aa7dd5 refactor image resource loading code in minui
Reduce the number of copies of libpng boilerplate.  Rename
res_create_* functions to be more clear.  Make explicit the use of the
framebuffer pixel format for images, and handle more combinations of
input and output (eg, loading a grayscale image for display rather
than use as a text alpha channel).

Change-Id: I3d41c800a8f4c22b2f0167967ce6ee4d6b2b8846
2014-03-17 12:27:08 -07:00
Mark Salyzyn
679baa06b7 am 4b6de1ba: am 026ebe02: Merge "Recovery 64-bit compile issues"
* commit '4b6de1ba1ce0fff95c18a8abb7ba6e5762006d49':
  Recovery 64-bit compile issues
2014-03-14 21:35:41 +00:00
Mark Salyzyn
f3bb31c32f Recovery 64-bit compile issues
Change-Id: I92d5abd1a628feab3b0246924fab7f97ba3b9d34
2014-03-14 13:51:39 -07:00
Doug Zongker
5290f2087a separate fbdev-specific code out from minui
Isolate the code that interacts with fbdev, in preparation for adding
a new backend.

Change-Id: I19105e9da1ca6408cebc110f7e2bb5abfb481ee9
2014-03-11 14:56:41 -07:00
Doug Zongker
16f97c3961 remove pixelflinger from recovery
Recovery now draws directly to the framebuffer by rolling its own
graphics code, rather than depending on libpixelflinger.

The recovery UI is modified slightly to eliminate operations that are
slow with the software implementation: when the text display / menu is
turned on, it now appears on a black background instead of a dimmed
version of the recovery icon.

There's probably substantial room for optimization of the graphics
operations.

Bug: 12131110
Change-Id: Iab6520e0a7aaec39e2ce39377c10aef82ae0c595

Conflicts:
	minui/resources.c
2014-03-11 14:40:04 -07:00
Doug Zongker
469954fe3d change how recovery animation is implemented
Instead of one 'base' installing image and a number of overlay images
that are drawn on top of it, we represent the installing animation
with one PNG that contains all the animation frames, interlaced by
row.  The PNG is expected to have a text chunk with the keyword
'Frames' and a value that's the number of frames (as an ascii
string).  This representation provides better compression, removes the
need to subclass ScreenRecoveryUI just to change the position of the
overlay or number of frames, and doesn't require gr_blit() to support
an alpha channel.

We also remove the 'indeterminate' progress bar used when wiping data
and/or cache.  The main animation serves the same purpose (showing
that the device is still alive); the spinning progress bar has been
redundant for a while.

This changes the default recovery animation to include the
antenna-wiggling and gear-turning that's used in the Nexus 5 recovery
animation.

Change-Id: I51930a76035ac09969a25472f4e572b289418729

Conflicts:
	screen_ui.cpp
	screen_ui.h
2014-03-11 14:06:35 -07:00
Doug Zongker
830b3e3363 separate fbdev-specific code out from minui
Isolate the code that interacts with fbdev, in preparation for adding
a new backend.

Change-Id: I19105e9da1ca6408cebc110f7e2bb5abfb481ee9
2014-03-11 13:22:04 -07:00
Doug Zongker
39cf417e17 remove pixelflinger from recovery
Recovery now draws directly to the framebuffer by rolling its own
graphics code, rather than depending on libpixelflinger.

The recovery UI is modified slightly to eliminate operations that are
slow with the software implementation: when the text display / menu is
turned on, it now appears on a black background instead of a dimmed
version of the recovery icon.

There's probably substantial room for optimization of the graphics
operations.

Bug: 12131110
Change-Id: Iab6520e0a7aaec39e2ce39377c10aef82ae0c595
2014-03-11 11:10:00 -07:00
Doug Zongker
eac881c952 change how recovery animation is implemented
Instead of one 'base' installing image and a number of overlay images
that are drawn on top of it, we represent the installing animation
with one PNG that contains all the animation frames, interlaced by
row.  The PNG is expected to have a text chunk with the keyword
'Frames' and a value that's the number of frames (as an ascii
string).  This representation provides better compression, removes the
need to subclass ScreenRecoveryUI just to change the position of the
overlay or number of frames, and doesn't require gr_blit() to support
an alpha channel.

We also remove the 'indeterminate' progress bar used when wiping data
and/or cache.  The main animation serves the same purpose (showing
that the device is still alive); the spinning progress bar has been
redundant for a while.

This changes the default recovery animation to include the
antenna-wiggling and gear-turning that's used in the Nexus 5 recovery
animation.

Change-Id: I51930a76035ac09969a25472f4e572b289418729
2014-03-07 09:45:44 -08:00
Colin Cross
707d321a87 am 2739ed96: am a5d105e2: Merge "recovery: fix building with pointer-to-int errors turned on"
* commit '2739ed9628f72813d213b7a429c4c1b8dcebe5fc':
  recovery: fix building with pointer-to-int errors turned on
2014-02-06 03:07:48 +00:00
Colin Cross
92cdf9c372 recovery: fix building with pointer-to-int errors turned on
Use intptr_t/uintptr_t to cast between pointer and int to allow
building with -Werror=pointer-to-int-cast and
Werror=int-to-pointer-cast turned on.

Cast to char* instead of unsigned int for pointer arithmetic.

Change-Id: Ia862306fdcca53866b330e8cf726f3d62f2248a0
2014-02-05 17:34:45 -08:00
Nick Kralevich
f3819c271e am 27efc8f9: am 617d1cad: Merge "minui: do not use flexible array initialization"
* commit '27efc8f9d1711134051b45d28b2fc38bfb4c7dc6':
  minui: do not use flexible array initialization
2014-01-04 02:02:17 +00:00
synergy dev
a0ecc8c427 minui: do not use flexible array initialization
Avoiding the use of gnu extensions improves code portability

Change-Id: I441a49ce08b6ecb1d735ca453552fa92026c5016
2013-11-26 03:21:13 +00:00
Doug Zongker
58207b84d3 fix use of RGBA images in minui
Bug: 10934401
Change-Id: I471b30e5b2e877c620e4a0a524e950cddbc6d2c0
2013-09-25 16:41:07 -07:00
Todd Poynor
a5ef19fabd recovery: fix epoll events type to uint32_t
Change-Id: I5db9987102201c18821acb45d1f824e9865a1451
2013-09-17 21:58:52 +00:00
Todd Poynor
4665ede960 minui: add ev_get_epollfd() to retrieve epoll file descriptor
To allow use of ev_* functions with an external main loop.

Change-Id: If73717b64d7c455ca726b90a815a31c1edf52544
2013-09-12 12:42:34 -07:00
Todd Poynor
1fc89d4c84 minui: convert ev_*() event interface to epoll
Help enable external main loop combined with ev_*() key event processing.

Specify EPOLLWAKEUP to hold a wakelock on any event, assuming this is needed
(may need to make this optional).

Convert callback events parameter to unsigned int.

Change-Id: Ib5e09abbd7724ffd830e2cf8e25e7eb59d3aa072
2013-09-12 12:42:33 -07:00
John Reck
19877de513 am 5c4e1dac: Merge "Update libpng API usage"
* commit '5c4e1dac0bd8f31559bd50eec4343b7a17b7a976':
  Update libpng API usage
2013-08-27 09:54:05 -07:00
John Reck
94fd07ba6d Update libpng API usage
Remove usage of deprecated methods

Change-Id: I747568a2c8c0c65ecbc9a3da4bac7b9cac7708ab
2013-08-26 16:45:33 -07:00
John Reck
41329c5fd0 Fix libpng API usage
Remove usage of deprecated methods that were removed in 1.6

Change-Id: I2a669bf5201197f60adfdbe512fd729bebb74f9c
2013-08-13 13:01:29 -07:00
Doug Zongker
fafc85b4ad recovery: move log output to stdout
Recovery currently has a random mix of messages printed to stdout and
messages printed to stderr, which can make logs hard to read.  Move
everything to stdout.

Change-Id: Ie33bd4a9e1272e731302569cdec918e0534c48a6
2013-07-09 12:50:24 -07:00
Doug Zongker
6fd59ac07d more font improvements and cleanup
Get rid of the notion of a font's "ascent"; the reference point for
drawing is the top-left corner of the character box rather than the
baseline.  Add some more space between the menu entries and make the
highlight bar around the text.

Replace the default font.png with two images; the build system will
include one or the other based on the resolutions of the device.

Restore the original compiled-in bitmap font, to fall back on when
font.png can't be found (eg, in the charger binary).

Add support for bold text (when a font.png image is used).

Change-Id: I6d211a486a3636f20208502b1cd2aeae8b9f5b02
2013-03-07 13:34:24 -08:00
Doug Zongker
55a36ac1e0 recovery: change font for menus to be an image
Instead of representing the font used for menus and log messages in
the recovery binary, load it from a resource PNG image.  This allows
different devices to substitute their own font images.

Change-Id: Ib36b86db3d01298aa7ae2b62a26ca29e6ef18014
2013-03-04 16:37:44 -08:00
Doug Zongker
c560a67b12 add optional overscan compensation to recovery graphics
If your screen is a TV, it may not actually be displaying the edges of
the framebuffer.  Allow specifying an overscan percentage, and move
each edge of the framebuffer in by that percent of the width/height.
(The gr_* layer just lies to the caller about the size of the
framebuffer, telling the caller it's smaller than it really is, and
offsets all drawing commands to match.)

Change-Id: I11bb2feb39ae522bd3e957a14ebdecf3609e0fdc
2012-12-18 16:31:27 -08:00
Doug Zongker
52eeea4fa5 minor recovery fixes
- protect against missing/malformed bitmaps: fail to display them but
  don't crash.

- don't draw animation overlays until the overlay offset is computed.

- logging cleanup

Change-Id: Ieb1c155cfbb11e643000bdb5d1a57900c8757739
2012-09-04 14:28:25 -07:00
Doug Zongker
aff4dbb0ae Merge "recovery locale handling fixes" into jb-mr1-dev 2012-08-29 15:57:02 -07:00
Doug Zongker
8b240ccca1 recovery locale handling fixes
- change locale filename to "last_locale" so the main system doesn't
  delete it

- clean up some chatty logging

- update images with real German (other languages TBD)

Change-Id: I2ebb4ed4e054bd1808a3042d9efbb2c18f3a044d
2012-08-29 15:19:29 -07:00
Jean-Baptiste Queru
d52ef348d5 am bddbb5b3: Merge "Fixing trivial warnings for libminui"
* commit 'bddbb5b370d925d6e5ae62d560f5e7ad09a6ffac':
  Fixing trivial warnings for libminui
2012-08-24 13:06:43 -07:00
Doug Zongker
02ec6b88ed add simple text to recovery UI
- recovery takes a --locale argument, which will be passed by the main
  system

- the locale is saved in cache, in case the --locale argument is
  missing (eg, when recovery is started from fastboot)

- we include images that have prerendered text for many locales

- we split the background states into four (installing update,
  erasing, no command, error) so that appropriate text can be shown.

Change-Id: I731b8108e83d5ccc09a4aacfc1dbf7e86b397aaf
2012-08-22 17:26:40 -07:00
Edwin Vane
edc5d17096 Fixing trivial warnings for libminui
After fixing three trivial warnings, libminui builds cleanly with clang.

Change-Id: Id7c6228295427a5ed3c774c5f90e88a28336c1f7
Author: Edwin Vane <edwin.vane@intel.com>
Reviewed-by: Kevin P Schoedel <kevin.p.schoedel@intel.com>
2012-08-21 16:04:43 -04:00
Ed Heyl
64c5a59be9 fix conflicts with merge of jb-dev-mako
Change-Id: I2d8d18232ed02b2c4e3e661544046bf4b8039800
2012-07-26 13:57:07 -07:00
Doug Zongker
aade2e590e am dd6cd4fc: Merge "graphics: add support for "single buffering""
* commit 'dd6cd4fcc1b22df7f55e1ab3e54589939dc54179':
  graphics: add support for "single buffering"
2012-07-20 22:35:27 -07:00
Devin Kim
862d026fb2 minui: fix screen update issue
yres_virtual value is set incorrectly, causing serveral images to be skipped.
Change this value according to the number of buffers to fix this issue.

from: codeaurora.org
minui: Display the battery charging image correctly
commit: 581a4dead6b96579a13ff22e2454c1f329731679

Change-Id: I10f5d1c6cc37705f0287c7dd517082de2e11d264
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-07-20 07:01:11 -07:00
Octavian Purdila
0e34880ca2 graphics: add support for "single buffering"
When we don't have enough video memory for double buffering we
fallback to "single buffering".

Change-Id: I8bfab6d8cd6b54f0cc6c67edc41a4c37d8fbd4ba
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2012-07-11 15:32:11 -07:00
Doug Zongker
9c5efe6bde allow double-quotes or not in TARGET_RECOVERY_PIXEL_FORMAT
Change-Id: I0bf22c87c51a34ee4a839c4966277fad8150bd59
2012-07-11 13:21:02 -07:00
Doug Zongker
28ce47cfa6 turn recovery into a C++ binary
Change-Id: I423a23581048d451d53eef46e5f5eac485b77555
2011-10-31 10:24:09 -07:00
Dima Zavin
441031dadc minui: add ability to synchronize current key state
If a key is down prior to the time of initialization, we would not get the
down event for the key, and thus think that the key is not pressed.

Add an interface that allows one to provide a callback to execute
on all keys that are currently down.

Change-Id: I2a4096c0cb4c7c7a9a80d207835f168a0b418413
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-12 15:53:32 -07:00