From 0863e159faa8c8bf7c47deb92a109961e8653e52 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 27 Feb 2014 14:44:51 +0100 Subject: emulator/opengl: Remove android::Vector<> usage. This remove the use of android::Vector<> by providing an alternative vector implementation (emugl::PodVector<>) which is heavily based on the emulator version under external/qemu/android/base/containers/PodVector.h. Ultimately the GPU emulation libraries will move under external/qemu/, and the code will be changed to use android::base::PodVector<> instead of emugl::PodVector<>. Change-Id: I9836ed961795c0791115c61e731d15d17f036972 --- emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h') diff --git a/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h b/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h index 02278a2..713e17e 100644 --- a/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h +++ b/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h @@ -16,6 +16,10 @@ #ifndef _GL_SHARED_GROUP_H_ #define _GL_SHARED_GROUP_H_ +#include "emugl/common/mutex.h" +#include "emugl/common/pod_vector.h" +#include "emugl/common/smart_ptr.h" + #define GL_API #ifndef ANDROID #define GL_APIENTRY @@ -34,14 +38,12 @@ #include #include #include "FixedBuffer.h" -#include "emugl/common/mutex.h" -#include "emugl/common/smart_ptr.h" struct BufferData { BufferData(); BufferData(GLsizeiptr size, void * data); GLsizeiptr m_size; - FixedBuffer m_fixedBuffer; + FixedBuffer m_fixedBuffer; }; class ProgramData { @@ -61,7 +63,7 @@ private: bool m_initialized; bool m_locShiftWAR; - android::Vector m_shaders; + emugl::PodVector m_shaders; public: enum { -- cgit v1.1 From aa20016e9d48f69a14d4ccf7fb05c18275492a86 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 27 Feb 2014 17:36:41 +0100 Subject: emulator/opengl: Remove android::KeyedVector usage. Replace it with a custom emugl::IdToObjectMap template class that owns the objects, simplifying the code. Change-Id: Id18319e8080211acebed814bc0d702fbaab3b245 --- emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h') diff --git a/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h b/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h index 713e17e..0daa3a8 100644 --- a/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h +++ b/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h @@ -16,6 +16,7 @@ #ifndef _GL_SHARED_GROUP_H_ #define _GL_SHARED_GROUP_H_ +#include "emugl/common/id_to_object_map.h" #include "emugl/common/mutex.h" #include "emugl/common/pod_vector.h" #include "emugl/common/smart_ptr.h" @@ -34,7 +35,6 @@ #include #include #include "ErrorLog.h" -#include #include #include #include "FixedBuffer.h" @@ -101,13 +101,13 @@ struct ShaderData { class GLSharedGroup { private: - android::DefaultKeyedVector m_buffers; - android::DefaultKeyedVector m_programs; - android::DefaultKeyedVector m_shaders; + emugl::IdToObjectMap m_buffers; + emugl::IdToObjectMap m_programs; + emugl::IdToObjectMap m_shaders; mutable emugl::Mutex m_lock; - void refShaderDataLocked(ssize_t shaderIdx); - void unrefShaderDataLocked(ssize_t shaderIdx); + void refShaderDataLocked(GLuint shader); + void unrefShaderDataLocked(GLuint shader); public: GLSharedGroup(); -- cgit v1.1 From c26879632b8ed3e91c7e5e9e9650d2412835e849 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 27 Feb 2014 17:41:57 +0100 Subject: emulator/opengl: Remove + This removes dependencies on two libutils headers. Rather than provide alternative data types, simply disable the corresponding code because it looks like the corresponding fields are simply never used by the code? It is likely that this code is only used in the guest portion of the code, and thus completely un-necessary on the host side. Change-Id: I22c67f114c2c77381ceba8de23dd631158276596 --- emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h') diff --git a/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h b/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h index 0daa3a8..f111f99 100644 --- a/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h +++ b/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h @@ -35,8 +35,6 @@ #include #include #include "ErrorLog.h" -#include -#include #include "FixedBuffer.h" struct BufferData { @@ -94,8 +92,10 @@ public: }; struct ShaderData { +#if 0 // TODO(digit): Undertand why this is never used? typedef android::List StringList; StringList samplerExternalNames; +#endif int refcount; }; -- cgit v1.1