Skip to content

Commit

Permalink
hwc: On downscale check swap on 90 transform
Browse files Browse the repository at this point in the history
While checking for valid dimensions, take 90 transform into
account while calculating downscales.

b/14225977

Change-Id: Ie8b527c8263a5eb366ae2a4adaa2ffbbf270ba50
  • Loading branch information
Saurabh Shah authored and Simon Wilson committed Jan 9, 2015
1 parent c5223a2 commit 370a4b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions msm8226/libhwcomposer/hwc_mdpcomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,9 @@ bool MDPComp::isValidDimension(hwc_context_t *ctx, hwc_layer_1_t *layer) {

hwc_rect_t crop = integerizeSourceCrop(layer->sourceCropf);
hwc_rect_t dst = layer->displayFrame;
int crop_w = crop.right - crop.left;
int crop_h = crop.bottom - crop.top;
bool rotated90 = (bool)layer->transform & HAL_TRANSFORM_ROT_90;
int crop_w = rotated90 ? crop.bottom - crop.top : crop.right - crop.left;
int crop_h = rotated90 ? crop.right - crop.left : crop.bottom - crop.top;
int dst_w = dst.right - dst.left;
int dst_h = dst.bottom - dst.top;
float w_scale = ((float)crop_w / (float)dst_w);
Expand Down

0 comments on commit 370a4b1

Please sign in to comment.