[-]
[+]
|
Changed |
_service:tar_git:libhybris.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris.spec
^
|
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/libhybris/hybris/Makefile.am
^
|
@@ -6,7 +6,7 @@
if HAS_ANDROID_5_0_0
SUBDIRS += libsync
endif
-SUBDIRS += egl glesv1 glesv2 ui sf input camera vibrator
+SUBDIRS += egl glesv1 glesv2 vibrator
if HAS_LIBNFC_NXP_HEADERS
SUBDIRS += libnfc_nxp libnfc_ndef_nxp
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/libhybris/hybris/common/hooks.c
^
|
@@ -1255,6 +1255,80 @@
return res;
}
+static int my_alphasort(struct bionic_dirent **a,
+ struct bionic_dirent **b)
+{
+ return strcoll((*a)->d_name, (*b)->d_name);
+}
+
+static int my_versionsort(struct bionic_dirent **a,
+ struct bionic_dirent **b)
+{
+ return strverscmp((*a)->d_name, (*b)->d_name);
+}
+
+static int my_scandirat(int fd, const char *dir,
+ struct bionic_dirent ***namelist,
+ int (*filter) (const struct bionic_dirent *),
+ int (*compar) (const struct bionic_dirent **,
+ const struct bionic_dirent **))
+{
+ struct dirent **namelist_r;
+ struct bionic_dirent **result;
+ struct bionic_dirent *filter_r;
+
+ int i = 0;
+ size_t nItems = 0;
+
+ int res = scandirat(fd, dir, &namelist_r, NULL, NULL);
+
+ if (res != 0 && namelist_r != NULL) {
+
+ result = malloc(res * sizeof(struct bionic_dirent));
+ if (!result)
+ return -1;
+
+ for (i = 0; i < res; i++) {
+ filter_r = malloc(sizeof(struct bionic_dirent));
+ if (!filter_r) {
+ while (i-- > 0)
+ free(result[i]);
+ free(result);
+ return -1;
+ }
+ filter_r->d_ino = namelist_r[i]->d_ino;
+ filter_r->d_off = namelist_r[i]->d_off;
+ filter_r->d_reclen = namelist_r[i]->d_reclen;
+ filter_r->d_type = namelist_r[i]->d_type;
+
+ strcpy(filter_r->d_name, namelist_r[i]->d_name);
+ filter_r->d_name[sizeof(namelist_r[i]->d_name) - 1] = '\0';
+
+ if (filter != NULL && !(*filter)(filter_r)) {//apply filter
+ free(filter_r);
+ continue;
+ }
+
+ result[nItems++] = filter_r;
+ }
+ if (nItems && compar != NULL) // sort
+ qsort(result, nItems, sizeof(struct bionic_dirent *), compar);
+
+ *namelist = result;
+ }
+
+ return res;
+}
+
+static int my_scandir(const char *dir,
+ struct bionic_dirent ***namelist,
+ int (*filter) (const struct bionic_dirent *),
+ int (*compar) (const struct bionic_dirent **,
+ const struct bionic_dirent **))
+{
+ return my_scandirat(AT_FDCWD, dir, namelist, filter, compar);
+}
+
extern long my_sysconf(int name);
FP_ATTRIB static double my_strtod(const char *nptr, char **endptr)
@@ -1558,9 +1632,12 @@
{"seekdir", seekdir},
{"telldir", telldir},
{"dirfd", dirfd},
+ {"scandir", my_scandir},
+ {"scandirat", my_scandirat},
+ {"alphasort", my_alphasort},
+ {"versionsort", my_versionsort},
/* fcntl.h */
{"open", my_open},
- // TODO: scandir, scandirat, alphasort, versionsort
{"__get_tls_hooks", __get_tls_hooks},
{"sscanf", sscanf},
{"scanf", scanf},
@@ -1575,6 +1652,9 @@
{"timer_gettime", timer_gettime},
{"timer_delete", timer_delete},
{"timer_getoverrun", timer_getoverrun},
+ {"localtime", localtime},
+ {"localtime_r", localtime_r},
+ {"gmtime", gmtime},
{"abort", abort},
{"writev", writev},
/* unistd.h */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/libhybris/hybris/configure.ac
^
|
@@ -208,13 +208,6 @@
libnfc_ndef_nxp/libnfc_ndef_nxp.pc
libsync/Makefile
libsync/libsync.pc
- ui/Makefile
- sf/Makefile
- sf/libsf.pc
- input/Makefile
- input/libis.pc
- camera/Makefile
- camera/libcamera.pc
vibrator/Makefile
vibrator/libvibrator.pc
include/Makefile
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/libhybris/hybris/egl/platforms/hwcomposer/Makefile.am
^
|
@@ -5,7 +5,8 @@
hwcomposerwindowincludedir = $(includedir)/hybris/hwcomposerwindow
hwcomposerwindowinclude_HEADERS = \
- hwcomposer_window.h
+ hwcomposer_window.h \
+ hwcomposer.h
libhybris_hwcomposerwindow_la_SOURCES = \
hwcomposer_window.cpp
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/libhybris/hybris/egl/platforms/hwcomposer/hwcomposer.h
^
|
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2015 Jolla Ltd
+ *
+ * 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.
+ */
+
+#ifndef HYBRIS_HWCOMPOSER_H
+#define HYBRIS_HWCOMPOSER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct ANativeWindow;
+struct ANativeWindowBuffer;
+
+typedef void (*HWCPresentCallback)(void *user_data, struct ANativeWindow *window,
+ struct ANativeWindowBuffer *buffer);
+
+/** Create a new HWC ANativeWindow.
+ *
+ * The Window can be casted to EGLNativeWindowType and used to create
+ * an EGLSurface.
+ * The specified present callback will be called by the window when a new
+ * buffer is ready to be presented on screen. It is responsibility of the
+ * caller to make sure that happens, by using the hwcomposer API.
+ * Returns the window on success or NULL on failure.
+ *
+ * \param width The width of the window in pixels.
+ * \param height The height of the window in pixels.
+ * \param format The HAL format of the window.
+ * \param present The present callback the window will use.
+ * \param cbData The callback data the window will pass along to the present callback.
+ *
+ * \sa HWCNativeWindowDestroy
+ */
+struct ANativeWindow *HWCNativeWindowCreate(unsigned int width, unsigned int height, unsigned int format,
+ HWCPresentCallback present, void *cbData);
+
+/** Destroy a HWC ANativeWindow.
+ *
+ * Destroys a native window created with HWCNativeWindowCreate().
+ * It is not necessary to call this after using eglDestroyWindowSurface()
+ * with an EGLSurface backing a valid ANativeWindow, the window will
+ * be destroyed automatically.
+ *
+ * \sa HWCNativeWindowCreate
+ */
+void HWCNativeWindowDestroy(struct ANativeWindow *window);
+
+/** Get the current fence FD on a buffer.
+ *
+ * The buffer must be a buffer passed from the HWC layer trough the present
+ * callback of a ANativeWindow.
+ *
+ * \sa HWCNativeWindowCreate
+ * \sa HWCNativeBufferSetFence
+ */
+int HWCNativeBufferGetFence(struct ANativeWindowBuffer *buf);
+
+/** Set the current fence FD on a buffer.
+ *
+ * The buffer must be a buffer passed from the HWC layer trough the present
+ * callback of a ANativeWindow.
+ *
+ * \sa HWCNativeWindowCreate
+ * \sa HWCNativeBufferGetFence
+ */
+void HWCNativeBufferSetFence(struct ANativeWindowBuffer *buf, int fd);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/libhybris/hybris/egl/platforms/hwcomposer/hwcomposer_window.cpp
^
|
@@ -16,6 +16,7 @@
#include <android-config.h>
#include "hwcomposer_window.h"
+#include "hwcomposer.h"
#include "logging.h"
#include <errno.h>
@@ -28,6 +29,55 @@
#include <sync/sync.h>
};
+
+extern "C" struct ANativeWindow *HWCNativeWindowCreate(unsigned int width, unsigned int height, unsigned int format, HWCPresentCallback present, void *cb_data)
+{
+ class Window : public HWComposerNativeWindow
+ {
+ public:
+ Window(unsigned int w, unsigned int h, unsigned int f, HWCPresentCallback p, void *d)
+ : HWComposerNativeWindow(w, h, f)
+ , cb(p)
+ , cb_data(d)
+ {
+ }
+
+ void present(HWComposerNativeWindowBuffer *b)
+ {
+ cb(cb_data, static_cast<ANativeWindow *>(this), static_cast<ANativeWindowBuffer *>(b));
+ }
+
+ HWCPresentCallback cb;
+ void *cb_data;
+ };
+
+ if (!present)
+ return 0;
+
+ Window *w = new Window(width, height, format, present, cb_data);
+ return w;
+}
+
+extern "C" void HWCNativeWindowDestroy(struct ANativeWindow *window)
+{
+ delete window;
+}
+
+struct _BufferFenceAccessor : public HWComposerNativeWindowBuffer {
+ int get() { return fenceFd; }
+ void set(int fd) { fenceFd = fd; };
+};
+
+extern "C" int HWCNativeBufferGetFence(struct ANativeWindowBuffer *buf)
+{
+ return static_cast<_BufferFenceAccessor *>(buf)->get();
+}
+
+extern "C" void HWCNativeBufferSetFence(struct ANativeWindowBuffer *buf, int fd)
+{
+ static_cast<_BufferFenceAccessor *>(buf)->set(fd);
+}
+
static pthread_cond_t _cond = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t _mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -71,18 +121,19 @@
////////////////////////////////////////////////////////////////////////////////
HWComposerNativeWindow::HWComposerNativeWindow(unsigned int width, unsigned int height, unsigned int format)
{
+ pthread_mutex_init(&m_mutex, 0);
m_alloc = NULL;
m_width = width;
m_height = height;
m_bufFormat = format;
m_usage = GRALLOC_USAGE_HW_COMPOSER|GRALLOC_USAGE_HW_FB;
- m_frontBuf = NULL;
+ m_bufferCount = 2;
+ m_nextBuffer = 0;
}
void HWComposerNativeWindow::setup(gralloc_module_t* gralloc, alloc_device_t* alloc)
{
m_alloc = alloc;
- setBufferCount(2);
}
HWComposerNativeWindow::~HWComposerNativeWindow()
@@ -96,15 +147,14 @@
{
TRACE("");
- std::list<HWComposerNativeWindowBuffer*>::iterator it = m_bufList.begin();
+ std::vector<HWComposerNativeWindowBuffer*>::iterator it = m_bufList.begin();
for (; it!=m_bufList.end(); ++it)
{
HWComposerNativeWindowBuffer* fbnb = *it;
fbnb->common.decRef(&fbnb->common);
}
m_bufList.clear();
- m_freeBufs = 0;
- m_frontBuf = NULL;
+ m_nextBuffer = 0;
}
@@ -145,54 +195,35 @@
{
HYBRIS_TRACE_BEGIN("hwcomposer-platform", "dequeueBuffer", "");
- HWComposerNativeWindowBuffer* fbnb=NULL;
+ pthread_mutex_lock(&m_mutex);
- pthread_mutex_lock(&_mutex);
-
- HYBRIS_TRACE_BEGIN("hwcomposer-platform", "dequeueBuffer-wait", "");
-#if defined(DEBUG)
-
- if (m_frontBuf)
- TRACE("Status: Has front buf %p", m_frontBuf);
-
- std::list<HWComposerNativeWindowBuffer*>::iterator cit = m_bufList.begin();
- for (; cit != m_bufList.end(); ++cit)
- {
- TRACE("Status: Buffer %p with busy %i\n", (*cit), (*cit)->busy);
- }
-#endif
-
- std::list<HWComposerNativeWindowBuffer*>::iterator it = m_bufList.begin();
- for (; it != m_bufList.end(); ++it)
- {
- if (*it==m_frontBuf)
- continue;
- if ((*it)->busy==0)
- {
- TRACE("Found a free non-front buffer");
- break;
- }
- }
- if (it == m_bufList.end())
- {
- fbnb = m_frontBuf;
- }
- else
- {
- fbnb = *it;
+ // Allocate buffers if the list is empty, typically on the first call
+ if (m_bufList.empty())
+ allocateBuffers();
+ assert(!m_bufList.empty());
+ assert(m_nextBuffer < m_bufList.size());
+
+
+ // Grabe the next available buffer in the list and assign m_nextBuffer to
+ // the next one.
+ HWComposerNativeWindowBuffer *b = m_bufList.at(m_nextBuffer);
+ TRACE("idx=%d, buffer=%p, fence=%d", m_nextBuffer, b, b->fenceFd);
+ *buffer = b;
+ m_nextBuffer++;
+ if (m_nextBuffer >= m_bufList.size())
+ m_nextBuffer = 0;
+
+ // assign the buffer's fence to fenceFd and close/reset our fd.
+ int fence = b->fenceFd;
+ if (fenceFd)
+ *fenceFd = dup(fence);
+ if (fence != -1) {
+ close(b->fenceFd);
+ b->fenceFd = -1;
}
- HYBRIS_TRACE_END("hwcomposer-platform", "dequeueBuffer-wait", "");
-
- assert(fbnb!=NULL);
- fbnb->busy = 1;
- *buffer = fbnb;
- *fenceFd = dup(fbnb->fenceFd);
- close(fbnb->fenceFd);
- TRACE("%lu DONE --> %p", pthread_self(), fbnb);
- pthread_mutex_unlock(&_mutex);
+ pthread_mutex_unlock(&m_mutex);
HYBRIS_TRACE_END("hwcomposer-platform", "dequeueBuffer", "");
-
return 0;
}
@@ -217,21 +248,18 @@
*/
int HWComposerNativeWindow::queueBuffer(BaseNativeWindowBuffer* buffer, int fenceFd)
{
- TRACE("%lu %d", pthread_self(), fenceFd);
- HWComposerNativeWindowBuffer* fbnb = (HWComposerNativeWindowBuffer*) buffer;
+ HWComposerNativeWindowBuffer* b = (HWComposerNativeWindowBuffer*) buffer;
+ HYBRIS_TRACE_BEGIN("hwcomposer-platform", "queueBuffer", "-%p", b);
+ TRACE("%lu %p %d", pthread_self(), buffer, fenceFd);
+
+ pthread_mutex_lock(&m_mutex);
+ assert(b->fenceFd == -1); // We reset it in dequeue, so it better be -1 still..
+ b->fenceFd = fenceFd;
+ this->present(b);
+ pthread_mutex_unlock(&m_mutex);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/libhybris/hybris/egl/platforms/hwcomposer/hwcomposer_window.h
^
|
@@ -21,7 +21,7 @@
#include <linux/fb.h>
#include <hardware/gralloc.h>
-#include <list>
+#include <vector>
class HWComposerNativeWindowBuffer : public BaseNativeWindowBuffer {
@@ -75,21 +75,24 @@
virtual int setBuffersDimensions(int width, int height);
virtual int setBufferCount(int cnt);
virtual void present(HWComposerNativeWindowBuffer *buffer) = 0;
+
private:
void destroyBuffers();
+ void allocateBuffers();
private:
framebuffer_device_t* m_fbDev;
alloc_device_t* m_alloc;
unsigned int m_usage;
unsigned int m_bufFormat;
- int m_freeBufs;
- std::list<HWComposerNativeWindowBuffer*> m_bufList;
- HWComposerNativeWindowBuffer* m_frontBuf;
+ std::vector<HWComposerNativeWindowBuffer*> m_bufList;
+ unsigned int m_bufferCount;
+ unsigned int m_nextBuffer;
int m_width;
int m_height;
+ pthread_mutex_t m_mutex;
};
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/libhybris/hybris/glesv2/glesv2.c
^
|
@@ -48,6 +48,133 @@
static void (*_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) FP_ATTRIB = NULL;
static void (*_glEGLImageTargetTexture2DOES)(GLenum target, GLeglImageOES image) = NULL;
+static void (*_glActiveTexture)(GLenum texture) = NULL;
+static void (*_glAttachShader)(GLuint program, GLuint shader) = NULL;
+static void (*_glBindAttribLocation)(GLuint program, GLuint index, const GLchar* name) = NULL;
+static void (*_glBindBuffer)(GLenum target, GLuint buffer) = NULL;
+static void (*_glBindFramebuffer)(GLenum target, GLuint framebuffer) = NULL;
+static void (*_glBindRenderbuffer)(GLenum target, GLuint framebuffer) = NULL;
+static void (*_glBindTexture)(GLenum target, GLuint texture) = NULL;
+static void (*_glBlendEquation)(GLenum mode) = NULL;
+static void (*_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha) = NULL;
+static void (*_glBlendFunc)(GLenum sfactor, GLenum dfactor) = NULL;
+static void (*_glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) = NULL;
+static void (*_glBufferData)(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) = NULL;
+static void (*_glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) = NULL;
+static GLenum (*_glCheckFramebufferStatus)(GLenum target) = NULL;
+static void (*_glClear)(GLbitfield mask) = NULL;
+static void (*_glClearStencil)(GLint s) = NULL;
+static void (*_glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) = NULL;
+static void (*_glCompileShader)(GLuint shader) = NULL;
+static void (*_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data) = NULL;
+static void (*_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data) = NULL;
+static void (*_glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) = NULL;
+static void (*_glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
+static GLuint (*_glCreateProgram)(void) = NULL;
+static GLuint (*_glCreateShader)(GLenum type) = NULL;
+static void (*_glCullFace)(GLenum mode) = NULL;
+static void (*_glDeleteBuffers)(GLsizei n, const GLuint* buffers) = NULL;
+static void (*_glDeleteFramebuffers)(GLsizei n, const GLuint* buffers) = NULL;
+static void (*_glDeleteProgram)(GLuint program) = NULL;
+static void (*_glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers) = NULL;
+static void (*_glDeleteShader)(GLuint shader) = NULL;
+static void (*_glDeleteTextures)(GLsizei n, const GLuint* textures) = NULL;
+static void (*_glDepthFunc)(GLenum func) = NULL;
+static void (*_glDepthMask)(GLboolean flag) = NULL;
+static void (*_glDetachShader)(GLuint program, GLuint shader) = NULL;
+static void (*_glDisable)(GLenum cap) = NULL;
+static void (*_glDisableVertexAttribArray)(GLuint index) = NULL;
+static void (*_glDrawArrays)(GLenum mode, GLint first, GLsizei count) = NULL;
+static void (*_glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) = NULL;
+static void (*_glEnable)(GLenum cap) = NULL;
+static void (*_glEnableVertexAttribArray)(GLuint index) = NULL;
+static void (*_glFinish)(void) = NULL;
+static void (*_glFlush)(void) = NULL;
+static void (*_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) = NULL;
+static void (*_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) = NULL;
+static void (*_glFrontFace)(GLenum mode) = NULL;
+static void (*_glGenBuffers)(GLsizei n, GLuint* buffers) = NULL;
+static void (*_glGenerateMipmap)(GLenum target) = NULL;
+static void (*_glGenFramebuffers)(GLsizei n, GLuint* framebuffers) = NULL;
+static void (*_glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers) = NULL;
+static void (*_glGenTextures)(GLsizei n, GLuint* textures) = NULL;
+static void (*_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) = NULL;
+static void (*_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) = NULL;
+static void (*_glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) = NULL;
+static int (*_glGetAttribLocation)(GLuint program, const GLchar* name) = NULL;
+static void (*_glGetBooleanv)(GLenum pname, GLboolean* params) = NULL;
+static void (*_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params) = NULL;
+static GLenum (*_glGetError)(void) = NULL;
+static void (*_glGetFloatv)(GLenum pname, GLfloat* params) = NULL;
+static void (*_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params) = NULL;
+static void (*_glGetIntegerv)(GLenum pname, GLint* params) = NULL;
+static void (*_glGetProgramiv)(GLuint program, GLenum pname, GLint* params) = NULL;
+static void (*_glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog) = NULL;
+static void (*_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params) = NULL;
+static void (*_glGetShaderiv)(GLuint shader, GLenum pname, GLint* params) = NULL;
+static void (*_glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog) = NULL;
+static void (*_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) = NULL;
+static void (*_glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source) = NULL;
+static const GLubyte* (*_glGetString)(GLenum name) = NULL;
+static void (*_glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat* params) = NULL;
+static void (*_glGetTexParameteriv)(GLenum target, GLenum pname, GLint* params) = NULL;
+static void (*_glGetUniformfv)(GLuint program, GLint location, GLfloat* params) = NULL;
+static void (*_glGetUniformiv)(GLuint program, GLint location, GLint* params) = NULL;
+static int (*_glGetUniformLocation)(GLuint program, const GLchar* name) = NULL;
+static void (*_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params) = NULL;
+static void (*_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params) = NULL;
+static void (*_glGetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid** pointer) = NULL;
+static void (*_glHint)(GLenum target, GLenum mode) = NULL;
+static GLboolean (*_glIsBuffer)(GLuint buffer) = NULL;
+static GLboolean (*_glIsEnabled)(GLenum cap) = NULL;
+static GLboolean (*_glIsFramebuffer)(GLuint framebuffer) = NULL;
+static GLboolean (*_glIsProgram)(GLuint program) = NULL;
+static GLboolean (*_glIsRenderbuffer)(GLuint renderbuffer) = NULL;
+static GLboolean (*_glIsShader)(GLuint shader) = NULL;
+static GLboolean (*_glIsTexture)(GLuint texture) = NULL;
+static void (*_glLinkProgram)(GLuint program) = NULL;
+static void (*_glPixelStorei)(GLenum pname, GLint param) = NULL;
+static void (*_glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) = NULL;
+static void (*_glReleaseShaderCompiler)(void) = NULL;
+static void (*_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) = NULL;
+static void (*_glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
+static void (*_glShaderBinary)(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length) = NULL;
+static void (*_glShaderSource)(GLuint shader, GLsizei count, const GLchar** string, const GLint* length) = NULL;
+static void (*_glStencilFunc)(GLenum func, GLint ref, GLuint mask) = NULL;
+static void (*_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask) = NULL;
+static void (*_glStencilMask)(GLuint mask) = NULL;
+static void (*_glStencilMaskSeparate)(GLenum face, GLuint mask) = NULL;
+static void (*_glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) = NULL;
+static void (*_glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) = NULL;
+static void (*_glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) = NULL;
+static void (*_glTexParameterfv)(GLenum target, GLenum pname, const GLfloat* params) = NULL;
+static void (*_glTexParameteri)(GLenum target, GLenum pname, GLint param) = NULL;
+static void (*_glTexParameteriv)(GLenum target, GLenum pname, const GLint* params) = NULL;
+static void (*_glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels) = NULL;
+static void (*_glUniform1fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
+static void (*_glUniform1i)(GLint location, GLint x) = NULL;
+static void (*_glUniform1iv)(GLint location, GLsizei count, const GLint* v) = NULL;
+static void (*_glUniform2fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
+static void (*_glUniform2i)(GLint location, GLint x, GLint y) = NULL;
+static void (*_glUniform2iv)(GLint location, GLsizei count, const GLint* v) = NULL;
+static void (*_glUniform3fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
+static void (*_glUniform3i)(GLint location, GLint x, GLint y, GLint z) = NULL;
+static void (*_glUniform3iv)(GLint location, GLsizei count, const GLint* v) = NULL;
+static void (*_glUniform4fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
+static void (*_glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w) = NULL;
+static void (*_glUniform4iv)(GLint location, GLsizei count, const GLint* v) = NULL;
+static void (*_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL;
+static void (*_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL;
+static void (*_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL;
+static void (*_glUseProgram)(GLuint program) = NULL;
+static void (*_glValidateProgram)(GLuint program) = NULL;
+static void (*_glVertexAttrib1fv)(GLuint indx, const GLfloat* values) = NULL;
+static void (*_glVertexAttrib2fv)(GLuint indx, const GLfloat* values) = NULL;
+static void (*_glVertexAttrib3fv)(GLuint indx, const GLfloat* values) = NULL;
+static void (*_glVertexAttrib4fv)(GLuint indx, const GLfloat* values) = NULL;
+static void (*_glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) = NULL;
+static void (*_glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
+
#define GLES2_LOAD(sym) { *(&_ ## sym) = (void *) android_dlsym(_libglesv2, #sym); }
@@ -60,8 +187,11 @@
typeof(sym) * sym ## _dispatch (void) __asm__ (#sym);\
typeof(sym) * sym ## _dispatch (void) \
{ \
- return (void *) android_dlsym(_libglesv2, #sym); \
-}
+ if (_libglesv2) \
+ return (void *) android_dlsym(_libglesv2, #sym); \
+ else \
+ return &sym ## _wrapper; \
+}
static void __attribute__((constructor)) _init_androidglesv2() {
_libglesv2 = (void *) android_dlopen(getenv("LIBGLESV2") ? getenv("LIBGLESV2") : "libGLESv2.so", RTLD_NOW);
@@ -82,9 +212,766 @@
GLES2_LOAD(glVertexAttrib3f);
GLES2_LOAD(glVertexAttrib4f);
GLES2_LOAD(glEGLImageTargetTexture2DOES);
+
+ GLES2_LOAD(glActiveTexture);
+ GLES2_LOAD(glAttachShader);
+ GLES2_LOAD(glBindAttribLocation);
+ GLES2_LOAD(glBindBuffer);
+ GLES2_LOAD(glBindFramebuffer);
+ GLES2_LOAD(glBindRenderbuffer);
+ GLES2_LOAD(glBindTexture);
+ GLES2_LOAD(glBlendEquation);
+ GLES2_LOAD(glBlendEquationSeparate);
+ GLES2_LOAD(glBlendFunc);
+ GLES2_LOAD(glBlendFuncSeparate);
+ GLES2_LOAD(glBufferData);
+ GLES2_LOAD(glBufferSubData);
+ GLES2_LOAD(glCheckFramebufferStatus);
+ GLES2_LOAD(glClear);
+ GLES2_LOAD(glClearStencil);
+ GLES2_LOAD(glColorMask);
+ GLES2_LOAD(glCompileShader);
+ GLES2_LOAD(glCompressedTexImage2D);
+ GLES2_LOAD(glCompressedTexSubImage2D);
+ GLES2_LOAD(glCopyTexImage2D);
+ GLES2_LOAD(glCopyTexSubImage2D);
+ GLES2_LOAD(glCreateProgram);
+ GLES2_LOAD(glCreateShader);
+ GLES2_LOAD(glCullFace);
+ GLES2_LOAD(glDeleteBuffers);
+ GLES2_LOAD(glDeleteFramebuffers);
+ GLES2_LOAD(glDeleteProgram);
+ GLES2_LOAD(glDeleteRenderbuffers);
+ GLES2_LOAD(glDeleteShader);
+ GLES2_LOAD(glDeleteTextures);
+ GLES2_LOAD(glDepthFunc);
+ GLES2_LOAD(glDepthMask);
+ GLES2_LOAD(glDetachShader);
+ GLES2_LOAD(glDisable);
+ GLES2_LOAD(glDisableVertexAttribArray);
+ GLES2_LOAD(glDrawArrays);
+ GLES2_LOAD(glDrawElements);
+ GLES2_LOAD(glEnable);
+ GLES2_LOAD(glEnableVertexAttribArray);
+ GLES2_LOAD(glFinish);
+ GLES2_LOAD(glFlush);
+ GLES2_LOAD(glFramebufferRenderbuffer);
+ GLES2_LOAD(glFramebufferTexture2D);
+ GLES2_LOAD(glFrontFace);
+ GLES2_LOAD(glGenBuffers);
+ GLES2_LOAD(glGenerateMipmap);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/libhybris/hybris/tests/Makefile.am
^
|
@@ -2,11 +2,7 @@
test_egl \
test_egl_configs \
test_glesv2 \
- test_ui \
- test_sf \
test_sensors \
- test_input \
- test_camera \
test_vibrator \
test_gps
@@ -108,44 +104,6 @@
$(top_builddir)/common/libhybris-common.la \
$(top_builddir)/hardware/libhardware.la
-test_ui_SOURCES = test_ui.c
-test_ui_CFLAGS = \
- -I$(top_srcdir)/include \
- $(ANDROID_HEADERS_CFLAGS)
-test_ui_LDADD = \
- $(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/ui/libui.la
-
-test_sf_SOURCES = test_sf.c
-test_sf_CFLAGS = \
- -I$(top_srcdir)/include \
- $(ANDROID_HEADERS_CFLAGS)
-test_sf_LDADD = \
- $(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/egl/libEGL.la \
- $(top_builddir)/glesv2/libGLESv2.la \
- $(top_builddir)/sf/libsf.la
-
-test_input_SOURCES = test_input.c
-test_input_CFLAGS = \
- -I$(top_srcdir)/include \
- $(ANDROID_HEADERS_CFLAGS)
-test_input_LDADD = \
- $(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/input/libis.la
-
-test_camera_SOURCES = test_camera.c
-test_camera_CFLAGS = \
- -I$(top_srcdir)/include \
- $(ANDROID_HEADERS_CFLAGS)
-
-test_camera_LDADD = \
- $(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/egl/libEGL.la \
- $(top_builddir)/glesv2/libGLESv2.la \
- $(top_builddir)/camera/libcamera.la \
- $(top_builddir)/input/libis.la
-
test_gps_SOURCES = test_gps.c
test_gps_CFLAGS = -pthread \
-I$(top_srcdir)/include \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/upstream/hybris/Makefile.am
^
|
@@ -6,7 +6,7 @@
if HAS_ANDROID_5_0_0
SUBDIRS += libsync
endif
-SUBDIRS += egl glesv1 glesv2 ui sf input camera vibrator
+SUBDIRS += egl glesv1 glesv2 vibrator
if HAS_LIBNFC_NXP_HEADERS
SUBDIRS += libnfc_nxp libnfc_ndef_nxp
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/upstream/hybris/common/hooks.c
^
|
@@ -1255,6 +1255,80 @@
return res;
}
+static int my_alphasort(struct bionic_dirent **a,
+ struct bionic_dirent **b)
+{
+ return strcoll((*a)->d_name, (*b)->d_name);
+}
+
+static int my_versionsort(struct bionic_dirent **a,
+ struct bionic_dirent **b)
+{
+ return strverscmp((*a)->d_name, (*b)->d_name);
+}
+
+static int my_scandirat(int fd, const char *dir,
+ struct bionic_dirent ***namelist,
+ int (*filter) (const struct bionic_dirent *),
+ int (*compar) (const struct bionic_dirent **,
+ const struct bionic_dirent **))
+{
+ struct dirent **namelist_r;
+ struct bionic_dirent **result;
+ struct bionic_dirent *filter_r;
+
+ int i = 0;
+ size_t nItems = 0;
+
+ int res = scandirat(fd, dir, &namelist_r, NULL, NULL);
+
+ if (res != 0 && namelist_r != NULL) {
+
+ result = malloc(res * sizeof(struct bionic_dirent));
+ if (!result)
+ return -1;
+
+ for (i = 0; i < res; i++) {
+ filter_r = malloc(sizeof(struct bionic_dirent));
+ if (!filter_r) {
+ while (i-- > 0)
+ free(result[i]);
+ free(result);
+ return -1;
+ }
+ filter_r->d_ino = namelist_r[i]->d_ino;
+ filter_r->d_off = namelist_r[i]->d_off;
+ filter_r->d_reclen = namelist_r[i]->d_reclen;
+ filter_r->d_type = namelist_r[i]->d_type;
+
+ strcpy(filter_r->d_name, namelist_r[i]->d_name);
+ filter_r->d_name[sizeof(namelist_r[i]->d_name) - 1] = '\0';
+
+ if (filter != NULL && !(*filter)(filter_r)) {//apply filter
+ free(filter_r);
+ continue;
+ }
+
+ result[nItems++] = filter_r;
+ }
+ if (nItems && compar != NULL) // sort
+ qsort(result, nItems, sizeof(struct bionic_dirent *), compar);
+
+ *namelist = result;
+ }
+
+ return res;
+}
+
+static int my_scandir(const char *dir,
+ struct bionic_dirent ***namelist,
+ int (*filter) (const struct bionic_dirent *),
+ int (*compar) (const struct bionic_dirent **,
+ const struct bionic_dirent **))
+{
+ return my_scandirat(AT_FDCWD, dir, namelist, filter, compar);
+}
+
extern long my_sysconf(int name);
FP_ATTRIB static double my_strtod(const char *nptr, char **endptr)
@@ -1558,9 +1632,12 @@
{"seekdir", seekdir},
{"telldir", telldir},
{"dirfd", dirfd},
+ {"scandir", my_scandir},
+ {"scandirat", my_scandirat},
+ {"alphasort", my_alphasort},
+ {"versionsort", my_versionsort},
/* fcntl.h */
{"open", my_open},
- // TODO: scandir, scandirat, alphasort, versionsort
{"__get_tls_hooks", __get_tls_hooks},
{"sscanf", sscanf},
{"scanf", scanf},
@@ -1575,6 +1652,9 @@
{"timer_gettime", timer_gettime},
{"timer_delete", timer_delete},
{"timer_getoverrun", timer_getoverrun},
+ {"localtime", localtime},
+ {"localtime_r", localtime_r},
+ {"gmtime", gmtime},
{"abort", abort},
{"writev", writev},
/* unistd.h */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/upstream/hybris/configure.ac
^
|
@@ -208,13 +208,6 @@
libnfc_ndef_nxp/libnfc_ndef_nxp.pc
libsync/Makefile
libsync/libsync.pc
- ui/Makefile
- sf/Makefile
- sf/libsf.pc
- input/Makefile
- input/libis.pc
- camera/Makefile
- camera/libcamera.pc
vibrator/Makefile
vibrator/libvibrator.pc
include/Makefile
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/upstream/hybris/egl/platforms/hwcomposer/Makefile.am
^
|
@@ -5,7 +5,8 @@
hwcomposerwindowincludedir = $(includedir)/hybris/hwcomposerwindow
hwcomposerwindowinclude_HEADERS = \
- hwcomposer_window.h
+ hwcomposer_window.h \
+ hwcomposer.h
libhybris_hwcomposerwindow_la_SOURCES = \
hwcomposer_window.cpp
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/upstream/hybris/egl/platforms/hwcomposer/hwcomposer.h
^
|
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2015 Jolla Ltd
+ *
+ * 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.
+ */
+
+#ifndef HYBRIS_HWCOMPOSER_H
+#define HYBRIS_HWCOMPOSER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct ANativeWindow;
+struct ANativeWindowBuffer;
+
+typedef void (*HWCPresentCallback)(void *user_data, struct ANativeWindow *window,
+ struct ANativeWindowBuffer *buffer);
+
+/** Create a new HWC ANativeWindow.
+ *
+ * The Window can be casted to EGLNativeWindowType and used to create
+ * an EGLSurface.
+ * The specified present callback will be called by the window when a new
+ * buffer is ready to be presented on screen. It is responsibility of the
+ * caller to make sure that happens, by using the hwcomposer API.
+ * Returns the window on success or NULL on failure.
+ *
+ * \param width The width of the window in pixels.
+ * \param height The height of the window in pixels.
+ * \param format The HAL format of the window.
+ * \param present The present callback the window will use.
+ * \param cbData The callback data the window will pass along to the present callback.
+ *
+ * \sa HWCNativeWindowDestroy
+ */
+struct ANativeWindow *HWCNativeWindowCreate(unsigned int width, unsigned int height, unsigned int format,
+ HWCPresentCallback present, void *cbData);
+
+/** Destroy a HWC ANativeWindow.
+ *
+ * Destroys a native window created with HWCNativeWindowCreate().
+ * It is not necessary to call this after using eglDestroyWindowSurface()
+ * with an EGLSurface backing a valid ANativeWindow, the window will
+ * be destroyed automatically.
+ *
+ * \sa HWCNativeWindowCreate
+ */
+void HWCNativeWindowDestroy(struct ANativeWindow *window);
+
+/** Get the current fence FD on a buffer.
+ *
+ * The buffer must be a buffer passed from the HWC layer trough the present
+ * callback of a ANativeWindow.
+ *
+ * \sa HWCNativeWindowCreate
+ * \sa HWCNativeBufferSetFence
+ */
+int HWCNativeBufferGetFence(struct ANativeWindowBuffer *buf);
+
+/** Set the current fence FD on a buffer.
+ *
+ * The buffer must be a buffer passed from the HWC layer trough the present
+ * callback of a ANativeWindow.
+ *
+ * \sa HWCNativeWindowCreate
+ * \sa HWCNativeBufferGetFence
+ */
+void HWCNativeBufferSetFence(struct ANativeWindowBuffer *buf, int fd);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/upstream/hybris/egl/platforms/hwcomposer/hwcomposer_window.cpp
^
|
@@ -16,6 +16,7 @@
#include <android-config.h>
#include "hwcomposer_window.h"
+#include "hwcomposer.h"
#include "logging.h"
#include <errno.h>
@@ -28,6 +29,55 @@
#include <sync/sync.h>
};
+
+extern "C" struct ANativeWindow *HWCNativeWindowCreate(unsigned int width, unsigned int height, unsigned int format, HWCPresentCallback present, void *cb_data)
+{
+ class Window : public HWComposerNativeWindow
+ {
+ public:
+ Window(unsigned int w, unsigned int h, unsigned int f, HWCPresentCallback p, void *d)
+ : HWComposerNativeWindow(w, h, f)
+ , cb(p)
+ , cb_data(d)
+ {
+ }
+
+ void present(HWComposerNativeWindowBuffer *b)
+ {
+ cb(cb_data, static_cast<ANativeWindow *>(this), static_cast<ANativeWindowBuffer *>(b));
+ }
+
+ HWCPresentCallback cb;
+ void *cb_data;
+ };
+
+ if (!present)
+ return 0;
+
+ Window *w = new Window(width, height, format, present, cb_data);
+ return w;
+}
+
+extern "C" void HWCNativeWindowDestroy(struct ANativeWindow *window)
+{
+ delete window;
+}
+
+struct _BufferFenceAccessor : public HWComposerNativeWindowBuffer {
+ int get() { return fenceFd; }
+ void set(int fd) { fenceFd = fd; };
+};
+
+extern "C" int HWCNativeBufferGetFence(struct ANativeWindowBuffer *buf)
+{
+ return static_cast<_BufferFenceAccessor *>(buf)->get();
+}
+
+extern "C" void HWCNativeBufferSetFence(struct ANativeWindowBuffer *buf, int fd)
+{
+ static_cast<_BufferFenceAccessor *>(buf)->set(fd);
+}
+
static pthread_cond_t _cond = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t _mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -71,18 +121,19 @@
////////////////////////////////////////////////////////////////////////////////
HWComposerNativeWindow::HWComposerNativeWindow(unsigned int width, unsigned int height, unsigned int format)
{
+ pthread_mutex_init(&m_mutex, 0);
m_alloc = NULL;
m_width = width;
m_height = height;
m_bufFormat = format;
m_usage = GRALLOC_USAGE_HW_COMPOSER|GRALLOC_USAGE_HW_FB;
- m_frontBuf = NULL;
+ m_bufferCount = 2;
+ m_nextBuffer = 0;
}
void HWComposerNativeWindow::setup(gralloc_module_t* gralloc, alloc_device_t* alloc)
{
m_alloc = alloc;
- setBufferCount(2);
}
HWComposerNativeWindow::~HWComposerNativeWindow()
@@ -96,15 +147,14 @@
{
TRACE("");
- std::list<HWComposerNativeWindowBuffer*>::iterator it = m_bufList.begin();
+ std::vector<HWComposerNativeWindowBuffer*>::iterator it = m_bufList.begin();
for (; it!=m_bufList.end(); ++it)
{
HWComposerNativeWindowBuffer* fbnb = *it;
fbnb->common.decRef(&fbnb->common);
}
m_bufList.clear();
- m_freeBufs = 0;
- m_frontBuf = NULL;
+ m_nextBuffer = 0;
}
@@ -145,54 +195,35 @@
{
HYBRIS_TRACE_BEGIN("hwcomposer-platform", "dequeueBuffer", "");
- HWComposerNativeWindowBuffer* fbnb=NULL;
+ pthread_mutex_lock(&m_mutex);
- pthread_mutex_lock(&_mutex);
-
- HYBRIS_TRACE_BEGIN("hwcomposer-platform", "dequeueBuffer-wait", "");
-#if defined(DEBUG)
-
- if (m_frontBuf)
- TRACE("Status: Has front buf %p", m_frontBuf);
-
- std::list<HWComposerNativeWindowBuffer*>::iterator cit = m_bufList.begin();
- for (; cit != m_bufList.end(); ++cit)
- {
- TRACE("Status: Buffer %p with busy %i\n", (*cit), (*cit)->busy);
- }
-#endif
-
- std::list<HWComposerNativeWindowBuffer*>::iterator it = m_bufList.begin();
- for (; it != m_bufList.end(); ++it)
- {
- if (*it==m_frontBuf)
- continue;
- if ((*it)->busy==0)
- {
- TRACE("Found a free non-front buffer");
- break;
- }
- }
- if (it == m_bufList.end())
- {
- fbnb = m_frontBuf;
- }
- else
- {
- fbnb = *it;
+ // Allocate buffers if the list is empty, typically on the first call
+ if (m_bufList.empty())
+ allocateBuffers();
+ assert(!m_bufList.empty());
+ assert(m_nextBuffer < m_bufList.size());
+
+
+ // Grabe the next available buffer in the list and assign m_nextBuffer to
+ // the next one.
+ HWComposerNativeWindowBuffer *b = m_bufList.at(m_nextBuffer);
+ TRACE("idx=%d, buffer=%p, fence=%d", m_nextBuffer, b, b->fenceFd);
+ *buffer = b;
+ m_nextBuffer++;
+ if (m_nextBuffer >= m_bufList.size())
+ m_nextBuffer = 0;
+
+ // assign the buffer's fence to fenceFd and close/reset our fd.
+ int fence = b->fenceFd;
+ if (fenceFd)
+ *fenceFd = dup(fence);
+ if (fence != -1) {
+ close(b->fenceFd);
+ b->fenceFd = -1;
}
- HYBRIS_TRACE_END("hwcomposer-platform", "dequeueBuffer-wait", "");
-
- assert(fbnb!=NULL);
- fbnb->busy = 1;
- *buffer = fbnb;
- *fenceFd = dup(fbnb->fenceFd);
- close(fbnb->fenceFd);
- TRACE("%lu DONE --> %p", pthread_self(), fbnb);
- pthread_mutex_unlock(&_mutex);
+ pthread_mutex_unlock(&m_mutex);
HYBRIS_TRACE_END("hwcomposer-platform", "dequeueBuffer", "");
-
return 0;
}
@@ -217,21 +248,18 @@
*/
int HWComposerNativeWindow::queueBuffer(BaseNativeWindowBuffer* buffer, int fenceFd)
{
- TRACE("%lu %d", pthread_self(), fenceFd);
- HWComposerNativeWindowBuffer* fbnb = (HWComposerNativeWindowBuffer*) buffer;
+ HWComposerNativeWindowBuffer* b = (HWComposerNativeWindowBuffer*) buffer;
+ HYBRIS_TRACE_BEGIN("hwcomposer-platform", "queueBuffer", "-%p", b);
+ TRACE("%lu %p %d", pthread_self(), buffer, fenceFd);
+
+ pthread_mutex_lock(&m_mutex);
+ assert(b->fenceFd == -1); // We reset it in dequeue, so it better be -1 still..
+ b->fenceFd = fenceFd;
+ this->present(b);
+ pthread_mutex_unlock(&m_mutex);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/upstream/hybris/egl/platforms/hwcomposer/hwcomposer_window.h
^
|
@@ -21,7 +21,7 @@
#include <linux/fb.h>
#include <hardware/gralloc.h>
-#include <list>
+#include <vector>
class HWComposerNativeWindowBuffer : public BaseNativeWindowBuffer {
@@ -75,21 +75,24 @@
virtual int setBuffersDimensions(int width, int height);
virtual int setBufferCount(int cnt);
virtual void present(HWComposerNativeWindowBuffer *buffer) = 0;
+
private:
void destroyBuffers();
+ void allocateBuffers();
private:
framebuffer_device_t* m_fbDev;
alloc_device_t* m_alloc;
unsigned int m_usage;
unsigned int m_bufFormat;
- int m_freeBufs;
- std::list<HWComposerNativeWindowBuffer*> m_bufList;
- HWComposerNativeWindowBuffer* m_frontBuf;
+ std::vector<HWComposerNativeWindowBuffer*> m_bufList;
+ unsigned int m_bufferCount;
+ unsigned int m_nextBuffer;
int m_width;
int m_height;
+ pthread_mutex_t m_mutex;
};
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/upstream/hybris/glesv2/glesv2.c
^
|
@@ -48,6 +48,133 @@
static void (*_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) FP_ATTRIB = NULL;
static void (*_glEGLImageTargetTexture2DOES)(GLenum target, GLeglImageOES image) = NULL;
+static void (*_glActiveTexture)(GLenum texture) = NULL;
+static void (*_glAttachShader)(GLuint program, GLuint shader) = NULL;
+static void (*_glBindAttribLocation)(GLuint program, GLuint index, const GLchar* name) = NULL;
+static void (*_glBindBuffer)(GLenum target, GLuint buffer) = NULL;
+static void (*_glBindFramebuffer)(GLenum target, GLuint framebuffer) = NULL;
+static void (*_glBindRenderbuffer)(GLenum target, GLuint framebuffer) = NULL;
+static void (*_glBindTexture)(GLenum target, GLuint texture) = NULL;
+static void (*_glBlendEquation)(GLenum mode) = NULL;
+static void (*_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha) = NULL;
+static void (*_glBlendFunc)(GLenum sfactor, GLenum dfactor) = NULL;
+static void (*_glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) = NULL;
+static void (*_glBufferData)(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) = NULL;
+static void (*_glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) = NULL;
+static GLenum (*_glCheckFramebufferStatus)(GLenum target) = NULL;
+static void (*_glClear)(GLbitfield mask) = NULL;
+static void (*_glClearStencil)(GLint s) = NULL;
+static void (*_glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) = NULL;
+static void (*_glCompileShader)(GLuint shader) = NULL;
+static void (*_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data) = NULL;
+static void (*_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data) = NULL;
+static void (*_glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) = NULL;
+static void (*_glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
+static GLuint (*_glCreateProgram)(void) = NULL;
+static GLuint (*_glCreateShader)(GLenum type) = NULL;
+static void (*_glCullFace)(GLenum mode) = NULL;
+static void (*_glDeleteBuffers)(GLsizei n, const GLuint* buffers) = NULL;
+static void (*_glDeleteFramebuffers)(GLsizei n, const GLuint* buffers) = NULL;
+static void (*_glDeleteProgram)(GLuint program) = NULL;
+static void (*_glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers) = NULL;
+static void (*_glDeleteShader)(GLuint shader) = NULL;
+static void (*_glDeleteTextures)(GLsizei n, const GLuint* textures) = NULL;
+static void (*_glDepthFunc)(GLenum func) = NULL;
+static void (*_glDepthMask)(GLboolean flag) = NULL;
+static void (*_glDetachShader)(GLuint program, GLuint shader) = NULL;
+static void (*_glDisable)(GLenum cap) = NULL;
+static void (*_glDisableVertexAttribArray)(GLuint index) = NULL;
+static void (*_glDrawArrays)(GLenum mode, GLint first, GLsizei count) = NULL;
+static void (*_glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) = NULL;
+static void (*_glEnable)(GLenum cap) = NULL;
+static void (*_glEnableVertexAttribArray)(GLuint index) = NULL;
+static void (*_glFinish)(void) = NULL;
+static void (*_glFlush)(void) = NULL;
+static void (*_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) = NULL;
+static void (*_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) = NULL;
+static void (*_glFrontFace)(GLenum mode) = NULL;
+static void (*_glGenBuffers)(GLsizei n, GLuint* buffers) = NULL;
+static void (*_glGenerateMipmap)(GLenum target) = NULL;
+static void (*_glGenFramebuffers)(GLsizei n, GLuint* framebuffers) = NULL;
+static void (*_glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers) = NULL;
+static void (*_glGenTextures)(GLsizei n, GLuint* textures) = NULL;
+static void (*_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) = NULL;
+static void (*_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) = NULL;
+static void (*_glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) = NULL;
+static int (*_glGetAttribLocation)(GLuint program, const GLchar* name) = NULL;
+static void (*_glGetBooleanv)(GLenum pname, GLboolean* params) = NULL;
+static void (*_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params) = NULL;
+static GLenum (*_glGetError)(void) = NULL;
+static void (*_glGetFloatv)(GLenum pname, GLfloat* params) = NULL;
+static void (*_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params) = NULL;
+static void (*_glGetIntegerv)(GLenum pname, GLint* params) = NULL;
+static void (*_glGetProgramiv)(GLuint program, GLenum pname, GLint* params) = NULL;
+static void (*_glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog) = NULL;
+static void (*_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params) = NULL;
+static void (*_glGetShaderiv)(GLuint shader, GLenum pname, GLint* params) = NULL;
+static void (*_glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog) = NULL;
+static void (*_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) = NULL;
+static void (*_glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source) = NULL;
+static const GLubyte* (*_glGetString)(GLenum name) = NULL;
+static void (*_glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat* params) = NULL;
+static void (*_glGetTexParameteriv)(GLenum target, GLenum pname, GLint* params) = NULL;
+static void (*_glGetUniformfv)(GLuint program, GLint location, GLfloat* params) = NULL;
+static void (*_glGetUniformiv)(GLuint program, GLint location, GLint* params) = NULL;
+static int (*_glGetUniformLocation)(GLuint program, const GLchar* name) = NULL;
+static void (*_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params) = NULL;
+static void (*_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params) = NULL;
+static void (*_glGetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid** pointer) = NULL;
+static void (*_glHint)(GLenum target, GLenum mode) = NULL;
+static GLboolean (*_glIsBuffer)(GLuint buffer) = NULL;
+static GLboolean (*_glIsEnabled)(GLenum cap) = NULL;
+static GLboolean (*_glIsFramebuffer)(GLuint framebuffer) = NULL;
+static GLboolean (*_glIsProgram)(GLuint program) = NULL;
+static GLboolean (*_glIsRenderbuffer)(GLuint renderbuffer) = NULL;
+static GLboolean (*_glIsShader)(GLuint shader) = NULL;
+static GLboolean (*_glIsTexture)(GLuint texture) = NULL;
+static void (*_glLinkProgram)(GLuint program) = NULL;
+static void (*_glPixelStorei)(GLenum pname, GLint param) = NULL;
+static void (*_glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) = NULL;
+static void (*_glReleaseShaderCompiler)(void) = NULL;
+static void (*_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) = NULL;
+static void (*_glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
+static void (*_glShaderBinary)(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length) = NULL;
+static void (*_glShaderSource)(GLuint shader, GLsizei count, const GLchar** string, const GLint* length) = NULL;
+static void (*_glStencilFunc)(GLenum func, GLint ref, GLuint mask) = NULL;
+static void (*_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask) = NULL;
+static void (*_glStencilMask)(GLuint mask) = NULL;
+static void (*_glStencilMaskSeparate)(GLenum face, GLuint mask) = NULL;
+static void (*_glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) = NULL;
+static void (*_glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) = NULL;
+static void (*_glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) = NULL;
+static void (*_glTexParameterfv)(GLenum target, GLenum pname, const GLfloat* params) = NULL;
+static void (*_glTexParameteri)(GLenum target, GLenum pname, GLint param) = NULL;
+static void (*_glTexParameteriv)(GLenum target, GLenum pname, const GLint* params) = NULL;
+static void (*_glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels) = NULL;
+static void (*_glUniform1fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
+static void (*_glUniform1i)(GLint location, GLint x) = NULL;
+static void (*_glUniform1iv)(GLint location, GLsizei count, const GLint* v) = NULL;
+static void (*_glUniform2fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
+static void (*_glUniform2i)(GLint location, GLint x, GLint y) = NULL;
+static void (*_glUniform2iv)(GLint location, GLsizei count, const GLint* v) = NULL;
+static void (*_glUniform3fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
+static void (*_glUniform3i)(GLint location, GLint x, GLint y, GLint z) = NULL;
+static void (*_glUniform3iv)(GLint location, GLsizei count, const GLint* v) = NULL;
+static void (*_glUniform4fv)(GLint location, GLsizei count, const GLfloat* v) = NULL;
+static void (*_glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w) = NULL;
+static void (*_glUniform4iv)(GLint location, GLsizei count, const GLint* v) = NULL;
+static void (*_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL;
+static void (*_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL;
+static void (*_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL;
+static void (*_glUseProgram)(GLuint program) = NULL;
+static void (*_glValidateProgram)(GLuint program) = NULL;
+static void (*_glVertexAttrib1fv)(GLuint indx, const GLfloat* values) = NULL;
+static void (*_glVertexAttrib2fv)(GLuint indx, const GLfloat* values) = NULL;
+static void (*_glVertexAttrib3fv)(GLuint indx, const GLfloat* values) = NULL;
+static void (*_glVertexAttrib4fv)(GLuint indx, const GLfloat* values) = NULL;
+static void (*_glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) = NULL;
+static void (*_glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
+
#define GLES2_LOAD(sym) { *(&_ ## sym) = (void *) android_dlsym(_libglesv2, #sym); }
@@ -60,8 +187,11 @@
typeof(sym) * sym ## _dispatch (void) __asm__ (#sym);\
typeof(sym) * sym ## _dispatch (void) \
{ \
- return (void *) android_dlsym(_libglesv2, #sym); \
-}
+ if (_libglesv2) \
+ return (void *) android_dlsym(_libglesv2, #sym); \
+ else \
+ return &sym ## _wrapper; \
+}
static void __attribute__((constructor)) _init_androidglesv2() {
_libglesv2 = (void *) android_dlopen(getenv("LIBGLESV2") ? getenv("LIBGLESV2") : "libGLESv2.so", RTLD_NOW);
@@ -82,9 +212,766 @@
GLES2_LOAD(glVertexAttrib3f);
GLES2_LOAD(glVertexAttrib4f);
GLES2_LOAD(glEGLImageTargetTexture2DOES);
+
+ GLES2_LOAD(glActiveTexture);
+ GLES2_LOAD(glAttachShader);
+ GLES2_LOAD(glBindAttribLocation);
+ GLES2_LOAD(glBindBuffer);
+ GLES2_LOAD(glBindFramebuffer);
+ GLES2_LOAD(glBindRenderbuffer);
+ GLES2_LOAD(glBindTexture);
+ GLES2_LOAD(glBlendEquation);
+ GLES2_LOAD(glBlendEquationSeparate);
+ GLES2_LOAD(glBlendFunc);
+ GLES2_LOAD(glBlendFuncSeparate);
+ GLES2_LOAD(glBufferData);
+ GLES2_LOAD(glBufferSubData);
+ GLES2_LOAD(glCheckFramebufferStatus);
+ GLES2_LOAD(glClear);
+ GLES2_LOAD(glClearStencil);
+ GLES2_LOAD(glColorMask);
+ GLES2_LOAD(glCompileShader);
+ GLES2_LOAD(glCompressedTexImage2D);
+ GLES2_LOAD(glCompressedTexSubImage2D);
+ GLES2_LOAD(glCopyTexImage2D);
+ GLES2_LOAD(glCopyTexSubImage2D);
+ GLES2_LOAD(glCreateProgram);
+ GLES2_LOAD(glCreateShader);
+ GLES2_LOAD(glCullFace);
+ GLES2_LOAD(glDeleteBuffers);
+ GLES2_LOAD(glDeleteFramebuffers);
+ GLES2_LOAD(glDeleteProgram);
+ GLES2_LOAD(glDeleteRenderbuffers);
+ GLES2_LOAD(glDeleteShader);
+ GLES2_LOAD(glDeleteTextures);
+ GLES2_LOAD(glDepthFunc);
+ GLES2_LOAD(glDepthMask);
+ GLES2_LOAD(glDetachShader);
+ GLES2_LOAD(glDisable);
+ GLES2_LOAD(glDisableVertexAttribArray);
+ GLES2_LOAD(glDrawArrays);
+ GLES2_LOAD(glDrawElements);
+ GLES2_LOAD(glEnable);
+ GLES2_LOAD(glEnableVertexAttribArray);
+ GLES2_LOAD(glFinish);
+ GLES2_LOAD(glFlush);
+ GLES2_LOAD(glFramebufferRenderbuffer);
+ GLES2_LOAD(glFramebufferTexture2D);
+ GLES2_LOAD(glFrontFace);
+ GLES2_LOAD(glGenBuffers);
+ GLES2_LOAD(glGenerateMipmap);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.13.tar.bz2/upstream/hybris/tests/Makefile.am
^
|
@@ -2,11 +2,7 @@
test_egl \
test_egl_configs \
test_glesv2 \
- test_ui \
- test_sf \
test_sensors \
- test_input \
- test_camera \
test_vibrator \
test_gps
@@ -108,44 +104,6 @@
$(top_builddir)/common/libhybris-common.la \
$(top_builddir)/hardware/libhardware.la
-test_ui_SOURCES = test_ui.c
-test_ui_CFLAGS = \
- -I$(top_srcdir)/include \
- $(ANDROID_HEADERS_CFLAGS)
-test_ui_LDADD = \
- $(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/ui/libui.la
-
-test_sf_SOURCES = test_sf.c
-test_sf_CFLAGS = \
- -I$(top_srcdir)/include \
- $(ANDROID_HEADERS_CFLAGS)
-test_sf_LDADD = \
- $(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/egl/libEGL.la \
- $(top_builddir)/glesv2/libGLESv2.la \
- $(top_builddir)/sf/libsf.la
-
-test_input_SOURCES = test_input.c
-test_input_CFLAGS = \
- -I$(top_srcdir)/include \
- $(ANDROID_HEADERS_CFLAGS)
-test_input_LDADD = \
- $(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/input/libis.la
-
-test_camera_SOURCES = test_camera.c
-test_camera_CFLAGS = \
- -I$(top_srcdir)/include \
- $(ANDROID_HEADERS_CFLAGS)
-
-test_camera_LDADD = \
- $(top_builddir)/common/libhybris-common.la \
- $(top_builddir)/egl/libEGL.la \
- $(top_builddir)/glesv2/libGLESv2.la \
- $(top_builddir)/camera/libcamera.la \
- $(top_builddir)/input/libis.la
-
test_gps_SOURCES = test_gps.c
test_gps_CFLAGS = -pthread \
-I$(top_srcdir)/include \
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/compat/camera/Android.mk
^
|
@@ -1,56 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-
-LOCAL_SRC_FILES := camera_compatibility_layer.cpp
-
-LOCAL_MODULE := libcamera_compat_layer
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_C_INCLUDES := \
- $(HYBRIS_PATH)/include
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libcamera_client \
- libutils \
- libbinder \
- libhardware \
- libui \
- libgui
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-
-LOCAL_SRC_FILES := direct_camera_test.cpp
-
-LOCAL_MODULE := direct_camera_test
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_C_INCLUDES := \
- $(HYBRIS_PATH)/include \
- bionic \
- bionic/libstdc++/include \
- external/gtest/include \
- external/stlport/stlport \
- external/skia/include/core \
-
-LOCAL_SHARED_LIBRARIES := \
- libis_compat_layer \
- libsf_compat_layer \
- libcamera_compat_layer \
- libcutils \
- libcamera_client \
- libutils \
- libbinder \
- libhardware \
- libui \
- libgui \
- libEGL \
- libGLESv2
-
-include $(BUILD_EXECUTABLE)
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/compat/camera/camera_compatibility_layer.cpp
^
|
@@ -1,739 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Thomas Voß <thomas.voss@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <hybris/internal/camera_control.h>
-#include <hybris/camera/camera_compatibility_layer.h>
-#include <hybris/camera/camera_compatibility_layer_capabilities.h>
-#include <hybris/camera/camera_compatibility_layer_configuration_translator.h>
-
-#include <hybris/internal/surface_flinger_compatibility_layer_internal.h>
-
-#include <binder/ProcessState.h>
-#include <camera/Camera.h>
-#include <camera/CameraParameters.h>
-#include <gui/SurfaceTexture.h>
-#include <ui/GraphicBuffer.h>
-
-#undef LOG_TAG
-#define LOG_TAG "CameraCompatibilityLayer"
-#include <utils/KeyedVector.h>
-#include <utils/Log.h>
-
-#define REPORT_FUNCTION() ALOGV("%s \n", __PRETTY_FUNCTION__)
-
-// From android::SurfaceTexture::FrameAvailableListener
-void CameraControl::onFrameAvailable()
-{
- REPORT_FUNCTION();
- if (listener)
- listener->on_preview_texture_needs_update_cb(listener->context);
-}
-
-// From android::CameraListener
-void CameraControl::notify(int32_t msg_type, int32_t ext1, int32_t ext2)
-{
- REPORT_FUNCTION();
- printf("\text1: %d, ext2: %d \n", ext1, ext2);
-
- if (!listener)
- return;
-
- switch (msg_type) {
- case CAMERA_MSG_ERROR:
- if (listener->on_msg_error_cb)
- listener->on_msg_error_cb(listener->context);
- break;
- case CAMERA_MSG_SHUTTER:
- if (listener->on_msg_shutter_cb)
- listener->on_msg_shutter_cb(listener->context);
- break;
- case CAMERA_MSG_ZOOM:
- if (listener->on_msg_zoom_cb)
- listener->on_msg_zoom_cb(listener->context, ext1);
- break;
- case CAMERA_MSG_FOCUS:
- if (listener->on_msg_focus_cb)
- listener->on_msg_focus_cb(listener->context);
- break;
- default:
- break;
- }
-}
-
-void CameraControl::postData(
- int32_t msg_type,
- const android::sp<android::IMemory>& data,
- camera_frame_metadata_t* metadata)
-{
- REPORT_FUNCTION();
-
- if (!listener)
- return;
-
- switch (msg_type) {
- case CAMERA_MSG_RAW_IMAGE:
- if (listener->on_data_raw_image_cb)
- listener->on_data_raw_image_cb(data->pointer(), data->size(), listener->context);
- break;
- case CAMERA_MSG_COMPRESSED_IMAGE:
- if (listener->on_data_compressed_image_cb)
- listener->on_data_compressed_image_cb(data->pointer(), data->size(), listener->context);
- break;
- default:
- break;
- }
-}
-
-void CameraControl::postDataTimestamp(
- nsecs_t timestamp,
- int32_t msg_type,
- const android::sp<android::IMemory>& data)
-{
- REPORT_FUNCTION();
- (void) timestamp;
- (void) msg_type;
- (void) data;
-}
-
-namespace android
-{
-NativeBufferAlloc::NativeBufferAlloc() {
-}
-
-NativeBufferAlloc::~NativeBufferAlloc() {
-}
-
-sp<GraphicBuffer> NativeBufferAlloc::createGraphicBuffer(uint32_t w, uint32_t h,
- PixelFormat format, uint32_t usage, status_t* error) {
- sp<GraphicBuffer> graphicBuffer(new GraphicBuffer(w, h, format, usage));
- status_t err = graphicBuffer->initCheck();
- *error = err;
- if (err != 0 || graphicBuffer->handle == 0) {
- if (err == NO_MEMORY) {
- GraphicBuffer::dumpAllocationsToSystemLog();
- }
- ALOGI("GraphicBufferAlloc::createGraphicBuffer(w=%d, h=%d) "
- "failed (%s), handle=%p",
- w, h, strerror(-err), graphicBuffer->handle);
- return 0;
- }
- return graphicBuffer;
-}
-}
-
-namespace
-{
-
-android::sp<CameraControl> camera_control_instance;
-
-}
-
-int android_camera_get_number_of_devices()
-{
- REPORT_FUNCTION();
- return android::Camera::getNumberOfCameras();
-}
-
-CameraControl* android_camera_connect_to(CameraType camera_type, CameraControlListener* listener)
-{
- REPORT_FUNCTION();
-
- int32_t camera_id;
- int32_t camera_count = camera_id = android::Camera::getNumberOfCameras();
-
- for (camera_id = 0; camera_id < camera_count; camera_id++) {
- android::CameraInfo ci;
- android::Camera::getCameraInfo(camera_id, &ci);
-
- if (ci.facing == camera_type)
- break;
- }
-
- if (camera_id == camera_count)
- return NULL;
-
- CameraControl* cc = new CameraControl();
- cc->listener = listener;
- cc->camera = android::Camera::connect(camera_id);
-
- if (cc->camera == NULL)
- return NULL;
-
- cc->camera_parameters = android::CameraParameters(cc->camera->getParameters());
-
- camera_control_instance = cc;
- cc->camera->setListener(camera_control_instance);
- cc->camera->lock();
-
- // TODO: Move this to a more generic component
- android::ProcessState::self()->startThreadPool();
-
- return cc;
-}
-
-void android_camera_disconnect(CameraControl* control)
-{
- REPORT_FUNCTION();
- assert(control);
-
- android::Mutex::Autolock al(control->guard);
-
- if (control->preview_texture != NULL)
- control->preview_texture->abandon();
-
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/compat/camera/direct_camera_test.cpp
^
|
@@ -1,515 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Thomas Voß <thomas.voss@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <hybris/camera/camera_compatibility_layer.h>
-#include <hybris/camera/camera_compatibility_layer_capabilities.h>
-
-#include <hybris/input/input_stack_compatibility_layer.h>
-#include <hybris/input/input_stack_compatibility_layer_codes_key.h>
-#include <hybris/input/input_stack_compatibility_layer_flags_key.h>
-#include <hybris/input/input_stack_compatibility_layer_flags_motion.h>
-
-#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
-
-#include <gui/ISurfaceComposer.h>
-
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <cassert>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-
-int shot_counter = 1;
-int32_t current_zoom_level = 1;
-bool new_camera_frame_available = true;
-
-EffectMode next_effect()
-{
- static EffectMode current_effect = EFFECT_MODE_NONE;
-
- EffectMode next = current_effect;
-
- switch (current_effect) {
- case EFFECT_MODE_NONE:
- next = EFFECT_MODE_MONO;
- break;
- case EFFECT_MODE_MONO:
- next = EFFECT_MODE_NEGATIVE;
- break;
- case EFFECT_MODE_NEGATIVE:
- next = EFFECT_MODE_SOLARIZE;
- break;
- case EFFECT_MODE_SOLARIZE:
- next = EFFECT_MODE_SEPIA;
- break;
- case EFFECT_MODE_SEPIA:
- next = EFFECT_MODE_POSTERIZE;
- break;
- case EFFECT_MODE_POSTERIZE:
- next = EFFECT_MODE_WHITEBOARD;
- break;
- case EFFECT_MODE_WHITEBOARD:
- next = EFFECT_MODE_BLACKBOARD;
- break;
- case EFFECT_MODE_BLACKBOARD:
- next = EFFECT_MODE_AQUA;
- break;
- case EFFECT_MODE_AQUA:
- next = EFFECT_MODE_NONE;
- break;
- }
-
- current_effect = next;
- return next;
-}
-
-void error_msg_cb(void* context)
-{
- printf("%s \n", __PRETTY_FUNCTION__);
-}
-
-void shutter_msg_cb(void* context)
-{
- printf("%s \n", __PRETTY_FUNCTION__);
-}
-
-void zoom_msg_cb(void* context, int32_t new_zoom_level)
-{
- printf("%s \n", __PRETTY_FUNCTION__);
-
- CameraControl* cc = static_cast<CameraControl*>(context);
- static int zoom;
- android_camera_get_current_zoom(cc, &zoom);
- printf("\t Current zoom: %d\n", zoom);
- current_zoom_level = new_zoom_level;
-}
-
-void autofocus_msg_cb(void* context)
-{
- printf("%s \n", __PRETTY_FUNCTION__);
-}
-
-void raw_data_cb(void* data, uint32_t data_size, void* context)
-{
- printf("%s: %d \n", __PRETTY_FUNCTION__, data_size);
-}
-
-void jpeg_data_cb(void* data, uint32_t data_size, void* context)
-{
- printf("%s: %d \n", __PRETTY_FUNCTION__, data_size);
-
- char fn[256];
- sprintf(fn, "/data/shot_%d.jpeg", shot_counter);
- int fd = open(fn, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
- write(fd, data, data_size);
- close(fd);
- shot_counter++;
-
- CameraControl* cc = static_cast<CameraControl*>(context);
- android_camera_start_preview(cc);
-}
-
-void size_cb(void* ctx, int width, int height)
-{
- printf("Supported size: [%d,%d]\n", width, height);
-}
-
-void preview_texture_needs_update_cb(void* ctx)
-{
- new_camera_frame_available = true;
-}
-
-void on_new_input_event(Event* event, void* context)
-{
- assert(context);
-
- if (event->type == KEY_EVENT_TYPE && event->action == ISCL_KEY_EVENT_ACTION_UP) {
- printf("We have got a key event: %d \n", event->details.key.key_code);
-
- CameraControl* cc = static_cast<CameraControl*>(context);
-
- switch(event->details.key.key_code) {
- case ISCL_KEYCODE_VOLUME_UP:
- printf("\tZooming in now.\n");
- android_camera_start_zoom(cc, current_zoom_level+1);
- break;
- case ISCL_KEYCODE_VOLUME_DOWN:
- printf("\tZooming out now.\n");
- android_camera_start_zoom(cc, current_zoom_level-1);
- break;
- case ISCL_KEYCODE_POWER:
- printf("\tTaking a photo now.\n");
- android_camera_take_snapshot(cc);
- break;
- case ISCL_KEYCODE_HEADSETHOOK:
- printf("\tSwitching effect.\n");
- android_camera_set_effect_mode(cc, next_effect());
- }
- } else if (event->type == MOTION_EVENT_TYPE &&
- event->details.motion.pointer_count == 1) {
- if ((event->action & ISCL_MOTION_EVENT_ACTION_MASK) == ISCL_MOTION_EVENT_ACTION_UP) {
- printf("\tMotion event(Action up): (%f, %f) \n",
- event->details.motion.pointer_coordinates[0].x,
- event->details.motion.pointer_coordinates[0].y);
- }
-
- if ((event->action & ISCL_MOTION_EVENT_ACTION_MASK) == ISCL_MOTION_EVENT_ACTION_DOWN) {
- printf("\tMotion event(Action down): (%f, %f) \n",
- event->details.motion.pointer_coordinates[0].x,
- event->details.motion.pointer_coordinates[0].y);
- }
- }
-}
-
-struct ClientWithSurface
-{
- SfClient* client;
- SfSurface* surface;
-};
-
-ClientWithSurface client_with_surface(bool setup_surface_with_egl)
-{
- ClientWithSurface cs = ClientWithSurface();
-
- cs.client = sf_client_create();
-
- if (!cs.client) {
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/compat/input/Android.mk
^
|
@@ -1,60 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-
-LOCAL_CFLAGS += -std=gnu++0x
-
-LOCAL_SRC_FILES:= input_compatibility_layer.cpp
-
-LOCAL_MODULE:= libis_compat_layer
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SHARED_LIBRARIES := \
- libinput \
- libcutils \
- libutils \
- libskia \
- libgui \
- libandroidfw
-
-LOCAL_C_INCLUDES := \
- $(HYBRIS_PATH)/include \
- external/skia/include/core \
- frameworks/base/services/input
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-
-LOCAL_CFLAGS += -std=gnu++0x
-
-LOCAL_SRC_FILES:= \
- direct_input_test.cpp
-
-LOCAL_MODULE:= direct_input_test
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_C_INCLUDES := \
- $(HYBRIS_PATH)/include \
- bionic \
- bionic/libstdc++/include \
- external/gtest/include \
- external/stlport/stlport \
- external/skia/include/core
-
-LOCAL_SHARED_LIBRARIES := \
- libis_compat_layer \
- libcutils \
- libutils \
- libskia \
- libgui \
- libandroidfw
-
-static_libraries := \
- libgtest \
- libgtest_main
-
-include $(BUILD_EXECUTABLE)
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/compat/input/direct_input_test.cpp
^
|
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Thomas Voß <thomas.voss@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <hybris/input/input_stack_compatibility_layer.h>
-
-#include <gtest/gtest.h>
-#include <utils/threads.h>
-
-#include <signal.h>
-
-namespace
-{
-
-bool g_stop = false;
-
-void signal_handler(int)
-{
- g_stop = true;
-}
-
-void on_new_event(Event* event, void* context)
-{
- printf("%s", __PRETTY_FUNCTION__);
-
- printf("\tEventType: %d \n", event->type);
- printf("\tdevice_id: %d \n", event->device_id);
- printf("\tsource_id: %d \n", event->source_id);
- printf("\taction: %d \n", event->action);
- printf("\tflags: %d \n", event->flags);
- printf("\tmeta_state: %d \n", event->meta_state);
-
- switch (event->type) {
- case MOTION_EVENT_TYPE:
- printf("\tdetails.motion.event_time: %lld\n",
- event->details.motion.event_time);
- printf("\tdetails.motion.pointer_coords.x: %f\n",
- event->details.motion.pointer_coordinates[0].x);
- printf("\tdetails.motion.pointer_coords.y: %f\n",
- event->details.motion.pointer_coordinates[0].y);
- break;
- default:
- break;
- }
-}
-
-}
-
-int main(int argc, char** argv)
-{
- g_stop = false;
- signal(SIGINT, signal_handler);
-
- AndroidEventListener listener;
- listener.on_new_event = on_new_event;
- listener.context = NULL;
-
- InputStackConfiguration config = {
- enable_touch_point_visualization : true,
- default_layer_for_touch_point_visualization : 10000,
- input_area_width : 1024,
- input_area_height : 1024
- };
-
- android_input_stack_initialize(&listener, &config);
- android_input_stack_start_waiting_for_flag(&g_stop);
-
- android_input_stack_stop();
- android_input_stack_shutdown();
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/compat/input/input_compatibility_layer.cpp
^
|
@@ -1,358 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Thomas Voß <thomas.voss@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <hybris/input/input_stack_compatibility_layer.h>
-
-#include "InputListener.h"
-#include "InputReader.h"
-#include "PointerController.h"
-#include "SpriteController.h"
-#include <gui/ISurfaceComposer.h>
-#include <gui/SurfaceComposerClient.h>
-
-#undef LOG_TAG
-#define LOG_TAG "InputStackCompatibilityLayer"
-#include <utils/Log.h>
-
-namespace
-{
-static bool enable_verbose_function_reporting = false;
-}
-
-#define REPORT_FUNCTION() ALOGV("%s\n", __PRETTY_FUNCTION__);
-
-namespace
-{
-
-class DefaultPointerControllerPolicy : public android::PointerControllerPolicyInterface
-{
-public:
- static const size_t bitmap_width = 64;
- static const size_t bitmap_height = 64;
-
- DefaultPointerControllerPolicy()
- {
- bitmap.setConfig(
- SkBitmap::kARGB_8888_Config,
- bitmap_width,
- bitmap_height);
- bitmap.allocPixels();
-
- // Icon for spot touches
- bitmap.eraseARGB(125, 0, 255, 0);
- spotTouchIcon = android::SpriteIcon(
- bitmap,
- bitmap_width/2,
- bitmap_height/2);
-
- // Icon for anchor touches
- bitmap.eraseARGB(125, 0, 0, 255);
- spotAnchorIcon = android::SpriteIcon(
- bitmap,
- bitmap_width/2,
- bitmap_height/2);
-
- // Icon for hovering touches
- bitmap.eraseARGB(125, 255, 0, 0);
- spotHoverIcon = android::SpriteIcon(
- bitmap,
- bitmap_width/2,
- bitmap_height/2);
- }
-
- void loadPointerResources(android::PointerResources* outResources)
- {
- outResources->spotHover = spotHoverIcon.copy();
- outResources->spotTouch = spotTouchIcon.copy();
- outResources->spotAnchor = spotAnchorIcon.copy();
- }
-
- android::SpriteIcon spotHoverIcon;
- android::SpriteIcon spotTouchIcon;
- android::SpriteIcon spotAnchorIcon;
- SkBitmap bitmap;
-};
-
-class DefaultInputReaderPolicyInterface : public android::InputReaderPolicyInterface
-{
-public:
- static const int32_t internal_display_id = android::ISurfaceComposer::eDisplayIdMain;
- static const int32_t external_display_id = android::ISurfaceComposer::eDisplayIdHdmi;
-
- DefaultInputReaderPolicyInterface(
- InputStackConfiguration* configuration,
- const android::sp<android::Looper>& looper)
- : looper(looper),
- default_layer_for_touch_point_visualization(configuration->default_layer_for_touch_point_visualization),
- input_area_width(configuration->input_area_width),
- input_area_height(configuration->input_area_height)
- {
- default_configuration.showTouches = configuration->enable_touch_point_visualization;
-
- android::DisplayViewport viewport;
- viewport.setNonDisplayViewport(input_area_width, input_area_height);
- viewport.displayId = android::ISurfaceComposer::eDisplayIdMain;
- default_configuration.setDisplayInfo(
- false, /* external */
- viewport);
- }
-
- void getReaderConfiguration(android::InputReaderConfiguration* outConfig)
- {
- *outConfig = default_configuration;
- }
-
- android::sp<android::PointerControllerInterface> obtainPointerController(int32_t deviceId)
- {
- (void) deviceId;
-
- android::sp<android::SpriteController> sprite_controller(
- new android::SpriteController(
- looper,
- default_layer_for_touch_point_visualization));
- android::sp<android::PointerController> pointer_controller(
- new android::PointerController(
- android::sp<DefaultPointerControllerPolicy>(new DefaultPointerControllerPolicy()),
- looper,
- sprite_controller));
- pointer_controller->setPresentation(
- android::PointerControllerInterface::PRESENTATION_SPOT);
-
- pointer_controller->setDisplayViewport(input_area_width, input_area_height, 0);
- return pointer_controller;
- }
-
- virtual void notifyInputDevicesChanged(const android::Vector<android::InputDeviceInfo>& inputDevices) {
- mInputDevices = inputDevices;
- }
-
- virtual android::sp<android::KeyCharacterMap> getKeyboardLayoutOverlay(const android::String8& inputDeviceDescriptor) {
- return NULL;
- }
-
- virtual android::String8 getDeviceAlias(const android::InputDeviceIdentifier& identifier) {
- return android::String8::empty();
- }
-
-private:
- android::sp<android::Looper> looper;
- int default_layer_for_touch_point_visualization;
- android::InputReaderConfiguration default_configuration;
- android::Vector<android::InputDeviceInfo> mInputDevices;
- int input_area_width;
- int input_area_height;
-};
-
-class ExportedInputListener : public android::InputListenerInterface
-{
-public:
- ExportedInputListener(AndroidEventListener* external_listener) : external_listener(external_listener)
- {
- }
-
- void notifyConfigurationChanged(const android::NotifyConfigurationChangedArgs* args)
- {
- REPORT_FUNCTION();
- (void) args;
- }
-
- void notifyKey(const android::NotifyKeyArgs* args)
- {
- REPORT_FUNCTION();
-
- current_event.type = KEY_EVENT_TYPE;
- current_event.device_id = args->deviceId;
- current_event.source_id = args->source;
- current_event.action = args->action;
- current_event.flags = args->flags;
- current_event.meta_state = args->metaState;
-
- current_event.details.key.key_code = args->keyCode;
- current_event.details.key.scan_code = args->scanCode;
- current_event.details.key.down_time = args->downTime;
- current_event.details.key.event_time = args->eventTime;
-
- current_event.details.key.is_system_key = false;
-
- external_listener->on_new_event(¤t_event, external_listener->context);
- }
-
- void notifyMotion(const android::NotifyMotionArgs* args)
- {
- REPORT_FUNCTION();
-
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/compat/surface_flinger/Android.mk
^
|
@@ -1,44 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-
-LOCAL_SRC_FILES:= \
- surface_flinger_compatibility_layer.cpp
-
-LOCAL_MODULE:= libsf_compat_layer
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_C_INCLUDES := \
- $(HYBRIS_PATH)/include
-
-LOCAL_SHARED_LIBRARIES := \
- libui \
- libutils \
- libgui \
- libEGL \
- libGLESv2
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-
-LOCAL_SRC_FILES:= \
- direct_sf_test.cpp
-
-LOCAL_MODULE:= direct_sf_test
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_C_INCLUDES := \
- $(HYBRIS_PATH)/include
-
-LOCAL_SHARED_LIBRARIES := \
- libui \
- libutils \
- libEGL \
- libGLESv2 \
- libsf_compat_layer
-
-include $(BUILD_EXECUTABLE)
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/compat/surface_flinger/direct_sf_test.cpp
^
|
@@ -1,233 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Thomas Voß <thomas.voss@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
-
-#include <cstdio>
-#include <unistd.h>
-
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-/* animation state variables */
-GLfloat rotation_angle = 0.0f;
-
-static GLuint gProgram;
-static GLuint gvPositionHandle, gvColorHandle;
-static GLuint rotation_uniform;
-static GLint num_vertex = 3;
-static const GLfloat triangle[] = {
- -0.125f, -0.125f, 0.0f, 0.5f,
- 0.0f, 0.125f, 0.0f, 0.5f,
- 0.125f, -0.125f, 0.0f, 0.5f
-};
-static const GLfloat color_triangle[] = {
- 0.0f, 0.0f, 1.0f, 1.0f,
- 0.0f, 1.0f, 0.0f, 1.0f,
- 1.0f, 0.0f, 0.0f, 0.0f
-};
-const GLfloat * vertex_data;
-const GLfloat * color_data;
-static const char gVertexShader[] =
- "attribute vec4 vPosition;\n"
- "attribute vec4 vColor;\n"
- "uniform float angle;\n"
- "varying vec4 colorinfo;\n"
- "void main() {\n"
- " mat3 rot_z = mat3( vec3( cos(angle), sin(angle), 0.0),\n"
- " vec3(-sin(angle), cos(angle), 0.0),\n"
- " vec3( 0.0, 0.0, 1.0));\n"
- " gl_Position = vec4(rot_z * vPosition.xyz, 1.0);\n"
- " colorinfo = vColor;\n"
- "}\n";
-
-static const char gFragmentShader[] = "precision mediump float;\n"
- "varying vec4 colorinfo;\n"
- "void main() {\n"
- " gl_FragColor = colorinfo;\n"
- "}\n";
-
-/* util functions */
-GLuint loadShader(GLenum shaderType, const char* pSource)
-{
- GLuint shader = glCreateShader(shaderType);
- if (shader) {
- glShaderSource(shader, 1, &pSource, NULL);
- glCompileShader(shader);
- GLint compiled = 0;
- glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
-
- if (!compiled) {
- GLint infoLen = 0;
- glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
- if (infoLen) {
- char* buf = (char*) malloc(infoLen);
- if (buf) {
- glGetShaderInfoLog(shader, infoLen, NULL, buf);
- fprintf(stderr, "Could not compile shader %d:\n%s\n",
- shaderType, buf);
- free(buf);
- }
- glDeleteShader(shader);
- shader = 0;
- }
- }
- } else {
- printf("Error, during shader creation: %i\n", glGetError());
- }
-
- return shader;
-}
-
-GLuint createProgram(const char* pVertexSource, const char* pFragmentSource)
-{
- GLuint vertexShader = loadShader(GL_VERTEX_SHADER, pVertexSource);
- if (!vertexShader) {
- printf("vertex shader not compiled\n");
- return 0;
- }
-
- GLuint pixelShader = loadShader(GL_FRAGMENT_SHADER, pFragmentSource);
- if (!pixelShader) {
- printf("frag shader not compiled\n");
- return 0;
- }
-
- GLuint program = glCreateProgram();
- if (program) {
- glAttachShader(program, vertexShader);
- glAttachShader(program, pixelShader);
- glLinkProgram(program);
- GLint linkStatus = GL_FALSE;
- glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
-
- if (linkStatus != GL_TRUE) {
- GLint bufLength = 0;
- glGetProgramiv(program, GL_INFO_LOG_LENGTH, &bufLength);
- if (bufLength) {
- char* buf = (char*) malloc(bufLength);
- if (buf) {
- glGetProgramInfoLog(program, bufLength, NULL, buf);
- fprintf(stderr, "Could not link program:\n%s\n", buf);
- free(buf);
- }
- }
- glDeleteProgram(program);
- program = 0;
- }
- }
-
- return program;
-}
-
-bool setupGraphics()
-{
- vertex_data = triangle;
- color_data = color_triangle;
-
- gProgram = createProgram(gVertexShader, gFragmentShader);
- if (!gProgram) {
- printf("error making program\n");
- return 0;
- }
-
- gvPositionHandle = glGetAttribLocation(gProgram, "vPosition");
- gvColorHandle = glGetAttribLocation(gProgram, "vColor");
-
- rotation_uniform = glGetUniformLocation(gProgram, "angle");
-
- return true;
-}
-
-void hw_render(EGLDisplay displ, EGLSurface surface)
-{
- glUseProgram(gProgram);
-
- glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
-
- glUniform1fv(rotation_uniform,1, &rotation_angle);
-
- glVertexAttribPointer(gvColorHandle, num_vertex, GL_FLOAT, GL_FALSE, sizeof(GLfloat)*4, color_data);
- glVertexAttribPointer(gvPositionHandle, num_vertex, GL_FLOAT, GL_FALSE, 0, vertex_data);
- glEnableVertexAttribArray(gvPositionHandle);
- glEnableVertexAttribArray(gvColorHandle);
-
- glDrawArrays(GL_TRIANGLE_STRIP, 0, num_vertex);
- glDisableVertexAttribArray(gvPositionHandle);
- glDisableVertexAttribArray(gvColorHandle);
-
- eglSwapBuffers(displ, surface);
-}
-
-void hw_step()
-{
- rotation_angle += 0.01;
- return;
-}
-
-int main(int argc, char** argv)
-{
- SfClient* sf_client = sf_client_create();
-
- if (!sf_client) {
- printf("Problem creating client ... aborting now.");
- return 1;
- }
-
- SfSurfaceCreationParameters params = {
- 200,
- 200,
- 500,
- 500,
- -1, //PIXEL_FORMAT_RGBA_8888,
- INT_MAX,
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/compat/surface_flinger/surface_flinger_compatibility_layer.cpp
^
|
@@ -1,355 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Thomas Voss <thomas.voss@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
-#include <hybris/internal/surface_flinger_compatibility_layer_internal.h>
-
-#include <utils/misc.h>
-
-#include <gui/SurfaceComposerClient.h>
-#include <gui/ISurfaceComposer.h>
-#include <ui/DisplayInfo.h>
-#include <ui/PixelFormat.h>
-#include <ui/Region.h>
-#include <ui/Rect.h>
-
-#include <cassert>
-#include <cstdio>
-
-namespace
-{
-void report_failed_to_allocate_surface_flinger_composer_client_on_creation()
-{
- printf("Problem allocating an object of type SurfaceComposerClient during client creation");
-}
-
-void report_failed_to_get_egl_default_display_on_creation()
-{
- printf("Problem accessing default egl display during client creation");
-}
-
-void report_failed_to_initialize_egl_on_creation()
-{
- printf("Problem initializing egl during client creation");
-}
-
-void report_failed_to_choose_egl_config_on_creation()
-{
- printf("Problem choosing egl config on creation");
-}
-
-void report_surface_control_is_null_during_creation()
-{
- printf("Could not acquire surface control object during surface creation");
-}
-
-void report_surface_is_null_during_creation()
-{
- printf("Could not acquire surface from surface control during surface creation");
-}
-}
-
-void sf_blank(size_t display_id)
-{
- android::sp<android::IBinder> display;
-
- if (display_id == 0) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdMain);
- } else if (display_id == 1) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdHdmi);
- } else {
- fprintf(stderr, "Warning: sf_blank invalid display_id (0 || 1)\n");
- return;
- }
-
- android::SurfaceComposerClient::blankDisplay(display);
-}
-
-void sf_unblank(size_t display_id)
-{
- android::sp<android::IBinder> display;
-
- if (display_id == 0) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdMain);
- } else if (display_id == 1) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdHdmi);
- } else {
- fprintf(stderr, "Warning: sf_unblank invalid display_id (0 || 1)\n");
- return;
- }
-
- android::SurfaceComposerClient::unblankDisplay(display);
-}
-
-size_t sf_get_display_width(size_t display_id)
-{
- android::sp<android::IBinder> display;
-
- if (display_id == 0) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdMain);
- } else if (display_id == 1) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdHdmi);
- } else {
- fprintf(stderr, "Warning: sf_get_display_width invalid display_id (0 || 1)\n");
- return -1;
- }
-
- android::DisplayInfo info;
- android::SurfaceComposerClient::getDisplayInfo(display, &info);
- return info.w;
-}
-
-size_t sf_get_display_height(size_t display_id)
-{
- android::sp<android::IBinder> display;
-
- if (display_id == 0) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdMain);
- } else if (display_id == 1) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdHdmi);
- } else {
- fprintf(stderr, "Warning: sf_get_display_height invalid display_id (0 || 1)\n");
- return -1;
- }
-
- android::DisplayInfo info;
- android::SurfaceComposerClient::getDisplayInfo(display, &info);
- return info.h;
-}
-
-SfClient* sf_client_create_full(bool egl_support)
-{
- SfClient* client = new SfClient();
-
- client->client = new android::SurfaceComposerClient();
- if (client->client == NULL) {
- report_failed_to_allocate_surface_flinger_composer_client_on_creation();
- delete client;
- return NULL;
- }
-
- client->egl_support = egl_support;
- if (egl_support) {
- client->egl_display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- if (client->egl_display == EGL_NO_DISPLAY) {
- report_failed_to_get_egl_default_display_on_creation();
- delete client;
- return NULL;
- }
-
- int major, minor;
- int rc = eglInitialize(client->egl_display, &major, &minor);
- if (rc == EGL_FALSE) {
- report_failed_to_initialize_egl_on_creation();
- delete client;
- return NULL;
- }
-
- EGLint attribs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL_NONE
- };
-
- int n;
- if (eglChooseConfig(client->egl_display,
- attribs,
- &client->egl_config, 1,
- &n) == EGL_FALSE) {
- report_failed_to_choose_egl_config_on_creation();
- delete client;
- return NULL;
- }
-
- EGLint context_attribs[] = {
- EGL_CONTEXT_CLIENT_VERSION, 2,
- EGL_NONE
- };
-
- client->egl_context = eglCreateContext(
- client->egl_display,
- client->egl_config,
- EGL_NO_CONTEXT,
- context_attribs);
- }
-
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/compat/ui/Android.mk
^
|
@@ -1,25 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-
-LOCAL_SRC_FILES:= \
- ui_compatibility_layer.cpp
-
-LOCAL_MODULE:= libui_compat_layer
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_C_INCLUDES := \
- $(HYBRIS_PATH)/include \
- frameworks/native/include
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libutils \
- libbinder \
- libhardware \
- libui
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/compat/ui/ui_compatibility_layer.cpp
^
|
@@ -1,142 +0,0 @@
-/*
- * Copyright (C) 2013 Simon Busch <morphis@gravedo.de>
- *
- * 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 <fcntl.h>
-#include <sys/stat.h>
-
-#include <ui/GraphicBuffer.h>
-#include <ui/GraphicBufferMapper.h>
-#include <ui/GraphicBufferAllocator.h>
-
-#include <hybris/ui/ui_compatibility_layer.h>
-
-struct graphic_buffer
-{
- android::GraphicBuffer *self;
-};
-
-struct graphic_buffer* graphic_buffer_new(void)
-{
- struct graphic_buffer *buffer = NULL;
-
- buffer = (struct graphic_buffer*) malloc(sizeof(struct graphic_buffer));
- if (!buffer)
- return NULL;
-
- buffer->self = new android::GraphicBuffer();
-
- return buffer;
-}
-
-struct graphic_buffer* graphic_buffer_new_sized(uint32_t w, uint32_t h,
- int32_t format, uint32_t usage)
-{
- struct graphic_buffer *buffer = NULL;
-
- buffer = (struct graphic_buffer*) malloc(sizeof(struct graphic_buffer));
- if (!buffer)
- return NULL;
-
- buffer->self = new android::GraphicBuffer(w, h, format, usage);
-
- return buffer;
-}
-
-struct graphic_buffer* graphic_buffer_new_existing(uint32_t w, uint32_t h,
- int32_t format, uint32_t usage,
- uint32_t stride, void *handle,
- bool keepOwnership)
-{
- struct graphic_buffer *buffer = NULL;
-
- buffer = (struct graphic_buffer*) malloc(sizeof(struct graphic_buffer));
- if (!buffer)
- return NULL;
-
- buffer->self = new android::GraphicBuffer(w, h, format, usage, stride, (native_handle_t*) handle, keepOwnership);
-
- return buffer;
-
-}
-
-void graphic_buffer_free(struct graphic_buffer *buffer)
-{
- if (!buffer)
- return;
-
- free(buffer);
-}
-
-uint32_t graphic_buffer_get_width(struct graphic_buffer *buffer)
-{
- return buffer->self->getWidth();
-}
-
-uint32_t graphic_buffer_get_height(struct graphic_buffer *buffer)
-{
- return buffer->self->getHeight();
-}
-
-uint32_t graphic_buffer_get_stride(struct graphic_buffer *buffer)
-{
- return buffer->self->getStride();
-}
-
-uint32_t graphic_buffer_get_usage(struct graphic_buffer *buffer)
-{
- return buffer->self->getUsage();
-}
-
-int32_t graphic_buffer_get_pixel_format(struct graphic_buffer *buffer)
-{
- return buffer->self->getPixelFormat();
-}
-
-uint32_t graphic_buffer_reallocate(struct graphic_buffer *buffer, uint32_t w,
- uint32_t h, int32_t f, uint32_t usage)
-{
- return buffer->self->reallocate(w, h, f, usage);
-}
-
-uint32_t graphic_buffer_lock(struct graphic_buffer *buffer, uint32_t usage, void **vaddr)
-{
- return buffer->self->lock(usage, vaddr);
-}
-
-uint32_t graphic_buffer_unlock(struct graphic_buffer *buffer)
-{
- return buffer->self->unlock();
-}
-
-void* graphic_buffer_get_native_buffer(struct graphic_buffer *buffer)
-{
- return buffer->self->getNativeBuffer();
-}
-
-void graphic_buffer_set_index(struct graphic_buffer *buffer, int index)
-{
- return buffer->self->setIndex(index);
-}
-
-int graphic_buffer_get_index(struct graphic_buffer *buffer)
-{
- return buffer->self->getIndex();
-}
-
-int graphic_buffer_init_check(struct graphic_buffer *buffer)
-{
- return buffer->self->initCheck();
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/hybris/camera/Makefile.am
^
|
@@ -1,17 +0,0 @@
-lib_LTLIBRARIES = \
- libcamera.la
-
-libcamera_la_SOURCES = camera.c
-libcamera_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
-if WANT_TRACE
-libcamera_la_CFLAGS += -DDEBUG
-endif
-if WANT_DEBUG
-libcamera_la_CFLAGS += -ggdb -O0
-endif
-libcamera_la_LDFLAGS = \
- $(top_builddir)/common/libhybris-common.la \
- -version-info "1":"0":"0"
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libcamera.pc
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/hybris/camera/camera.c
^
|
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Michael Frey <michael.frey@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <android-config.h>
-#include <dlfcn.h>
-#include <stddef.h>
-
-#include <hybris/common/binding.h>
-#include <hybris/camera/camera_compatibility_layer.h>
-#include <hybris/camera/camera_compatibility_layer_capabilities.h>
-#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
-
-#define COMPAT_LIBRARY_PATH "/system/lib/libcamera_compat_layer.so"
-
-HYBRIS_LIBRARY_INITIALIZE(camera, COMPAT_LIBRARY_PATH);
-
-HYBRIS_IMPLEMENT_FUNCTION0(camera, int, android_camera_get_number_of_devices);
-HYBRIS_IMPLEMENT_FUNCTION2(camera, struct CameraControl*, android_camera_connect_to,
- CameraType, struct CameraControlListener*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_disconnect,
- struct CameraControl*);
-HYBRIS_IMPLEMENT_FUNCTION1(camera, int, android_camera_lock, struct CameraControl*);
-HYBRIS_IMPLEMENT_FUNCTION1(camera, int, android_camera_unlock, struct CameraControl*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_delete, struct CameraControl*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_dump_parameters,
- struct CameraControl*);
-
-// Setters
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_effect_mode,
- struct CameraControl*, EffectMode);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_flash_mode,
- struct CameraControl*, FlashMode);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_white_balance_mode,
- struct CameraControl*, WhiteBalanceMode);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_scene_mode,
- struct CameraControl*, SceneMode);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_auto_focus_mode,
- struct CameraControl*, AutoFocusMode);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_set_picture_size,
- struct CameraControl*, int, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_set_preview_size,
- struct CameraControl*, int, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_display_orientation,
- struct CameraControl*, int32_t);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_preview_texture,
- struct CameraControl*, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_preview_surface,
- struct CameraControl*, struct SfSurface*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_focus_region,
- struct CameraControl*, FocusRegion*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_reset_focus_region,
- struct CameraControl*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_preview_fps,
- struct CameraControl*, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_rotation,
- struct CameraControl*, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_set_video_size,
- struct CameraControl*, int, int);
-
-// Getters
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_effect_mode,
- struct CameraControl*, EffectMode*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_flash_mode,
- struct CameraControl*, FlashMode*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_white_balance_mode,
- struct CameraControl*, WhiteBalanceMode*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_scene_mode,
- struct CameraControl*, SceneMode*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_auto_focus_mode,
- struct CameraControl*, AutoFocusMode*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_max_zoom,
- struct CameraControl*, int*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_get_picture_size,
- struct CameraControl*, int*, int*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_get_preview_size,
- struct CameraControl*, int*, int*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_get_preview_fps_range,
- struct CameraControl*, int*, int*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_preview_fps,
- struct CameraControl*, int*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_preview_texture_transformation,
- struct CameraControl*, float*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_get_video_size,
- struct CameraControl*, int*, int*);
-
-// Enumerators
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_enumerate_supported_picture_sizes,
- struct CameraControl*, size_callback, void*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_enumerate_supported_preview_sizes,
- struct CameraControl*, size_callback, void*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_enumerate_supported_video_sizes,
- struct CameraControl*, size_callback, void*);
-
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_update_preview_texture, struct CameraControl*);
-
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_start_preview, struct CameraControl*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_stop_preview, struct CameraControl*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_start_autofocus, struct CameraControl*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_stop_autofocus, struct CameraControl*);
-
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_start_zoom, struct CameraControl*, int32_t);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_zoom, struct CameraControl*, int32_t);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_stop_zoom, struct CameraControl*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_take_snapshot, struct CameraControl*);
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/hybris/camera/libcamera.pc.in
^
|
@@ -1,10 +0,0 @@
-prefix=@prefix@
-exec_prefix=${prefix}
-libdir=@libdir@
-includedir=@includedir@
-
-Name: hybris-camera
-Description: libhybris camera library
-Version: @VERSION@
-Libs: -L${libdir} -lhybris-common -lcamera
-Cflags: -I${includedir}
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/hybris/input/Makefile.am
^
|
@@ -1,17 +0,0 @@
-lib_LTLIBRARIES = \
- libis.la
-
-libis_la_SOURCES = is.c
-libis_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
-if WANT_TRACE
-libis_la_CFLAGS += -DDEBUG
-endif
-if WANT_DEBUG
-libis_la_CFLAGS += -ggdb -O0
-endif
-libis_la_LDFLAGS = \
- $(top_builddir)/common/libhybris-common.la \
- -version-info "1":"0":"0"
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libis.pc
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/hybris/input/is.c
^
|
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Michael Frey <michael.frey@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <dlfcn.h>
-#include <stddef.h>
-#include <stdbool.h>
-
-#include <hybris/common/binding.h>
-#include <hybris/input/input_stack_compatibility_layer.h>
-
-#define COMPAT_LIBRARY_PATH "/system/lib/libis_compat_layer.so"
-
-HYBRIS_LIBRARY_INITIALIZE(is, COMPAT_LIBRARY_PATH);
-
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(is, android_input_stack_initialize,
- struct AndroidEventListener*, struct InputStackConfiguration*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION0(is, android_input_stack_start);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(is, android_input_stack_start_waiting_for_flag, bool*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION0(is, android_input_stack_stop);
-HYBRIS_IMPLEMENT_VOID_FUNCTION0(is, android_input_stack_shutdown);
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/hybris/input/libis.pc.in
^
|
@@ -1,10 +0,0 @@
-prefix=@prefix@
-exec_prefix=${prefix}
-libdir=@libdir@
-includedir=@includedir@
-
-Name: hybris-input
-Description: libhybris input library
-Version: @VERSION@
-Libs: -L${libdir} -lhybris-common -lis
-Cflags: -I${includedir}
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/hybris/sf/Makefile.am
^
|
@@ -1,17 +0,0 @@
-lib_LTLIBRARIES = \
- libsf.la
-
-libsf_la_SOURCES = sf.c
-libsf_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
-if WANT_TRACE
-libsf_la_CFLAGS += -DDEBUG
-endif
-if WANT_DEBUG
-libsf_la_CFLAGS += -ggdb -O0
-endif
-libsf_la_LDFLAGS = \
- $(top_builddir)/common/libhybris-common.la \
- -version-info "1":"0":"0"
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libsf.pc
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/hybris/sf/libsf.pc.in
^
|
@@ -1,10 +0,0 @@
-prefix=@prefix@
-exec_prefix=${prefix}
-libdir=@libdir@
-includedir=@includedir@
-
-Name: hybris-surface-flinger
-Description: libhybris surface flinger library
-Version: @VERSION@
-Libs: -L${libdir} -lhybris-common -lsf
-Cflags: -I${includedir}
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/hybris/sf/sf.c
^
|
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Michael Frey <michael.frey@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <EGL/egl.h>
-#include <dlfcn.h>
-#include <stddef.h>
-
-#include <hybris/common/binding.h>
-#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
-
-#define COMPAT_LIBRARY_PATH "/system/lib/libsf_compat_layer.so"
-
-HYBRIS_LIBRARY_INITIALIZE(sf, COMPAT_LIBRARY_PATH);
-
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_blank, size_t);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_unblank, size_t);
-HYBRIS_IMPLEMENT_FUNCTION1(sf, size_t, sf_get_display_width, size_t);
-HYBRIS_IMPLEMENT_FUNCTION1(sf, size_t, sf_get_display_height, size_t);
-HYBRIS_IMPLEMENT_FUNCTION1(sf, struct SfClient*, sf_client_create_full, int);
-HYBRIS_IMPLEMENT_FUNCTION0(sf, struct SfClient*, sf_client_create);
-HYBRIS_IMPLEMENT_FUNCTION1(sf, EGLDisplay, sf_client_get_egl_display,
- struct SfClient*);
-HYBRIS_IMPLEMENT_FUNCTION1(sf, EGLConfig, sf_client_get_egl_config,
- struct SfClient*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_client_begin_transaction,
- struct SfClient*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_client_end_transaction,
- struct SfClient*);
-HYBRIS_IMPLEMENT_FUNCTION2(sf, struct SfSurface*, sf_surface_create,
- struct SfClient*, SfSurfaceCreationParameters*);
-HYBRIS_IMPLEMENT_FUNCTION1(sf, EGLSurface, sf_surface_get_egl_surface,
- struct SfSurface*);
-HYBRIS_IMPLEMENT_FUNCTION1(sf, EGLNativeWindowType,
- sf_surface_get_egl_native_window, struct SfSurface*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_surface_make_current, struct SfSurface*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(sf, sf_surface_move_to,
- struct SfSurface*, int, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(sf, sf_surface_set_size,
- struct SfSurface*, int, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(sf, sf_surface_set_layer,
- struct SfSurface*, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(sf, sf_surface_set_alpha,
- struct SfSurface*, float);
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/hybris/ui/Makefile.am
^
|
@@ -1,14 +0,0 @@
-lib_LTLIBRARIES = \
- libui.la
-
-libui_la_SOURCES = ui.c
-libui_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
-if WANT_TRACE
-libui_la_CFLAGS += -DDEBUG
-endif
-if WANT_DEBUG
-libui_la_CFLAGS += -ggdb -O0
-endif
-libui_la_LDFLAGS = \
- $(top_builddir)/common/libhybris-common.la \
- -version-info "1":"0":"0"
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/libhybris/hybris/ui/ui.c
^
|
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2013 Simon Busch <morphis@gravedo.de>
- *
- * 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 <dlfcn.h>
-#include <stddef.h>
-
-#include <hybris/common/binding.h>
-#include <hybris/ui/ui_compatibility_layer.h>
-
-#define COMPAT_LIBRARY_PATH "/system/lib/libui_compat_layer.so"
-
-HYBRIS_LIBRARY_INITIALIZE(ui, COMPAT_LIBRARY_PATH);
-
-HYBRIS_IMPLEMENT_FUNCTION0(ui, struct graphic_buffer*, graphic_buffer_new);
-HYBRIS_IMPLEMENT_FUNCTION4(ui, struct graphic_buffer*,
- graphic_buffer_new_sized, uint32_t, uint32_t, int32_t, uint32_t);
-HYBRIS_IMPLEMENT_FUNCTION7(ui, struct graphic_buffer*, graphic_buffer_new_existing,
- uint32_t, uint32_t, int32_t, uint32_t, uint32_t, void*, bool);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(ui, graphic_buffer_free, struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_get_width,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_get_height,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_get_stride,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_get_usage,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, int32_t, graphic_buffer_get_pixel_format,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION5(ui, uint32_t, graphic_buffer_reallocate,
- struct graphic_buffer*, uint32_t, uint32_t, int32_t, uint32_t);
-HYBRIS_IMPLEMENT_FUNCTION3(ui, uint32_t, graphic_buffer_lock,
- struct graphic_buffer*, uint32_t, void**);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_unlock,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, void*, graphic_buffer_get_native_buffer,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(ui, graphic_buffer_set_index,
- struct graphic_buffer*, int);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, int, graphic_buffer_get_index,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, int, graphic_buffer_init_check,
- struct graphic_buffer*);
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/compat/camera/Android.mk
^
|
@@ -1,56 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-
-LOCAL_SRC_FILES := camera_compatibility_layer.cpp
-
-LOCAL_MODULE := libcamera_compat_layer
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_C_INCLUDES := \
- $(HYBRIS_PATH)/include
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libcamera_client \
- libutils \
- libbinder \
- libhardware \
- libui \
- libgui
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-
-LOCAL_SRC_FILES := direct_camera_test.cpp
-
-LOCAL_MODULE := direct_camera_test
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_C_INCLUDES := \
- $(HYBRIS_PATH)/include \
- bionic \
- bionic/libstdc++/include \
- external/gtest/include \
- external/stlport/stlport \
- external/skia/include/core \
-
-LOCAL_SHARED_LIBRARIES := \
- libis_compat_layer \
- libsf_compat_layer \
- libcamera_compat_layer \
- libcutils \
- libcamera_client \
- libutils \
- libbinder \
- libhardware \
- libui \
- libgui \
- libEGL \
- libGLESv2
-
-include $(BUILD_EXECUTABLE)
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/compat/camera/camera_compatibility_layer.cpp
^
|
@@ -1,739 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Thomas Voß <thomas.voss@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <hybris/internal/camera_control.h>
-#include <hybris/camera/camera_compatibility_layer.h>
-#include <hybris/camera/camera_compatibility_layer_capabilities.h>
-#include <hybris/camera/camera_compatibility_layer_configuration_translator.h>
-
-#include <hybris/internal/surface_flinger_compatibility_layer_internal.h>
-
-#include <binder/ProcessState.h>
-#include <camera/Camera.h>
-#include <camera/CameraParameters.h>
-#include <gui/SurfaceTexture.h>
-#include <ui/GraphicBuffer.h>
-
-#undef LOG_TAG
-#define LOG_TAG "CameraCompatibilityLayer"
-#include <utils/KeyedVector.h>
-#include <utils/Log.h>
-
-#define REPORT_FUNCTION() ALOGV("%s \n", __PRETTY_FUNCTION__)
-
-// From android::SurfaceTexture::FrameAvailableListener
-void CameraControl::onFrameAvailable()
-{
- REPORT_FUNCTION();
- if (listener)
- listener->on_preview_texture_needs_update_cb(listener->context);
-}
-
-// From android::CameraListener
-void CameraControl::notify(int32_t msg_type, int32_t ext1, int32_t ext2)
-{
- REPORT_FUNCTION();
- printf("\text1: %d, ext2: %d \n", ext1, ext2);
-
- if (!listener)
- return;
-
- switch (msg_type) {
- case CAMERA_MSG_ERROR:
- if (listener->on_msg_error_cb)
- listener->on_msg_error_cb(listener->context);
- break;
- case CAMERA_MSG_SHUTTER:
- if (listener->on_msg_shutter_cb)
- listener->on_msg_shutter_cb(listener->context);
- break;
- case CAMERA_MSG_ZOOM:
- if (listener->on_msg_zoom_cb)
- listener->on_msg_zoom_cb(listener->context, ext1);
- break;
- case CAMERA_MSG_FOCUS:
- if (listener->on_msg_focus_cb)
- listener->on_msg_focus_cb(listener->context);
- break;
- default:
- break;
- }
-}
-
-void CameraControl::postData(
- int32_t msg_type,
- const android::sp<android::IMemory>& data,
- camera_frame_metadata_t* metadata)
-{
- REPORT_FUNCTION();
-
- if (!listener)
- return;
-
- switch (msg_type) {
- case CAMERA_MSG_RAW_IMAGE:
- if (listener->on_data_raw_image_cb)
- listener->on_data_raw_image_cb(data->pointer(), data->size(), listener->context);
- break;
- case CAMERA_MSG_COMPRESSED_IMAGE:
- if (listener->on_data_compressed_image_cb)
- listener->on_data_compressed_image_cb(data->pointer(), data->size(), listener->context);
- break;
- default:
- break;
- }
-}
-
-void CameraControl::postDataTimestamp(
- nsecs_t timestamp,
- int32_t msg_type,
- const android::sp<android::IMemory>& data)
-{
- REPORT_FUNCTION();
- (void) timestamp;
- (void) msg_type;
- (void) data;
-}
-
-namespace android
-{
-NativeBufferAlloc::NativeBufferAlloc() {
-}
-
-NativeBufferAlloc::~NativeBufferAlloc() {
-}
-
-sp<GraphicBuffer> NativeBufferAlloc::createGraphicBuffer(uint32_t w, uint32_t h,
- PixelFormat format, uint32_t usage, status_t* error) {
- sp<GraphicBuffer> graphicBuffer(new GraphicBuffer(w, h, format, usage));
- status_t err = graphicBuffer->initCheck();
- *error = err;
- if (err != 0 || graphicBuffer->handle == 0) {
- if (err == NO_MEMORY) {
- GraphicBuffer::dumpAllocationsToSystemLog();
- }
- ALOGI("GraphicBufferAlloc::createGraphicBuffer(w=%d, h=%d) "
- "failed (%s), handle=%p",
- w, h, strerror(-err), graphicBuffer->handle);
- return 0;
- }
- return graphicBuffer;
-}
-}
-
-namespace
-{
-
-android::sp<CameraControl> camera_control_instance;
-
-}
-
-int android_camera_get_number_of_devices()
-{
- REPORT_FUNCTION();
- return android::Camera::getNumberOfCameras();
-}
-
-CameraControl* android_camera_connect_to(CameraType camera_type, CameraControlListener* listener)
-{
- REPORT_FUNCTION();
-
- int32_t camera_id;
- int32_t camera_count = camera_id = android::Camera::getNumberOfCameras();
-
- for (camera_id = 0; camera_id < camera_count; camera_id++) {
- android::CameraInfo ci;
- android::Camera::getCameraInfo(camera_id, &ci);
-
- if (ci.facing == camera_type)
- break;
- }
-
- if (camera_id == camera_count)
- return NULL;
-
- CameraControl* cc = new CameraControl();
- cc->listener = listener;
- cc->camera = android::Camera::connect(camera_id);
-
- if (cc->camera == NULL)
- return NULL;
-
- cc->camera_parameters = android::CameraParameters(cc->camera->getParameters());
-
- camera_control_instance = cc;
- cc->camera->setListener(camera_control_instance);
- cc->camera->lock();
-
- // TODO: Move this to a more generic component
- android::ProcessState::self()->startThreadPool();
-
- return cc;
-}
-
-void android_camera_disconnect(CameraControl* control)
-{
- REPORT_FUNCTION();
- assert(control);
-
- android::Mutex::Autolock al(control->guard);
-
- if (control->preview_texture != NULL)
- control->preview_texture->abandon();
-
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/compat/camera/direct_camera_test.cpp
^
|
@@ -1,515 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Thomas Voß <thomas.voss@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <hybris/camera/camera_compatibility_layer.h>
-#include <hybris/camera/camera_compatibility_layer_capabilities.h>
-
-#include <hybris/input/input_stack_compatibility_layer.h>
-#include <hybris/input/input_stack_compatibility_layer_codes_key.h>
-#include <hybris/input/input_stack_compatibility_layer_flags_key.h>
-#include <hybris/input/input_stack_compatibility_layer_flags_motion.h>
-
-#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
-
-#include <gui/ISurfaceComposer.h>
-
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <cassert>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-
-int shot_counter = 1;
-int32_t current_zoom_level = 1;
-bool new_camera_frame_available = true;
-
-EffectMode next_effect()
-{
- static EffectMode current_effect = EFFECT_MODE_NONE;
-
- EffectMode next = current_effect;
-
- switch (current_effect) {
- case EFFECT_MODE_NONE:
- next = EFFECT_MODE_MONO;
- break;
- case EFFECT_MODE_MONO:
- next = EFFECT_MODE_NEGATIVE;
- break;
- case EFFECT_MODE_NEGATIVE:
- next = EFFECT_MODE_SOLARIZE;
- break;
- case EFFECT_MODE_SOLARIZE:
- next = EFFECT_MODE_SEPIA;
- break;
- case EFFECT_MODE_SEPIA:
- next = EFFECT_MODE_POSTERIZE;
- break;
- case EFFECT_MODE_POSTERIZE:
- next = EFFECT_MODE_WHITEBOARD;
- break;
- case EFFECT_MODE_WHITEBOARD:
- next = EFFECT_MODE_BLACKBOARD;
- break;
- case EFFECT_MODE_BLACKBOARD:
- next = EFFECT_MODE_AQUA;
- break;
- case EFFECT_MODE_AQUA:
- next = EFFECT_MODE_NONE;
- break;
- }
-
- current_effect = next;
- return next;
-}
-
-void error_msg_cb(void* context)
-{
- printf("%s \n", __PRETTY_FUNCTION__);
-}
-
-void shutter_msg_cb(void* context)
-{
- printf("%s \n", __PRETTY_FUNCTION__);
-}
-
-void zoom_msg_cb(void* context, int32_t new_zoom_level)
-{
- printf("%s \n", __PRETTY_FUNCTION__);
-
- CameraControl* cc = static_cast<CameraControl*>(context);
- static int zoom;
- android_camera_get_current_zoom(cc, &zoom);
- printf("\t Current zoom: %d\n", zoom);
- current_zoom_level = new_zoom_level;
-}
-
-void autofocus_msg_cb(void* context)
-{
- printf("%s \n", __PRETTY_FUNCTION__);
-}
-
-void raw_data_cb(void* data, uint32_t data_size, void* context)
-{
- printf("%s: %d \n", __PRETTY_FUNCTION__, data_size);
-}
-
-void jpeg_data_cb(void* data, uint32_t data_size, void* context)
-{
- printf("%s: %d \n", __PRETTY_FUNCTION__, data_size);
-
- char fn[256];
- sprintf(fn, "/data/shot_%d.jpeg", shot_counter);
- int fd = open(fn, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
- write(fd, data, data_size);
- close(fd);
- shot_counter++;
-
- CameraControl* cc = static_cast<CameraControl*>(context);
- android_camera_start_preview(cc);
-}
-
-void size_cb(void* ctx, int width, int height)
-{
- printf("Supported size: [%d,%d]\n", width, height);
-}
-
-void preview_texture_needs_update_cb(void* ctx)
-{
- new_camera_frame_available = true;
-}
-
-void on_new_input_event(Event* event, void* context)
-{
- assert(context);
-
- if (event->type == KEY_EVENT_TYPE && event->action == ISCL_KEY_EVENT_ACTION_UP) {
- printf("We have got a key event: %d \n", event->details.key.key_code);
-
- CameraControl* cc = static_cast<CameraControl*>(context);
-
- switch(event->details.key.key_code) {
- case ISCL_KEYCODE_VOLUME_UP:
- printf("\tZooming in now.\n");
- android_camera_start_zoom(cc, current_zoom_level+1);
- break;
- case ISCL_KEYCODE_VOLUME_DOWN:
- printf("\tZooming out now.\n");
- android_camera_start_zoom(cc, current_zoom_level-1);
- break;
- case ISCL_KEYCODE_POWER:
- printf("\tTaking a photo now.\n");
- android_camera_take_snapshot(cc);
- break;
- case ISCL_KEYCODE_HEADSETHOOK:
- printf("\tSwitching effect.\n");
- android_camera_set_effect_mode(cc, next_effect());
- }
- } else if (event->type == MOTION_EVENT_TYPE &&
- event->details.motion.pointer_count == 1) {
- if ((event->action & ISCL_MOTION_EVENT_ACTION_MASK) == ISCL_MOTION_EVENT_ACTION_UP) {
- printf("\tMotion event(Action up): (%f, %f) \n",
- event->details.motion.pointer_coordinates[0].x,
- event->details.motion.pointer_coordinates[0].y);
- }
-
- if ((event->action & ISCL_MOTION_EVENT_ACTION_MASK) == ISCL_MOTION_EVENT_ACTION_DOWN) {
- printf("\tMotion event(Action down): (%f, %f) \n",
- event->details.motion.pointer_coordinates[0].x,
- event->details.motion.pointer_coordinates[0].y);
- }
- }
-}
-
-struct ClientWithSurface
-{
- SfClient* client;
- SfSurface* surface;
-};
-
-ClientWithSurface client_with_surface(bool setup_surface_with_egl)
-{
- ClientWithSurface cs = ClientWithSurface();
-
- cs.client = sf_client_create();
-
- if (!cs.client) {
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/compat/input/Android.mk
^
|
@@ -1,60 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-
-LOCAL_CFLAGS += -std=gnu++0x
-
-LOCAL_SRC_FILES:= input_compatibility_layer.cpp
-
-LOCAL_MODULE:= libis_compat_layer
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SHARED_LIBRARIES := \
- libinput \
- libcutils \
- libutils \
- libskia \
- libgui \
- libandroidfw
-
-LOCAL_C_INCLUDES := \
- $(HYBRIS_PATH)/include \
- external/skia/include/core \
- frameworks/base/services/input
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-
-LOCAL_CFLAGS += -std=gnu++0x
-
-LOCAL_SRC_FILES:= \
- direct_input_test.cpp
-
-LOCAL_MODULE:= direct_input_test
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_C_INCLUDES := \
- $(HYBRIS_PATH)/include \
- bionic \
- bionic/libstdc++/include \
- external/gtest/include \
- external/stlport/stlport \
- external/skia/include/core
-
-LOCAL_SHARED_LIBRARIES := \
- libis_compat_layer \
- libcutils \
- libutils \
- libskia \
- libgui \
- libandroidfw
-
-static_libraries := \
- libgtest \
- libgtest_main
-
-include $(BUILD_EXECUTABLE)
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/compat/input/direct_input_test.cpp
^
|
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Thomas Voß <thomas.voss@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <hybris/input/input_stack_compatibility_layer.h>
-
-#include <gtest/gtest.h>
-#include <utils/threads.h>
-
-#include <signal.h>
-
-namespace
-{
-
-bool g_stop = false;
-
-void signal_handler(int)
-{
- g_stop = true;
-}
-
-void on_new_event(Event* event, void* context)
-{
- printf("%s", __PRETTY_FUNCTION__);
-
- printf("\tEventType: %d \n", event->type);
- printf("\tdevice_id: %d \n", event->device_id);
- printf("\tsource_id: %d \n", event->source_id);
- printf("\taction: %d \n", event->action);
- printf("\tflags: %d \n", event->flags);
- printf("\tmeta_state: %d \n", event->meta_state);
-
- switch (event->type) {
- case MOTION_EVENT_TYPE:
- printf("\tdetails.motion.event_time: %lld\n",
- event->details.motion.event_time);
- printf("\tdetails.motion.pointer_coords.x: %f\n",
- event->details.motion.pointer_coordinates[0].x);
- printf("\tdetails.motion.pointer_coords.y: %f\n",
- event->details.motion.pointer_coordinates[0].y);
- break;
- default:
- break;
- }
-}
-
-}
-
-int main(int argc, char** argv)
-{
- g_stop = false;
- signal(SIGINT, signal_handler);
-
- AndroidEventListener listener;
- listener.on_new_event = on_new_event;
- listener.context = NULL;
-
- InputStackConfiguration config = {
- enable_touch_point_visualization : true,
- default_layer_for_touch_point_visualization : 10000,
- input_area_width : 1024,
- input_area_height : 1024
- };
-
- android_input_stack_initialize(&listener, &config);
- android_input_stack_start_waiting_for_flag(&g_stop);
-
- android_input_stack_stop();
- android_input_stack_shutdown();
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/compat/input/input_compatibility_layer.cpp
^
|
@@ -1,358 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Thomas Voß <thomas.voss@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <hybris/input/input_stack_compatibility_layer.h>
-
-#include "InputListener.h"
-#include "InputReader.h"
-#include "PointerController.h"
-#include "SpriteController.h"
-#include <gui/ISurfaceComposer.h>
-#include <gui/SurfaceComposerClient.h>
-
-#undef LOG_TAG
-#define LOG_TAG "InputStackCompatibilityLayer"
-#include <utils/Log.h>
-
-namespace
-{
-static bool enable_verbose_function_reporting = false;
-}
-
-#define REPORT_FUNCTION() ALOGV("%s\n", __PRETTY_FUNCTION__);
-
-namespace
-{
-
-class DefaultPointerControllerPolicy : public android::PointerControllerPolicyInterface
-{
-public:
- static const size_t bitmap_width = 64;
- static const size_t bitmap_height = 64;
-
- DefaultPointerControllerPolicy()
- {
- bitmap.setConfig(
- SkBitmap::kARGB_8888_Config,
- bitmap_width,
- bitmap_height);
- bitmap.allocPixels();
-
- // Icon for spot touches
- bitmap.eraseARGB(125, 0, 255, 0);
- spotTouchIcon = android::SpriteIcon(
- bitmap,
- bitmap_width/2,
- bitmap_height/2);
-
- // Icon for anchor touches
- bitmap.eraseARGB(125, 0, 0, 255);
- spotAnchorIcon = android::SpriteIcon(
- bitmap,
- bitmap_width/2,
- bitmap_height/2);
-
- // Icon for hovering touches
- bitmap.eraseARGB(125, 255, 0, 0);
- spotHoverIcon = android::SpriteIcon(
- bitmap,
- bitmap_width/2,
- bitmap_height/2);
- }
-
- void loadPointerResources(android::PointerResources* outResources)
- {
- outResources->spotHover = spotHoverIcon.copy();
- outResources->spotTouch = spotTouchIcon.copy();
- outResources->spotAnchor = spotAnchorIcon.copy();
- }
-
- android::SpriteIcon spotHoverIcon;
- android::SpriteIcon spotTouchIcon;
- android::SpriteIcon spotAnchorIcon;
- SkBitmap bitmap;
-};
-
-class DefaultInputReaderPolicyInterface : public android::InputReaderPolicyInterface
-{
-public:
- static const int32_t internal_display_id = android::ISurfaceComposer::eDisplayIdMain;
- static const int32_t external_display_id = android::ISurfaceComposer::eDisplayIdHdmi;
-
- DefaultInputReaderPolicyInterface(
- InputStackConfiguration* configuration,
- const android::sp<android::Looper>& looper)
- : looper(looper),
- default_layer_for_touch_point_visualization(configuration->default_layer_for_touch_point_visualization),
- input_area_width(configuration->input_area_width),
- input_area_height(configuration->input_area_height)
- {
- default_configuration.showTouches = configuration->enable_touch_point_visualization;
-
- android::DisplayViewport viewport;
- viewport.setNonDisplayViewport(input_area_width, input_area_height);
- viewport.displayId = android::ISurfaceComposer::eDisplayIdMain;
- default_configuration.setDisplayInfo(
- false, /* external */
- viewport);
- }
-
- void getReaderConfiguration(android::InputReaderConfiguration* outConfig)
- {
- *outConfig = default_configuration;
- }
-
- android::sp<android::PointerControllerInterface> obtainPointerController(int32_t deviceId)
- {
- (void) deviceId;
-
- android::sp<android::SpriteController> sprite_controller(
- new android::SpriteController(
- looper,
- default_layer_for_touch_point_visualization));
- android::sp<android::PointerController> pointer_controller(
- new android::PointerController(
- android::sp<DefaultPointerControllerPolicy>(new DefaultPointerControllerPolicy()),
- looper,
- sprite_controller));
- pointer_controller->setPresentation(
- android::PointerControllerInterface::PRESENTATION_SPOT);
-
- pointer_controller->setDisplayViewport(input_area_width, input_area_height, 0);
- return pointer_controller;
- }
-
- virtual void notifyInputDevicesChanged(const android::Vector<android::InputDeviceInfo>& inputDevices) {
- mInputDevices = inputDevices;
- }
-
- virtual android::sp<android::KeyCharacterMap> getKeyboardLayoutOverlay(const android::String8& inputDeviceDescriptor) {
- return NULL;
- }
-
- virtual android::String8 getDeviceAlias(const android::InputDeviceIdentifier& identifier) {
- return android::String8::empty();
- }
-
-private:
- android::sp<android::Looper> looper;
- int default_layer_for_touch_point_visualization;
- android::InputReaderConfiguration default_configuration;
- android::Vector<android::InputDeviceInfo> mInputDevices;
- int input_area_width;
- int input_area_height;
-};
-
-class ExportedInputListener : public android::InputListenerInterface
-{
-public:
- ExportedInputListener(AndroidEventListener* external_listener) : external_listener(external_listener)
- {
- }
-
- void notifyConfigurationChanged(const android::NotifyConfigurationChangedArgs* args)
- {
- REPORT_FUNCTION();
- (void) args;
- }
-
- void notifyKey(const android::NotifyKeyArgs* args)
- {
- REPORT_FUNCTION();
-
- current_event.type = KEY_EVENT_TYPE;
- current_event.device_id = args->deviceId;
- current_event.source_id = args->source;
- current_event.action = args->action;
- current_event.flags = args->flags;
- current_event.meta_state = args->metaState;
-
- current_event.details.key.key_code = args->keyCode;
- current_event.details.key.scan_code = args->scanCode;
- current_event.details.key.down_time = args->downTime;
- current_event.details.key.event_time = args->eventTime;
-
- current_event.details.key.is_system_key = false;
-
- external_listener->on_new_event(¤t_event, external_listener->context);
- }
-
- void notifyMotion(const android::NotifyMotionArgs* args)
- {
- REPORT_FUNCTION();
-
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/compat/surface_flinger/Android.mk
^
|
@@ -1,44 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-
-LOCAL_SRC_FILES:= \
- surface_flinger_compatibility_layer.cpp
-
-LOCAL_MODULE:= libsf_compat_layer
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_C_INCLUDES := \
- $(HYBRIS_PATH)/include
-
-LOCAL_SHARED_LIBRARIES := \
- libui \
- libutils \
- libgui \
- libEGL \
- libGLESv2
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-
-LOCAL_SRC_FILES:= \
- direct_sf_test.cpp
-
-LOCAL_MODULE:= direct_sf_test
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_C_INCLUDES := \
- $(HYBRIS_PATH)/include
-
-LOCAL_SHARED_LIBRARIES := \
- libui \
- libutils \
- libEGL \
- libGLESv2 \
- libsf_compat_layer
-
-include $(BUILD_EXECUTABLE)
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/compat/surface_flinger/direct_sf_test.cpp
^
|
@@ -1,233 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Thomas Voß <thomas.voss@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
-
-#include <cstdio>
-#include <unistd.h>
-
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-/* animation state variables */
-GLfloat rotation_angle = 0.0f;
-
-static GLuint gProgram;
-static GLuint gvPositionHandle, gvColorHandle;
-static GLuint rotation_uniform;
-static GLint num_vertex = 3;
-static const GLfloat triangle[] = {
- -0.125f, -0.125f, 0.0f, 0.5f,
- 0.0f, 0.125f, 0.0f, 0.5f,
- 0.125f, -0.125f, 0.0f, 0.5f
-};
-static const GLfloat color_triangle[] = {
- 0.0f, 0.0f, 1.0f, 1.0f,
- 0.0f, 1.0f, 0.0f, 1.0f,
- 1.0f, 0.0f, 0.0f, 0.0f
-};
-const GLfloat * vertex_data;
-const GLfloat * color_data;
-static const char gVertexShader[] =
- "attribute vec4 vPosition;\n"
- "attribute vec4 vColor;\n"
- "uniform float angle;\n"
- "varying vec4 colorinfo;\n"
- "void main() {\n"
- " mat3 rot_z = mat3( vec3( cos(angle), sin(angle), 0.0),\n"
- " vec3(-sin(angle), cos(angle), 0.0),\n"
- " vec3( 0.0, 0.0, 1.0));\n"
- " gl_Position = vec4(rot_z * vPosition.xyz, 1.0);\n"
- " colorinfo = vColor;\n"
- "}\n";
-
-static const char gFragmentShader[] = "precision mediump float;\n"
- "varying vec4 colorinfo;\n"
- "void main() {\n"
- " gl_FragColor = colorinfo;\n"
- "}\n";
-
-/* util functions */
-GLuint loadShader(GLenum shaderType, const char* pSource)
-{
- GLuint shader = glCreateShader(shaderType);
- if (shader) {
- glShaderSource(shader, 1, &pSource, NULL);
- glCompileShader(shader);
- GLint compiled = 0;
- glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
-
- if (!compiled) {
- GLint infoLen = 0;
- glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
- if (infoLen) {
- char* buf = (char*) malloc(infoLen);
- if (buf) {
- glGetShaderInfoLog(shader, infoLen, NULL, buf);
- fprintf(stderr, "Could not compile shader %d:\n%s\n",
- shaderType, buf);
- free(buf);
- }
- glDeleteShader(shader);
- shader = 0;
- }
- }
- } else {
- printf("Error, during shader creation: %i\n", glGetError());
- }
-
- return shader;
-}
-
-GLuint createProgram(const char* pVertexSource, const char* pFragmentSource)
-{
- GLuint vertexShader = loadShader(GL_VERTEX_SHADER, pVertexSource);
- if (!vertexShader) {
- printf("vertex shader not compiled\n");
- return 0;
- }
-
- GLuint pixelShader = loadShader(GL_FRAGMENT_SHADER, pFragmentSource);
- if (!pixelShader) {
- printf("frag shader not compiled\n");
- return 0;
- }
-
- GLuint program = glCreateProgram();
- if (program) {
- glAttachShader(program, vertexShader);
- glAttachShader(program, pixelShader);
- glLinkProgram(program);
- GLint linkStatus = GL_FALSE;
- glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
-
- if (linkStatus != GL_TRUE) {
- GLint bufLength = 0;
- glGetProgramiv(program, GL_INFO_LOG_LENGTH, &bufLength);
- if (bufLength) {
- char* buf = (char*) malloc(bufLength);
- if (buf) {
- glGetProgramInfoLog(program, bufLength, NULL, buf);
- fprintf(stderr, "Could not link program:\n%s\n", buf);
- free(buf);
- }
- }
- glDeleteProgram(program);
- program = 0;
- }
- }
-
- return program;
-}
-
-bool setupGraphics()
-{
- vertex_data = triangle;
- color_data = color_triangle;
-
- gProgram = createProgram(gVertexShader, gFragmentShader);
- if (!gProgram) {
- printf("error making program\n");
- return 0;
- }
-
- gvPositionHandle = glGetAttribLocation(gProgram, "vPosition");
- gvColorHandle = glGetAttribLocation(gProgram, "vColor");
-
- rotation_uniform = glGetUniformLocation(gProgram, "angle");
-
- return true;
-}
-
-void hw_render(EGLDisplay displ, EGLSurface surface)
-{
- glUseProgram(gProgram);
-
- glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
-
- glUniform1fv(rotation_uniform,1, &rotation_angle);
-
- glVertexAttribPointer(gvColorHandle, num_vertex, GL_FLOAT, GL_FALSE, sizeof(GLfloat)*4, color_data);
- glVertexAttribPointer(gvPositionHandle, num_vertex, GL_FLOAT, GL_FALSE, 0, vertex_data);
- glEnableVertexAttribArray(gvPositionHandle);
- glEnableVertexAttribArray(gvColorHandle);
-
- glDrawArrays(GL_TRIANGLE_STRIP, 0, num_vertex);
- glDisableVertexAttribArray(gvPositionHandle);
- glDisableVertexAttribArray(gvColorHandle);
-
- eglSwapBuffers(displ, surface);
-}
-
-void hw_step()
-{
- rotation_angle += 0.01;
- return;
-}
-
-int main(int argc, char** argv)
-{
- SfClient* sf_client = sf_client_create();
-
- if (!sf_client) {
- printf("Problem creating client ... aborting now.");
- return 1;
- }
-
- SfSurfaceCreationParameters params = {
- 200,
- 200,
- 500,
- 500,
- -1, //PIXEL_FORMAT_RGBA_8888,
- INT_MAX,
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/compat/surface_flinger/surface_flinger_compatibility_layer.cpp
^
|
@@ -1,355 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Thomas Voss <thomas.voss@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
-#include <hybris/internal/surface_flinger_compatibility_layer_internal.h>
-
-#include <utils/misc.h>
-
-#include <gui/SurfaceComposerClient.h>
-#include <gui/ISurfaceComposer.h>
-#include <ui/DisplayInfo.h>
-#include <ui/PixelFormat.h>
-#include <ui/Region.h>
-#include <ui/Rect.h>
-
-#include <cassert>
-#include <cstdio>
-
-namespace
-{
-void report_failed_to_allocate_surface_flinger_composer_client_on_creation()
-{
- printf("Problem allocating an object of type SurfaceComposerClient during client creation");
-}
-
-void report_failed_to_get_egl_default_display_on_creation()
-{
- printf("Problem accessing default egl display during client creation");
-}
-
-void report_failed_to_initialize_egl_on_creation()
-{
- printf("Problem initializing egl during client creation");
-}
-
-void report_failed_to_choose_egl_config_on_creation()
-{
- printf("Problem choosing egl config on creation");
-}
-
-void report_surface_control_is_null_during_creation()
-{
- printf("Could not acquire surface control object during surface creation");
-}
-
-void report_surface_is_null_during_creation()
-{
- printf("Could not acquire surface from surface control during surface creation");
-}
-}
-
-void sf_blank(size_t display_id)
-{
- android::sp<android::IBinder> display;
-
- if (display_id == 0) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdMain);
- } else if (display_id == 1) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdHdmi);
- } else {
- fprintf(stderr, "Warning: sf_blank invalid display_id (0 || 1)\n");
- return;
- }
-
- android::SurfaceComposerClient::blankDisplay(display);
-}
-
-void sf_unblank(size_t display_id)
-{
- android::sp<android::IBinder> display;
-
- if (display_id == 0) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdMain);
- } else if (display_id == 1) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdHdmi);
- } else {
- fprintf(stderr, "Warning: sf_unblank invalid display_id (0 || 1)\n");
- return;
- }
-
- android::SurfaceComposerClient::unblankDisplay(display);
-}
-
-size_t sf_get_display_width(size_t display_id)
-{
- android::sp<android::IBinder> display;
-
- if (display_id == 0) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdMain);
- } else if (display_id == 1) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdHdmi);
- } else {
- fprintf(stderr, "Warning: sf_get_display_width invalid display_id (0 || 1)\n");
- return -1;
- }
-
- android::DisplayInfo info;
- android::SurfaceComposerClient::getDisplayInfo(display, &info);
- return info.w;
-}
-
-size_t sf_get_display_height(size_t display_id)
-{
- android::sp<android::IBinder> display;
-
- if (display_id == 0) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdMain);
- } else if (display_id == 1) {
- display = android::SurfaceComposerClient::getBuiltInDisplay(
- android::ISurfaceComposer::eDisplayIdHdmi);
- } else {
- fprintf(stderr, "Warning: sf_get_display_height invalid display_id (0 || 1)\n");
- return -1;
- }
-
- android::DisplayInfo info;
- android::SurfaceComposerClient::getDisplayInfo(display, &info);
- return info.h;
-}
-
-SfClient* sf_client_create_full(bool egl_support)
-{
- SfClient* client = new SfClient();
-
- client->client = new android::SurfaceComposerClient();
- if (client->client == NULL) {
- report_failed_to_allocate_surface_flinger_composer_client_on_creation();
- delete client;
- return NULL;
- }
-
- client->egl_support = egl_support;
- if (egl_support) {
- client->egl_display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- if (client->egl_display == EGL_NO_DISPLAY) {
- report_failed_to_get_egl_default_display_on_creation();
- delete client;
- return NULL;
- }
-
- int major, minor;
- int rc = eglInitialize(client->egl_display, &major, &minor);
- if (rc == EGL_FALSE) {
- report_failed_to_initialize_egl_on_creation();
- delete client;
- return NULL;
- }
-
- EGLint attribs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL_NONE
- };
-
- int n;
- if (eglChooseConfig(client->egl_display,
- attribs,
- &client->egl_config, 1,
- &n) == EGL_FALSE) {
- report_failed_to_choose_egl_config_on_creation();
- delete client;
- return NULL;
- }
-
- EGLint context_attribs[] = {
- EGL_CONTEXT_CLIENT_VERSION, 2,
- EGL_NONE
- };
-
- client->egl_context = eglCreateContext(
- client->egl_display,
- client->egl_config,
- EGL_NO_CONTEXT,
- context_attribs);
- }
-
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/compat/ui/Android.mk
^
|
@@ -1,25 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-
-LOCAL_SRC_FILES:= \
- ui_compatibility_layer.cpp
-
-LOCAL_MODULE:= libui_compat_layer
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_C_INCLUDES := \
- $(HYBRIS_PATH)/include \
- frameworks/native/include
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libutils \
- libbinder \
- libhardware \
- libui
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/compat/ui/ui_compatibility_layer.cpp
^
|
@@ -1,142 +0,0 @@
-/*
- * Copyright (C) 2013 Simon Busch <morphis@gravedo.de>
- *
- * 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 <fcntl.h>
-#include <sys/stat.h>
-
-#include <ui/GraphicBuffer.h>
-#include <ui/GraphicBufferMapper.h>
-#include <ui/GraphicBufferAllocator.h>
-
-#include <hybris/ui/ui_compatibility_layer.h>
-
-struct graphic_buffer
-{
- android::GraphicBuffer *self;
-};
-
-struct graphic_buffer* graphic_buffer_new(void)
-{
- struct graphic_buffer *buffer = NULL;
-
- buffer = (struct graphic_buffer*) malloc(sizeof(struct graphic_buffer));
- if (!buffer)
- return NULL;
-
- buffer->self = new android::GraphicBuffer();
-
- return buffer;
-}
-
-struct graphic_buffer* graphic_buffer_new_sized(uint32_t w, uint32_t h,
- int32_t format, uint32_t usage)
-{
- struct graphic_buffer *buffer = NULL;
-
- buffer = (struct graphic_buffer*) malloc(sizeof(struct graphic_buffer));
- if (!buffer)
- return NULL;
-
- buffer->self = new android::GraphicBuffer(w, h, format, usage);
-
- return buffer;
-}
-
-struct graphic_buffer* graphic_buffer_new_existing(uint32_t w, uint32_t h,
- int32_t format, uint32_t usage,
- uint32_t stride, void *handle,
- bool keepOwnership)
-{
- struct graphic_buffer *buffer = NULL;
-
- buffer = (struct graphic_buffer*) malloc(sizeof(struct graphic_buffer));
- if (!buffer)
- return NULL;
-
- buffer->self = new android::GraphicBuffer(w, h, format, usage, stride, (native_handle_t*) handle, keepOwnership);
-
- return buffer;
-
-}
-
-void graphic_buffer_free(struct graphic_buffer *buffer)
-{
- if (!buffer)
- return;
-
- free(buffer);
-}
-
-uint32_t graphic_buffer_get_width(struct graphic_buffer *buffer)
-{
- return buffer->self->getWidth();
-}
-
-uint32_t graphic_buffer_get_height(struct graphic_buffer *buffer)
-{
- return buffer->self->getHeight();
-}
-
-uint32_t graphic_buffer_get_stride(struct graphic_buffer *buffer)
-{
- return buffer->self->getStride();
-}
-
-uint32_t graphic_buffer_get_usage(struct graphic_buffer *buffer)
-{
- return buffer->self->getUsage();
-}
-
-int32_t graphic_buffer_get_pixel_format(struct graphic_buffer *buffer)
-{
- return buffer->self->getPixelFormat();
-}
-
-uint32_t graphic_buffer_reallocate(struct graphic_buffer *buffer, uint32_t w,
- uint32_t h, int32_t f, uint32_t usage)
-{
- return buffer->self->reallocate(w, h, f, usage);
-}
-
-uint32_t graphic_buffer_lock(struct graphic_buffer *buffer, uint32_t usage, void **vaddr)
-{
- return buffer->self->lock(usage, vaddr);
-}
-
-uint32_t graphic_buffer_unlock(struct graphic_buffer *buffer)
-{
- return buffer->self->unlock();
-}
-
-void* graphic_buffer_get_native_buffer(struct graphic_buffer *buffer)
-{
- return buffer->self->getNativeBuffer();
-}
-
-void graphic_buffer_set_index(struct graphic_buffer *buffer, int index)
-{
- return buffer->self->setIndex(index);
-}
-
-int graphic_buffer_get_index(struct graphic_buffer *buffer)
-{
- return buffer->self->getIndex();
-}
-
-int graphic_buffer_init_check(struct graphic_buffer *buffer)
-{
- return buffer->self->initCheck();
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/hybris/camera/Makefile.am
^
|
@@ -1,17 +0,0 @@
-lib_LTLIBRARIES = \
- libcamera.la
-
-libcamera_la_SOURCES = camera.c
-libcamera_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
-if WANT_TRACE
-libcamera_la_CFLAGS += -DDEBUG
-endif
-if WANT_DEBUG
-libcamera_la_CFLAGS += -ggdb -O0
-endif
-libcamera_la_LDFLAGS = \
- $(top_builddir)/common/libhybris-common.la \
- -version-info "1":"0":"0"
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libcamera.pc
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/hybris/camera/camera.c
^
|
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Michael Frey <michael.frey@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <android-config.h>
-#include <dlfcn.h>
-#include <stddef.h>
-
-#include <hybris/common/binding.h>
-#include <hybris/camera/camera_compatibility_layer.h>
-#include <hybris/camera/camera_compatibility_layer_capabilities.h>
-#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
-
-#define COMPAT_LIBRARY_PATH "/system/lib/libcamera_compat_layer.so"
-
-HYBRIS_LIBRARY_INITIALIZE(camera, COMPAT_LIBRARY_PATH);
-
-HYBRIS_IMPLEMENT_FUNCTION0(camera, int, android_camera_get_number_of_devices);
-HYBRIS_IMPLEMENT_FUNCTION2(camera, struct CameraControl*, android_camera_connect_to,
- CameraType, struct CameraControlListener*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_disconnect,
- struct CameraControl*);
-HYBRIS_IMPLEMENT_FUNCTION1(camera, int, android_camera_lock, struct CameraControl*);
-HYBRIS_IMPLEMENT_FUNCTION1(camera, int, android_camera_unlock, struct CameraControl*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_delete, struct CameraControl*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_dump_parameters,
- struct CameraControl*);
-
-// Setters
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_effect_mode,
- struct CameraControl*, EffectMode);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_flash_mode,
- struct CameraControl*, FlashMode);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_white_balance_mode,
- struct CameraControl*, WhiteBalanceMode);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_scene_mode,
- struct CameraControl*, SceneMode);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_auto_focus_mode,
- struct CameraControl*, AutoFocusMode);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_set_picture_size,
- struct CameraControl*, int, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_set_preview_size,
- struct CameraControl*, int, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_display_orientation,
- struct CameraControl*, int32_t);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_preview_texture,
- struct CameraControl*, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_preview_surface,
- struct CameraControl*, struct SfSurface*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_focus_region,
- struct CameraControl*, FocusRegion*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_reset_focus_region,
- struct CameraControl*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_preview_fps,
- struct CameraControl*, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_rotation,
- struct CameraControl*, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_set_video_size,
- struct CameraControl*, int, int);
-
-// Getters
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_effect_mode,
- struct CameraControl*, EffectMode*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_flash_mode,
- struct CameraControl*, FlashMode*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_white_balance_mode,
- struct CameraControl*, WhiteBalanceMode*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_scene_mode,
- struct CameraControl*, SceneMode*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_auto_focus_mode,
- struct CameraControl*, AutoFocusMode*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_max_zoom,
- struct CameraControl*, int*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_get_picture_size,
- struct CameraControl*, int*, int*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_get_preview_size,
- struct CameraControl*, int*, int*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_get_preview_fps_range,
- struct CameraControl*, int*, int*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_preview_fps,
- struct CameraControl*, int*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_get_preview_texture_transformation,
- struct CameraControl*, float*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_get_video_size,
- struct CameraControl*, int*, int*);
-
-// Enumerators
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_enumerate_supported_picture_sizes,
- struct CameraControl*, size_callback, void*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_enumerate_supported_preview_sizes,
- struct CameraControl*, size_callback, void*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera, android_camera_enumerate_supported_video_sizes,
- struct CameraControl*, size_callback, void*);
-
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_update_preview_texture, struct CameraControl*);
-
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_start_preview, struct CameraControl*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_stop_preview, struct CameraControl*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_start_autofocus, struct CameraControl*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_stop_autofocus, struct CameraControl*);
-
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_start_zoom, struct CameraControl*, int32_t);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera, android_camera_set_zoom, struct CameraControl*, int32_t);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_stop_zoom, struct CameraControl*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera, android_camera_take_snapshot, struct CameraControl*);
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/hybris/camera/libcamera.pc.in
^
|
@@ -1,10 +0,0 @@
-prefix=@prefix@
-exec_prefix=${prefix}
-libdir=@libdir@
-includedir=@includedir@
-
-Name: hybris-camera
-Description: libhybris camera library
-Version: @VERSION@
-Libs: -L${libdir} -lhybris-common -lcamera
-Cflags: -I${includedir}
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/hybris/input/Makefile.am
^
|
@@ -1,17 +0,0 @@
-lib_LTLIBRARIES = \
- libis.la
-
-libis_la_SOURCES = is.c
-libis_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
-if WANT_TRACE
-libis_la_CFLAGS += -DDEBUG
-endif
-if WANT_DEBUG
-libis_la_CFLAGS += -ggdb -O0
-endif
-libis_la_LDFLAGS = \
- $(top_builddir)/common/libhybris-common.la \
- -version-info "1":"0":"0"
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libis.pc
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/hybris/input/is.c
^
|
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Michael Frey <michael.frey@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <dlfcn.h>
-#include <stddef.h>
-#include <stdbool.h>
-
-#include <hybris/common/binding.h>
-#include <hybris/input/input_stack_compatibility_layer.h>
-
-#define COMPAT_LIBRARY_PATH "/system/lib/libis_compat_layer.so"
-
-HYBRIS_LIBRARY_INITIALIZE(is, COMPAT_LIBRARY_PATH);
-
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(is, android_input_stack_initialize,
- struct AndroidEventListener*, struct InputStackConfiguration*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION0(is, android_input_stack_start);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(is, android_input_stack_start_waiting_for_flag, bool*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION0(is, android_input_stack_stop);
-HYBRIS_IMPLEMENT_VOID_FUNCTION0(is, android_input_stack_shutdown);
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/hybris/input/libis.pc.in
^
|
@@ -1,10 +0,0 @@
-prefix=@prefix@
-exec_prefix=${prefix}
-libdir=@libdir@
-includedir=@includedir@
-
-Name: hybris-input
-Description: libhybris input library
-Version: @VERSION@
-Libs: -L${libdir} -lhybris-common -lis
-Cflags: -I${includedir}
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/hybris/sf/Makefile.am
^
|
@@ -1,17 +0,0 @@
-lib_LTLIBRARIES = \
- libsf.la
-
-libsf_la_SOURCES = sf.c
-libsf_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
-if WANT_TRACE
-libsf_la_CFLAGS += -DDEBUG
-endif
-if WANT_DEBUG
-libsf_la_CFLAGS += -ggdb -O0
-endif
-libsf_la_LDFLAGS = \
- $(top_builddir)/common/libhybris-common.la \
- -version-info "1":"0":"0"
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libsf.pc
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/hybris/sf/libsf.pc.in
^
|
@@ -1,10 +0,0 @@
-prefix=@prefix@
-exec_prefix=${prefix}
-libdir=@libdir@
-includedir=@includedir@
-
-Name: hybris-surface-flinger
-Description: libhybris surface flinger library
-Version: @VERSION@
-Libs: -L${libdir} -lhybris-common -lsf
-Cflags: -I${includedir}
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/hybris/sf/sf.c
^
|
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical Ltd
- *
- * 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.
- *
- * Authored by: Michael Frey <michael.frey@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <EGL/egl.h>
-#include <dlfcn.h>
-#include <stddef.h>
-
-#include <hybris/common/binding.h>
-#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
-
-#define COMPAT_LIBRARY_PATH "/system/lib/libsf_compat_layer.so"
-
-HYBRIS_LIBRARY_INITIALIZE(sf, COMPAT_LIBRARY_PATH);
-
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_blank, size_t);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_unblank, size_t);
-HYBRIS_IMPLEMENT_FUNCTION1(sf, size_t, sf_get_display_width, size_t);
-HYBRIS_IMPLEMENT_FUNCTION1(sf, size_t, sf_get_display_height, size_t);
-HYBRIS_IMPLEMENT_FUNCTION1(sf, struct SfClient*, sf_client_create_full, int);
-HYBRIS_IMPLEMENT_FUNCTION0(sf, struct SfClient*, sf_client_create);
-HYBRIS_IMPLEMENT_FUNCTION1(sf, EGLDisplay, sf_client_get_egl_display,
- struct SfClient*);
-HYBRIS_IMPLEMENT_FUNCTION1(sf, EGLConfig, sf_client_get_egl_config,
- struct SfClient*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_client_begin_transaction,
- struct SfClient*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_client_end_transaction,
- struct SfClient*);
-HYBRIS_IMPLEMENT_FUNCTION2(sf, struct SfSurface*, sf_surface_create,
- struct SfClient*, SfSurfaceCreationParameters*);
-HYBRIS_IMPLEMENT_FUNCTION1(sf, EGLSurface, sf_surface_get_egl_surface,
- struct SfSurface*);
-HYBRIS_IMPLEMENT_FUNCTION1(sf, EGLNativeWindowType,
- sf_surface_get_egl_native_window, struct SfSurface*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_surface_make_current, struct SfSurface*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(sf, sf_surface_move_to,
- struct SfSurface*, int, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION3(sf, sf_surface_set_size,
- struct SfSurface*, int, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(sf, sf_surface_set_layer,
- struct SfSurface*, int);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(sf, sf_surface_set_alpha,
- struct SfSurface*, float);
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/hybris/ui/Makefile.am
^
|
@@ -1,14 +0,0 @@
-lib_LTLIBRARIES = \
- libui.la
-
-libui_la_SOURCES = ui.c
-libui_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS)
-if WANT_TRACE
-libui_la_CFLAGS += -DDEBUG
-endif
-if WANT_DEBUG
-libui_la_CFLAGS += -ggdb -O0
-endif
-libui_la_LDFLAGS = \
- $(top_builddir)/common/libhybris-common.la \
- -version-info "1":"0":"0"
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.9.tar.bz2/upstream/hybris/ui/ui.c
^
|
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2013 Simon Busch <morphis@gravedo.de>
- *
- * 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 <dlfcn.h>
-#include <stddef.h>
-
-#include <hybris/common/binding.h>
-#include <hybris/ui/ui_compatibility_layer.h>
-
-#define COMPAT_LIBRARY_PATH "/system/lib/libui_compat_layer.so"
-
-HYBRIS_LIBRARY_INITIALIZE(ui, COMPAT_LIBRARY_PATH);
-
-HYBRIS_IMPLEMENT_FUNCTION0(ui, struct graphic_buffer*, graphic_buffer_new);
-HYBRIS_IMPLEMENT_FUNCTION4(ui, struct graphic_buffer*,
- graphic_buffer_new_sized, uint32_t, uint32_t, int32_t, uint32_t);
-HYBRIS_IMPLEMENT_FUNCTION7(ui, struct graphic_buffer*, graphic_buffer_new_existing,
- uint32_t, uint32_t, int32_t, uint32_t, uint32_t, void*, bool);
-HYBRIS_IMPLEMENT_VOID_FUNCTION1(ui, graphic_buffer_free, struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_get_width,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_get_height,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_get_stride,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_get_usage,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, int32_t, graphic_buffer_get_pixel_format,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION5(ui, uint32_t, graphic_buffer_reallocate,
- struct graphic_buffer*, uint32_t, uint32_t, int32_t, uint32_t);
-HYBRIS_IMPLEMENT_FUNCTION3(ui, uint32_t, graphic_buffer_lock,
- struct graphic_buffer*, uint32_t, void**);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_unlock,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, void*, graphic_buffer_get_native_buffer,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_VOID_FUNCTION2(ui, graphic_buffer_set_index,
- struct graphic_buffer*, int);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, int, graphic_buffer_get_index,
- struct graphic_buffer*);
-HYBRIS_IMPLEMENT_FUNCTION1(ui, int, graphic_buffer_init_check,
- struct graphic_buffer*);
|