From 373e234f6a5f16229f3417a165c20247d59d2042 Mon Sep 17 00:00:00 2001 From: Raphael Moll Date: Mon, 7 Jul 2014 16:31:17 -0700 Subject: Move SdkVersionInfo from sdk-common to sdklib, part 3. Fix imports in ADT. Related to tools/base change Iea81ed343f41112eaa9dbb94a97f8f01930bbb0b. Change-Id: I87c57ceb175ef7cda09d44f014d587eb046ab90e --- .../src/com/android/ide/eclipse/adt/AdtUtils.java | 2 +- .../ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java | 2 +- .../android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java | 2 +- .../ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java | 6 +++--- .../eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java index 11896d8..93cd2da 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java @@ -22,7 +22,7 @@ import static org.eclipse.ui.IWorkbenchPage.MATCH_INPUT; import com.android.annotations.NonNull; import com.android.annotations.Nullable; -import com.android.ide.common.sdk.SdkVersionInfo; +import com.android.sdklib.SdkVersionInfo; import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor; import com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart; import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java index b047b1b..1a7fe56 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java @@ -25,7 +25,7 @@ import static org.eclipse.jdt.core.dom.SingleMemberAnnotation.VALUE_PROPERTY; import com.android.annotations.NonNull; import com.android.annotations.Nullable; -import com.android.ide.common.sdk.SdkVersionInfo; +import com.android.sdklib.SdkVersionInfo; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.AdtUtils; import com.android.ide.eclipse.adt.internal.editors.IconFactory; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java index b77b475..88e0880 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java @@ -22,7 +22,7 @@ import static com.android.SdkConstants.DOT_XML; import com.android.annotations.NonNull; import com.android.annotations.Nullable; -import com.android.ide.common.sdk.SdkVersionInfo; +import com.android.sdklib.SdkVersionInfo; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.AdtUtils; import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java index 60dd0f2..14f59c0 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java @@ -21,7 +21,7 @@ import static com.android.ide.eclipse.adt.AdtUtils.extractClassName; import static com.android.ide.eclipse.adt.internal.wizards.templates.NewTemplatePage.WIZARD_PAGE_WIDTH; import com.android.annotations.Nullable; -import com.android.ide.common.sdk.SdkVersionInfo; +import com.android.sdklib.SdkVersionInfo; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.AdtUtils; import com.android.ide.eclipse.adt.internal.editors.IconFactory; @@ -551,8 +551,8 @@ public class NewProjectPage extends WizardPage try { minSdk = Integer.parseInt(mValues.minSdk); } catch (NumberFormatException nufe) { - // If not a number, then the string is a codename, so treat it - // as a preview version. + // If not a number, then the string is a codename, so treat it + // as a preview version. minSdk = SdkVersionInfo.HIGHEST_KNOWN_API + 1; } } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java index e5fb3a3..09f4592 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java @@ -24,7 +24,7 @@ import static com.android.ide.eclipse.adt.internal.wizards.templates.TemplateHan import com.android.annotations.NonNull; import com.android.annotations.Nullable; -import com.android.ide.common.sdk.SdkVersionInfo; +import com.android.sdklib.SdkVersionInfo; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.AdtUtils; import com.android.ide.eclipse.adt.internal.lint.EclipseLintClient; -- cgit v1.1 From 312fcf92af876b0b2ca1f5458f298bce68a4706b Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Tue, 8 Jul 2014 16:17:55 +0200 Subject: emulator/opengl: Add global lock to libOpenglRender. This patch ensures that all render threads use the same global lock to synchronize calls to the underlying GLES/EGL libraries. Original patch from Thomas Knych (thomaswk@google.com) BUG=9627179 Change-Id: I8ac9a43bc30bba8a9a06f832cf29e72263d946ce --- .../opengl/host/libs/libOpenglRender/RenderServer.cpp | 3 ++- .../opengl/host/libs/libOpenglRender/RenderServer.h | 2 ++ .../opengl/host/libs/libOpenglRender/RenderThread.cpp | 19 ++++++++----------- .../opengl/host/libs/libOpenglRender/RenderThread.h | 7 +++++-- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/emulator/opengl/host/libs/libOpenglRender/RenderServer.cpp b/emulator/opengl/host/libs/libOpenglRender/RenderServer.cpp index 0acb307..de28f8f 100644 --- a/emulator/opengl/host/libs/libOpenglRender/RenderServer.cpp +++ b/emulator/opengl/host/libs/libOpenglRender/RenderServer.cpp @@ -27,6 +27,7 @@ typedef std::set RenderThreadsSet; RenderServer::RenderServer() : + m_lock(), m_listenSock(NULL), m_exiting(false) { @@ -102,7 +103,7 @@ int RenderServer::Main() break; } - RenderThread *rt = RenderThread::create(stream); + RenderThread *rt = RenderThread::create(stream, &m_lock); if (!rt) { fprintf(stderr,"Failed to create RenderThread\n"); delete stream; diff --git a/emulator/opengl/host/libs/libOpenglRender/RenderServer.h b/emulator/opengl/host/libs/libOpenglRender/RenderServer.h index 18b4442..ff63c94 100644 --- a/emulator/opengl/host/libs/libOpenglRender/RenderServer.h +++ b/emulator/opengl/host/libs/libOpenglRender/RenderServer.h @@ -17,6 +17,7 @@ #define _LIB_OPENGL_RENDER_RENDER_SERVER_H #include "SocketStream.h" +#include "emugl/common/mutex.h" #include "osThread.h" class RenderServer : public osUtils::Thread @@ -33,6 +34,7 @@ private: RenderServer(); private: + emugl::Mutex m_lock; SocketStream *m_listenSock; bool m_exiting; }; diff --git a/emulator/opengl/host/libs/libOpenglRender/RenderThread.cpp b/emulator/opengl/host/libs/libOpenglRender/RenderThread.cpp index 9ae2a43..19d6c1f 100644 --- a/emulator/opengl/host/libs/libOpenglRender/RenderThread.cpp +++ b/emulator/opengl/host/libs/libOpenglRender/RenderThread.cpp @@ -25,9 +25,10 @@ #define STREAM_BUFFER_SIZE 4*1024*1024 -RenderThread::RenderThread() : +RenderThread::RenderThread(IOStream *stream, emugl::Mutex *lock) : osUtils::Thread(), - m_stream(NULL), + m_lock(lock), + m_stream(stream), m_finished(false) { } @@ -37,16 +38,9 @@ RenderThread::~RenderThread() delete m_stream; } -RenderThread *RenderThread::create(IOStream *p_stream) +RenderThread *RenderThread::create(IOStream *p_stream, emugl::Mutex *lock) { - RenderThread *rt = new RenderThread(); - if (!rt) { - return NULL; - } - - rt->m_stream = p_stream; - - return rt; + return new RenderThread(p_stream, lock); } int RenderThread::Main() @@ -113,6 +107,7 @@ int RenderThread::Main() do { progress = false; + m_lock->lock(); // // try to process some of the command buffer using the GLESv1 decoder // @@ -141,6 +136,8 @@ int RenderThread::Main() progress = true; } + m_lock->unlock(); + } while( progress ); } diff --git a/emulator/opengl/host/libs/libOpenglRender/RenderThread.h b/emulator/opengl/host/libs/libOpenglRender/RenderThread.h index 80a9aef..e94d782 100644 --- a/emulator/opengl/host/libs/libOpenglRender/RenderThread.h +++ b/emulator/opengl/host/libs/libOpenglRender/RenderThread.h @@ -19,20 +19,23 @@ #include "IOStream.h" #include "GLDecoder.h" #include "renderControl_dec.h" + +#include "emugl/common/mutex.h" #include "osThread.h" class RenderThread : public osUtils::Thread { public: - static RenderThread *create(IOStream *p_stream); + static RenderThread* create(IOStream* p_stream, emugl::Mutex* mutex); virtual ~RenderThread(); bool isFinished() const { return m_finished; } private: - RenderThread(); + RenderThread(IOStream* p_stream, emugl::Mutex* mutex); virtual int Main(); private: + emugl::Mutex *m_lock; IOStream *m_stream; renderControl_decoder_context_t m_rcDec; bool m_finished; -- cgit v1.1