diff options
| author | 2015-08-07 14:47:20 -0700 | |
|---|---|---|
| committer | 2015-08-24 10:50:52 -0700 | |
| commit | 60d6922a011fe18c111b8d30fb6ef1f655b6b15e (patch) | |
| tree | 4618ad5fc60b4e25c76c9f5d1e80ad3223baff31 /libs/gui/Surface.cpp | |
| parent | 72f314a50f34de593686661b0a99906125d18bfd (diff) | |
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
Diffstat (limited to 'libs/gui/Surface.cpp')
| -rw-r--r-- | libs/gui/Surface.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<IGraphicBufferProducer>& 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> 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 { |