summaryrefslogtreecommitdiffstats
path: root/minui/graphics.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* minui: remove libadf since it is no longer supportedMarissa Wall2020-02-281-7/+1
| | | | | | | | | | Libadf is being removed since there are no android common kernels that support adf. Remove support from miniui. Test: Compiles and boots Bug: 150467766 Change-Id: Ic66ea7a012b0466810ddeb8f884150b50c8ae769
* minui: add ARGB_8888 formatAdrian Salido2019-12-131-1/+3
| | | | | | | | | | | | | | | | | | | | Minui currently really only supports composing in 2 different formats (see gr_color()) with ALPHA always as MSB. However, some devices interpret PixelFormat as either Big Endian (i.e. ARGB has alpha at MSB) or Little Endian (i.e. BGRA has alpha at MSB). This change attempts to give multiple options to specify the same format depending on device interpretation, while keeping just 2 different composition formats supported by minui. * ARGB + BGRA: Pixels have (A)lpha at MSB and (B)lue at LSB * RGBX + ABGR: Pixels have (A)lpha at MSB and (R)ed at LSB With this in mind, limiting the use of png_set_bgr() to happen only for (ARGB/BGRA) combination while leaving (RGBX/ABGR) unchanged. Bug: 143480444 Test: Boot device with TARGET_RECOVERY_PIXEL_FORMAT := <<all>> Change-Id: Ia0f94ccbc564b8def7c9416483712ff1abbbf49a
* minui: Move GRSurface into a class.Tao Bao2018-10-231-29/+30
| | | | | | | | | | | | | | | | | | | | | | This CL adds GRSurface::Create() and dtor for managing the allocated memory in GRSurface class. It also adds GRSurface::data() that hides the underlying implementation, with both of const and non-const overloads. This allows `const GRSurface&` to be more useful - previously it only ensured a const member variable of `data`, instead of a read-only buffer it points to. It also marks the parameters in gr_texticon() and gr_blit() as const, as they're incoming source that shouldn't be altered. It corrects the type of gr_draw, which is the sink to be painted on (an earlier attempt was made in [1], but didn't get the full picture correctly). [1] https://android-review.googlesource.com/c/platform/bootable/recovery/+/704757/ Test: mmma -j bootable/recovery Test: recovery_unit_test on marlin Test: Run graphics test on marlin (fbdev). Test: Run graphics test on blueline (drm). Change-Id: I7904df084cd6c08fa04a9da97d01b4b1a6e3a20c
* minui: Track the name change to minui related properties.Tao Bao2018-09-061-3/+3
| | | | | | | | | | | These properties need to be exposed to both of charger and recovery. This CL tracks the name change. Bug: 113567255 Test: Build along with other CLs in the topic (for Makefile and sepolicy changes). Boot into charger mode. Test: Boot into recovery. Run graphics test. Change-Id: I4d90778c1767c9bd7e00830a34ee2d4875ce0b83
* minui: Use runtime properties instead of build time vars.Tao Bao2018-08-021-11/+28
| | | | | | | | | | | | | | | This CL removes the use of the following build time macros, and uses the runtime property values instead. - TARGET_RECOVERY_PIXEL_FORMAT - TARGET_RECOVERY_OVERSCAN_PERCENT - TARGET_RECOVERY_DEFAULT_ROTATION Bug: 110380063 Test: Set up taimen with `TARGET_RECOVERY_DEFAULT_ROTATION := ROTATION_LEFT`. Build and check recovery UI. Test: Set up taimen with `TARGET_RECOVERY_PIXEL_FORMAT := ABGR_8888`. Build and check recovery UI. Change-Id: I4439556a03fde4805a18011ef72eff1373f31d47
* minui: Clean up the use of `rotation`.Tao Bao2018-08-011-22/+45
| | | | | | | | | | | | | | | This CL uses scoped enum for GRRotation. It also refactors the previous comparisions to improve readability -- it was hard to tell the meaning of `if (rotation % 2)` unless by checking the exact values. It also temporarily adds STRINGFY to expand the macro of DEFAULT_ROTATION. This will be removed once minui is changed from reading build time vars to runtime properties. Test: Build and boot into recovery image on marlin. Test: Set `TARGET_RECOVERY_DEFAULT_ROTATION := ROTATION_LEFT` and check the display under recovery with `Run graphics test`. Change-Id: Ieb08b1cd13c284f8dcf906cb2a1430c6bae2835b
* minui: Add constness to GRSurface* in gr_get_{width,height}.Tao Bao2018-06-131-14/+18
| | | | | | | | | Also free gr_font in gr_exit(), as it's owned by minui. Test: mmma -j bootable/recovery system/core/healthd Test: recovery_unit_test on marlin Test: Boot into recovery. Run graphics test. Change-Id: I00457bb97ed3dc95ef5aad493827fb5a62a258dc
* minui: Handle the failures from the drm backend in gr_initTianjie Xu2018-06-061-0/+4
| | | | | | | | | | | In a charger mode manual test, we encounter failures from the MinuiBackendDrm when calling DrmEnableCrtc and Flip. To make the minui more robust, we should fall back to another backend if drm's SetCrtc fails. And check the value of gr_draw before dereferencing. Bug: 80249440 Test: boot to recovery Change-Id: Ibd1ca1fb1115fe1132684586c54eccd8fb4c3ad9
* Let gr_init proceed even if we failed to load a font fileTianjie Xu2018-06-011-3/+12
| | | | | | | | | | Some users of minui don't need to draw texts; and we should let them still be able to use the library without providing a font file. Also add check for null pointers in gr_measure() and gr_font_size(). Bug: 80535212 Test: boot into recovery without a font file, and the buttons still work Change-Id: I848e4410f2ce09ea0ab433573e6827b7e9b2c575
* Remove the obsolete mkfont.c and font_10x18.hTianjie Xu2018-03-301-32/+5
| | | | | | | | | | | | | | | | | | | The font_10x18.h is used as a fall back for fonts if the $(recovery_font) under bootable/recovery/fonts failed to reload. This font looks very small on the screen and we haven't used it in a while. Plus, fonts in header doesn't have many benefits if we support only ascii characters. So we decide to remove this header along with the mkfont.c that generates the header. For reference, here's the steps to use mkfont: 1. Generate a picture of fonts with apps on host 2. Open the pic with GIMP 3. Export the pic as '.c' file, and rename it into '.h' file 4. Compile the generated '.h' file with mkfont.c Bug: 76420958 Test: build and check the recovery menu on angler Change-Id: I6c108aa43a07bf4994115ef764275bd84df725e1
* graphics: add rotation logicLuke Song2017-09-281-208/+251
| | | | | | | Bug: 65556996 Bug: 63541890 Test: Tried 4 rotations, viewed logs and graphics test Change-Id: I2a6c18c28df03f0461663f63bf16db32c45211ec
* Merge "minui: Move graphics_{adf,drm,fbdev} into classes." am: 0d14cc279c am: 6585a3c368 am: b8997adc20Tao Bao2017-02-131-40/+38
|\ | | | | | | | | | | am: 1cb8964aac Change-Id: I8b1fb8ba115f7313f7382b7669e35184eaea3a79
| * minui: Move graphics_{adf,drm,fbdev} into classes.Tao Bao2017-02-111-40/+38
| | | | | | | | | | | | | | | | This CL defines minui_backend as an interface, and expresses the three backends (adf, drm and fbdev) as subclasses to the interface. Test: 'Run graphics test' on N9, Pixel C and N5X. Change-Id: I0e23951c7b2e2ff918957a8d9fc8b0085b6e5952
* | Merge "minui: Minor clean up to graphics.cpp." am: b04bc0540d am: ec8d74580d am: 7d8e13a535Tao Bao2017-02-031-62/+1
|\| | | | | | | | | | | am: cdd7b47545 Change-Id: Ib8e921d63f067bdf3547419e072cdb1a7ad9f0fc
| * minui: Minor clean up to graphics.cpp.Tao Bao2017-02-031-62/+1
| | | | | | | | | | | | | | | | | | | | Remove unneeded header includes. Remove the dead code in gr_test() (already commented out). Similar tests have been covered by the "Run graphics test" from recovery menu. Test: mmma -j32 bootable/recovery Change-Id: If977c1b780602f5c5054469a3dae4fd85f34ab1a
* | Merge "minui: Export minui/minui.h." am: 13d15af08f am: ad20b76397 am: 54890af615Tao Bao2017-01-171-3/+3
|\| | | | | | | | | | | am: 397c6c5382 Change-Id: Ib72aea7ad125286d1d347ff3b25fb5f90c408bd3
| * minui: Export minui/minui.h.Tao Bao2017-01-171-3/+3
| | | | | | | | | | | | | | For libminui static and shared libraries. Test: build Change-Id: Ib30dc5e2ef4a3c8b3ca3a0cec68cb65e229a0c16
* | Merge "Remove unnecessary uses of reinterpret_cast." am: c470dc8681 am: 849a911dee am: 6a6e54da04Rahul Chaudhry2016-11-161-1/+1
|\| | | | | | | | | | | am: 8ef4c38abe Change-Id: I795ab2874d6fc8c6087c89df72e7a2341e97e387
| * Remove unnecessary uses of reinterpret_cast.Rahul Chaudhry2016-11-161-1/+1
| | | | | | | | | | | | | | Discovered while looking at compiler warnings (b/26936282). Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mma Change-Id: I66f8f6026ed732a504504ade93ff196dc8b727ca
| * Use static_cast to cast pointers returned by malloc/calloc/realloc/mmap.Rahul Chaudhry2016-11-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | static_cast is preferable to reinterpret_cast when casting from void* pointers returned by malloc/calloc/realloc/mmap calls. Discovered while looking at compiler warnings (b/26936282). Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mma Change-Id: Iaffd537784aa857108f6981fdfd82d0496eb5592 Merged-In: I151642d5a60c94f312d0611576ad0143c249ba3d
| * Have gr_init_font alloc memory for the fontDamien Bargiacchi2016-11-161-7/+15
| | | | | | | | | | Change-Id: I8ccf369d52011bc5d07d8e041fe558ce734a78fc (cherry picked from commit d00f5eb63a8e4690f9bef1e943d539d052444d9b)
| * Support use of custom fonts in miniuiDamien Bargiacchi2016-11-151-47/+55
| | | | | | | | | | | | Bug: 29547343 Change-Id: I398160c85daac90ffab2fa9bb2e96795b9e9885a (cherry picked from commit 35fff61b1c0d736d090a1cd1bb4e99141cc88ad8)
* | Use static_cast to cast pointers returned by malloc/calloc/realloc/mmap.Rahul Chaudhry2016-11-091-4/+4
| | | | | | | | | | | | | | | | | | | | static_cast is preferable to reinterpret_cast when casting from void* pointers returned by malloc/calloc/realloc/mmap calls. Discovered while looking at compiler warnings (b/26936282). Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mma Change-Id: I151642d5a60c94f312d0611576ad0143c249ba3d
* | Have gr_init_font alloc memory for the fontDamien Bargiacchi2016-09-091-7/+15
| | | | | | | | Change-Id: I8ccf369d52011bc5d07d8e041fe558ce734a78fc
* | Support use of custom fonts in miniuiDamien Bargiacchi2016-08-191-47/+55
|/ | | | | Bug: 29547343 Change-Id: I398160c85daac90ffab2fa9bb2e96795b9e9885a
* Add drm support to minuiStéphane Marchesin2015-07-021-0/+5
| | | | | | | Bug: 22231636 Change-Id: I103c8e906b7dd9862b7bb89d8642268e9a3006b4 Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
* Don't use typedefs that hide *s.Elliott Hughes2015-04-151-1/+1
| | | | | | gr_surface was causing confusion for no good reason. Change-Id: If7120187f9a00dd16297877fc49352185a4d4ea6
* Move the menu header out of the menu.Elliott Hughes2015-04-141-1/+1
| | | | | | | | | | | This makes it easier for us to deal with arbitrary information at the top, and means that headers added by specific commands don't overwrite the default ones. Add the fingerprint back, but broken up so it fits even on sprout's display. Change-Id: Id71da79ab1aa455a611d72756a3100a97ceb4c1c
* Switch minui over to C++.Elliott Hughes2015-04-101-0/+406
Change-Id: I59e08a304ae514a3fdb6fab58721f11670bc1b01