Revert "Respect buffer source crop in client composition."
This reverts commit e0451f753d51e33afde34c7b6837c5824169c59f.
Reason for revert: this doesn't quite work in split screen when the device is rotated due to some buffer size mismatch. I have a forward fix in mind, but I don't believe it requires some of the interface changes so reverting first even though no one's caught this yet :x.
Change-Id: I1a0a0d028beb13f810ac16eb8d112d7c89b1cfca
diff --git a/services/surfaceflinger/BufferLayer.cpp b/services/surfaceflinger/BufferLayer.cpp
index 164a3a6..4eafeac 100644
--- a/services/surfaceflinger/BufferLayer.cpp
+++ b/services/surfaceflinger/BufferLayer.cpp
@@ -624,19 +624,16 @@
* minimal value)? Or, we could make GL behave like HWC -- but this feel
* like more of a hack.
*/
+ const Rect bounds{computeBounds()}; // Rounds from FloatRect
- // Convert to Rect so that bounds are clipped to integers.
- const Rect win{computeCrop(Rect::INVALID_RECT)};
- // computeCrop() returns the cropping rectangle in buffer space, so we
- // shouldn't use getBufferSize() since that may return a rectangle specified
- // in layer space. Otherwise we may compute incorrect texture coordinates.
- const float bufWidth = float(mActiveBuffer->getWidth());
- const float bufHeight = float(mActiveBuffer->getHeight());
+ Rect win = bounds;
+ const int bufferWidth = getBufferSize(s).getWidth();
+ const int bufferHeight = getBufferSize(s).getHeight();
- const float left = win.left / bufWidth;
- const float top = win.top / bufHeight;
- const float right = win.right / bufWidth;
- const float bottom = win.bottom / bufHeight;
+ const float left = float(win.left) / float(bufferWidth);
+ const float top = float(win.top) / float(bufferHeight);
+ const float right = float(win.right) / float(bufferWidth);
+ const float bottom = float(win.bottom) / float(bufferHeight);
// TODO: we probably want to generate the texture coords with the mesh
// here we assume that we only have 4 vertices