diff options
| author | David 'Digit' Turner <digit@google.com> | 2014-01-17 16:47:15 +0100 |
|---|---|---|
| committer | David 'Digit' Turner <digit@google.com> | 2014-01-21 03:26:57 +0100 |
| commit | bf5b0bc2d53d82bc6ff62ceec2fdaa8b796aa130 (patch) | |
| tree | 5a144545e29d6894149f673b88e5fcaf647b3137 /emulator/opengl/host/libs/libOpenglRender | |
| parent | 2cab9c9e9b9e8075b27ee466fc01e34392b9380b (diff) | |
| download | sdk-bf5b0bc2d53d82bc6ff62ceec2fdaa8b796aa130.tar.gz sdk-bf5b0bc2d53d82bc6ff62ceec2fdaa8b796aa130.tar.bz2 sdk-bf5b0bc2d53d82bc6ff62ceec2fdaa8b796aa130.zip | |
emulator/opengl: Refactor SmartPtr implementation.
This gets rid of two copies of SmartPtr.h and replaces them with
a single implementation under shared/emugl/common/smart_ptr.*
Note that this uses a new include path rooted at the shared/
directory for classes that are likely to be built both for
the host and the device (in case we back-port this to
device/generic/goldfish/opengl/ in the future).
+ Add a gtest-based set of unittests, after building, just
call 'emugl_common_host_unittests' to run it.
Note that this probably needs a 64-bit version as well,
will come later once I find a way to build GTest for 64-bits
without breaking the platform build :-)
Also note that this moves the class to the 'emugl' namespace,
in order to make the code easier to build out of the platform
tree, and embed it in other projects. More classes will be
transitioned / refactored in future patches.
AOSP_BUG=64806
Change-Id: Ieb326c5f3f002a21537b8a391a82ce2ef9925073
Diffstat (limited to 'emulator/opengl/host/libs/libOpenglRender')
4 files changed, 8 insertions, 8 deletions
diff --git a/emulator/opengl/host/libs/libOpenglRender/Android.mk b/emulator/opengl/host/libs/libOpenglRender/Android.mk index 1d923b40b..8b8ba792c 100644 --- a/emulator/opengl/host/libs/libOpenglRender/Android.mk +++ b/emulator/opengl/host/libs/libOpenglRender/Android.mk @@ -54,7 +54,7 @@ $(call emugl-export,C_INCLUDES,$(LOCAL_PATH)) # use Translator's egl/gles headers LOCAL_C_INCLUDES += $(EMUGL_PATH)/host/libs/Translator/include -LOCAL_STATIC_LIBRARIES += libutils liblog +LOCAL_STATIC_LIBRARIES += libemugl_common libutils libcutils liblog $(call emugl-export,CFLAGS,$(host_common_CFLAGS)) @@ -76,7 +76,7 @@ $(call emugl-export,C_INCLUDES,$(LOCAL_PATH)) # use Translator's egl/gles headers LOCAL_C_INCLUDES += $(EMUGL_PATH)/host/libs/Translator/include -LOCAL_STATIC_LIBRARIES += lib64utils lib64log +LOCAL_STATIC_LIBRARIES += lib64emugl_common lib64utils lib64cutils lib64log $(call emugl-export,CFLAGS,$(host_common_CFLAGS) -m64) diff --git a/emulator/opengl/host/libs/libOpenglRender/ColorBuffer.h b/emulator/opengl/host/libs/libOpenglRender/ColorBuffer.h index 883162bc4..9a919c367 100644 --- a/emulator/opengl/host/libs/libOpenglRender/ColorBuffer.h +++ b/emulator/opengl/host/libs/libOpenglRender/ColorBuffer.h @@ -19,7 +19,7 @@ #include <EGL/egl.h> #include <EGL/eglext.h> #include <GLES/gl.h> -#include <SmartPtr.h> +#include "emugl/common/smart_ptr.h" class ColorBuffer { @@ -55,6 +55,6 @@ private: GLenum m_internalFormat; }; -typedef SmartPtr<ColorBuffer> ColorBufferPtr; +typedef emugl::SmartPtr<ColorBuffer> ColorBufferPtr; #endif diff --git a/emulator/opengl/host/libs/libOpenglRender/RenderContext.h b/emulator/opengl/host/libs/libOpenglRender/RenderContext.h index 9cbb5fc9b..80ac43fe1 100644 --- a/emulator/opengl/host/libs/libOpenglRender/RenderContext.h +++ b/emulator/opengl/host/libs/libOpenglRender/RenderContext.h @@ -16,12 +16,12 @@ #ifndef _LIBRENDER_RENDERCONTEXT_H #define _LIBRENDER_RENDERCONTEXT_H -#include "SmartPtr.h" +#include "emugl/common/smart_ptr.h" #include <EGL/egl.h> #include "GLDecoderContextData.h" class RenderContext; -typedef SmartPtr<RenderContext> RenderContextPtr; +typedef emugl::SmartPtr<RenderContext> RenderContextPtr; class RenderContext { diff --git a/emulator/opengl/host/libs/libOpenglRender/WindowSurface.h b/emulator/opengl/host/libs/libOpenglRender/WindowSurface.h index e9f1f7d2f..fe35a94a6 100644 --- a/emulator/opengl/host/libs/libOpenglRender/WindowSurface.h +++ b/emulator/opengl/host/libs/libOpenglRender/WindowSurface.h @@ -19,7 +19,7 @@ #include "ColorBuffer.h" #include "RenderContext.h" #include "FBConfig.h" -#include "SmartPtr.h" +#include "emugl/common/smart_ptr.h" #include "FixedBuffer.h" #include <EGL/egl.h> #include <GLES/gl.h> @@ -66,6 +66,6 @@ private: const FBConfig *m_fbconf; }; -typedef SmartPtr<WindowSurface> WindowSurfacePtr; +typedef emugl::SmartPtr<WindowSurface> WindowSurfacePtr; #endif |
