summaryrefslogtreecommitdiffstats
path: root/minuitwrp/minui.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-03-18TW_ROTATION: add flag to handle hardware-rotated display panelsVladimir Oltean1-1/+17
* The existence of TW_ROTATION that implements this feature at the level of calls to libpixelflinger API closely mirrors the existence of ro.sf.hwrotation for surfaceflinger in LineageOS. * A brute-force approach was previously attempted via the BOARD_HAS_FLIPPED_SCREEN makefile flag. That code iterated over the active display surface in a double-buffered setup, and performed a "smart" memcpy from the UI drawing surface (gr_draw) onto the display surface. The problem was that, without heavy loop optimizations, that code could have never scaled for 90 and 270 degree rotation. I tried and you could literally see the for loop with the naked eye while the display surface was updating. * That code is now gone, but support for BOARD_HAS_FLIPPED_SCREEN := true is still there (now means TW_ROTATION := 180). * This patch relies on the assumption that it is impossibly difficult and non-portable to rotate whole framebuffer display surfaces, in a way that is not dependent upon the graphics backend (adf, fbdev, drm, overlay etc). Therefore, it identifies the rendering primitives that the TWRP graphics stack exposes to the GUI application above, and implements hwrotation inside each of those calls instead: - gr_line(), gr_fill() - 2D geometric shapes (lines, rectangles) - gr_blit() - graphical image resources - gr_ttf_textExWH() - font rendering - gr_fb_width(), gr_fb_height() - framebuffer resolution * The gist is to keep the backend and framebuffer (dimensions, row size etc) unchanged (because making changes there is asking for trouble), but present an altogether different reality to the calling API, according to the compile-time constant TW_ROTATION. * All (x, y) API coordinates and shapes are transformed before being actually rendered as (x_disp, y_disp) display coordinates. * With TW_ROTATION := 90 or 270 you can turn a landscape device into a portrait one, because the GUI is fooled by the reversed dimensions reported by gr_fb_width() and gr_fb_height() and renders the UI as for a different device. * For blit and text rendering operations, figuring out the transformed coordinates in display space is not enough, as the surfaces that are to be rendered have to be rotated themselves. This is handled by allocating an intermediary rotated surface on each rendering operation (not ideal), so the code with the intermediary surface is compiled out for the TW_ROTATION := 0 case. * This is still not as bad as rotating the whole framebuffer though, and on a msm8976 device the performance hit is not even noticeable (for software rendering). * Currently there is no attempt to make a connection between the TW_ROTATION and the { RECOVERY_TOUCHSCREEN_SWAP_XY, RECOVERY_TOUCHSCREEN_FLIP_X, RECOVERY_TOUCHSCREEN_FLIP_Y } settings. Change-Id: Ic8966ad5360c8a499649fdb16e242286640fd992 Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
2016-01-27Update minuitwrp graphics in line with latest minuiEthan Yonker1-13/+11
Note: events.cpp is still old code renamed to cpp to make it easier to call functions like gr_fb_width(). I had to modify AOSP fbdev code to provide a separate memory surface for drawing to as drawing directly to the framebuffer resulted in rendering taking about 5 times longer. I also modified AOSP adf code to provide a separate memory surface for drawing for the same performance reasons. The Nexus 9 supports adf graphics. Overlay graphics work on at least one device. Overlay provides a separate memory buffer already so performance is good. I do not have a drm device yet that I know of. I made some attempt to update the drm code to determine the correct pixel format based on the drm graphics format, but what is available in pixel flinger and what is available in drm do not line up all that well. Reports are that the Pixel C is using drm graphics, but performance is slow, likely due to the use of a mmap instead of a memory buffyer. Change-Id: Ibd45bccca6ac2cb826037aa9b2aa5065cf683eed
2015-10-16Allow text to scale to fitEthan Yonker1-0/+4
Change-Id: Iacd4bb78f551b51d092ecde09521b5541e7dadcd
2015-10-15Remove support for non-TTF fontsEthan Yonker1-8/+0
This patch set removes support in TWRP for the old .dat file format as well as support for the AOSP style fonts in header files. We need TTF for scaling. Note that the old AOSP style header font is still supported in minui which is not used by TWRP. Change-Id: I6124a3333d479f1fc668138f7e32c4be9b519552
2015-03-11Implement gr_line() and gr_render_circle()Vojtech Bocek1-0/+2
Change-Id: I63c8dcfa276bbeb550ca051a3a1a0646a2d07dc6 Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2015-02-15gui: support scrollable lists without headersthat1-0/+2
If the <header> element doesn't exist, the header is not drawn. - minuitwrp: add function for clipping all drawing to a rectangle ...and another one to cancel it. Change-Id: If0f688a5debee6ebd9c457999fe571705a42c5cc
2015-02-10Scale the GUI to fit the screenEthan Yonker1-0/+2
With this patch set, if needed, we scale the images during early boot. TTF support is needed to properly scale the font. No font scaling is done on the old style fixed width font used in the console. Special thanks to _that for figuring out the scaling and blending function calls to make this possible. Change-Id: If2f79bef16d6db2e1298bfc3d00c9bcca2bee37a
2015-02-09gui: avoid high CPU usage while waiting for inputthat1-1/+1
- add a timeout to ev_get - set timeout to 1 second when idle - delay timeout for 15 frames to keep animation objects working - stop kinetic scrolling immediately at end of list Change-Id: I77138055c464b65b71e296f9c7ef63ea06809bc1
2015-01-30Move input handling into the main threadEthan Yonker1-1/+1
This also makes the hardwarekeyboard.cpp file that I created for the Asus Transformer tablets with a keyboard dock the default hardware keyboard handler. USB keyboards should work properly now if present for keyboard input. Change-Id: I724606e91ffe2a55265a9d1cb1ec714de244d38b
2014-11-06Revert "Make libminuitwrp compile"Dees Troy1-10/+1
This reverts commit a27d02fab9d6feb793cdcd6146f2655658f36f2b. Change-Id: I62d143044749f101cd70fef048057f896e46c208
2014-11-06Make libminuitwrp compileEthan Yonker1-1/+10
Odds are this is horribly broken, but we are not able to work on it just yet. Change-Id: I8cd12a6dba7957b1ccc1275b8d72c24797856db0
2014-10-14Add support for TrueType fontsVojtech Bocek1-3/+18
* Keeps original font system in place * Uses the same API as original font system: - You can render only one line at a time - You can only use one font and color for one gr_text* call * Caches all rendered text, with a string cache limited to 400 entries, then it trucates to 250, which results in memory usage hovering around 5-10MB Change-Id: I36107b9dcd8d57bae4486fce8b8f64e49ef3d906 Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2014-07-09Implement "take a screenshot" featureVojtech Bocek1-0/+2
* Like in android - press power+volume down, screenshots are saved in /sdcard/Pictures/Screenshots (if /sdcard is mounted) or /tmp Change-Id: Iaefa15b11a1d5fdfac57d77388db1621f378a8d4 Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2014-02-26Add word wrap to console output and fix scrolling in consoleDees Troy1-0/+1
Change-Id: Ibcf89952ee1391350c715f1ec82cf0cdb9b0ca7d
2014-02-07Implement mouse cursorVojtech Bocek1-0/+1
Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: I66d6db7b3ed9cca50b469d125b36224332e06913
2014-02-06Add haptic feedbackSamer Diab (S.a.M.e.R_d)1-0/+2
Change-Id: I15d723f73c0b0bb4a40645d1c3f4c1c616f36998
2013-08-24Revert "Fix touch not working due to gr_fb_width returning 0 in some cases"Dees_Troy1-1/+1
This reverts commit 70e1129612765b14e5aace0155d4683c91cde951. No longer needed after http://review.teamw.in/#/c/655/
2013-08-11Fix touch not working due to gr_fb_width returning 0 in some casesDees_Troy1-1/+1
Change-Id: Id5ce607a181110118ebc647fc07d387a7a3dc660
2013-03-01Add 2 second pre-dim and bugfix blank timerDees_Troy1-1/+1
2 second predim code courtesy of bigbiff Change-Id: I052ac422f78dc82c05f58c188587534b800b935a
2012-09-05TWRP-ify AOSP codeDees_Troy1-29/+22
Pull in most TWRP sources Stub out partition management code Make it compile -- probably will not boot Kind of a mess but have to start somewhere
2012-08-23add simple text to recovery UIDoug Zongker1-0/+2
- 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
2011-10-31turn recovery into a C++ binaryDoug Zongker1-0/+8
Change-Id: I423a23581048d451d53eef46e5f5eac485b77555
2011-10-28turn recovery into a C++ binaryDoug Zongker1-0/+8
Change-Id: I68a67a4c8edec9a74463b3d4766005ce27b51316
2011-10-13minui: add ability to synchronize current key stateDima Zavin1-0/+2
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-09-02minui: events: add ability to poll on non-input fdsDima Zavin1-0/+1
Change-Id: Iad52a6f2adcae0068d252d6163586f9d7b93121d Signed-off-by: Dima Zavin <dima@android.com>
2011-09-02minui: events: refactor event acquisitionDima Zavin1-2/+13
Events are now delivered through a callback mechanism during a call to ev_dispatch(). This will allow us to extend the events code to handle other devices/fds, not just input. One such example is the ability to process uevents. During initialization, we provide an input callback to ev_init that gets called when a new event is encountered during dispatch. ev_get has been removed and replaced with ev_get_input() helper function that can be called from inside the callback to attempt to get an input event. The existing client of ev_get in recovery has been split up such that the input thread just calls ev_wait(); ev_dispatch(); and the input_callback handles individual events by using the ev_get_input() helper. Change-Id: I24d8e71bd1533876b4ab1ae751ba200fea43c049 Signed-off-by: Dima Zavin <dima@android.com>
2011-08-30minui: graphics: add interface for framebuffer blank/unblankDima Zavin1-0/+3
Change-Id: I5c3ee61cbf6fadae50f10b9f2e73caceaa5048a7 Signed-off-by: Dima Zavin <dima@android.com>
2011-08-30minui: graphics: add ability to query font sizeDima Zavin1-0/+1
Change-Id: I5e8f477b7b205794f2975f12e6b6010c177f6052 Signed-off-by: Dima Zavin <dima@android.com>
2009-11-13eclair snapshotJean-Baptiste Queru1-16/+0
2009-06-11split out device-specific recovery UI code into vendor directoriesDoug Zongker1-16/+0
Take some device-specific details of the recovery UI (eg, what keys to press to bring up the interface and perform actions, exact text of the menu, etc.) and split them out into separate C functions. Arrange to take implementations of those functions from the appropriate vendor directory at build time. Provide a default implementation in case no vendor-specific one is available.
2009-03-04auto import from //depot/cupcake/@135843The Android Open Source Project1-0/+70
2009-03-04auto import from //depot/cupcake/@135843The Android Open Source Project1-70/+0