drm_hwcomposer: Add Rect utility type
This change refactors the IRect and FRect types into a single templated type Rect<T>, which allows the implementation to be shared across both variants. This change also adds convenience getters for the rect widths and heights, and updates callsites accordingly. Change-Id: I38509631d57706266186a7b7fa21bd43c0860890
This commit is contained in:
parent
9255d0d10b
commit
2261f81762
4 changed files with 34 additions and 35 deletions
|
|
@ -173,8 +173,7 @@ uint32_t Backend::CalcPixOps(const std::vector<const HwcLayer*>& layers,
|
|||
const auto* layer = layers[z_order];
|
||||
const auto& df = layer->GetLayerData().pi.display_frame;
|
||||
if (df.i_rect.has_value()) {
|
||||
pixops += (df.i_rect->right - df.i_rect->left) *
|
||||
(df.i_rect->bottom - df.i_rect->top);
|
||||
pixops += df.i_rect->Width() * df.i_rect->Height();
|
||||
} else {
|
||||
// nullopt frame rect means whole display.
|
||||
pixops += whole_display;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue