Merge "hwc: Avoid MDP comp for RGB downscaled layer"

This commit is contained in:
Linux Build Service Account
2015-04-29 08:20:38 -07:00
committed by Gerrit - the friendly Code Review server
4 changed files with 46 additions and 0 deletions

View File

@@ -972,6 +972,27 @@ bool isDownscaleRequired(hwc_layer_1_t const* layer) {
return false;
}
bool isDownscaleWithinThreshold(hwc_layer_1_t const* layer, float threshold) {
hwc_rect_t displayFrame = layer->displayFrame;
hwc_rect_t sourceCrop = integerizeSourceCrop(layer->sourceCropf);
int dst_w, dst_h, src_w, src_h;
float downscale = 1.0;
dst_w = displayFrame.right - displayFrame.left;
dst_h = displayFrame.bottom - displayFrame.top;
src_w = sourceCrop.right - sourceCrop.left;
src_h = sourceCrop.bottom - sourceCrop.top;
if(dst_w && dst_h) {
float w_scale = ((float)src_w / (float)dst_w);
float h_scale = ((float)src_h / (float)dst_h);
if((w_scale > threshold) or (h_scale > threshold))
return false;
}
return true;
}
bool needsScaling(hwc_layer_1_t const* layer) {
int dst_w, dst_h, src_w, src_h;
hwc_rect_t displayFrame = layer->displayFrame;