summaryrefslogtreecommitdiffstats
path: root/minui/graphics_adf.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-03-01Use O_CLOEXEC at a few places.Tao Bao1-1/+1
Found these FDs unintentionally propagated into forked processes (e.g. updater) during my local debugging. Use O_CLOEXEC to avoid that. Test: Dump open FDs in updater process. Test: Sideload a package on taimen (which uses framebuffer). Test: Run graphics test on taimen. Change-Id: I1fb65dd4a103c47d28b15973def9e9359c251ca3
2018-11-01minui: Refactor GRSurfaceAdf.Tao Bao1-45/+44
Test: mmma -j bootable/recovery Change-Id: I14514017aace4b7043a9db1f5a93ec130a6f89c4
2018-10-23minui: Move GRSurface into a class.Tao Bao1-5/+7
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
2018-08-02minui: Use runtime properties instead of build time vars.Tao Bao1-9/+10
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
2017-04-29minui: Fix breakage in graphics_adf.Alistair Strachan1-1/+2
When graphics_adf was refactored in 557fa1f, a class member was introduced that was not initialized to zero. This meant that the first time Flip() was called, current_surface would have a junk value and cause a bad pointer rereference, crashing recovery. Make sure current_surface is initialized to 0 for the first Flip(). Test: Ran recovery on a device using the ADF backend. Change-Id: I9b8fac0a4d48cac990e5e9808a071c232de1ebfb
2017-02-11minui: Move graphics_{adf,drm,fbdev} into classes.Tao Bao1-102/+60
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
2017-02-09minui: Save errno before calling close().Tao Bao1-1/+2
Otherwise errno would be overwritten when calling close(2). Test: mmma bootable/recovery Change-Id: I661e46b1b040f550639a728aa2683e91621b4307
2017-02-07minui: Clean up graphics_adf.cpp.Tao Bao1-191/+156
Remove unneeded header includes. Switch a few memset() to '= {}' style. Otherwise mostly cosmetic changes like reformatting. Test: 'Run graphics test' on N9 (which is an ADF device). Change-Id: If008af18ddae9521f53216b581d882d5eed76d41
2016-11-16Use static_cast to cast pointers returned by malloc/calloc/realloc/mmap.Rahul Chaudhry1-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: Iaffd537784aa857108f6981fdfd82d0496eb5592 Merged-In: I151642d5a60c94f312d0611576ad0143c249ba3d
2016-11-09Use static_cast to cast pointers returned by malloc/calloc/realloc/mmap.Rahul Chaudhry1-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
2016-08-06Recovery mode UI flickerxinglong.zhu1-1/+23
[root cause ] miniui has no mechanism to protect the buffer which is displaying [changes ] recovery [side effects] ui show [self test ] sc9850-2 general operation has not display abnormal [reviewers ] xinglong.zhu Signed-off-by: xinglong.zhu <xinglong.zhu@spreadtrum.com> [change_type ] AOB --> google_original [tag_product ] common Change-Id: I989a0b2943ff6070a0e98718cfbe95144510d3a2
2016-05-06Keep ADF device alive for the lifetime of the minui backendJonathan Hamilton1-6/+8
Some ADF drivers do some amount of state cleanup when the ADF device node is closed, making and attempts to draw using it fail. This changes the minui ADF backend to keep the adf_device open until it is exited, fixing issues on such devices.
2015-04-15Don't use typedefs that hide *s.Elliott Hughes1-4/+4
gr_surface was causing confusion for no good reason. Change-Id: If7120187f9a00dd16297877fc49352185a4d4ea6
2015-04-10Switch minui over to C++.Elliott Hughes1-22/+21
Change-Id: I59e08a304ae514a3fdb6fab58721f11670bc1b01
2015-02-12Fix Droid and animation color in recovery modeTony Kuo1-1/+3
[Problem] Droid and animation color in recovery mode are incorrect [Modify] - Add support for flipping (zero copy) with RECOVERY_ABGR. - Decodes PNG files to BGRA directly, and other fills, text and alpha blending are also done directly in BGRA (i.e. blits can still bypass conversion) - Remove the BGRA workaround added previous for single buffer mode (f766396) Bug:19216535 Change-Id: Ie864419fc6da776ff58b2d02e130f203c194500f Signed-off-by: Tony Kuo <tony.kuo@mediatek.com>
2015-01-30Add missing includes.Elliott Hughes1-0/+1
Change-Id: I06ea08400efa511e627be37a4fd70fbdfadea2e6
2014-04-26recovery: minui: add adf backendGreg Hackmann1-0/+247
Change-Id: I1ad97b5b62bddbcb1104fa0b4e54415b793a4194 Signed-off-by: Greg Hackmann <ghackmann@google.com>