Commit Graph

33 Commits

Author SHA1 Message Date
Greg Wallace ace7623306 Flag to enable jpg support
Builder using a custom theme may have need for this.  Add a flag to
easily enable jpg support.

Change-Id: Ica74f8cb1312d3193105f2201a5cf8073e2edc82
2016-02-03 05:15:10 +01:00
Ethan Yonker 31f855b5ad Change some graphics build flags
While not all of these old build flags are active or implemented
yet (and they may not ever be implemeted until we find a device
that needs them), we need to make sure that the old build flags
are only applied when actually needed. Since there are a lot of
device trees that probably won't get updated due to lack of device
maintainers, we will rename the build flags and fix up devices on
a case by case basis.

Also added some pixel format related build flags to the make file
from AOSP so that AOSP devices should work in TWRP without
additional build flags.

Change-Id: I11ab475297d02b6aeffe89404fe50b4799a36be3
2016-02-03 03:57:53 +01:00
Greg Wallace 62c188ca3d Fix minuitwrp include mistake
Change-Id: Iebb5763277eec83fd6db4fdca8b7ecfd3c78dc6b
2016-01-29 17:56:35 +01:00
Ethan Yonker e95c4868b9 ifdef and comment out libjpeg
Chances are there are not many themes in widespread use that are
using jpeg images, but this will be easy to revert back or even
just temporarily modify if we need jpeg support in a pinch.

Change-Id: If17b05ce3ebccce724fd74b26ed8ea91b287c3cf
2016-01-27 10:58:02 -06:00
Ethan Yonker fbb4353a24 Update minuitwrp graphics in line with latest minui
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
2016-01-27 10:53:13 -06:00
Ethan Yonker 2c80efa0c8 Update rules for libpixelfinger_twrp
Change-Id: I40131f330e902afab033e810761bf98c07bbd03d
2015-11-07 07:57:36 -06:00
Ethan Yonker 88037f476f Remove support for non-TTF fonts
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-10-15 09:23:39 -05:00
Kra1o5 7756859abe Add support for RGBA_8888 pixel format
Change-Id: Ia15d49e51cad5bc8a3291975e1ff515a2b1c419c
2015-10-14 13:32:03 -05:00
Ethan Yonker c798c9cd24 Merge up to AOSP marshmallow-release
In order to maintain compatibility with older trees, we now have
minadbd.old and minui.old. I had to use a TARGET_GLOBAL_CFLAG to
handle ifdef issues in minui/minui.d because healthd includes
minui/minui.h and there was no other alternative to make minui.h
compatible with older trees without having to modify healthd rules
which is outside of TWRP.

Note that the new minui does not currently have support for qcom
overlay graphics. Support for this graphics mode will likely be
added in a later patch set. If you are building in a 6.0 tree and
have a device that needs qcom overlay graphics, be warned, as off
mode charging may not work properly. A dead battery in this case
could potentially brick your device if it is unable to charge as
healthd handles charging duties.

Update rules for building toolbox and add rules for making toybox

Use permissive.sh in init.rc which will follow symlinks so we do
not have to worry about what binary is supplying the setenforce
functionality (toolbox, toybox, or busybox).

Fix a few warnings in the main recovery binary source code.

Fix a few includes that were missing that prevented compiling in
6.0

Change-Id: Ia67aa2107d260883da5e365475a19bea538e8b97
2015-10-09 11:15:29 -05:00
Ethan Yonker d6821a11bb Add TW_IGNORE_ABS_MT_TRACKING_ID
Fixes touch on Oppo R7 Plus

Oppo R7 Plus, when recovery is flashed and booted from the actual
recovery partition, the digitizer sends some extra touch data for
up to 10 different touch slots even if no actual touch is present
for those slots (ABS_MT_SLOT). This patch allows TWRP to handle
touch data properly for this device and maybe others.

Change-Id: I8f9171b605566788b674b3d4d96bd9f2f65736c2
2015-08-26 22:36:34 +02:00
Kra1o5 c9556ccb5e Add flag to disable double buffering
Some devices don't support double buffering, so add
the flag TW_DISABLE_DOUBLE_BUFFERING to disable it

Change-Id: Ia9c233fa229ae9c221a6c6f219b216d1753052f4
2015-06-29 19:42:40 +02:00
Kra1o5 de50c5f552 Add option to use new heap_id_mask instead of old heap_mask
Use TW_NEW_ION_HEAP := true to use it

Change-Id: I2ad105fa6d122b460ed4b5dc78563077b7904567
2015-04-23 21:49:57 +02:00
Ethan Yonker 591b920536 Reduce themes to 5 and rely on scaling
This will significantly reduce theme maintainence and should be a
lot more sustainable over time. Eliminate most themes leaving only
5 remaining in 3 categores:
 * watch_mdpi: 320x320
 * portrait_mdpi: 480x800
 * portrait_hdpi: 1080x1920
 * landscape_mdpi: 800x480
 * landscape_hdpi: 1920x1200

Add handling to map the old DEVICE RESOLUTION to the new TW_THEME
build flag. New devices should specify a theme using the new
TW_THEME build flag using one of the 5 values from the list above.
Long term we will eliminate the use of the DEVICE_RESOLUTION flag
in favor of the new flag.

Change the way sliders render so that they completely follow the
placement="5". This will probably break some custom themes but is
necessary so that we can retain the aspect ratio on slider images
and still have them rendered at the center of the screen.

Add code to the console slideout button so that it can be centered.
Centering the slideout button allows us to keep the button at the
center of the screen when retaining aspect ratios on the image.

Add more retain aspect ratios for home, back, slideout, folder,
file, and lock screen images.

Change the way we build the top bar in TWRP. It is now mostly
drawn using fill objects and the TWRP logo is a separate image so
that we can retain its aspect ratio during scaling. Thanks to Mark
Norelus for providing the TWRP logo.

Change-Id: I801a7b3163cad9ef353461f4c327690a9ccbb3aa
2015-03-12 18:41:34 -05:00
Dees Troy 3454ade92d Use /twres instead of /res for theme resources
AOSP and other ROM trees now do a rm -rf of the res folder during
the ramdisk creation process that removes the TWRP resources.
Using /twres instead of /res works around this issue making TWRP
more compatible with AOSP and other build trees.

Change-Id: I0d4c7e06ca381ac5aa0069b6f2b8c47f7dec49e7
2015-01-22 15:21:27 -06:00
Ethan Yonker 32f68a3c92 Add TW_IGNORE_MT_POSITION_0 touch flag
This fixes touch on the a11 when fastboot booting the image. We
are also adding event logging for ABS_MT_POSITION data which we
should have been logging before but for some reason we did not.

Change-Id: I1b38c31c716efdcbe48db4faa5d0cef97c91c58e
2014-12-29 16:21:57 +01:00
Kra1o5 0024e3826b Add support for custom kernel headers
Change-Id: I39fe4de8919e59dd75e8cb535fa0648948035c26
2014-12-17 11:47:33 +01:00
Dees Troy f171e103a8 Revert "Make libminuitwrp compile"
This reverts commit a27d02fab9.

Change-Id: I62d143044749f101cd70fef048057f896e46c208
2014-11-06 22:20:20 +01:00
Ethan Yonker a27d02fab9 Make libminuitwrp compile
Odds are this is horribly broken, but we are not able to work on
it just yet.

Change-Id: I8cd12a6dba7957b1ccc1275b8d72c24797856db0
2014-11-06 10:24:42 -06:00
Vojtech Bocek 76ee903d84 Add support for TrueType fonts
* 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-10-14 15:06:56 +02:00
Matt Mower 55c75cad80 Build block TWRP with RECOVERY_VARIANT
Enable TWRP to reside alongside other recoveries with the naming
convention: bootable/recovery(-flag). If TWRP resides at
bootable/recovery and a device does not specify RECOVERY_VARIANT, then
it will build like normal. If TWRP resides at bootable/recovery-twrp,
then its makefiles will only be parsed if a device specifies
'RECOVERY_VARIANT := twrp'. This prevents TWRP specific makefile
warnings/errors (notably, missing DEVICE_RESOLUTION) when another
recovery is being built.

Change-Id: I8f02fffcd79c309c7123b9428eedc69af02e126e
2014-09-03 10:53:37 -05:00
Ethan Yonker 5742a40b87 Allow blacklisting input devices by build flag
Usage:
TW_INPUT_BLACKLIST := accelerometer
TW_INPUT_BLACKLIST := "accelerometer\x0agyroscope"

This can be used to fix touch input on devices where an input
device is breaking touch processing in TWRP.

We are using new line chars to separate multiple devices and in
the make file you specify the new line character with \x0a which
is the hex code in ASCII for a new line.

The new line character might be a bit of a pain to use as a
delimeter, but it is highly unlikely that an OEM will ever name
an input device with a new line character in the name.

Change-Id: I255136b7a686909a23e649918c661843153c2853
2014-08-14 10:05:40 -05:00
xNUTx cd56f8cb29 TW_SCREEN_BLANK_ON_BOOT will jolt the screen/touch driver.
If on the default settings the screen will only kick in to action
AFTER it has gone to sleep once and has been woken up again with a
key press, this will be needed to set to 'true' in the
BoardConfig.mk

The code was already there, Dees_Troy and I thought it would be
nice to make it a switch to control at compile time.

Change-Id: I5116a27afe9cba57122761c192ea3ee153d98162
2014-08-10 07:59:35 -05:00
Ethan Yonker b24caab14c Set font based on resolution if not set already
Change-Id: I6efaeb1c508c06513ac9ace7aa72a2eefa0cb1bb
2014-08-07 09:28:04 -05:00
Vojtech Bocek 03fd6c56fe Implement "take a screenshot" feature
* 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-07-09 17:35:36 +02:00
Flemmard f4674619a2 minuitwrp: use a whitelist for the input device instead of a hardcoded ignore list
* use a whitelist for the input device to listen on, every other will be ignored

Change-Id: I1296a45ec3d5ca0bca2a9e2601b0710e2c030fde
2014-06-30 11:45:40 -05:00
Ethan Yonker 4ee5ad751f Support Qualcomm overlay graphics in recovery
Change-Id: Ia75c34ab1a45b7c8802c902906198517aa3437d5
2014-04-01 11:13:58 -05:00
Ibrahim Awwal 2e9cb01bda Don't interpret ABS_MT_TOUCH_MAJOR == 0 as touch release
On n8013 at least, this event is sometimes/often sent on touch start which
causes touches to be randomly rejected and throws you back to the start screen.

Touch releases still work fine for me, since it sends ABS_MT_TRACKING_ID == -1
for that purpose.

Adds a flag TW_IGNORE_MAJOR_AXIS_0 to configure this behavior.

Change-Id: I14bb036a2c2d4ee676b642c3ab297c55bb6c2084
2014-01-04 12:38:26 -08:00
OliverG96 06b91e7965 crypto: Fix crypto dependencies for ICS/Samsung methods
- libmincrypt renamed to libmincrypttwrp that is an static library
- libjpegtwrp does not exist
- libfs_mgrtwrp is for JB decryption methods

This fixes making full builds when TW_INCLUDE_CRYPTO_SAMSUNG := true and TW_INCLUDE_CRYPTO := true are set.
Somehow typing make recoveryimage doesnt push the mentioned issue.

Change-Id: I7cad5db4f51152a1a8209e619b188ca88d7c74d1
2013-12-19 17:08:31 +00:00
Dees_Troy 930bf01caf Remove libjpegtwrp and use CM provided libjpeg 2013-08-10 22:19:03 +00:00
Dees_Troy 66fc8b5887 Tweak libs 2013-04-05 19:42:15 +00:00
Dees_Troy 2673cec07a Move all AOSP code out of recovery binary
Improves license compatibility between GPL and Apache

Change-Id: I2b165aa575bb6213af6b07936f99610c113443f0
2013-04-04 18:57:34 +00:00
Dees_Troy 86382ca223 Add build flag for custom graphics 2013-01-15 16:54:59 +00:00
Dees_Troy 51a0e82eb2 TWRP-ify AOSP code
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-09-05 15:24:31 -04:00