summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/BufferLayer.cpp
diff options
context:
space:
mode:
author Vishnu Nair <vishnun@google.com> 2018-11-29 16:14:19 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-11-29 16:14:19 +0000
commitd2d06d7a076dabc2a860452f667bdd3bfadf37e4 (patch)
tree2b91b6704d239631f4b001a4794bcf1c442770ef /services/surfaceflinger/BufferLayer.cpp
parent2df5735422298b212be08d2a146a4fed73d642c1 (diff)
parent88a11f2640cffb3fdfc3d0c7081f118a59507d0f (diff)
Merge changes from topic "remove_surface_size"
* changes: SF: User buffer size instead of layer size when calculating size SF: User buffer size to compute crop, set geometry and update cursor pos
Diffstat (limited to 'services/surfaceflinger/BufferLayer.cpp')
-rw-r--r--services/surfaceflinger/BufferLayer.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/services/surfaceflinger/BufferLayer.cpp b/services/surfaceflinger/BufferLayer.cpp
index ade62bf68f..7caae989cd 100644
--- a/services/surfaceflinger/BufferLayer.cpp
+++ b/services/surfaceflinger/BufferLayer.cpp
@@ -501,7 +501,7 @@ Region BufferLayer::latchBuffer(bool& recomputeVisibleRegions, nsecs_t latchTime
// FIXME: postedRegion should be dirty & bounds
// transform the dirty region to window-manager space
- return getTransform().transform(Region(Rect(getActiveWidth(s), getActiveHeight(s))));
+ return getTransform().transform(Region(getBufferSize(s)));
}
// transaction
@@ -624,11 +624,13 @@ void BufferLayer::drawWithOpenGL(const RenderArea& renderArea, bool useIdentityT
ui::Transform t = getTransform();
Rect win = bounds;
+ const int bufferWidth = getBufferSize(s).getWidth();
+ const int bufferHeight = getBufferSize(s).getHeight();
- float left = float(win.left) / float(getActiveWidth(s));
- float top = float(win.top) / float(getActiveHeight(s));
- float right = float(win.right) / float(getActiveWidth(s));
- float bottom = float(win.bottom) / float(getActiveHeight(s));
+ 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