OSDN Git Service

Hwclayer: Don't transform when full damage
authorHarish Krupo <harish.krupo.kps@intel.com>
Mon, 9 Jul 2018 08:44:36 +0000 (14:14 +0530)
committerKalyan Kondapally <kalyan.kondapally@intel.com>
Sun, 15 Jul 2018 18:06:17 +0000 (11:06 -0700)
When the surface damage rects set are 0, the surface_damage_
is equal to the display_frame_. Dont apply transformations in
this case.

Jira: None
Test: Cube test in ApiDemos on android renders correctly

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
common/core/hwclayer.cpp
public/hwcutils.h

index 117119c..ee951df 100644 (file)
@@ -330,6 +330,11 @@ const HwcRect<int>& HwcLayer::GetLayerDamage() {
     return current_rendering_damage_;
   }
 
+  if (surface_damage_ == display_frame_) {
+    current_rendering_damage_ = display_frame_;
+    return current_rendering_damage_;
+  }
+
   current_rendering_damage_.reset();
 
   int ox = 0, oy = 0;
index fc3ca92..dd3ea0a 100644 (file)
@@ -102,19 +102,12 @@ inline HwcRect<int> Intersection(const hwcomposer::HwcRect<int>& rect1,
   HwcRect<int> rect = {0, 0, 0, 0};
 
   int lmax = std::max(rect1.left, rect2.left);
-  int rmax = std::max(rect1.right, rect2.right);
   int tmax = std::max(rect1.top, rect2.top);
-  int bmax = std::max(rect1.bottom, rect2.bottom);
 
-  int lmin = std::min(rect1.left, rect2.left);
   int rmin = std::min(rect1.right, rect2.right);
-  int tmin = std::min(rect1.top, rect2.top);
   int bmin = std::min(rect1.bottom, rect2.bottom);
 
-  if (lmax == rmax || tmax == bmax)
-    return rect;
-
-  if (lmin == rmin || tmin == bmin)
+  if (rmin < lmax || bmin < tmax)
     return rect;
 
   rect.left = lmax;