From 60d6922a011fe18c111b8d30fb6ef1f655b6b15e Mon Sep 17 00:00:00 2001 From: Pablo Ceballos Date: Fri, 7 Aug 2015 14:47:20 -0700 Subject: libsgui: Change Rect default constructor The current Rect default constructor initializes to all zeroes. Change it to initialize to an invalid Rect. Modify all of the existing invocations of the default constructor to maintain the existing behavior. Bug 18173359 Change-Id: Ibbad076f1550a94f56d7b1cf5350071f2022e09a --- libs/gui/Surface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libs/gui/Surface.cpp') diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index 4b76f9834c..0a36c56144 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -43,6 +43,7 @@ Surface::Surface( const sp& bufferProducer, bool controlledByApp) : mGraphicBufferProducer(bufferProducer), + mCrop(Rect::EMPTY_RECT), mGenerationNumber(0) { // Initialize the ANativeWindow function pointers. @@ -67,7 +68,6 @@ Surface::Surface( mReqUsage = 0; mTimestamp = NATIVE_WINDOW_TIMESTAMP_AUTO; mDataSpace = HAL_DATASPACE_UNKNOWN; - mCrop.clear(); mScalingMode = NATIVE_WINDOW_SCALING_MODE_FREEZE; mTransform = 0; mStickyTransform = 0; @@ -332,7 +332,7 @@ int Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) { // Make sure the crop rectangle is entirely inside the buffer. - Rect crop; + Rect crop(Rect::EMPTY_RECT); mCrop.intersect(Rect(buffer->width, buffer->height), &crop); sp fence(fenceFd >= 0 ? new Fence(fenceFd) : Fence::NO_FENCE); @@ -779,7 +779,7 @@ int Surface::setCrop(Rect const* rect) { ATRACE_CALL(); - Rect realRect; + Rect realRect(Rect::EMPTY_RECT); if (rect == NULL || rect->isEmpty()) { realRect.clear(); } else { -- cgit v1.2.3-59-g8ed1b