diff options
| -rw-r--r-- | include/utils/Functor.h | 3 | ||||
| -rw-r--r-- | include/utils/Vector.h | 3 | ||||
| -rw-r--r-- | libs/ui/Region.cpp | 12 | ||||
| -rw-r--r-- | opengl/libs/EGL/egl.cpp | 9 | ||||
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 14 | ||||
| -rw-r--r-- | services/surfaceflinger/tests/resize/resize.cpp | 16 | ||||
| -rw-r--r-- | services/surfaceflinger/tests/surface/surface.cpp | 16 |
7 files changed, 60 insertions, 13 deletions
diff --git a/include/utils/Functor.h b/include/utils/Functor.h index 565f4a3c85..e24ded4cf5 100644 --- a/include/utils/Functor.h +++ b/include/utils/Functor.h @@ -25,8 +25,7 @@ class Functor { public: Functor() {} virtual ~Functor() {} - virtual status_t operator ()() { return true; } - virtual status_t operator ()(float* data, uint32_t len) { return true; } + virtual status_t operator ()(int what, void* data) { return NO_ERROR; } }; }; // namespace android diff --git a/include/utils/Vector.h b/include/utils/Vector.h index ec851bd0b5..6fd307f3b6 100644 --- a/include/utils/Vector.h +++ b/include/utils/Vector.h @@ -162,6 +162,9 @@ public: inline status_t sort(compar_t cmp); inline status_t sort(compar_r_t cmp, void* state); + // for debugging only + inline size_t getItemSize() const { return itemSize(); } + protected: virtual void do_construct(void* storage, size_t num) const; virtual void do_destroy(void* storage, size_t num) const; diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp index 1994f6a432..a060a5f39d 100644 --- a/libs/ui/Region.cpp +++ b/libs/ui/Region.cpp @@ -56,6 +56,9 @@ Region::Region() Region::Region(const Region& rhs) : mBounds(rhs.mBounds), mStorage(rhs.mStorage) { +#if VALIDATE_REGIONS + validate(rhs, "rhs copy-ctor"); +#endif } Region::Region(const Rect& rhs) @@ -76,7 +79,8 @@ Region::~Region() Region& Region::operator = (const Region& rhs) { #if VALIDATE_REGIONS - validate(rhs, "operator="); + validate(*this, "this->operator="); + validate(rhs, "rhs.operator="); #endif mBounds = rhs.mBounds; mStorage = rhs.mStorage; @@ -366,6 +370,12 @@ void Region::boolean_operation(int op, Region& dst, const Region& lhs, const Region& rhs, int dx, int dy) { +#if VALIDATE_REGIONS + validate(lhs, "boolean_operation (before): lhs"); + validate(rhs, "boolean_operation (before): rhs"); + validate(dst, "boolean_operation (before): dst"); +#endif + size_t lhs_count; Rect const * const lhs_rects = lhs.getArray(&lhs_count); diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index f4a16509ed..e13af1ca24 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -2077,14 +2077,15 @@ EGLBoolean eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync) if (!validate_display_context(dpy, ctx)) return EGL_FALSE; + EGLBoolean result = EGL_FALSE; egl_context_t * const c = get_context(ctx); - if (c->cnx->egl.eglDestroySyncKHR) { - return c->cnx->egl.eglDestroySyncKHR( + result = c->cnx->egl.eglDestroySyncKHR( dp->disp[c->impl].dpy, syncObject->sync); + if (result) + _s.terminate(); } - - return EGL_FALSE; + return result; } EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 1297363159..517c335925 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -809,7 +809,7 @@ status_t Layer::ClientRef::setToken(const sp<UserClient>& uc, { // scope for strong mUserClient reference sp<UserClient> userClient(mUserClient.promote()); - if (mUserClient != 0 && mControlBlock != 0) { + if (userClient != 0 && mControlBlock != 0) { mControlBlock->setStatus(NO_INIT); } } @@ -858,11 +858,13 @@ status_t Layer::BufferManager::resize(size_t size, Mutex::Autolock _l(mLock); if (size < mNumBuffers) { - // Move the active texture into slot 0 - BufferData activeBufferData = mBufferData[mActiveBufferIndex]; - mBufferData[mActiveBufferIndex] = mBufferData[0]; - mBufferData[0] = activeBufferData; - mActiveBufferIndex = 0; + // If there is an active texture, move it into slot 0 if needed + if (mActiveBufferIndex > 0) { + BufferData activeBufferData = mBufferData[mActiveBufferIndex]; + mBufferData[mActiveBufferIndex] = mBufferData[0]; + mBufferData[0] = activeBufferData; + mActiveBufferIndex = 0; + } // Free the buffers that are no longer needed. for (size_t i = size; i < mNumBuffers; i++) { diff --git a/services/surfaceflinger/tests/resize/resize.cpp b/services/surfaceflinger/tests/resize/resize.cpp index 99f4b4f6c8..0ccca77dd6 100644 --- a/services/surfaceflinger/tests/resize/resize.cpp +++ b/services/surfaceflinger/tests/resize/resize.cpp @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #include <cutils/memory.h> #include <utils/Log.h> diff --git a/services/surfaceflinger/tests/surface/surface.cpp b/services/surfaceflinger/tests/surface/surface.cpp index 194fbb6dc5..67ecf7e100 100644 --- a/services/surfaceflinger/tests/surface/surface.cpp +++ b/services/surfaceflinger/tests/surface/surface.cpp @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #include <cutils/memory.h> #include <utils/Log.h> |