Loading services/surfaceflinger/Layer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -559,7 +559,7 @@ void Layer::setGeometry( #endif activeCrop.clear(); } activeCrop = s.active.transform.inverse().transform(activeCrop); activeCrop = s.active.transform.inverse().transform(activeCrop, true); // This needs to be here as transform.transform(Rect) computes the // transformed rect and then takes the bounding box of the result before // returning. This means Loading services/surfaceflinger/Transform.cpp +12 −5 Original line number Diff line number Diff line Loading @@ -196,7 +196,7 @@ Rect Transform::makeBounds(int w, int h) const return transform( Rect(w, h) ); } Rect Transform::transform(const Rect& bounds) const Rect Transform::transform(const Rect& bounds, bool roundOutwards) const { Rect r; vec2 lt( bounds.left, bounds.top ); Loading @@ -209,10 +209,17 @@ Rect Transform::transform(const Rect& bounds) const lb = transform(lb); rb = transform(rb); if (roundOutwards) { r.left = floorf(min(lt[0], rt[0], lb[0], rb[0])); r.top = floorf(min(lt[1], rt[1], lb[1], rb[1])); r.right = ceilf(max(lt[0], rt[0], lb[0], rb[0])); r.bottom = ceilf(max(lt[1], rt[1], lb[1], rb[1])); } else { r.left = floorf(min(lt[0], rt[0], lb[0], rb[0]) + 0.5f); r.top = floorf(min(lt[1], rt[1], lb[1], rb[1]) + 0.5f); r.right = floorf(max(lt[0], rt[0], lb[0], rb[0]) + 0.5f); r.bottom = floorf(max(lt[1], rt[1], lb[1], rb[1]) + 0.5f); } return r; } Loading services/surfaceflinger/Transform.h +2 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,8 @@ public: Rect makeBounds(int w, int h) const; vec2 transform(int x, int y) const; Region transform(const Region& reg) const; Rect transform(const Rect& bounds) const; Rect transform(const Rect& bounds, bool roundOutwards = false) const; Transform operator * (const Transform& rhs) const; // assumes the last row is < 0 , 0 , 1 > vec2 transform(const vec2& v) const; Loading Loading
services/surfaceflinger/Layer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -559,7 +559,7 @@ void Layer::setGeometry( #endif activeCrop.clear(); } activeCrop = s.active.transform.inverse().transform(activeCrop); activeCrop = s.active.transform.inverse().transform(activeCrop, true); // This needs to be here as transform.transform(Rect) computes the // transformed rect and then takes the bounding box of the result before // returning. This means Loading
services/surfaceflinger/Transform.cpp +12 −5 Original line number Diff line number Diff line Loading @@ -196,7 +196,7 @@ Rect Transform::makeBounds(int w, int h) const return transform( Rect(w, h) ); } Rect Transform::transform(const Rect& bounds) const Rect Transform::transform(const Rect& bounds, bool roundOutwards) const { Rect r; vec2 lt( bounds.left, bounds.top ); Loading @@ -209,10 +209,17 @@ Rect Transform::transform(const Rect& bounds) const lb = transform(lb); rb = transform(rb); if (roundOutwards) { r.left = floorf(min(lt[0], rt[0], lb[0], rb[0])); r.top = floorf(min(lt[1], rt[1], lb[1], rb[1])); r.right = ceilf(max(lt[0], rt[0], lb[0], rb[0])); r.bottom = ceilf(max(lt[1], rt[1], lb[1], rb[1])); } else { r.left = floorf(min(lt[0], rt[0], lb[0], rb[0]) + 0.5f); r.top = floorf(min(lt[1], rt[1], lb[1], rb[1]) + 0.5f); r.right = floorf(max(lt[0], rt[0], lb[0], rb[0]) + 0.5f); r.bottom = floorf(max(lt[1], rt[1], lb[1], rb[1]) + 0.5f); } return r; } Loading
services/surfaceflinger/Transform.h +2 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,8 @@ public: Rect makeBounds(int w, int h) const; vec2 transform(int x, int y) const; Region transform(const Region& reg) const; Rect transform(const Rect& bounds) const; Rect transform(const Rect& bounds, bool roundOutwards = false) const; Transform operator * (const Transform& rhs) const; // assumes the last row is < 0 , 0 , 1 > vec2 transform(const vec2& v) const; Loading