summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libs/gui/GLConsumer.cpp12
-rw-r--r--libs/gui/include/gui/GLConsumer.h3
2 files changed, 11 insertions, 4 deletions
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp
index 14d993714..1e6796cc3 100644
--- a/libs/gui/GLConsumer.cpp
+++ b/libs/gui/GLConsumer.cpp
@@ -812,8 +812,9 @@ void GLConsumer::computeCurrentTransformMatrixLocked() {
812 GLC_LOGD("computeCurrentTransformMatrixLocked: " 812 GLC_LOGD("computeCurrentTransformMatrixLocked: "
813 "mCurrentTextureImage is NULL"); 813 "mCurrentTextureImage is NULL");
814 } 814 }
815 Rect cropRect = getCurrentCropLocked();
815 computeTransformMatrix(mCurrentTransformMatrix, buf, 816 computeTransformMatrix(mCurrentTransformMatrix, buf,
816 isEglImageCroppable(mCurrentCrop) ? Rect::EMPTY_RECT : mCurrentCrop, 817 isEglImageCroppable(cropRect) ? Rect::EMPTY_RECT : cropRect,
817 mCurrentTransform, mFilteringEnabled); 818 mCurrentTransform, mFilteringEnabled);
818} 819}
819 820
@@ -943,9 +944,7 @@ sp<GraphicBuffer> GLConsumer::getCurrentBuffer(int* outSlot) const {
943 NULL : mCurrentTextureImage->graphicBuffer(); 944 NULL : mCurrentTextureImage->graphicBuffer();
944} 945}
945 946
946Rect GLConsumer::getCurrentCrop() const { 947Rect GLConsumer::getCurrentCropLocked() const {
947 Mutex::Autolock lock(mMutex);
948
949 Rect outCrop = mCurrentCrop; 948 Rect outCrop = mCurrentCrop;
950 if (mCurrentScalingMode == NATIVE_WINDOW_SCALING_MODE_SCALE_CROP) { 949 if (mCurrentScalingMode == NATIVE_WINDOW_SCALING_MODE_SCALE_CROP) {
951 uint32_t newWidth = static_cast<uint32_t>(mCurrentCrop.width()); 950 uint32_t newWidth = static_cast<uint32_t>(mCurrentCrop.width());
@@ -986,6 +985,11 @@ Rect GLConsumer::getCurrentCrop() const {
986 return outCrop; 985 return outCrop;
987} 986}
988 987
988Rect GLConsumer::getCurrentCrop() const {
989 Mutex::Autolock lock(mMutex);
990 return getCurrentCropLocked();
991}
992
989uint32_t GLConsumer::getCurrentTransform() const { 993uint32_t GLConsumer::getCurrentTransform() const {
990 Mutex::Autolock lock(mMutex); 994 Mutex::Autolock lock(mMutex);
991 return mCurrentTransform; 995 return mCurrentTransform;
diff --git a/libs/gui/include/gui/GLConsumer.h b/libs/gui/include/gui/GLConsumer.h
index 75f2ccaae..b65c478da 100644
--- a/libs/gui/include/gui/GLConsumer.h
+++ b/libs/gui/include/gui/GLConsumer.h
@@ -368,6 +368,9 @@ private:
368 // mCurrentTextureImage must not be NULL. 368 // mCurrentTextureImage must not be NULL.
369 void computeCurrentTransformMatrixLocked(); 369 void computeCurrentTransformMatrixLocked();
370 370
371 // getCurrentCrop returns the cropping rectangle of the current buffer.
372 Rect getCurrentCropLocked() const;
373
371 // doGLFenceWaitLocked inserts a wait command into the OpenGL ES command 374 // doGLFenceWaitLocked inserts a wait command into the OpenGL ES command
372 // stream to ensure that it is safe for future OpenGL ES commands to 375 // stream to ensure that it is safe for future OpenGL ES commands to
373 // access the current texture buffer. 376 // access the current texture buffer.