[-]
[+]
|
Changed |
_service:tar_git:libhybris.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/mer-hybris/libhybris.git</param>
<param name="branch">master</param>
- <param name="revision">0.0.5.34</param>
+ <param name="revision">0.0.5.37</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/tests/test_camera.c
^
|
@@ -1,574 +0,0 @@
-/*
- * Copyright (C) 2012 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.
- *
- */
-
-#include "config.h"
-
-#include <wayland-client.h>
-#include <wayland-server.h>
-#include <wayland-client-protocol.h>
-#include <wayland-egl.h>
-
-#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 <EGL/egl.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <limits.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-int shot_counter = 1;
-int32_t current_zoom_level = 1;
-bool new_camera_frame_available = true;
-
-static GLuint gProgram;
-static GLuint gaPositionHandle, gaTexHandle, gsTextureHandle, gmTexMatrix;
-
-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__);
-
- 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, "/tmp/shot_%d.jpeg", shot_counter);
- int fd = open(fn, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
- if(fd < 0)
- return;
- TEMP_FAILURE_RETRY(write(fd, data, data_size));
- close(fd);
- shot_counter++;
-
- struct CameraControl* cc = (struct 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(struct 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);
-
- struct CameraControl* cc = (struct 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);
- }
- }
-}
-
-static const char* vertex_shader()
-{
- return
- "#extension GL_OES_EGL_image_external : require \n"
- "attribute vec4 a_position; \n"
- "attribute vec2 a_texCoord; \n"
- "uniform mat4 m_texMatrix; \n"
- "varying vec2 v_texCoord; \n"
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/tests/test_glesv2.c
^
|
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 2012 Carsten Munk <carsten.munk@gmail.com>
- *
- * 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 <EGL/egl.h>
-#include <GLES2/gl2.h>
-#include <assert.h>
-#include <stdio.h>
-#include <math.h>
-#include <stddef.h>
-#include <stdlib.h>
-
-const char vertex_src [] =
-" \
- attribute vec4 position; \
- varying mediump vec2 pos; \
- uniform vec4 offset; \
- \
- void main() \
- { \
- gl_Position = position + offset; \
- pos = position.xy; \
- } \
-";
-
-
-const char fragment_src [] =
-" \
- varying mediump vec2 pos; \
- uniform mediump float phase; \
- \
- void main() \
- { \
- gl_FragColor = vec4( 1., 0.9, 0.7, 1.0 ) * \
- cos( 30.*sqrt(pos.x*pos.x + 1.5*pos.y*pos.y) \
- + atan(pos.y,pos.x) - phase ); \
- } \
-";
-
-GLuint load_shader(const char *shader_source, GLenum type)
-{
- GLuint shader = glCreateShader(type);
-
- glShaderSource(shader, 1, &shader_source, NULL);
- glCompileShader(shader);
-
- return shader;
-}
-
-
-GLfloat norm_x = 0.0;
-GLfloat norm_y = 0.0;
-GLfloat offset_x = 0.0;
-GLfloat offset_y = 0.0;
-GLfloat p1_pos_x = 0.0;
-GLfloat p1_pos_y = 0.0;
-
-GLint phase_loc;
-GLint offset_loc;
-GLint position_loc;
-
-const float vertexArray[] = {
- 0.0, 1.0, 0.0,
- -1., 0.0, 0.0,
- 0.0, -1.0, 0.0,
- 1., 0.0, 0.0,
- 0.0, 1., 0.0
-};
-
-
-int main(int argc, char **argv)
-{
- EGLDisplay display;
- EGLConfig ecfg;
- EGLint num_config;
- EGLint attr[] = { // some attributes to set up our egl-interface
- EGL_BUFFER_SIZE, 32,
- EGL_RENDERABLE_TYPE,
- EGL_OPENGL_ES2_BIT,
- EGL_NONE
- };
- EGLSurface surface;
- EGLint ctxattr[] = {
- EGL_CONTEXT_CLIENT_VERSION, 2,
- EGL_NONE
- };
- EGLContext context;
-
- EGLBoolean rv;
-
- display = eglGetDisplay(NULL);
- assert(eglGetError() == EGL_SUCCESS);
- assert(display != EGL_NO_DISPLAY);
-
- rv = eglInitialize(display, 0, 0);
- assert(eglGetError() == EGL_SUCCESS);
- assert(rv == EGL_TRUE);
-
- eglChooseConfig((EGLDisplay) display, attr, &ecfg, 1, &num_config);
- assert(eglGetError() == EGL_SUCCESS);
- assert(rv == EGL_TRUE);
-
- surface = eglCreateWindowSurface((EGLDisplay) display, ecfg, (EGLNativeWindowType)NULL, NULL);
- assert(eglGetError() == EGL_SUCCESS);
- assert(surface != EGL_NO_SURFACE);
-
- context = eglCreateContext((EGLDisplay) display, ecfg, EGL_NO_CONTEXT, ctxattr);
- assert(eglGetError() == EGL_SUCCESS);
- assert(context != EGL_NO_CONTEXT);
-
- assert(eglMakeCurrent((EGLDisplay) display, surface, surface, context) == EGL_TRUE);
-
- const char *version = (const char *)glGetString(GL_VERSION);
- assert(version);
- printf("%s\n",version);
-
-
- GLuint vertexShader = load_shader ( vertex_src , GL_VERTEX_SHADER ); // load vertex shader
- GLuint fragmentShader = load_shader ( fragment_src , GL_FRAGMENT_SHADER ); // load fragment shader
-
- GLuint shaderProgram = glCreateProgram (); // create program object
- glAttachShader ( shaderProgram, vertexShader ); // and attach both...
- glAttachShader ( shaderProgram, fragmentShader ); // ... shaders to it
-
- glLinkProgram ( shaderProgram ); // link the program
- glUseProgram ( shaderProgram ); // and select it for usage
-
- //// now get the locations (kind of handle) of the shaders variables
- position_loc = glGetAttribLocation ( shaderProgram , "position" );
- phase_loc = glGetUniformLocation ( shaderProgram , "phase" );
- offset_loc = glGetUniformLocation ( shaderProgram , "offset" );
- if ( position_loc < 0 || phase_loc < 0 || offset_loc < 0 ) {
- return 1;
- }
-
- //glViewport ( 0 , 0 , 800, 600); // commented out so it uses the initial window dimensions
- glClearColor ( 1. , 1. , 1. , 1.); // background color
- float phase = 0;
- int frames = -1;
- if(argc == 2) {
- frames = atoi(argv[1]);
- }
- if(frames < 0) {
- frames = 30 * 60;
- }
-
- int i;
- for (i = 0; i < frames; ++i) {
- if(i % 60 == 0) printf("frame:%i\n", i);
- glClear(GL_COLOR_BUFFER_BIT);
- glUniform1f ( phase_loc , phase ); // write the value of phase to the shaders phase
- phase = fmodf ( phase + 0.5f , 2.f * 3.141f ); // and update the local variable
-
- glUniform4f ( offset_loc , offset_x , offset_y , 0.0 , 0.0 );
-
- glVertexAttribPointer ( position_loc, 3, GL_FLOAT, GL_FALSE, 0, vertexArray );
- glEnableVertexAttribArray ( position_loc );
- glDrawArrays ( GL_TRIANGLE_STRIP, 0, 5 );
-
- eglSwapBuffers ( (EGLDisplay) display, surface ); // get the rendered buffer to the screen
- }
-
- printf("stop\n");
-
-#if 0
-(*egldestroycontext)((EGLDisplay) display, context);
- printf("destroyed context\n");
-
- (*egldestroysurface)((EGLDisplay) display, surface);
- printf("destroyed surface\n");
- (*eglterminate)((EGLDisplay) display);
- printf("terminated\n");
- android_dlclose(baz);
-#endif
-}
-
-// vim:ts=4:sw=4:noexpandtab
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/tests/test_hwc2.cpp
^
|
@@ -1,358 +0,0 @@
-/*
- * Copyright (C) 2018 TheKit <nekit1000@gmail.com>
- * Copyright (c) 2012 Carsten Munk <carsten.munk@gmail.com>
- *
- * 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.
- *
- */
-
-#if HAS_HWCOMPOSER2_HEADERS
-
-#include <assert.h>
-#include <stdio.h>
-#include <math.h>
-#include <mutex>
-
-#include <EGL/egl.h>
-#include <GLES2/gl2.h>
-#include <cutils/log.h>
-#include <sync/sync.h>
-
-#include <hwcomposer_window.h>
-
-#include <hybris/hwc2/hwc2_compatibility_layer.h>
-#include "logging.h"
-
-const char vertex_src [] =
-" \
- attribute vec4 position; \
- varying mediump vec2 pos; \
- uniform vec4 offset; \
- \
- void main() \
- { \
- gl_Position = position + offset; \
- pos = position.xy; \
- } \
-";
-
-
-const char fragment_src [] =
-" \
- varying mediump vec2 pos; \
- uniform mediump float phase; \
- \
- void main() \
- { \
- gl_FragColor = vec4( 1., 0.9, 0.7, 1.0 ) * \
- cos( 30.*sqrt(pos.x*pos.x + 1.5*pos.y*pos.y) \
- + atan(pos.y,pos.x) - phase ); \
- } \
-";
-
-GLuint load_shader(const char *shader_source, GLenum type)
-{
- GLuint shader = glCreateShader(type);
-
- glShaderSource(shader, 1, &shader_source, NULL);
- glCompileShader(shader);
-
- return shader;
-}
-
-
-GLfloat norm_x = 0.0;
-GLfloat norm_y = 0.0;
-GLfloat offset_x = 0.0;
-GLfloat offset_y = 0.0;
-GLfloat p1_pos_x = 0.0;
-GLfloat p1_pos_y = 0.0;
-
-GLint phase_loc;
-GLint offset_loc;
-GLint position_loc;
-
-const float vertexArray[] = {
- 0.0, 1.0, 0.0,
- -1., 0.0, 0.0,
- 0.0, -1.0, 0.0,
- 1., 0.0, 0.0,
- 0.0, 1., 0.0
-};
-
-hwc2_compat_device_t* hwcDevice;
-
-class HWComposer : public HWComposerNativeWindow
-{
- private:
- hwc2_compat_layer_t *layer;
- hwc2_compat_display_t *hwcDisplay;
- int lastPresentFence = -1;
- protected:
- void present(HWComposerNativeWindowBuffer *buffer);
-
- public:
-
- HWComposer(unsigned int width, unsigned int height, unsigned int format,
- hwc2_compat_display_t *display, hwc2_compat_layer_t *layer);
- void set();
-};
-
-HWComposer::HWComposer(unsigned int width, unsigned int height,
- unsigned int format, hwc2_compat_display_t* display,
- hwc2_compat_layer_t *layer) :
- HWComposerNativeWindow(width, height, format)
-{
- this->layer = layer;
- this->hwcDisplay = display;
-}
-
-void HWComposer::present(HWComposerNativeWindowBuffer *buffer)
-{
- uint32_t numTypes = 0;
- uint32_t numRequests = 0;
- hwc2_display_t displayId = 0;
-
- hwc2_error_t error = hwc2_compat_display_validate(hwcDisplay, &numTypes,
- &numRequests);
-
- if (error != HWC2_ERROR_NONE && error != HWC2_ERROR_HAS_CHANGES) {
- HYBRIS_ERROR("prepare: validate failed for display %lu: %s (%d)", displayId,
- to_string(static_cast<HWC2::Error>(error)).c_str(), error);
- return;
- }
-
- if (numTypes || numRequests) {
- HYBRIS_ERROR("prepare: validate required changes for display %lu: %s (%d)",
- displayId, to_string(static_cast<HWC2::Error>(error)).c_str(),
- error);
- return;
- }
-
- error = hwc2_compat_display_accept_changes(hwcDisplay);
- if (error != HWC2_ERROR_NONE) {
- HYBRIS_ERROR("prepare: acceptChanges failed: %s",
- to_string(static_cast<HWC2::Error>(error)).c_str());
- return;
- }
-
- hwc2_compat_display_set_client_target(hwcDisplay, /* slot */0, buffer,
- getFenceBufferFd(buffer),
- HAL_DATASPACE_UNKNOWN);
-
- int presentFence;
- hwc2_compat_display_present(hwcDisplay, &presentFence);
-
- if (error != HWC2_ERROR_NONE) {
- HYBRIS_ERROR("presentAndGetReleaseFences: failed for display %lu: %s (%d)",
- displayId,
- to_string(static_cast<HWC2::Error>(error)).c_str(), error);
- return;
- }
-
- hwc2_compat_out_fences_t* fences;
- error = hwc2_compat_display_get_release_fences(
- hwcDisplay, &fences);
-
- if (error != HWC2_ERROR_NONE) {
- HYBRIS_ERROR("presentAndGetReleaseFences: Failed to get release fences "
- "for display %lu: %s (%d)",
- displayId, to_string(static_cast<HWC2::Error>(error)).c_str(),
- error);
- return;
- }
-
- int fenceFd = hwc2_compat_out_fences_get_fence(fences, layer);
- if (fenceFd != -1)
- setFenceBufferFd(buffer, fenceFd);
-
- hwc2_compat_out_fences_destroy(fences);
-
- if (lastPresentFence != -1) {
- sync_wait(lastPresentFence, -1);
- close(lastPresentFence);
- }
- lastPresentFence = presentFence;
-}
-
-void onVsyncReceived(HWC2EventListener* listener, int32_t sequenceId,
- hwc2_display_t display, int64_t timestamp)
-{
-}
-
-void onHotplugReceived(HWC2EventListener* listener, int32_t sequenceId,
- hwc2_display_t display, bool connected,
- bool primaryDisplay)
-{
- HYBRIS_INFO("onHotplugReceived(%d, %" PRIu64 ", %s, %s)",
- sequenceId, display,
- connected ?
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/tests/test_media.c
^
|
@@ -1,370 +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: Jim Hodapp <jim.hodapp@canonical.com>
- * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
- */
-
-#include <hybris/media/media_compatibility_layer.h>
-#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
-
-#include <EGL/egl.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdbool.h>
-#include <limits.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-enum {
- OK = 0,
- NO_ERROR = 0,
-};
-
-static float DestWidth = 0.0, DestHeight = 0.0;
-// Actual video dimmensions
-static int Width = 0, Height = 0;
-
-static GLuint gProgram;
-static GLuint gaPositionHandle, gaTexHandle, gsTextureHandle, gmTexMatrix;
-
-static GLfloat positionCoordinates[8];
-
-struct MediaPlayerWrapper *player = NULL;
-
-void calculate_position_coordinates()
-{
- // Assuming cropping output for now
- float x = 1, y = 1;
-
- // Black borders
- x = (float) (Width / DestWidth);
- y = (float) (Height / DestHeight);
-
- // Make the larger side be 1
- if (x > y) {
- y /= x;
- x = 1;
- } else {
- x /= y;
- y = 1;
- }
-
- positionCoordinates[0] = -x;
- positionCoordinates[1] = y;
- positionCoordinates[2] = -x;
- positionCoordinates[3] = -y;
- positionCoordinates[4] = x;
- positionCoordinates[5] = -y;
- positionCoordinates[6] = x;
- positionCoordinates[7] = y;
-}
-
-struct ClientWithSurface
-{
- struct SfClient* client;
- struct SfSurface* surface;
-};
-
-struct ClientWithSurface client_with_surface(bool setup_surface_with_egl)
-{
- struct ClientWithSurface cs;
-
- cs.client = sf_client_create();
-
- if (!cs.client) {
- printf("Problem creating client ... aborting now.");
- return cs;
- }
-
- static const size_t primary_display = 0;
-
- DestWidth = sf_get_display_width(primary_display);
- DestHeight = sf_get_display_height(primary_display);
- printf("Primary display width: %f, height: %f\n", DestWidth, DestHeight);
-
- SfSurfaceCreationParameters params = {
- 0,
- 0,
- DestWidth,
- DestHeight,
- -1, //PIXEL_FORMAT_RGBA_8888,
- 15000,
- 0.5f,
- setup_surface_with_egl, // Do not associate surface with egl, will be done by camera HAL
- "MediaCompatLayerTestSurface"
- };
-
- cs.surface = sf_surface_create(cs.client, ¶ms);
-
- if (!cs.surface) {
- printf("Problem creating surface ... aborting now.");
- return cs;
- }
-
- sf_surface_make_current(cs.surface);
-
- return cs;
-}
-
-static const char *vertex_shader()
-{
- return
- "attribute vec4 a_position; \n"
- "attribute vec2 a_texCoord; \n"
- "uniform mat4 m_texMatrix; \n"
- "varying vec2 v_texCoord; \n"
- "varying float topDown; \n"
- "void main() \n"
- "{ \n"
- " gl_Position = a_position; \n"
- " v_texCoord = (m_texMatrix * vec4(a_texCoord, 0.0, 1.0)).xy;\n"
- "} \n";
-}
-
-static const char *fragment_shader()
-{
- return
- "#extension GL_OES_EGL_image_external : require \n"
- "precision mediump float; \n"
- "varying vec2 v_texCoord; \n"
- "uniform samplerExternalOES s_texture; \n"
- "void main() \n"
- "{ \n"
- " gl_FragColor = texture2D( s_texture, v_texCoord );\n"
- "} \n";
-}
-
-static 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;
-}
-
-static GLuint create_program(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");
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/tests/test_recorder.c
^
|
@@ -1,486 +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: Jim Hodapp <jim.hodapp@canonical.com>
- * Guenter Schwann <guenter.schwann@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/media/recorder_compatibility_layer.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/surface_flinger/surface_flinger_compatibility_layer.h>
-
-#include <EGL/egl.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdbool.h>
-#include <limits.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-int shot_counter = 1;
-int32_t current_zoom_level = 1;
-bool new_camera_frame_available = true;
-struct MediaRecorderWrapper *mr = 0;
-GLuint preview_texture_id = 0;
-
-static GLuint gProgram;
-static GLuint gaPositionHandle, gaTexHandle, gsTextureHandle, gmTexMatrix;
-
-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__);
-
- 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);
- struct CameraControl* cc = (struct 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(struct 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);
-
- struct CameraControl* cc = (struct CameraControl*) context;
-
- int ret;
- switch (event->details.key.key_code) {
- case ISCL_KEYCODE_VOLUME_UP:
- printf("Starting video recording\n");
-
- android_camera_unlock(cc);
-
- ret = android_recorder_setCamera(mr, cc);
- if (ret < 0) {
- printf("android_recorder_setCamera() failed\n");
- return;
- }
- //state initial / idle
- ret = android_recorder_setAudioSource(mr, ANDROID_AUDIO_SOURCE_CAMCORDER);
- if (ret < 0) {
- printf("android_recorder_setAudioSource() failed\n");
- return;
- }
- ret = android_recorder_setVideoSource(mr, ANDROID_VIDEO_SOURCE_CAMERA);
- if (ret < 0) {
- printf("android_recorder_setVideoSource() failed\n");
- return;
- }
- //state initialized
- ret = android_recorder_setOutputFormat(mr, ANDROID_OUTPUT_FORMAT_MPEG_4);
- if (ret < 0) {
- printf("android_recorder_setOutputFormat() failed\n");
- return;
- }
- //state DataSourceConfigured
- ret = android_recorder_setAudioEncoder(mr, ANDROID_AUDIO_ENCODER_AAC);
- if (ret < 0) {
- printf("android_recorder_setAudioEncoder() failed\n");
- return;
- }
- ret = android_recorder_setVideoEncoder(mr, ANDROID_VIDEO_ENCODER_H264);
- if (ret < 0) {
- printf("android_recorder_setVideoEncoder() failed\n");
- return;
- }
-
- int fd;
- fd = open("/tmp/test_video_recorder.avi", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
- if (fd < 0) {
- printf("Could not open file for video recording\n");
- printf("FD: %i\n", fd);
- return;
- }
- ret = android_recorder_setOutputFile(mr, fd);
- if (ret < 0) {
- printf("android_recorder_setOutputFile() failed\n");
- return;
- }
-
- ret = android_recorder_setVideoSize(mr, 1280, 720);
- if (ret < 0) {
- printf("android_recorder_setVideoSize() failed\n");
- return;
- }
- ret = android_recorder_setVideoFrameRate(mr, 30);
- if (ret < 0) {
- printf("android_recorder_setVideoFrameRate() failed\n");
- return;
- }
-
- ret = android_recorder_prepare(mr);
- if (ret < 0) {
- printf("android_recorder_prepare() failed\n");
- return;
- }
- //state prepared
- ret = android_recorder_start(mr);
- if (ret < 0) {
- printf("android_recorder_start() failed\n");
- return;
- }
- break;
- case ISCL_KEYCODE_VOLUME_DOWN:
- printf("Stoping video recording\n");
- ret = android_recorder_stop(mr);
-
- printf("Stoping video recording returned\n");
- if (ret < 0) {
- printf("android_recorder_stop() failed\n");
- return;
- }
- printf("Stopped video recording\n");
- ret = android_recorder_reset(mr);
- if (ret < 0) {
- printf("android_recorder_reset() failed\n");
- return;
|
[-]
[+]
|
Deleted |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/tests/test_sf.c
^
|
@@ -1,251 +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 <android-config.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <limits.h>
-
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
-
-struct SfSurface* sf_surface_create(struct SfClient* client, SfSurfaceCreationParameters* params);
-EGLSurface sf_surface_get_egl_surface(struct SfSurface*);
-void sf_surface_make_current(struct SfSurface* surface);
-
-void sf_surface_move_to(struct SfSurface* surface, int x, int y);
-void sf_surface_set_layer(struct SfSurface* surface, int layer);
-void sf_surface_set_alpha(struct SfSurface* surface, float alpha);
-
-double rotation_increment = 0.01;
-
-/* 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;
-}
-
-int 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 1;
-}
-
-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 += rotation_increment;
- return;
-}
-
-int main(int argc, char** argv)
-{
- struct SfClient* sf_client = sf_client_create();
-
- if (!sf_client) {
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/compat/camera/camera_compatibility_layer.cpp
^
|
@@ -141,10 +141,12 @@
(void) data;
}
+#if ANDROID_VERSION_MAJOR >= 7
void CameraControl::postRecordingFrameHandleTimestamp(nsecs_t /*timestamp*/, native_handle_t* /*handle*/)
{
REPORT_FUNCTION();
}
+#endif
#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=3
namespace android
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/compat/camera/direct_camera_test.cpp
^
|
@@ -121,12 +121,12 @@
void raw_data_cb(void* data, uint32_t data_size, void* context)
{
- printf("%s: %d \n", __PRETTY_FUNCTION__, data_size);
+ printf("%s: %u \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);
+ printf("%s: %u \n", __PRETTY_FUNCTION__, data_size);
char fn[256];
sprintf(fn, "/cache/shot_%d.jpeg", shot_counter);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/compat/hwc2/hwc2_compatibility_layer.cpp
^
|
@@ -214,7 +214,11 @@
android::sp<android::Fence> presentFence;
HWC2::Error error = display->self->present(&presentFence);
- *outPresentFence = presentFence->dup();
+ if (presentFence != NULL) {
+ *outPresentFence = presentFence->dup();
+ } else {
+ *outPresentFence = -1;
+ }
return static_cast<hwc2_error_t>(error);
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/compat/hwc2/tests/direct_hwc2_test.cpp
^
|
@@ -240,7 +240,6 @@
EGLBoolean rv;
- int err;
int composerSequenceId = 0;
hwcDevice = hwc2_compat_device_new(false);
@@ -290,7 +289,7 @@
assert(eglGetError() == EGL_SUCCESS);
assert(rv == EGL_TRUE);
- eglChooseConfig((EGLDisplay) display, attr, &ecfg, 1, &num_config);
+ rv = eglChooseConfig((EGLDisplay) display, attr, &ecfg, 1, &num_config);
assert(eglGetError() == EGL_SUCCESS);
assert(rv == EGL_TRUE);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/compat/media/direct_media_test.cpp
^
|
@@ -289,7 +289,7 @@
static void print_gl_error(unsigned int line)
{
GLint error = glGetError();
- printf("GL error: %#04x (line: %d)\n", error, line);
+ printf("GL error: %#04x (line: %u)\n", error, line);
}
static int update_gl_buffer(RenderData *render_data, EGLDisplay *disp, EGLSurface *surface)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/compat/media/media_format_layer_priv.cpp
^
|
@@ -46,5 +46,3 @@
#ifdef __cplusplus
}
#endif
-
-#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/compat/media/media_recorder.cpp
^
|
@@ -34,7 +34,9 @@
#include <media/mediaplayer.h> // for MEDIA_ERROR_SERVER_DIED
#include <gui/IGraphicBufferProducer.h>
namespace a = android;
+#if ANDROID_VERSION_MAJOR >= 7
namespace ah = android::hardware;
+#endif
#if ANDROID_VERSION_MAJOR >= 7
a::status_t a::MediaRecorder::setCamera(const sp<ah::ICamera>& camera, const sp<ICameraRecordingProxy>& proxy)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/autogen.sh
^
|
@@ -1,14 +1,14 @@
#!/bin/sh
-srcdir=`dirname $0`
+srcdir=$(dirname "$0")
test -z "$srcdir" && srcdir=.
-ORIGDIR=`pwd`
+ORIGDIR=$(pwd)
cd $srcdir
autoreconf -v --install || exit 1
-cd $ORIGDIR || exit $?
+cd "$ORIGDIR" || exit $?
-if [ x$NOCONFIGURE = x ]; then
+if [ x"$NOCONFIGURE" = x ]; then
$srcdir/configure "$@"
fi
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/common/hooks.c
^
|
@@ -257,6 +257,7 @@
fret = syscall(SYS_futex , &cond->value,
pshared ? FUTEX_WAKE : FUTEX_WAKE_PRIVATE, counter,
NULL, NULL, NULL);
+ (void)fret;
LOGD("futex based pthread_cond_*, value %d, counter %d, ret %d",
cond->value, counter, fret);
return 0;
@@ -324,9 +325,19 @@
{
TRACE_HOOK("size %zu", size);
+ void *res = malloc(size);
+
+ TRACE_HOOK("res %p", res);
+
+ return res;
+}
+
#ifdef WANT_ADRENO_QUIRKS
- if(size == 4) size = 5;
-#endif
+static void *_hybris_hook_malloc45(size_t size)
+{
+ TRACE_HOOK("size %zu", size);
+
+ if (size == 4) size = 5;
void *res = malloc(size);
@@ -334,6 +345,7 @@
return res;
}
+#endif
static size_t _hybris_hook_malloc_usable_size (void *ptr)
{
@@ -346,6 +358,10 @@
{
TRACE_HOOK("dst %p src %p len %zu", dst, src, len);
+ if (src == dst) {
+ return dst;
+ }
+
if (src == NULL || dst == NULL)
return dst;
@@ -1386,7 +1402,7 @@
typedef off_t bionic_fpos_t;
/* "struct __sFILE" from bionic/libc/include/stdio.h */
-struct __attribute__((packed)) bionic_file {
+struct bionic_file {
unsigned char *_p; /* current position in (some) buffer */
int _r; /* read space left for getc() */
int _w; /* write space left for putc() */
@@ -1573,14 +1589,14 @@
static int _hybris_hook_fseek(FILE *fp, long offset, int whence)
{
- TRACE_HOOK("fp %p offset %jd whence %d", fp, offset, whence);
+ TRACE_HOOK("fp %p offset %ld whence %d", fp, offset, whence);
return fseek(_get_actual_fp(fp), offset, whence);
}
static int _hybris_hook_fseeko(FILE *fp, off_t offset, int whence)
{
- TRACE_HOOK("fp %p offset %jd whence %d", fp, offset, whence);
+ TRACE_HOOK("fp %p offset %ld whence %d", fp, offset, whence);
return fseeko(_get_actual_fp(fp), offset, whence);
}
@@ -1592,7 +1608,6 @@
fpos_t my_fpos;
my_fpos.__pos = *pos;
memset(&my_fpos.__state, 0, sizeof(mbstate_t));
- mbsinit(&my_fpos.__state);
return fsetpos(_get_actual_fp(fp), &my_fpos);
}
@@ -2054,28 +2069,28 @@
static int _hybris_hook___system_property_update(void *pi, const char *value, unsigned int len)
{
- TRACE_HOOK("pi %p value '%s' len %d", pi, value, len);
+ TRACE_HOOK("pi %p value '%s' len %u", pi, value, len);
return 0;
}
static int _hybris_hook___system_property_add(const char *name, unsigned int namelen, const char *value, unsigned int valuelen)
{
- TRACE_HOOK("name '%s' namelen %d value '%s' valuelen %d",
+ TRACE_HOOK("name '%s' namelen %u value '%s' valuelen %u",
name, namelen, value, valuelen);
return 0;
}
static unsigned int _hybris_hook___system_property_wait_any(unsigned int serial)
{
- TRACE_HOOK("serial %d", serial);
+ TRACE_HOOK("serial %u", serial);
return 0;
}
static const void *_hybris_hook___system_property_find_nth(unsigned n)
{
- TRACE_HOOK("n %d", n);
+ TRACE_HOOK("n %u", n);
return NULL;
}
@@ -2363,7 +2378,7 @@
static void* _hybris_hook_mmap(void *addr, size_t len, int prot,
int flags, int fd, off_t offset)
{
- TRACE_HOOK("addr %p len %zu prot %i flags %i fd %i offset %jd",
+ TRACE_HOOK("addr %p len %zu prot %i flags %i fd %i offset %ld",
addr, len, prot, flags, fd, offset);
return mmap(addr, len, prot, flags, fd, offset);
@@ -2553,7 +2568,7 @@
{
TRACE("addr %p info %p", addr, info);
- return _android_dladdr(addr, info);
+ return (void *)_android_dladdr(addr, info);
}
static int _hybris_hook_dlclose(void *handle)
@@ -2586,7 +2601,7 @@
void _hybris_hook_android_get_LD_LIBRARY_PATH(char* buffer, size_t buffer_size)
{
- TRACE("buffer %p, buffer_size %zu\n", buffer_size);
+ TRACE("buffer %p, buffer_size %zu\n", buffer, buffer_size);
_android_get_LD_LIBRARY_PATH(buffer, buffer_size);
}
@@ -2600,16 +2615,16 @@
void* _hybris_hook_android_dlopen_ext(const char* filename, int flag, const void* extinfo)
{
- TRACE("filename %s, flag %d, extinfo %s", filename, flag, extinfo);
+ TRACE("filename %s, flag %d, extinfo %p", filename, flag, extinfo);
return _android_dlopen_ext(filename, flag, extinfo);
}
void _hybris_hook_android_set_application_target_sdk_version(uint32_t target)
{
- TRACE("target %d", target);
+ TRACE("target %u", target);
- android_set_application_target_sdk_version(target);
+ _android_set_application_target_sdk_version(target);
}
uint32_t _hybris_hook_android_get_application_target_sdk_version()
@@ -2653,12 +2668,9 @@
return _android_get_exported_namespace(name);
}
-/* this was added while debugging in the hopes to get a backtrace from a double
- * free crash. Unfortunately it fixes the problem so we cannot get a proper
- * backtrace to fix the underlying problem. */
void _hybris_hook_free(void *ptr)
{
- if (ptr) ((char*)ptr)[0] = 0;
+ TRACE_HOOK("ptr %p", ptr);
free(ptr);
}
@@ -3180,6 +3192,12 @@
return (void*) found;
}
+#ifdef WANT_ADRENO_QUIRKS
+ if (strstr(requester, "libllvm-glnext.so") != NULL && strcmp(sym, "malloc") == 0) {
+ return _hybris_hook_malloc45;
+ }
+#endif
+
if (!sorted)
{
qsort(hooks_properties, HOOKS_SIZE(hooks_properties), sizeof(hooks_properties[0]), hook_cmp);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/common/jb/linker.c
^
|
@@ -1373,14 +1373,14 @@
if(sym != 0) {
sym_name = (char *)(strtab + symtab[sym].st_name);
INFO("HYBRIS: '%s' checking hooks for sym '%s'\n", si->name, sym_name);
- sym_addr = _get_hooked_symbol(sym_name, si->name);
- if (sym_addr != NULL) {
+ sym_addr = (unsigned)_get_hooked_symbol(sym_name, si->name);
+ if (sym_addr != 0) {
INFO("HYBRIS: '%s' hooked symbol %s to %x\n", si->name,
sym_name, sym_addr);
} else {
s = _do_lookup(si, sym_name, &base);
}
- if(sym_addr == NULL)
+ if(sym_addr == 0) {
if(s == NULL) {
/* We only allow an undefined symbol if this is a weak
reference.. */
@@ -1448,7 +1448,8 @@
}
#endif
sym_addr = (unsigned)(s->st_value + base);
- }
+ }
+ }
COUNT_RELOC(RELOC_SYMBOL);
} else {
s = NULL;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/common/jb/linker_debug.h
^
|
@@ -67,11 +67,12 @@
extern int format_fd(int, const char *, ...);
#define _PRINTVF(v,f,x...) \
do { \
- if (debug_verbosity > (v)) \
+ if (debug_verbosity > (v)) { \
if (debug_stdout) \
format_fd(1, x); \
else \
format_log(5-(v),"linker",x); \
+ } \
} while (0)
#else /* !LINKER_DEBUG */
#define _PRINTVF(v,f,x...) do {} while(0)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/common/mm/linker.cpp
^
|
@@ -468,7 +468,7 @@
offset += verdef->vd_next;
if (verdef->vd_version != 1) {
- DL_ERR("unsupported verdef[%zd] vd_version: %d (expected 1) library: %s",
+ DL_ERR("unsupported verdef[%zu] vd_version: %d (expected 1) library: %s",
i, verdef->vd_version, si->get_realpath());
return false;
}
@@ -482,7 +482,7 @@
}
if (verdef->vd_cnt == 0) {
- DL_ERR("invalid verdef[%zd] vd_cnt == 0 (version without a name)", i);
+ DL_ERR("invalid verdef[%zu] vd_cnt == 0 (version without a name)", i);
return false;
}
@@ -614,7 +614,7 @@
check_symbol_version(verneed, verdef) &&
strcmp(get_string(s->st_name), symbol_name.get_name()) == 0 &&
is_symbol_global_and_defined(this, s)) {
- TRACE_TYPE(LOOKUP, "FOUND %s in %s (%p) %zd",
+ TRACE_TYPE(LOOKUP, "FOUND %s in %s (%p) %zu",
symbol_name.get_name(), get_realpath(), reinterpret_cast<void*>(s->st_value),
static_cast<size_t>(s->st_size));
*symbol_index = n;
@@ -633,7 +633,7 @@
uint32_t* symbol_index) const {
uint32_t hash = symbol_name.elf_hash();
- TRACE_TYPE(LOOKUP, "SEARCH %s in %s@%p h=%x(elf) %zd",
+ TRACE_TYPE(LOOKUP, "SEARCH %s in %s@%p h=%x(elf) %zu",
symbol_name.get_name(), get_realpath(),
reinterpret_cast<void*>(base), hash, hash % nbucket_);
@@ -654,7 +654,7 @@
if (check_symbol_version(verneed, verdef) &&
strcmp(get_string(s->st_name), symbol_name.get_name()) == 0 &&
is_symbol_global_and_defined(this, s)) {
- TRACE_TYPE(LOOKUP, "FOUND %s in %s (%p) %zd",
+ TRACE_TYPE(LOOKUP, "FOUND %s in %s (%p) %zu",
symbol_name.get_name(), get_realpath(),
reinterpret_cast<void*>(s->st_value),
static_cast<size_t>(s->st_size));
@@ -663,7 +663,7 @@
}
}
- TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p %x %zd",
+ TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p %x %zu",
symbol_name.get_name(), get_realpath(),
reinterpret_cast<void*>(base), hash, hash % nbucket_);
@@ -1609,7 +1609,7 @@
soinfo_unload(si);
}
} else {
- TRACE("not unloading '%s' group, decrementing ref_count to %zd",
+ TRACE("not unloading '%s' group, decrementing ref_count to %zu",
root->get_realpath(), ref_count);
}
}
@@ -1715,7 +1715,7 @@
offset += verneed->vn_next;
if (verneed->vn_version != 1) {
- DL_ERR("unsupported verneed[%zd] vn_version: %d (expected 1)", i, verneed->vn_version);
+ DL_ERR("unsupported verneed[%zu] vn_version: %d (expected 1)", i, verneed->vn_version);
return false;
}
@@ -1726,7 +1726,7 @@
});
if (target_si == nullptr) {
- DL_ERR("cannot find \"%s\" from verneed[%zd] in DT_NEEDED list for \"%s\"",
+ DL_ERR("cannot find \"%s\" from verneed[%zu] in DT_NEEDED list for \"%s\"",
target_soname, i, si_from->get_realpath());
return false;
}
@@ -1817,7 +1817,7 @@
const char* sym_name = nullptr;
ElfW(Addr) addend = get_addend(rel, reloc);
- DEBUG("Processing '%s' relocation at index %zd", get_realpath(), idx);
+ DEBUG("Processing '%s' relocation at index %zu", get_realpath(), idx);
if (type == R_GENERIC_NONE) {
continue;
}
@@ -2216,7 +2216,7 @@
return;
}
- TRACE("[ Calling %s (size %zd) @ %p for '%s' ]", array_name, count, functions, get_realpath());
+ TRACE("[ Calling %s (size %zu) @ %p for '%s' ]", array_name, count, functions, get_realpath());
int begin = reverse ? (count - 1) : 0;
int end = reverse ? -1 : count;
@@ -2270,7 +2270,7 @@
if (!is_main_executable() && preinit_array_ != nullptr) {
// The GNU dynamic linker silently ignores these, but we warn the developer.
- PRINT("\"%s\": ignoring %zd-entry DT_PREINIT_ARRAY in shared library!",
+ PRINT("\"%s\": ignoring %zu-entry DT_PREINIT_ARRAY in shared library!",
get_realpath(), preinit_array_count_);
}
@@ -2591,7 +2591,7 @@
case DT_SYMENT:
if (d->d_un.d_val != sizeof(ElfW(Sym))) {
- DL_ERR("invalid DT_SYMENT: %zd in \"%s\"",
+ DL_ERR("invalid DT_SYMENT: %zu in \"%s\"",
static_cast<size_t>(d->d_un.d_val), get_realpath());
return false;
}
@@ -2675,7 +2675,7 @@
case DT_RELAENT:
if (d->d_un.d_val != sizeof(ElfW(Rela))) {
- DL_ERR("invalid DT_RELAENT: %zd", static_cast<size_t>(d->d_un.d_val));
+ DL_ERR("invalid DT_RELAENT: %zu", static_cast<size_t>(d->d_un.d_val));
return false;
}
break;
@@ -2703,7 +2703,7 @@
case DT_RELENT:
if (d->d_un.d_val != sizeof(ElfW(Rel))) {
- DL_ERR("invalid DT_RELENT: %zd", static_cast<size_t>(d->d_un.d_val));
+ DL_ERR("invalid DT_RELENT: %zu", static_cast<size_t>(d->d_un.d_val));
return false;
}
break;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/common/mm/linker_phdr.cpp
^
|
@@ -165,7 +165,7 @@
}
if (rc != sizeof(header_)) {
- DL_ERR("\"%s\" is too small to be an ELF executable: only found %zd bytes", name_,
+ DL_ERR("\"%s\" is too small to be an ELF executable: only found %zu bytes", name_,
static_cast<size_t>(rc));
return false;
}
@@ -232,7 +232,7 @@
// Like the kernel, we only accept program header tables that
// are smaller than 64KiB.
if (phdr_num_ < 1 || phdr_num_ > 65536/sizeof(ElfW(Phdr))) {
- DL_ERR("\"%s\" has invalid e_phnum: %zd", name_, phdr_num_);
+ DL_ERR("\"%s\" has invalid e_phnum: %zu", name_, phdr_num_);
return false;
}
@@ -336,14 +336,14 @@
if (load_size_ > reserved_size) {
if (!reserved_hint) {
- DL_ERR("reserved address space %zd smaller than %zd bytes needed for \"%s\"",
+ DL_ERR("reserved address space %zu smaller than %zu bytes needed for \"%s\"",
reserved_size - load_size_, load_size_, name_);
return false;
}
int mmap_flags = MAP_PRIVATE | MAP_ANONYMOUS;
start = mmap(mmap_hint, load_size_, PROT_NONE, mmap_flags, -1, 0);
if (start == MAP_FAILED) {
- DL_ERR("couldn't reserve %zd bytes of address space for \"%s\"", load_size_, name_);
+ DL_ERR("couldn't reserve %zu bytes of address space for \"%s\"", load_size_, name_);
return false;
}
} else {
@@ -401,7 +401,7 @@
fd_,
file_offset_ + file_page_start);
if (seg_addr == MAP_FAILED) {
- DL_ERR("couldn't map \"%s\" segment %zd: %s", name_, i, strerror(errno));
+ DL_ERR("couldn't map \"%s\" segment %zu: %s", name_, i, strerror(errno));
return false;
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/common/n/linker_phdr.cpp
^
|
@@ -191,7 +191,7 @@
}
if (rc != sizeof(header_)) {
- DL_ERR("\"%s\" is too small to be an ELF executable: only found %zd bytes", name_.c_str(),
+ DL_ERR("\"%s\" is too small to be an ELF executable: only found %zu bytes", name_.c_str(),
static_cast<size_t>(rc));
return false;
}
@@ -269,7 +269,7 @@
// Like the kernel, we only accept program header tables that
// are smaller than 64KiB.
if (phdr_num_ < 1 || phdr_num_ > 65536/sizeof(ElfW(Phdr))) {
- DL_ERR("\"%s\" has invalid e_phnum: %zd", name_.c_str(), phdr_num_);
+ DL_ERR("\"%s\" has invalid e_phnum: %zu", name_.c_str(), phdr_num_);
return false;
}
@@ -462,19 +462,19 @@
if (load_size_ > reserved_size) {
if (!reserved_hint) {
- DL_ERR("reserved address space %zd smaller than %zd bytes needed for \"%s\"",
+ DL_ERR("reserved address space %zu smaller than %zu bytes needed for \"%s\"",
reserved_size - load_size_, load_size_, name_.c_str());
return false;
}
int mmap_flags = MAP_PRIVATE | MAP_ANONYMOUS;
start = mmap(mmap_hint, load_size_, PROT_NONE, mmap_flags, -1, 0);
if (start == MAP_FAILED) {
- DL_ERR("couldn't reserve %zd bytes of address space for \"%s\"", load_size_, name_.c_str());
+ DL_ERR("couldn't reserve %zu bytes of address space for \"%s\"", load_size_, name_.c_str());
return false;
}
if (strict_hint && (start != mmap_hint)) {
munmap(start, load_size_);
- DL_ERR("couldn't reserve %zd bytes of address space at %p for \"%s\"",
+ DL_ERR("couldn't reserve %zu bytes of address space at %p for \"%s\"",
load_size_, mmap_hint, name_.c_str());
return false;
}
@@ -543,7 +543,7 @@
fd_,
file_offset_ + file_page_start);
if (seg_addr == MAP_FAILED) {
- DL_ERR("couldn't map \"%s\" segment %zd: %s", name_.c_str(), i, strerror(errno));
+ DL_ERR("couldn't map \"%s\" segment %zu: %s", name_.c_str(), i, strerror(errno));
return false;
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/common/o/linker.cpp
^
|
@@ -1853,7 +1853,7 @@
if (ref_count == 0) {
unload_list.push_back(si);
} else {
- TRACE("not unloading '%s' group, decrementing ref_count to %zd",
+ TRACE("not unloading '%s' group, decrementing ref_count to %zu",
si->get_realpath(), ref_count);
}
} else {
@@ -2424,7 +2424,7 @@
offset += verneed->vn_next;
if (verneed->vn_version != 1) {
- DL_ERR("unsupported verneed[%zd] vn_version: %d (expected 1)", i, verneed->vn_version);
+ DL_ERR("unsupported verneed[%zu] vn_version: %d (expected 1)", i, verneed->vn_version);
return false;
}
@@ -2435,7 +2435,7 @@
});
if (target_si == nullptr) {
- DL_ERR("cannot find \"%s\" from verneed[%zd] in DT_NEEDED list for \"%s\"",
+ DL_ERR("cannot find \"%s\" from verneed[%zu] in DT_NEEDED list for \"%s\"",
target_soname, i, si_from->get_realpath());
return false;
}
@@ -2475,7 +2475,7 @@
offset += verdef->vd_next;
if (verdef->vd_version != 1) {
- DL_ERR("unsupported verdef[%zd] vd_version: %d (expected 1) library: %s",
+ DL_ERR("unsupported verdef[%zu] vd_version: %d (expected 1) library: %s",
i, verdef->vd_version, si->get_realpath());
return false;
}
@@ -2489,7 +2489,7 @@
}
if (verdef->vd_cnt == 0) {
- DL_ERR("invalid verdef[%zd] vd_cnt == 0 (version without a name)", i);
+ DL_ERR("invalid verdef[%zu] vd_cnt == 0 (version without a name)", i);
return false;
}
@@ -2599,7 +2599,7 @@
const char* sym_name = nullptr;
ElfW(Addr) addend = get_addend(rel, reloc);
- DEBUG("Processing \"%s\" relocation at index %zd", get_realpath(), idx);
+ DEBUG("Processing \"%s\" relocation at index %zu", get_realpath(), idx);
if (type == R_GENERIC_NONE) {
continue;
}
@@ -3076,7 +3076,7 @@
case DT_SYMENT:
if (d->d_un.d_val != sizeof(ElfW(Sym))) {
- DL_ERR("invalid DT_SYMENT: %zd in \"%s\"",
+ DL_ERR("invalid DT_SYMENT: %zu in \"%s\"",
static_cast<size_t>(d->d_un.d_val), get_realpath());
return false;
}
@@ -3160,7 +3160,7 @@
case DT_RELAENT:
if (d->d_un.d_val != sizeof(ElfW(Rela))) {
- DL_ERR("invalid DT_RELAENT: %zd", static_cast<size_t>(d->d_un.d_val));
+ DL_ERR("invalid DT_RELAENT: %zu", static_cast<size_t>(d->d_un.d_val));
return false;
}
break;
@@ -3188,7 +3188,7 @@
case DT_RELENT:
if (d->d_un.d_val != sizeof(ElfW(Rel))) {
- DL_ERR("invalid DT_RELENT: %zd", static_cast<size_t>(d->d_un.d_val));
+ DL_ERR("invalid DT_RELENT: %zu", static_cast<size_t>(d->d_un.d_val));
return false;
}
break;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/common/o/linker_cfi.cpp
^
|
@@ -168,13 +168,13 @@
}
uintptr_t cfi_check = soinfo_find_cfi_check(si);
if (cfi_check == 0) {
- INFO("[ CFI add 0x%zx + 0x%zx %s ]", static_cast<uintptr_t>(si->base),
+ INFO("[ CFI add 0x%lx + 0x%lx %s ]", static_cast<uintptr_t>(si->base),
static_cast<uintptr_t>(si->size), si->get_soname());
AddUnchecked(si->base, si->base + si->size);
return true;
}
- INFO("[ CFI add 0x%zx + 0x%zx %s: 0x%zx ]", static_cast<uintptr_t>(si->base),
+ INFO("[ CFI add 0x%lx + 0x%lx %s: 0x%lx ]", static_cast<uintptr_t>(si->base),
static_cast<uintptr_t>(si->size), si->get_soname(), cfi_check);
#ifdef __arm__
// Require Thumb encoding.
@@ -265,7 +265,7 @@
void CFIShadowWriter::BeforeUnload(soinfo* si) {
if (shadow_start == nullptr) return;
if (si->base == 0 || si->size == 0) return;
- INFO("[ CFI remove 0x%zx + 0x%zx: %s ]", static_cast<uintptr_t>(si->base),
+ INFO("[ CFI remove 0x%lx + 0x%lx: %s ]", static_cast<uintptr_t>(si->base),
static_cast<uintptr_t>(si->size), si->get_soname());
AddInvalid(si->base, si->base + si->size);
FixupVmaName();
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/common/o/linker_config.cpp
^
|
@@ -182,7 +182,7 @@
int result = cp.next_token(&name, &value, &error);
if (result == ConfigParser::kError) {
- DL_WARN("error parsing %s:%zd: %s (ignoring this line)",
+ DL_WARN("error parsing %s:%zu: %s (ignoring this line)",
ld_config_file_path,
cp.lineno(),
error.c_str());
@@ -195,7 +195,7 @@
if (result == ConfigParser::kProperty) {
if (!startsWith(name, "dir.")) {
- DL_WARN("error parsing %s:%zd: unexpected property name \"%s\", "
+ DL_WARN("error parsing %s:%zu: unexpected property name \"%s\", "
"expected format dir.<section_name> (ignoring this line)",
ld_config_file_path,
cp.lineno(),
@@ -209,7 +209,7 @@
}
if (value.empty()) {
- DL_WARN("error parsing %s:%zd: property value is empty (ignoring this line)",
+ DL_WARN("error parsing %s:%zu: property value is empty (ignoring this line)",
ld_config_file_path,
cp.lineno());
continue;
@@ -256,7 +256,7 @@
if (result == ConfigParser::kProperty) {
if (properties->find(name) != properties->end()) {
- DL_WARN("%s:%zd: warning: property \"%s\" redefinition",
+ DL_WARN("%s:%zu: warning: property \"%s\" redefinition",
ld_config_file_path,
cp.lineno(),
name.c_str());
@@ -266,7 +266,7 @@
}
if (result == ConfigParser::kError) {
- DL_WARN("error parsing %s:%zd: %s (ignoring this line)",
+ DL_WARN("error parsing %s:%zu: %s (ignoring this line)",
ld_config_file_path,
cp.lineno(),
error.c_str());
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/common/o/linker_phdr.cpp
^
|
@@ -198,7 +198,7 @@
}
if (rc != sizeof(header_)) {
- DL_ERR("\"%s\" is too small to be an ELF executable: only found %zd bytes", name_.c_str(),
+ DL_ERR("\"%s\" is too small to be an ELF executable: only found %zu bytes", name_.c_str(),
static_cast<size_t>(rc));
return false;
}
@@ -314,7 +314,7 @@
// Like the kernel, we only accept program header tables that
// are smaller than 64KiB.
if (phdr_num_ < 1 || phdr_num_ > 65536/sizeof(ElfW(Phdr))) {
- DL_ERR("\"%s\" has invalid e_phnum: %zd", name_.c_str(), phdr_num_);
+ DL_ERR("\"%s\" has invalid e_phnum: %zu", name_.c_str(), phdr_num_);
return false;
}
@@ -586,18 +586,18 @@
if (load_size_ > reserved_size) {
if (!reserved_hint) {
- DL_ERR("reserved address space %zd smaller than %zd bytes needed for \"%s\"",
+ DL_ERR("reserved address space %zu smaller than %zu bytes needed for \"%s\"",
reserved_size - load_size_, load_size_, name_.c_str());
return false;
}
start = ReserveAligned(mmap_hint, load_size_, kLibraryAlignment);
if (start == nullptr) {
- DL_ERR("couldn't reserve %zd bytes of address space for \"%s\"", load_size_, name_.c_str());
+ DL_ERR("couldn't reserve %zu bytes of address space for \"%s\"", load_size_, name_.c_str());
return false;
}
if (strict_hint && (start != mmap_hint)) {
munmap(start, load_size_);
- DL_ERR("couldn't reserve %zd bytes of address space at %p for \"%s\"",
+ DL_ERR("couldn't reserve %zu bytes of address space at %p for \"%s\"",
load_size_, mmap_hint, name_.c_str());
return false;
}
@@ -668,7 +668,7 @@
fd_,
file_offset_ + file_page_start);
if (seg_addr == MAP_FAILED) {
- DL_ERR("couldn't map \"%s\" segment %zd: %s", name_.c_str(), i, strerror(errno));
+ DL_ERR("couldn't map \"%s\" segment %zu: %s", name_.c_str(), i, strerror(errno));
return false;
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/common/o/linker_soinfo.cpp
^
|
@@ -232,7 +232,7 @@
check_symbol_version(verneed, verdef) &&
strcmp(get_string(s->st_name), symbol_name.get_name()) == 0 &&
is_symbol_global_and_defined(this, s)) {
- TRACE_TYPE(LOOKUP, "FOUND %s in %s (%p) %zd",
+ TRACE_TYPE(LOOKUP, "FOUND %s in %s (%p) %zu",
symbol_name.get_name(), get_realpath(), reinterpret_cast<void*>(s->st_value),
static_cast<size_t>(s->st_size));
*symbol_index = n;
@@ -251,7 +251,7 @@
uint32_t* symbol_index) const {
uint32_t hash = symbol_name.elf_hash();
- TRACE_TYPE(LOOKUP, "SEARCH %s in %s@%p h=%x(elf) %zd",
+ TRACE_TYPE(LOOKUP, "SEARCH %s in %s@%p h=%x(elf) %zu",
symbol_name.get_name(), get_realpath(),
reinterpret_cast<void*>(base), hash, hash % nbucket_);
@@ -272,7 +272,7 @@
if (check_symbol_version(verneed, verdef) &&
strcmp(get_string(s->st_name), symbol_name.get_name()) == 0 &&
is_symbol_global_and_defined(this, s)) {
- TRACE_TYPE(LOOKUP, "FOUND %s in %s (%p) %zd",
+ TRACE_TYPE(LOOKUP, "FOUND %s in %s (%p) %zu",
symbol_name.get_name(), get_realpath(),
reinterpret_cast<void*>(s->st_value),
static_cast<size_t>(s->st_size));
@@ -281,7 +281,7 @@
}
}
- TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p %x %zd",
+ TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p %x %zu",
symbol_name.get_name(), get_realpath(),
reinterpret_cast<void*>(base), hash, hash % nbucket_);
@@ -372,7 +372,7 @@
return;
}
- TRACE("[ Calling %s (size %zd) @ %p for '%s' ]", array_name, count, functions, realpath);
+ TRACE("[ Calling %s (size %zu) @ %p for '%s' ]", array_name, count, functions, realpath);
int begin = reverse ? (count - 1) : 0;
int end = reverse ? -1 : count;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/configure.ac
^
|
@@ -74,15 +74,19 @@
AC_ARG_ENABLE(ubuntu-camera-headers,
[ --enable-ubuntu-camera-headers Enable Ubuntu camera headers (default=disabled)],
- [ubuntu-camera-headers=$enableval],
- [ubuntu-camera-headers="no"])
-AM_CONDITIONAL( [WANT_UBUNTU_CAMERA_HEADERS], [test x"$ubuntu-camera-headers" = x"yes"])
+ [ubuntu_camera_headers=$enableval],
+ [ubuntu_camera_headers="no"])
+AM_CONDITIONAL( [WANT_UBUNTU_CAMERA_HEADERS], [test x"$ubuntu_camera_headers" = x"yes"])
+
+WANT_WAYLAND_EGL="no"
AC_ARG_ENABLE(wayland,
[ --enable-wayland Enable wayland support (default=disabled)],
[wayland=$enableval
PKG_CHECK_MODULES(WAYLAND_CLIENT, wayland-client,, exit)
PKG_CHECK_MODULES(WAYLAND_SERVER, wayland-server,, exit)
+ PKG_CHECK_MODULES(WAYLAND_EGL, [wayland-egl >= 1.15], , [WANT_WAYLAND_EGL="yes"])
+ AC_DEFINE(WANT_WAYLAND_EGL, [], [We use internal Wayland EGL support])
WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],, [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
@@ -90,6 +94,7 @@
],
[wayland="no"])
AM_CONDITIONAL( [WANT_WAYLAND], [test x"$wayland" = x"yes"])
+AM_CONDITIONAL( [WANT_WAYLAND_EGL], [test x"$WANT_WAYLAND_EGL" = x"yes"])
AC_ARG_ENABLE(wayland_serverside_buffers,
[ --enable-wayland_serverside_buffers Enable serverside buffer allocation for wayland (default=enabled)],
@@ -171,6 +176,7 @@
AM_CONDITIONAL([HAS_HWCOMPOSER2_HEADERS], [false])
AM_CONDITIONAL([HAS_GRALLOC1_HEADER], [false])
AM_CONDITIONAL([HAS_VIBRATOR_HEADER], [false])
+ AC_SUBST([ANDROID_HEADERS_PKGCONFIG], [android-headers])
]
)
CPPFLAGS="$CPPFLAGS $ANDROID_HEADERS_CFLAGS"
@@ -307,7 +313,7 @@
tests/Makefile
])
-AM_COND_IF([WANT_WAYLAND], [AC_CONFIG_FILES([egl/platforms/common/wayland-egl.pc])])
+AM_COND_IF([WANT_WAYLAND_EGL], [AC_CONFIG_FILES([egl/platforms/common/wayland-egl.pc])])
AC_OUTPUT
echo
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/egl/egl.c
^
|
@@ -44,50 +44,15 @@
static void *_hybris_libgles2 = NULL;
static int _egl_context_client_version = 1;
-static EGLint (*_eglGetError)(void) = NULL;
-
static EGLDisplay (*_eglGetDisplay)(EGLNativeDisplayType display_id) = NULL;
-static EGLBoolean (*_eglInitialize)(EGLDisplay dpy, EGLint *major, EGLint *minor) = NULL;
static EGLBoolean (*_eglTerminate)(EGLDisplay dpy) = NULL;
static const char * (*_eglQueryString)(EGLDisplay dpy, EGLint name) = NULL;
-static EGLBoolean (*_eglGetConfigs)(EGLDisplay dpy, EGLConfig *configs,
- EGLint config_size, EGLint *num_config) = NULL;
-static EGLBoolean (*_eglChooseConfig)(EGLDisplay dpy, const EGLint *attrib_list,
- EGLConfig *configs, EGLint config_size,
- EGLint *num_config) = NULL;
-static EGLBoolean (*_eglGetConfigAttrib)(EGLDisplay dpy, EGLConfig config,
- EGLint attribute, EGLint *value) = NULL;
-
static EGLSurface (*_eglCreateWindowSurface)(EGLDisplay dpy, EGLConfig config,
EGLNativeWindowType win,
const EGLint *attrib_list) = NULL;
-static EGLSurface (*_eglCreatePbufferSurface)(EGLDisplay dpy, EGLConfig config,
- const EGLint *attrib_list) = NULL;
-static EGLSurface (*_eglCreatePixmapSurface)(EGLDisplay dpy, EGLConfig config,
- EGLNativePixmapType pixmap,
- const EGLint *attrib_list) = NULL;
static EGLBoolean (*_eglDestroySurface)(EGLDisplay dpy, EGLSurface surface) = NULL;
-static EGLBoolean (*_eglQuerySurface)(EGLDisplay dpy, EGLSurface surface,
- EGLint attribute, EGLint *value) = NULL;
-
-static EGLBoolean (*_eglBindAPI)(EGLenum api) = NULL;
-static EGLenum (*_eglQueryAPI)(void) = NULL;
-
-static EGLBoolean (*_eglWaitClient)(void) = NULL;
-
-static EGLBoolean (*_eglReleaseThread)(void) = NULL;
-
-static EGLSurface (*_eglCreatePbufferFromClientBuffer)(
- EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
- EGLConfig config, const EGLint *attrib_list) = NULL;
-
-static EGLBoolean (*_eglSurfaceAttrib)(EGLDisplay dpy, EGLSurface surface,
- EGLint attribute, EGLint value) = NULL;
-static EGLBoolean (*_eglBindTexImage)(EGLDisplay dpy, EGLSurface surface, EGLint buffer) = NULL;
-static EGLBoolean (*_eglReleaseTexImage)(EGLDisplay dpy, EGLSurface surface, EGLint buffer) = NULL;
-
static EGLBoolean (*_eglSwapInterval)(EGLDisplay dpy, EGLint interval) = NULL;
@@ -95,21 +60,10 @@
static EGLContext (*_eglCreateContext)(EGLDisplay dpy, EGLConfig config,
EGLContext share_context,
const EGLint *attrib_list) = NULL;
-static EGLBoolean (*_eglDestroyContext)(EGLDisplay dpy, EGLContext ctx) = NULL;
-static EGLBoolean (*_eglMakeCurrent)(EGLDisplay dpy, EGLSurface draw,
- EGLSurface read, EGLContext ctx) = NULL;
-static EGLContext (*_eglGetCurrentContext)(void) = NULL;
static EGLSurface (*_eglGetCurrentSurface)(EGLint readdraw) = NULL;
-static EGLDisplay (*_eglGetCurrentDisplay)(void) = NULL;
-static EGLBoolean (*_eglQueryContext)(EGLDisplay dpy, EGLContext ctx,
- EGLint attribute, EGLint *value) = NULL;
-static EGLBoolean (*_eglWaitGL)(void) = NULL;
-static EGLBoolean (*_eglWaitNative)(EGLint engine) = NULL;
static EGLBoolean (*_eglSwapBuffers)(EGLDisplay dpy, EGLSurface surface) = NULL;
-static EGLBoolean (*_eglCopyBuffers)(EGLDisplay dpy, EGLSurface surface,
- EGLNativePixmapType target) = NULL;
static EGLImageKHR (*_eglCreateImageKHR)(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list) = NULL;
@@ -425,14 +379,12 @@
ret = _hybris_libgles1 ? dlsym(_hybris_libgles1, procname) : NULL;
break;
case 2: // OpenGL ES 2.0 API
+ case 3: // OpenGL ES 3.x API, backwards compatible with OpenGL ES 2.0 so we implement in same library
if (_hybris_libgles2 == NULL) {
_hybris_libgles2 = (void *) dlopen(getenv("HYBRIS_LIBGLESV2") ?: "libGLESv2.so.2", RTLD_LAZY);
}
ret = _hybris_libgles2 ? dlsym(_hybris_libgles2, procname) : NULL;
break;
- case 3: // OpenGL ES 3.x API
- // TODO: Load from libGLESv3.so once we have OpenGL ES 3.0/3.1 support
- break;
default:
HYBRIS_WARN("Unknown EGL context client version: %d", _egl_context_client_version);
break;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/egl/platforms/common/Makefile.am
^
|
@@ -11,10 +11,11 @@
pkgconfig_DATA = hybris-egl-platform.pc
if WANT_WAYLAND
+if WANT_WAYLAND_EGL
lib_LTLIBRARIES += libwayland-egl.la
pkgconfig_DATA += wayland-egl.pc
-
+endif
libhybris_eglplatformcommon_la_SOURCES += \
server_wlegl.cpp \
@@ -35,6 +36,7 @@
%-client-protocol.h : %.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
+if WANT_WAYLAND_EGL
libwayland_egl_la_SOURCES = wayland-egl.c
libwayland_egl_la_CFLAGS = -I. -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS) $(WAYLAND_CLIENT_CFLAGS) $(WAYLAND_SERVER_CFLAGS)
@@ -56,6 +58,7 @@
-version-info "1":"0"
endif
+endif
libhybris_eglplatformcommon_la_CFLAGS = -I$(top_srcdir)/include $(ANDROID_HEADERS_CFLAGS) -I$(top_srcdir)/egl -I$(top_srcdir)/common/
if WANT_WAYLAND
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/egl/platforms/common/eglplatformcommon.cpp
^
|
@@ -50,6 +50,7 @@
static int cnt = 0;
void *vaddr;
int ret = hybris_gralloc_lock(buf->handle, buf->usage, 0, 0, buf->width, buf->height, &vaddr);
+ (void)ret;
TRACE("buf:%p gralloc lock returns %i", buf, ret);
TRACE("buf:%p lock to vaddr %p", buf, vaddr);
char b[1024];
@@ -65,8 +66,8 @@
int fd = ::open(b, O_WRONLY|O_CREAT, S_IRWXU);
if(fd < 0)
return;
-
- ::write(fd, vaddr, buf->stride * buf->height * bytes_pp);
+ if (::write(fd, vaddr, buf->stride * buf->height * bytes_pp) < 0)
+ TRACE("dump buffer to file failed with error %i", errno);
::close(fd);
hybris_gralloc_unlock(buf->handle);
}
@@ -186,7 +187,7 @@
buffer_handle_t _handle;
int _stride;
- hybris_gralloc_allocate(width, height, format, usage, &_handle, (uint32_t*)&_stride);
+ ret = hybris_gralloc_allocate(width, height, format, usage, &_handle, (uint32_t*)&_stride);
if (ret == 0)
{
@@ -281,11 +282,11 @@
return (__eglMustCastToProperFunctionPointerType)eglplatformcommon_eglQueryWaylandBufferWL;
}
else
- if (strcmp(procname, "eglHybrisAcquireNativeBufferWL") == 0)
- {
- return (__eglMustCastToProperFunctionPointerType) eglplatformcommon_eglHybrisAcquireNativeBufferWL;
- }
- else
+ if (strcmp(procname, "eglHybrisAcquireNativeBufferWL") == 0)
+ {
+ return (__eglMustCastToProperFunctionPointerType) eglplatformcommon_eglHybrisAcquireNativeBufferWL;
+ }
+ else
#endif
if (strcmp(procname, "eglHybrisCreateNativeBuffer") == 0)
{
@@ -336,13 +337,7 @@
{
const char *ret = (*real_eglQueryString)(dpy, name);
static char eglextensionsbuf[2048];
- snprintf(eglextensionsbuf, 2046, "%sEGL_HYBRIS_native_buffer2 EGL_HYBRIS_WL_acquire_native_buffer %s", ret ? ret : "",
-#ifdef WANT_WAYLAND
- "EGL_WL_bind_wayland_display "
-#else
- ""
-#endif
- );
+ snprintf(eglextensionsbuf, 2046, "%sEGL_HYBRIS_native_buffer2 EGL_HYBRIS_WL_acquire_native_buffer EGL_WL_bind_wayland_display", ret ? ret : "");
ret = eglextensionsbuf;
return ret;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/egl/platforms/common/hybris-egl-platform.pc.in
^
|
@@ -6,7 +6,7 @@
Name: hybris-egl-platform
Description: libhybris EGL platform library
Version: @VERSION@
-Requires: android-headers
+Requires: @ANDROID_HEADERS_PKGCONFIG@
Libs: -L${libdir} -lhybris-common -lhybris-eglplatformcommon
-Cflags: -I${includedir} -I${includedir}/hybris/eglplatformcommon
+Cflags: -I${includedir} -I${includedir}/hybris/eglplatformcommon @ANDROID_HEADERS_CFLAGS@
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/egl/platforms/common/server_wlegl.cpp
^
|
@@ -53,7 +53,6 @@
int32_t num_fds,
struct wl_array *ints)
{
- server_wlegl *wlegl = server_wlegl_from(resource);
server_wlegl_handle *handle;
if (num_fds < 0) {
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/egl/platforms/common/wayland-egl-priv.h
^
|
@@ -14,8 +14,10 @@
#include <wayland-client.h>
+#define WL_EGL_WINDOW_VERSION 3
+
struct wl_egl_window {
- struct wl_surface *surface;
+ const intptr_t version;
int width;
int height;
@@ -25,9 +27,11 @@
int attached_width;
int attached_height;
- void *nativewindow;
+ void *driver_private;
void (*resize_callback)(struct wl_egl_window *, void *);
- void (*free_callback)(struct wl_egl_window *, void *);
+ void (*destroy_window_callback)(void *);
+
+ struct wl_surface *surface;
};
#ifdef __cplusplus
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/egl/platforms/common/wayland-egl.c
^
|
@@ -29,13 +29,15 @@
if (!egl_window)
return NULL;
+ intptr_t *version = (intptr_t *)&egl_window->version;
+ *version = WL_EGL_WINDOW_VERSION;
egl_window->surface = surface;
egl_window->resize_callback = NULL;
- egl_window->free_callback = NULL;
+ egl_window->destroy_window_callback = NULL;
wl_egl_window_resize(egl_window, width, height, 0, 0);
egl_window->attached_width = 0;
egl_window->attached_height = 0;
- egl_window->nativewindow = 0;
+ egl_window->driver_private = 0;
return egl_window;
@@ -44,8 +46,8 @@
WL_EGL_EXPORT void
wl_egl_window_destroy(struct wl_egl_window *egl_window)
{
- if (egl_window->free_callback)
- egl_window->free_callback(egl_window, NULL);
+ if (egl_window->destroy_window_callback)
+ egl_window->destroy_window_callback(egl_window->driver_private);
free(egl_window);
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/egl/platforms/fbdev/fbdev_window.cpp
^
|
@@ -510,7 +510,7 @@
{
destroyBuffers();
- for(unsigned int i = 0; i < m_bufferCount; i++)
+ for(int i = 0; i < m_bufferCount; i++)
{
FbDevNativeWindowBuffer *fbnb = new FbDevNativeWindowBuffer(hybris_gralloc_fbdev_width(),
hybris_gralloc_fbdev_height(), hybris_gralloc_fbdev_format(), m_usage|GRALLOC_USAGE_HW_FB);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/egl/platforms/fbdev/fbdev_window.h
^
|
@@ -74,9 +74,9 @@
void reallocateBuffers();
private:
- unsigned int m_usage;
- unsigned int m_bufFormat;
- unsigned int m_bufferCount;
+ int m_usage;
+ int m_bufFormat;
+ int m_bufferCount;
int m_freeBufs;
bool m_allocateBuffers;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/egl/platforms/hwcomposer/hwcomposer_window.cpp
^
|
@@ -91,9 +91,6 @@
static_cast<_BufferFenceAccessor *>(buf)->set(fd);
}
-static pthread_cond_t _cond = PTHREAD_COND_INITIALIZER;
-static pthread_mutex_t _mutex = PTHREAD_MUTEX_INITIALIZER;
-
HWComposerNativeWindowBuffer::HWComposerNativeWindowBuffer(unsigned int width,
unsigned int height,
@@ -496,7 +493,7 @@
if (b->status) {
b->common.decRef(&b->common);
- fprintf(stderr,"WARNING: %s: allocated only %d buffers out of %d\n", __PRETTY_FUNCTION__, m_bufList.size(), m_bufferCount);
+ fprintf(stderr,"WARNING: %s: allocated only %zu buffers out of %u\n", __PRETTY_FUNCTION__, m_bufList.size(), m_bufferCount);
break;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/egl/platforms/wayland/eglplatform_wayland.cpp
^
|
@@ -207,7 +207,7 @@
{
struct wl_egl_window *eglwin = (struct wl_egl_window *) win;
- return ((WaylandNativeWindow *) eglwin->nativewindow)->postBuffer((ANativeWindowBuffer *) buffer);
+ return ((WaylandNativeWindow *) eglwin->driver_private)->postBuffer((ANativeWindowBuffer *) buffer);
}
/**
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/egl/platforms/wayland/wayland_window.cpp
^
|
@@ -97,12 +97,12 @@
void WaylandNativeWindow::resize_callback(struct wl_egl_window *egl_window, void *)
{
TRACE("%dx%d",egl_window->width,egl_window->height);
- ((WaylandNativeWindow *) egl_window->nativewindow)->resize(egl_window->width, egl_window->height);
+ ((WaylandNativeWindow *) egl_window->driver_private)->resize(egl_window->width, egl_window->height);
}
-void WaylandNativeWindow::free_callback(struct wl_egl_window *egl_window, void *)
+void WaylandNativeWindow::destroy_window_callback(void *data)
{
- WaylandNativeWindow *native = (WaylandNativeWindow*)egl_window->nativewindow;
+ WaylandNativeWindow *native = (WaylandNativeWindow*)data;
native->lock();
native->m_window = 0;
@@ -132,21 +132,25 @@
WaylandNativeWindow::sync_callback
};
+
+#if WAYLAND_VERSION_MAJOR == 0 || (WAYLAND_VERSION_MAJOR == 1 && WAYLAND_VERSION_MINOR < 6)
int
-WaylandNativeWindow::wayland_roundtrip(WaylandNativeWindow *display)
+WaylandNativeWindow::wl_display_roundtrip_queue(struct wl_display *display,
+ struct wl_event_queue *queue)
{
struct wl_callback *callback;
int done = 0, ret = 0;
- wl_display_dispatch_queue_pending(display->m_display, display->wl_queue);
+ wl_display_dispatch_queue_pending(display, queue);
- callback = wl_display_sync(display->m_display);
+ callback = wl_display_sync(display);
wl_callback_add_listener(callback, &sync_listener, &done);
- wl_proxy_set_queue((struct wl_proxy *) callback, display->wl_queue);
+ wl_proxy_set_queue((struct wl_proxy *) callback, queue);
while (ret >= 0 && !done)
- ret = wl_display_dispatch_queue(display->m_display, display->wl_queue);
+ ret = wl_display_dispatch_queue(display, queue);
return ret;
}
+#endif
static void check_fatal_error(struct wl_display *display)
{
@@ -179,18 +183,16 @@
WaylandNativeWindow::WaylandNativeWindow(struct wl_egl_window *window, struct wl_display *display, android_wlegl *wlegl)
: m_android_wlegl(wlegl)
{
- int wayland_ok;
-
HYBRIS_TRACE_BEGIN("wayland-platform", "create_window", "");
this->m_window = window;
- this->m_window->nativewindow = (void *) this;
+ this->m_window->driver_private = (void *) this;
this->m_display = display;
this->m_width = window->width;
this->m_height = window->height;
this->m_defaultWidth = window->width;
this->m_defaultHeight = window->height;
this->m_window->resize_callback = resize_callback;
- this->m_window->free_callback = free_callback;
+ this->m_window->destroy_window_callback = destroy_window_callback;
this->frame_callback = NULL;
this->wl_queue = wl_display_create_queue(display);
this->m_format = 1;
@@ -214,15 +216,14 @@
WaylandNativeWindow::~WaylandNativeWindow()
{
- std::list<WaylandNativeWindowBuffer *>::iterator it = m_bufList.begin();
destroyBuffers();
if (frame_callback)
wl_callback_destroy(frame_callback);
wl_event_queue_destroy(wl_queue);
if (m_window) {
- m_window->nativewindow = NULL;
+ m_window->driver_private = NULL;
m_window->resize_callback = NULL;
- m_window->free_callback = NULL;
+ m_window->destroy_window_callback = NULL;
}
}
@@ -400,6 +401,7 @@
int WaylandNativeWindow::lockBuffer(BaseNativeWindowBuffer* buffer){
WaylandNativeWindowBuffer *wnb = (WaylandNativeWindowBuffer*) buffer;
+ (void)wnb;
HYBRIS_TRACE_BEGIN("wayland-platform", "lockBuffer", "-%p", wnb);
HYBRIS_TRACE_END("wayland-platform", "lockBuffer", "-%p", wnb);
return NO_ERROR;
@@ -573,7 +575,6 @@
int WaylandNativeWindow::queueBuffer(BaseNativeWindowBuffer* buffer, int fenceFd)
{
WaylandNativeWindowBuffer *wnb = (WaylandNativeWindowBuffer*) buffer;
- int ret = 0;
HYBRIS_TRACE_BEGIN("wayland-platform", "queueBuffer", "-%p", wnb);
lock();
@@ -755,7 +756,7 @@
#ifndef HYBRIS_NO_SERVER_SIDE_BUFFERS
wnb = new ServerWaylandBuffer(m_width, m_height, m_format, m_usage, m_android_wlegl, wl_queue);
- wayland_roundtrip(this);
+ wl_display_roundtrip_queue(m_display, wl_queue);
#else
wnb = new ClientWaylandBuffer(m_width, m_height, m_format, m_usage);
#endif
@@ -770,19 +771,17 @@
int WaylandNativeWindow::setBufferCount(int cnt) {
- int start = 0;
-
TRACE("cnt:%d", cnt);
- if (m_bufList.size() == cnt)
+ if ((int)m_bufList.size() == cnt)
return NO_ERROR;
lock();
- if (m_bufList.size() > cnt) {
+ if ((int)m_bufList.size() > cnt) {
/* Decreasing buffer count, remove from beginning */
std::list<WaylandNativeWindowBuffer*>::iterator it = m_bufList.begin();
- for (int i = 0; i <= m_bufList.size() - cnt; i++ )
+ for (int i = 0; i <= (int)m_bufList.size() - cnt; i++ )
{
destroyBuffer(*it);
++it;
@@ -791,8 +790,8 @@
} else {
/* Increasing buffer count, start from current size */
- for (int i = m_bufList.size(); i < cnt; i++)
- WaylandNativeWindowBuffer *unused = addBuffer();
+ for (int i = (int)m_bufList.size(); i < cnt; i++)
+ (void)addBuffer();
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/egl/platforms/wayland/wayland_window.h
^
|
@@ -161,7 +161,7 @@
static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t name,
const char *interface, uint32_t version);
static void resize_callback(struct wl_egl_window *egl_window, void *);
- static void free_callback(struct wl_egl_window *egl_window, void *);
+ static void destroy_window_callback(void *data);
struct wl_event_queue *wl_queue;
protected:
@@ -199,9 +199,9 @@
struct wl_egl_window *m_window;
struct wl_display *m_display;
WaylandNativeWindowBuffer *m_lastBuffer;
- unsigned int m_width;
- unsigned int m_height;
- unsigned int m_format;
+ int m_width;
+ int m_height;
+ int m_format;
unsigned int m_defaultWidth;
unsigned int m_defaultHeight;
unsigned int m_usage;
@@ -213,7 +213,10 @@
EGLint *m_damage_rects, m_damage_n_rects;
struct wl_callback *frame_callback;
int m_swap_interval;
- static int wayland_roundtrip(WaylandNativeWindow *display);
+#if WAYLAND_VERSION_MAJOR == 0 || (WAYLAND_VERSION_MAJOR == 1 && WAYLAND_VERSION_MINOR < 6)
+ static int wl_roundtrip_queue(struct wl_display *display,
+ struct wl_event_queue *queue);
+#endif
};
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/egl/ws.c
^
|
@@ -21,6 +21,10 @@
#include <assert.h>
#include <stdio.h>
#include <sys/auxv.h>
+#include <pthread.h>
+#include <string.h>
+
+pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static struct ws_module *ws = NULL;
@@ -28,6 +32,12 @@
{
if (ws == NULL)
{
+ pthread_mutex_lock(&mutex);
+ if (ws != NULL) {
+ pthread_mutex_unlock(&mutex);
+ return;
+ }
+
char ws_name[2048];
char *egl_platform;
@@ -41,6 +51,10 @@
if (egl_platform == NULL)
egl_platform = DEFAULT_EGL_PLATFORM;
+ // The env variables may be defined yet empty
+ if (!strcmp(egl_platform, ""))
+ egl_platform = DEFAULT_EGL_PLATFORM;
+
const char *eglplatform_dir = PKGLIBDIR;
const char *user_eglplatform_dir = getauxval(AT_SECURE)
? NULL
@@ -59,6 +73,8 @@
ws = dlsym(wsmod, "ws_module_info");
assert(ws != NULL);
ws->init_module(&hybris_egl_interface);
+
+ pthread_mutex_unlock(&mutex);
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/glesv2/glesv2.c
^
|
@@ -1,5 +1,7 @@
/*
* Copyright (c) 2012 Carsten Munk <carsten.munk@gmail.com>
+ * Copyright (C) 2017 Bhushan Shah <bshah@kde.org>
+ * Copyright (C) 2020 Matti Lehtimäki <matti.lehtimaki@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,1038 +18,392 @@
*/
#define GL_GLEXT_PROTOTYPES
-#include <GLES2/gl2.h>
+#include <GLES3/gl32.h>
+#include <GLES3/gl3ext.h>
+
#include <GLES2/gl2ext.h>
+
#include <dlfcn.h>
#include <stddef.h>
#include <stdlib.h>
-#include <stdio.h>
#include <hybris/common/binding.h>
#include "../egl/ws.h"
-static void *_libglesv2 = 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 renderbuffer) = NULL;
-static void (*_glBindTexture)(GLenum target, GLuint texture) = NULL;
-static void (*_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) FP_ATTRIB = 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 (*_glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) FP_ATTRIB = NULL;
-static void (*_glClearDepthf)(GLclampf depth) FP_ATTRIB = 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* framebuffers) = 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 (*_glDepthRangef)(GLclampf zNear, GLclampf zFar) FP_ATTRIB = 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 (*_glLineWidth)(GLfloat width) FP_ATTRIB = NULL;
-static void (*_glLinkProgram)(GLuint program) = NULL;
-static void (*_glPixelStorei)(GLenum pname, GLint param) = NULL;
-static void (*_glPolygonOffset)(GLfloat factor, GLfloat units) FP_ATTRIB = 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 (*_glSampleCoverage)(GLclampf value, GLboolean invert) FP_ATTRIB = 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 (*_glTexParameterf)(GLenum target, GLenum pname, GLfloat param) FP_ATTRIB = 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 (*_glUniform1f)(GLint location, GLfloat x) FP_ATTRIB = 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 (*_glUniform2f)(GLint location, GLfloat x, GLfloat y) FP_ATTRIB = 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 (*_glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z) FP_ATTRIB = 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 (*_glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) FP_ATTRIB = 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 (*_glVertexAttrib1f)(GLuint indx, GLfloat x) FP_ATTRIB = NULL;
-static void (*_glVertexAttrib1fv)(GLuint indx, const GLfloat* values) = NULL;
-static void (*_glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y) FP_ATTRIB = NULL;
-static void (*_glVertexAttrib2fv)(GLuint indx, const GLfloat* values) = NULL;
-static void (*_glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z) FP_ATTRIB = NULL;
-static void (*_glVertexAttrib3fv)(GLuint indx, const GLfloat* values) = NULL;
-static void (*_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) FP_ATTRIB = 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;
-static void (*_glEGLImageTargetTexture2DOES) (GLenum target, GLeglImageOES image) = NULL;
-
-
-#define GLES2_LOAD(sym) { *(&_ ## sym) = (void *) android_dlsym(_libglesv2, #sym); }
-
-static void __attribute__((constructor)) _init_androidglesv2() {
- _libglesv2 = (void *) android_dlopen(getenv("LIBGLESV2") ? getenv("LIBGLESV2") : "libGLESv2.so", RTLD_NOW);
- GLES2_LOAD(glActiveTexture);
- GLES2_LOAD(glAttachShader);
- GLES2_LOAD(glBindAttribLocation);
- GLES2_LOAD(glBindBuffer);
- GLES2_LOAD(glBindFramebuffer);
- GLES2_LOAD(glBindRenderbuffer);
- GLES2_LOAD(glBindTexture);
- GLES2_LOAD(glBlendColor);
- 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(glClearColor);
- GLES2_LOAD(glClearDepthf);
- GLES2_LOAD(glClearStencil);
- GLES2_LOAD(glColorMask);
- GLES2_LOAD(glCompileShader);
- GLES2_LOAD(glCompressedTexImage2D);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/gralloc/gralloc.c
^
|
@@ -84,7 +84,8 @@
if (version == -1) {
if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, (const struct hw_module_t **)&gralloc_hardware_module) == 0) {
#if HAS_GRALLOC1_HEADER
- if ((gralloc1_open(gralloc_hardware_module, &gralloc1_device) == 0) && (gralloc1_device != NULL)) {
+ uint8_t majorVersion = (gralloc_hardware_module->module_api_version >> 8) & 0xFF;
+ if ((majorVersion == 1) && (gralloc1_open(gralloc_hardware_module, &gralloc1_device) == 0) && (gralloc1_device != NULL)) {
// success
gralloc1_init();
version = 1;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/gralloc/libgralloc.pc.in
^
|
@@ -6,6 +6,6 @@
Name: hybris-gralloc
Description: libhybris gralloc library
Version: @VERSION@
-Requires: android-headers
+Requires: @ANDROID_HEADERS_PKGCONFIG@
Libs: -L${libdir} -lgralloc
-Cflags: -I${includedir}
+Cflags: -I${includedir} @ANDROID_HEADERS_CFLAGS@
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/hardware/libhardware.pc.in
^
|
@@ -6,6 +6,6 @@
Name: hybris-hardware
Description: libhybris hardware library
Version: @VERSION@
-Requires: android-headers
+Requires: @ANDROID_HEADERS_PKGCONFIG@
Libs: -L${libdir} -lhardware
-Cflags: -I${includedir}
+Cflags: -I${includedir} @ANDROID_HEADERS_CFLAGS@
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/include/GLES3/gl3.h
^
|
@@ -0,0 +1,1205 @@
+#ifndef __gl3_h_
+#define __gl3_h_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2013-2016 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+/*
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+** http://www.opengl.org/registry/
+**
+** Khronos $Revision: 32749 $ on $Date: 2016-04-28 09:03:03 -0700 (Thu, 28 Apr 2016) $
+*/
+
+#include <GLES3/gl3platform.h>
+
+#ifndef GL_APIENTRYP
+#define GL_APIENTRYP GL_APIENTRY*
+#endif
+
+/* Generated on date 20160428 */
+
+/* Generated C header for:
+ * API: gles2
+ * Profile: common
+ * Versions considered: 2\.[0-9]|3\.0
+ * Versions emitted: .*
+ * Default extensions included: None
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
+
+#ifndef GL_ES_VERSION_2_0
+#define GL_ES_VERSION_2_0 1
+#include <KHR/khrplatform.h>
+typedef khronos_int8_t GLbyte;
+typedef khronos_float_t GLclampf;
+typedef khronos_int32_t GLfixed;
+typedef short GLshort;
+typedef unsigned short GLushort;
+typedef void GLvoid;
+typedef struct __GLsync *GLsync;
+typedef khronos_int64_t GLint64;
+typedef khronos_uint64_t GLuint64;
+typedef unsigned int GLenum;
+typedef unsigned int GLuint;
+typedef char GLchar;
+typedef khronos_float_t GLfloat;
+typedef khronos_ssize_t GLsizeiptr;
+typedef khronos_intptr_t GLintptr;
+typedef unsigned int GLbitfield;
+typedef int GLint;
+typedef unsigned char GLboolean;
+typedef int GLsizei;
+typedef khronos_uint8_t GLubyte;
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#define GL_FALSE 0
+#define GL_TRUE 1
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+#define GL_ZERO 0
+#define GL_ONE 1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA_SATURATE 0x0308
+#define GL_FUNC_ADD 0x8006
+#define GL_BLEND_EQUATION 0x8009
+#define GL_BLEND_EQUATION_RGB 0x8009
+#define GL_BLEND_EQUATION_ALPHA 0x883D
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_BLEND_DST_RGB 0x80C8
+#define GL_BLEND_SRC_RGB 0x80C9
+#define GL_BLEND_DST_ALPHA 0x80CA
+#define GL_BLEND_SRC_ALPHA 0x80CB
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_BLEND_COLOR 0x8005
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+#define GL_STREAM_DRAW 0x88E0
+#define GL_STATIC_DRAW 0x88E4
+#define GL_DYNAMIC_DRAW 0x88E8
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+#define GL_CURRENT_VERTEX_ATTRIB 0x8626
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_FRONT_AND_BACK 0x0408
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_CULL_FACE 0x0B44
+#define GL_BLEND 0x0BE2
+#define GL_DITHER 0x0BD0
+#define GL_STENCIL_TEST 0x0B90
+#define GL_DEPTH_TEST 0x0B71
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_NO_ERROR 0
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_OPERATION 0x0502
+#define GL_OUT_OF_MEMORY 0x0505
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+#define GL_LINE_WIDTH 0x0B21
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_STENCIL_BACK_FUNC 0x8800
+#define GL_STENCIL_BACK_FAIL 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
+#define GL_STENCIL_BACK_REF 0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
+#define GL_VIEWPORT 0x0BA2
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_ALPHA_BITS 0x0D55
+#define GL_DEPTH_BITS 0x0D56
+#define GL_STENCIL_BITS 0x0D57
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+#define GL_GENERATE_MIPMAP_HINT 0x8192
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/include/GLES3/gl31.h
^
|
@@ -0,0 +1,1518 @@
+#ifndef __gl31_h_
+#define __gl31_h_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2013-2016 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+/*
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+** http://www.opengl.org/registry/
+**
+** Khronos $Revision$ on $Date$
+*/
+
+#include <GLES3/gl3platform.h>
+
+#ifndef GL_APIENTRYP
+#define GL_APIENTRYP GL_APIENTRY*
+#endif
+
+/* Generated on date 20160428 */
+
+/* Generated C header for:
+ * API: gles2
+ * Profile: common
+ * Versions considered: 2\.[0-9]|3\.[01]
+ * Versions emitted: .*
+ * Default extensions included: None
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
+
+#ifndef GL_ES_VERSION_2_0
+#define GL_ES_VERSION_2_0 1
+#include <KHR/khrplatform.h>
+typedef khronos_int8_t GLbyte;
+typedef khronos_float_t GLclampf;
+typedef khronos_int32_t GLfixed;
+typedef short GLshort;
+typedef unsigned short GLushort;
+typedef void GLvoid;
+typedef struct __GLsync *GLsync;
+typedef khronos_int64_t GLint64;
+typedef khronos_uint64_t GLuint64;
+typedef unsigned int GLenum;
+typedef unsigned int GLuint;
+typedef char GLchar;
+typedef khronos_float_t GLfloat;
+typedef khronos_ssize_t GLsizeiptr;
+typedef khronos_intptr_t GLintptr;
+typedef unsigned int GLbitfield;
+typedef int GLint;
+typedef unsigned char GLboolean;
+typedef int GLsizei;
+typedef khronos_uint8_t GLubyte;
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#define GL_FALSE 0
+#define GL_TRUE 1
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+#define GL_ZERO 0
+#define GL_ONE 1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA_SATURATE 0x0308
+#define GL_FUNC_ADD 0x8006
+#define GL_BLEND_EQUATION 0x8009
+#define GL_BLEND_EQUATION_RGB 0x8009
+#define GL_BLEND_EQUATION_ALPHA 0x883D
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_BLEND_DST_RGB 0x80C8
+#define GL_BLEND_SRC_RGB 0x80C9
+#define GL_BLEND_DST_ALPHA 0x80CA
+#define GL_BLEND_SRC_ALPHA 0x80CB
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_BLEND_COLOR 0x8005
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+#define GL_STREAM_DRAW 0x88E0
+#define GL_STATIC_DRAW 0x88E4
+#define GL_DYNAMIC_DRAW 0x88E8
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+#define GL_CURRENT_VERTEX_ATTRIB 0x8626
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_FRONT_AND_BACK 0x0408
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_CULL_FACE 0x0B44
+#define GL_BLEND 0x0BE2
+#define GL_DITHER 0x0BD0
+#define GL_STENCIL_TEST 0x0B90
+#define GL_DEPTH_TEST 0x0B71
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_NO_ERROR 0
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_OPERATION 0x0502
+#define GL_OUT_OF_MEMORY 0x0505
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+#define GL_LINE_WIDTH 0x0B21
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_STENCIL_BACK_FUNC 0x8800
+#define GL_STENCIL_BACK_FAIL 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
+#define GL_STENCIL_BACK_REF 0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
+#define GL_VIEWPORT 0x0BA2
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_ALPHA_BITS 0x0D55
+#define GL_DEPTH_BITS 0x0D56
+#define GL_STENCIL_BITS 0x0D57
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+#define GL_GENERATE_MIPMAP_HINT 0x8192
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/include/GLES3/gl32.h
^
|
@@ -0,0 +1,1817 @@
+#ifndef __gl32_h_
+#define __gl32_h_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2013-2016 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+/*
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+** http://www.opengl.org/registry/
+**
+** Khronos $Revision$ on $Date$
+*/
+
+#include <GLES3/gl3platform.h>
+
+#ifndef GL_APIENTRYP
+#define GL_APIENTRYP GL_APIENTRY*
+#endif
+
+/* Generated on date 20160428 */
+
+/* Generated C header for:
+ * API: gles2
+ * Profile: common
+ * Versions considered: 2\.[0-9]|3\.[012]
+ * Versions emitted: .*
+ * Default extensions included: None
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
+
+#ifndef GL_ES_VERSION_2_0
+#define GL_ES_VERSION_2_0 1
+#include <KHR/khrplatform.h>
+typedef khronos_int8_t GLbyte;
+typedef khronos_float_t GLclampf;
+typedef khronos_int32_t GLfixed;
+typedef short GLshort;
+typedef unsigned short GLushort;
+typedef void GLvoid;
+typedef struct __GLsync *GLsync;
+typedef khronos_int64_t GLint64;
+typedef khronos_uint64_t GLuint64;
+typedef unsigned int GLenum;
+typedef unsigned int GLuint;
+typedef char GLchar;
+typedef khronos_float_t GLfloat;
+typedef khronos_ssize_t GLsizeiptr;
+typedef khronos_intptr_t GLintptr;
+typedef unsigned int GLbitfield;
+typedef int GLint;
+typedef unsigned char GLboolean;
+typedef int GLsizei;
+typedef khronos_uint8_t GLubyte;
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#define GL_FALSE 0
+#define GL_TRUE 1
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+#define GL_ZERO 0
+#define GL_ONE 1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA_SATURATE 0x0308
+#define GL_FUNC_ADD 0x8006
+#define GL_BLEND_EQUATION 0x8009
+#define GL_BLEND_EQUATION_RGB 0x8009
+#define GL_BLEND_EQUATION_ALPHA 0x883D
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_BLEND_DST_RGB 0x80C8
+#define GL_BLEND_SRC_RGB 0x80C9
+#define GL_BLEND_DST_ALPHA 0x80CA
+#define GL_BLEND_SRC_ALPHA 0x80CB
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_BLEND_COLOR 0x8005
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+#define GL_STREAM_DRAW 0x88E0
+#define GL_STATIC_DRAW 0x88E4
+#define GL_DYNAMIC_DRAW 0x88E8
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+#define GL_CURRENT_VERTEX_ATTRIB 0x8626
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_FRONT_AND_BACK 0x0408
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_CULL_FACE 0x0B44
+#define GL_BLEND 0x0BE2
+#define GL_DITHER 0x0BD0
+#define GL_STENCIL_TEST 0x0B90
+#define GL_DEPTH_TEST 0x0B71
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_NO_ERROR 0
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_OPERATION 0x0502
+#define GL_OUT_OF_MEMORY 0x0505
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+#define GL_LINE_WIDTH 0x0B21
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_STENCIL_BACK_FUNC 0x8800
+#define GL_STENCIL_BACK_FAIL 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
+#define GL_STENCIL_BACK_REF 0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
+#define GL_VIEWPORT 0x0BA2
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_ALPHA_BITS 0x0D55
+#define GL_DEPTH_BITS 0x0D56
+#define GL_STENCIL_BITS 0x0D57
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+#define GL_GENERATE_MIPMAP_HINT 0x8192
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/include/GLES3/gl3ext.h
^
|
@@ -0,0 +1,24 @@
+#ifndef __gl3ext_h_
+#define __gl3ext_h_
+
+/* $Revision: 17809 $ on $Date:: 2012-05-14 08:03:36 -0700 #$ */
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+/* OpenGL ES 3 Extensions
+ *
+ * After an OES extension's interactions with OpenGl ES 3.0 have been documented,
+ * its tokens and function definitions should be added to this file in a manner
+ * that does not conflict with gl2ext.h or gl3.h.
+ *
+ * Tokens and function definitions for extensions that have become standard
+ * features in OpenGL ES 3.0 will not be added to this file.
+ *
+ * Applications using OpenGL-ES-2-only extensions should include gl2ext.h
+ */
+
+#endif /* __gl3ext_h_ */
+
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/include/GLES3/gl3platform.h
^
|
@@ -0,0 +1,30 @@
+#ifndef __gl3platform_h_
+#define __gl3platform_h_
+
+/* $Revision: 23328 $ on $Date:: 2013-10-02 02:28:28 -0700 #$ */
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+/* Platform-specific types and definitions for OpenGL ES 3.X gl3.h
+ *
+ * Adopters may modify khrplatform.h and this file to suit their platform.
+ * You are encouraged to submit all modifications to the Khronos group so that
+ * they can be included in future versions of this file. Please submit changes
+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
+ * by filing a bug against product "OpenGL-ES" component "Registry".
+ */
+
+#include <KHR/khrplatform.h>
+
+#ifndef GL_APICALL
+#define GL_APICALL KHRONOS_APICALL
+#endif
+
+#ifndef GL_APIENTRY
+#define GL_APIENTRY KHRONOS_APIENTRY
+#endif
+
+#endif /* __gl3platform_h_ */
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/include/Makefile.am
^
|
@@ -18,6 +18,14 @@
GLES2/gl2ext.h \
GLES2/gl2platform.h
+gles3includedir = $(includedir)/GLES3
+gles3include_HEADERS = \
+ GLES3/gl3.h \
+ GLES3/gl31.h \
+ GLES3/gl32.h \
+ GLES3/gl3ext.h \
+ GLES3/gl3platform.h
+
khrincludedir = $(includedir)/KHR
khrinclude_HEADERS = \
KHR/khrplatform.h
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/libsync/sync_test.c
^
|
@@ -60,7 +60,7 @@
pt_info->driver_name, pt_info->status,
ts_sec, ts_usec);
if (!strcmp(pt_info->driver_name, "sw_sync"))
- printf(" val=%d\n", *(uint32_t *)pt_info->driver_data);
+ printf(" val=%u\n", *(uint32_t *)pt_info->driver_data);
else
printf("\n");
}
@@ -94,7 +94,7 @@
sprintf(str, "test_fence%d-%d", i, j);
int fd = sw_sync_fence_create(sync_timeline_fd, str, val);
if (fd < 0) {
- printf("can't create sync pt %d: %s", val, strerror(errno));
+ printf("can't create sync pt %u: %s", val, strerror(errno));
return 1;
}
sync_data[i].fd[j] = fd;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/opencl/opencl.c
^
|
@@ -30,115 +30,12 @@
static void *opencl_handle = NULL;
-/* Platform API */
-static cl_int (*_clGetPlatformIDs)(cl_uint, cl_platform_id *, cl_uint *) = NULL;
-
-static cl_int (*_clGetPlatformInfo)(cl_platform_id, cl_platform_info, size_t, void *, size_t *) = NULL;
-
-/* Device APIs */
-static cl_int (*_clGetDeviceIDs)(cl_platform_id, cl_device_type, cl_uint, cl_device_id *, cl_uint *) = NULL;
-
-static cl_int (*_clGetDeviceInfo)(cl_device_id, cl_device_info, size_t, void *, size_t *) = NULL;
-
-static cl_int (*_clCreateSubDevices)(cl_device_id, const cl_device_partition_property *, cl_uint, cl_device_id *, cl_uint *) = NULL;
-
-static cl_int (*_clRetainDevice)(cl_device_id) = NULL;
-
-static cl_int (*_clReleaseDevice)(cl_device_id) = NULL;
-
-static cl_int (*_clSetDefaultDeviceCommandQueue)(cl_context, cl_device_id, cl_command_queue) = NULL;
-
-static cl_int (*_clGetDeviceAndHostTimer)(cl_device_id, cl_ulong*, cl_ulong*) = NULL;
-
-static cl_int (*_clGetHostTimer)(cl_device_id, cl_ulong *) = NULL;
-
-/* Context APIs */
static cl_context (*_clCreateContext)(const cl_context_properties *, cl_uint, const cl_device_id *, void (CL_CALLBACK *)(const char *, const void *, size_t, void *), void *, cl_int *) = NULL;
static cl_context (*_clCreateContextFromType)(const cl_context_properties *, cl_device_type, void (CL_CALLBACK *)(const char *, const void *, size_t, void *), void *, cl_int *) = NULL;
-static cl_int (*_clRetainContext)(cl_context) = NULL;
-
-static cl_int (*_clReleaseContext)(cl_context) = NULL;
-
-static cl_int (*_clGetContextInfo)(cl_context, cl_context_info, size_t, void *, size_t *) = NULL;
-
-/* Command Queue APIs */
-
-static cl_command_queue (*_clCreateCommandQueueWithProperties)(cl_context, cl_device_id, const cl_queue_properties *, cl_int *) = NULL;
-
-static cl_int (*_clRetainCommandQueue)(cl_command_queue) = NULL;
-
-static cl_int (*_clReleaseCommandQueue)(cl_command_queue) = NULL;
-
-static cl_int (*_clGetCommandQueueInfo)(cl_command_queue, cl_command_queue_info, size_t, void *, size_t *) = NULL;
-
-#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
-#warning CL_USE_DEPRECATED_OPENCL_1_0_APIS is defined. These APIs are unsupported and untested in OpenCL 1.1!
-/*
- * WARNING:
- * This API introduces mutable state into the OpenCL implementation. It has been REMOVED
- * to better facilitate thread safety. The 1.0 API is not thread safe. It is not tested by the
- * OpenCL 1.1 conformance test, and consequently may not work or may not work dependably.
- * It is likely to be non-performant. Use of this API is not advised. Use at your own risk.
- *
- * Software developers previously relying on this API are instructed to set the command queue
- * properties when creating the queue, instead.
- */
-static cl_int clSetCommandQueueProperty(cl_command_queue, cl_command_queue_properties, cl_bool, cl_command_queue_properties *);
-#endif /* CL_USE_DEPRECATED_OPENCL_1_0_APIS */
-
-/* Memory Object APIs */
-static cl_mem (*_clCreateBuffer)(cl_context, cl_mem_flags, size_t, void *, cl_int *) = NULL;
-
-static cl_mem (*_clCreateSubBuffer)(cl_mem, cl_mem_flags, cl_buffer_create_type, const void *, cl_int *) = NULL;
-
-static cl_mem (*_clCreateImage)(cl_context, cl_mem_flags, const cl_image_format *, const cl_image_desc *, void *, cl_int *) = NULL;
-
-static cl_mem (*_clCreatePipe)(cl_context, cl_mem_flags, cl_uint, cl_uint, const cl_pipe_properties *, cl_int *) = NULL;
-
-static cl_int (*_clRetainMemObject)(cl_mem) = NULL;
-
-static cl_int (*_clReleaseMemObject)(cl_mem) = NULL;
-
-static cl_int (*_clGetSupportedImageFormats)(cl_context, cl_mem_flags, cl_mem_object_type, cl_uint, cl_image_format *, cl_uint *) = NULL;
-
-static cl_int (*_clGetMemObjectInfo)(cl_mem, cl_mem_info, size_t, void *, size_t *) = NULL;
-
-static cl_int (*_clGetImageInfo)(cl_mem, cl_image_info, size_t, void *, size_t *) = NULL;
-
-static cl_int (*_clGetPipeInfo)(cl_mem, cl_pipe_info, size_t, void *, size_t *) = NULL;
-
static cl_int (*_clSetMemObjectDestructorCallback)( cl_mem, void (CL_CALLBACK *)(cl_mem, void *), void *) = NULL;
-/* SVM Allocation APIs */
-static void * (*_clSVMAlloc)(cl_context, cl_svm_mem_flags, size_t, cl_uint) = NULL;
-
-static void (*_clSVMFree)(cl_context, void *) = NULL;
-
-/* Sampler APIs */
-
-static cl_sampler (*_clCreateSamplerWithProperties)(cl_context, const cl_sampler_properties *, cl_int *) = NULL;
-
-static cl_int (*_clRetainSampler)(cl_sampler) = NULL;
-
-static cl_int (*_clReleaseSampler)(cl_sampler) = NULL;
-
-static cl_int (*_clGetSamplerInfo)(cl_sampler, cl_sampler_info, size_t, void *, size_t *) = NULL;
-
-/* Program Object APIs */
-static cl_program (*_clCreateProgramWithSource)(cl_context, cl_uint, const char **, const size_t *, cl_int *) = NULL;
-
-static cl_program (*_clCreateProgramWithBinary)(cl_context, cl_uint, const cl_device_id *, const size_t *, const unsigned char **, cl_int *, cl_int *) = NULL;
-
-static cl_program (*_clCreateProgramWithBuiltInKernels)(cl_context, cl_uint, const cl_device_id *, const char *, cl_int *) = NULL;
-
-static cl_program (*_clCreateProgramWithIL)(cl_context, const void*, size_t, cl_int*) = NULL;
-
-static cl_int (*_clRetainProgram)(cl_program) = NULL;
-
-static cl_int (*_clReleaseProgram)(cl_program) = NULL;
-
static cl_int (*_clBuildProgram)(cl_program, cl_uint, const cl_device_id *, const char *, void (CL_CALLBACK *)(cl_program, void *), void *) = NULL;
static cl_int (*_clCompileProgram)(cl_program, cl_uint, const cl_device_id *, const char *, cl_uint, const cl_program *, const char **, void (CL_CALLBACK *)(cl_program, void *), void *) = NULL;
@@ -147,268 +44,23 @@
static cl_int (*_clSetProgramReleaseCallback)(cl_program, void (CL_CALLBACK *)(cl_program, void *), void *) = NULL;
-static cl_int (*_clSetProgramSpecializationConstant)(cl_program, cl_uint, size_t, const void*) = NULL;
-
-
-static cl_int (*_clUnloadPlatformCompiler)(cl_platform_id) = NULL;
-
-static cl_int (*_clGetProgramInfo)(cl_program, cl_program_info, size_t, void *, size_t *) = NULL;
-
-static cl_int (*_clGetProgramBuildInfo)(cl_program, cl_device_id, cl_program_build_info, size_t, void *, size_t *) = NULL;
-
-/* Kernel Object APIs */
-static cl_kernel (*_clCreateKernel)(cl_program, const char *, cl_int *) = NULL;
-
-static cl_int (*_clCreateKernelsInProgram)(cl_program, cl_uint, cl_kernel *, cl_uint *) = NULL;
-
-static cl_kernel (*_clCloneKernel)(cl_kernel, cl_int*) = NULL;
-
-static cl_int (*_clRetainKernel)(cl_kernel) = NULL;
-
-static cl_int (*_clReleaseKernel)(cl_kernel) = NULL;
-
-static cl_int (*_clSetKernelArg)(cl_kernel, cl_uint, size_t, const void *) = NULL;
-
-static cl_int (*_clSetKernelArgSVMPointer)(cl_kernel, cl_uint, const void *) = NULL;
-
-static cl_int (*_clSetKernelExecInfo)(cl_kernel, cl_kernel_exec_info, size_t, const void *) = NULL;
-
-static cl_int (*_clGetKernelInfo)(cl_kernel, cl_kernel_info, size_t, void *, size_t *) = NULL;
-
-static cl_int (*_clGetKernelArgInfo)(cl_kernel, cl_uint, cl_kernel_arg_info, size_t, void *, size_t *) = NULL;
-
-
-static cl_int (*_clGetKernelWorkGroupInfo)(cl_kernel, cl_device_id, cl_kernel_work_group_info, size_t, void *, size_t *) = NULL;
-
-static cl_int (*_clGetKernelSubGroupInfo)(cl_kernel, cl_device_id, cl_kernel_sub_group_info, size_t, const void*, size_t, void*, size_t*) = NULL;
-
-/* Event Object APIs */
-static cl_int (*_clWaitForEvents)(cl_uint, const cl_event *) = NULL;
-
-static cl_int (*_clGetEventInfo)(cl_event, cl_event_info, size_t, void *, size_t *) = NULL;
-
-static cl_event (*_clCreateUserEvent)(cl_context, cl_int *) = NULL;
-
-static cl_int (*_clRetainEvent)(cl_event) = NULL;
-
-static cl_int (*_clReleaseEvent)(cl_event) = NULL;
-
-static cl_int (*_clSetUserEventStatus)(cl_event, cl_int) = NULL;
-
static cl_int (*_clSetEventCallback)( cl_event, cl_int, void (CL_CALLBACK *)(cl_event, cl_int, void *), void *) = NULL;
-/* Profiling APIs */
-static cl_int (*_clGetEventProfilingInfo)(cl_event, cl_profiling_info, size_t, void *, size_t *) = NULL;
-
-/* Flush and Finish APIs */
-static cl_int (*_clFlush)(cl_command_queue) = NULL;
-
-static cl_int (*_clFinish)(cl_command_queue) = NULL;
-
-/* Enqueued Commands APIs */
-static cl_int (*_clEnqueueReadBuffer)(cl_command_queue, cl_mem, cl_bool, size_t, size_t, void *, cl_uint, const cl_event *, cl_event *) = NULL;
-
-static cl_int (*_clEnqueueReadBufferRect)(cl_command_queue, cl_mem, cl_bool, const size_t *, const size_t *, const size_t *, size_t, size_t, size_t, size_t, void *, cl_uint, const cl_event *, cl_event *) = NULL;
-
-static cl_int (*_clEnqueueWriteBuffer)(cl_command_queue, cl_mem, cl_bool, size_t, size_t, const void *, cl_uint, const cl_event *, cl_event *) = NULL;
-
-static cl_int (*_clEnqueueWriteBufferRect)(cl_command_queue, cl_mem, cl_bool, const size_t *, const size_t *, const size_t *, size_t, size_t, size_t, size_t, const void *, cl_uint, const cl_event *, cl_event *) = NULL;
-
-static cl_int (*_clEnqueueFillBuffer)(cl_command_queue, cl_mem, const void *, size_t, size_t, size_t, cl_uint, const cl_event *, cl_event *) = NULL;
-
-static cl_int (*_clEnqueueCopyBuffer)(cl_command_queue, cl_mem, cl_mem, size_t, size_t, size_t, cl_uint, const cl_event *, cl_event *) = NULL;
-
-static cl_int (*_clEnqueueCopyBufferRect)(cl_command_queue, cl_mem, cl_mem, const size_t *, const size_t *, const size_t *, size_t, size_t, size_t, size_t, cl_uint, const cl_event *, cl_event *) = NULL;
-
-static cl_int (*_clEnqueueReadImage)(cl_command_queue, cl_mem, cl_bool, const size_t *, const size_t *, size_t, size_t, void *, cl_uint, const cl_event *, cl_event *) = NULL;
-
-static cl_int (*_clEnqueueWriteImage)(cl_command_queue, cl_mem, cl_bool, const size_t *, const size_t *, size_t, size_t, const void *, cl_uint, const cl_event *, cl_event *) = NULL;
-
-static cl_int (*_clEnqueueFillImage)(cl_command_queue, cl_mem, const void *, const size_t *, const size_t *, cl_uint, const cl_event *, cl_event *) = NULL;
-
-static cl_int (*_clEnqueueCopyImage)(cl_command_queue, cl_mem, cl_mem, const size_t *, const size_t *, const size_t *, cl_uint, const cl_event *, cl_event *) = NULL;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/properties/Makefile.am
^
|
@@ -12,7 +12,7 @@
libandroid_properties_la_CFLAGS += -I$(top_srcdir)/include
libandroid_properties_la_LDFLAGS = \
- $(top_srcdir)/common/libhybris-common.la \
+ $(top_builddir)/common/libhybris-common.la \
-version-info "1":"0":"0"
pkgconfigdir = $(libdir)/pkgconfig
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/properties/hybris_properties.c
^
|
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2018 Jolla Ltd. <franz.haider@jolla.com>
+ * Copyright (c) 2020 UBports foundation <marius@ubports.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,12 +23,18 @@
#include <hybris/common/binding.h>
static void *libcutils = NULL;
+static int own_impl = 0;
// These may point to the libhybris implementation or to the bionic implementation, depending on the linker being used.
static int (*bionic_property_list)(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie) = NULL;
static int (*bionic_property_get)(const char *key, char *value, const char *default_value) = NULL;
static int (*bionic_property_set)(const char *key, const char *value) = NULL;
+// Private implementations as fallback
+extern int my_property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie);
+extern int my_property_get(const char *key, char *value, const char *default_value);
+extern int my_property_set(const char *key, const char *value);
+
static void unload_libcutils(void)
{
if (libcutils) {
@@ -43,7 +50,7 @@
static void ensure_bionic_properties_initialized(void)
{
- if (!libcutils) {
+ if (!libcutils && !own_impl) {
libcutils = android_dlopen("libcutils.so", RTLD_LAZY);
if (libcutils) {
PROPERTY_DLSYM(property_get);
@@ -51,8 +58,8 @@
PROPERTY_DLSYM(property_list);
atexit(unload_libcutils);
} else {
- fprintf(stderr, "failed to load bionic libc.so\n");
- abort();
+ own_impl = 1;
+ fprintf(stderr, "failed to load bionic libc.so, falling back own property implementation\n");
}
}
}
@@ -61,20 +68,28 @@
{
ensure_bionic_properties_initialized();
- return bionic_property_list(propfn, cookie);
+ if (!own_impl)
+ return bionic_property_list(propfn, cookie);
+ else
+ return my_property_list(propfn, cookie);
}
int property_get(const char *key, char *value, const char *default_value)
{
ensure_bionic_properties_initialized();
- return bionic_property_get(key, value, default_value);
+ if (!own_impl)
+ return bionic_property_get(key, value, default_value);
+ else
+ return my_property_get(key, value, default_value);
}
int property_set(const char *key, const char *value)
{
ensure_bionic_properties_initialized();
- return bionic_property_set(key, value);
+ if (!own_impl)
+ return bionic_property_set(key, value);
+ else
+ return my_property_set(key, value);
}
-
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/tests/Makefile.am
^
|
@@ -3,6 +3,7 @@
test_egl \
test_egl_configs \
test_glesv2 \
+ test_glesv3 \
test_sf \
test_sensors \
test_input \
@@ -14,7 +15,6 @@
test_gps \
test_opencl \
test_wifi \
- test_hwc2 \
test_hwcomposer \
test_nfc
@@ -26,11 +26,29 @@
$(top_builddir)/common/libhybris-common.la \
$(top_builddir)/hardware/libhardware.la
-test_egl_SOURCES = test_egl.c
+test_egl_SOURCES = test_egl.cpp
test_egl_CFLAGS = \
-I$(top_srcdir)/include \
$(ANDROID_HEADERS_CFLAGS) \
-I$(top_srcdir)/egl/platforms/common
+test_egl_CXXFLAGS = \
+ -I$(top_srcdir)/include \
+ $(ANDROID_HEADERS_CFLAGS) \
+ -I$(top_srcdir)/common \
+ -I$(top_srcdir)/egl/platforms/common \
+ -I$(top_srcdir)/egl/platforms/hwcomposer \
+ -I$(top_srcdir)/libsync \
+ -std=gnu++11
+if WANT_MESA
+test_egl_CXXFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
+endif
+if HAS_HWCOMPOSER2_HEADERS
+test_egl_CXXFLAGS += \
+ -DHAS_HWCOMPOSER2_HEADERS=1
+else
+test_egl_CXXFLAGS += \
+ -DHAS_HWCOMPOSER2_HEADERS=0
+endif
if WANT_MESA
test_egl_CFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
@@ -47,27 +65,77 @@
$(top_builddir)/common/libhybris-common.la \
$(top_builddir)/egl/libEGL.la
-test_glesv2_SOURCES = test_glesv2.c
-test_glesv2_CFLAGS = \
+test_glesv2_SOURCES = test_glesv2.cpp test_common.cpp
+test_glesv2_CXXFLAGS = \
-I$(top_srcdir)/include \
- $(ANDROID_HEADERS_CFLAGS)
+ $(ANDROID_HEADERS_CFLAGS) \
+ -I$(top_srcdir)/common \
+ -I$(top_srcdir)/egl/platforms/common \
+ -I$(top_srcdir)/egl/platforms/hwcomposer \
+ -I$(top_srcdir)/libsync \
+ -std=gnu++11 \
+ -DUSE_HWCOMPOSER=1
if WANT_MESA
-test_glesv2_CFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
+test_glesv2_CXXFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
endif
test_glesv2_LDADD = \
-lm \
$(top_builddir)/common/libhybris-common.la \
+ $(top_builddir)/egl/platforms/hwcomposer/libhybris-hwcomposerwindow.la \
+ $(top_builddir)/egl/platforms/common/libhybris-eglplatformcommon.la \
$(top_builddir)/egl/libEGL.la \
- $(top_builddir)/glesv2/libGLESv2.la
+ $(top_builddir)/glesv2/libGLESv2.la \
+ $(top_builddir)/libsync/libsync.la
+if HAS_HWCOMPOSER2_HEADERS
+test_glesv2_CXXFLAGS += \
+ -DHAS_HWCOMPOSER2_HEADERS=1
+test_glesv2_LDADD += \
+ $(top_builddir)/hwc2/libhwc2.la
+else
+test_glesv2_CXXFLAGS += \
+ -DHAS_HWCOMPOSER2_HEADERS=0
+endif
-test_hwcomposer_SOURCES = test_hwcomposer.cpp
+test_glesv3_SOURCES = test_glesv3.cpp test_common.cpp
+test_glesv3_CXXFLAGS = \
+ -I$(top_srcdir)/include \
+ $(ANDROID_HEADERS_CFLAGS) \
+ -I$(top_srcdir)/common \
+ -I$(top_srcdir)/egl/platforms/common \
+ -I$(top_srcdir)/egl/platforms/hwcomposer \
+ -I$(top_srcdir)/libsync \
+ -std=gnu++11 \
+ -DUSE_HWCOMPOSER=1
+if WANT_MESA
+test_glesv3_CXXFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
+endif
+test_glesv3_LDADD = \
+ -lm \
+ $(top_builddir)/common/libhybris-common.la \
+ $(top_builddir)/egl/platforms/hwcomposer/libhybris-hwcomposerwindow.la \
+ $(top_builddir)/egl/platforms/common/libhybris-eglplatformcommon.la \
+ $(top_builddir)/egl/libEGL.la \
+ $(top_builddir)/glesv2/libGLESv2.la \
+ $(top_builddir)/libsync/libsync.la
+if HAS_HWCOMPOSER2_HEADERS
+test_glesv3_CXXFLAGS += \
+ -DHAS_HWCOMPOSER2_HEADERS=1
+test_glesv3_LDADD += \
+ $(top_builddir)/hwc2/libhwc2.la
+else
+test_glesv3_CXXFLAGS += \
+ -DHAS_HWCOMPOSER2_HEADERS=0
+endif
+
+test_hwcomposer_SOURCES = test_hwcomposer.cpp test_common.cpp
test_hwcomposer_CXXFLAGS = \
-I$(top_srcdir)/include \
$(ANDROID_HEADERS_CFLAGS) \
-I$(top_srcdir)/common \
-I$(top_srcdir)/egl/platforms/common \
-I$(top_srcdir)/egl/platforms/hwcomposer \
- -I$(top_srcdir)/libsync
+ -I$(top_srcdir)/libsync \
+ -DUSE_HWCOMPOSER=1
if WANT_MESA
test_hwcomposer_CXXFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
@@ -80,6 +148,16 @@
$(top_builddir)/glesv2/libGLESv2.la \
$(top_builddir)/hardware/libhardware.la
+if HAS_HWCOMPOSER2_HEADERS
+test_hwcomposer_CXXFLAGS += \
+ -DHAS_HWCOMPOSER2_HEADERS=1
+test_hwcomposer_LDADD += \
+ $(top_builddir)/hwc2/libhwc2.la
+else
+test_hwcomposer_CXXFLAGS += \
+ -DHAS_HWCOMPOSER2_HEADERS=0
+endif
+
if HAS_ANDROID_4_2_0
test_hwcomposer_LDADD += \
@@ -118,8 +196,8 @@
$(top_builddir)/common/libhybris-common.la \
$(top_builddir)/ui/libui.la
-test_sf_SOURCES = test_sf.c
-test_sf_CFLAGS = \
+test_sf_SOURCES = test_sf.cpp test_common.cpp
+test_sf_CXXFLAGS = \
-I$(top_srcdir)/include \
$(ANDROID_HEADERS_CFLAGS)
test_sf_LDADD = \
@@ -136,10 +214,23 @@
$(top_builddir)/common/libhybris-common.la \
$(top_builddir)/input/libis.la
-test_camera_SOURCES = test_camera.c
-test_camera_CFLAGS = \
+test_camera_SOURCES = test_camera.cpp test_common.cpp
+test_camera_CXXFLAGS = \
-I$(top_srcdir)/include \
- $(ANDROID_HEADERS_CFLAGS)
+ $(ANDROID_HEADERS_CFLAGS) \
+ -I$(top_srcdir)/common \
+ -I$(top_srcdir)/egl/platforms/common \
+ -I$(top_srcdir)/egl/platforms/hwcomposer \
+ -I$(top_srcdir)/libsync \
+ -std=gnu++11
+if HAS_HWCOMPOSER2_HEADERS
+test_camera_CXXFLAGS += \
+ -DHAS_HWCOMPOSER2_HEADERS=1
+else
+test_camera_CXXFLAGS += \
+ -DHAS_HWCOMPOSER2_HEADERS=0
+endif
+if WANT_WAYLAND_EGL
test_camera_LDADD = \
$(top_builddir)/common/libhybris-common.la \
$(top_builddir)/egl/libEGL.la \
@@ -148,10 +239,29 @@
$(top_builddir)/input/libis.la \
$(top_builddir)/egl/platforms/common/libwayland-egl.la \
$(WAYLAND_CLIENT_LIBS)
+else
+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 \
+ $(WAYLAND_EGL_LIBS)
+ $(WAYLAND_CLIENT_LIBS)
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/tests/test_camera.cpp
^
|
@@ -0,0 +1,506 @@
+/*
+ * Copyright (C) 2012 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.
+ *
+ */
+
+#include "config.h"
+
+#include <wayland-client.h>
+#include <wayland-server.h>
+#include <wayland-client-protocol.h>
+#include <wayland-egl.h>
+
+#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 <EGL/egl.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "test_common.h"
+
+int shot_counter = 1;
+int32_t current_zoom_level = 1;
+bool new_camera_frame_available = true;
+
+static GLuint gProgram;
+static GLuint gaPositionHandle, gaTexHandle, gsTextureHandle, gmTexMatrix;
+
+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__);
+
+ 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: %u \n", __PRETTY_FUNCTION__, data_size);
+}
+
+void jpeg_data_cb(void* data, uint32_t data_size, void* context)
+{
+ printf("%s: %u \n", __PRETTY_FUNCTION__, data_size);
+
+ char fn[256];
+ sprintf(fn, "/tmp/shot_%d.jpeg", shot_counter);
+ int fd = open(fn, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+ if(fd < 0)
+ return;
+ TEMP_FAILURE_RETRY(write(fd, data, data_size));
+ close(fd);
+ shot_counter++;
+
+ struct CameraControl* cc = (struct 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(struct 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);
+
+ struct CameraControl* cc = (struct 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);
+ }
+ }
+}
+
+static const char* vertex_shader()
+{
+ return
+ "#extension GL_OES_EGL_image_external : require \n"
+ "attribute vec4 a_position; \n"
+ "attribute vec2 a_texCoord; \n"
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/tests/test_common.cpp
^
|
@@ -0,0 +1,462 @@
+/*
+ * Copyright (C) 2020 Matti Lehtimäki <matti.lehtimaki@gmail.com>
+ * Copyright (C) 2018 TheKit <nekit1000@gmail.com>
+ * Copyright (c) 2012 Carsten Munk <carsten.munk@gmail.com>
+ *
+ * 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 "test_common.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <cutils/log.h>
+#include <sync/sync.h>
+
+#include "test_common.h"
+
+#if USE_HWCOMPOSER
+
+#include "logging.h"
+
+inline static uint32_t interpreted_version(hw_device_t *hwc_device)
+{
+ uint32_t version = hwc_device->version;
+
+ if ((version & 0xffff0000) == 0) {
+ // Assume header version is always 1
+ uint32_t header_version = 1;
+
+ // Legacy version encoding
+ version = (version << 16) | header_version;
+ }
+ return version;
+}
+
+#if HAS_HWCOMPOSER2_HEADERS
+
+hwc2_compat_device_t* hwcDevice;
+
+HWComposer2::HWComposer2(unsigned int width, unsigned int height,
+ unsigned int format, hwc2_compat_display_t* display,
+ hwc2_compat_layer_t *layer)
+ : HWComposer(width, height, format)
+{
+ this->layer = layer;
+ this->hwcDisplay = display;
+}
+
+void HWComposer2::present(HWComposerNativeWindowBuffer *buffer)
+{
+ uint32_t numTypes = 0;
+ uint32_t numRequests = 0;
+
+ hwc2_error_t error = hwc2_compat_display_validate(hwcDisplay, &numTypes,
+ &numRequests);
+
+ if (error != HWC2_ERROR_NONE && error != HWC2_ERROR_HAS_CHANGES) {
+ HYBRIS_ERROR("prepare: validate failed for display %lu: %s (%d)", displayId,
+ to_string(static_cast<HWC2::Error>(error)).c_str(), error);
+ return;
+ }
+
+ if (numTypes || numRequests) {
+ HYBRIS_ERROR("prepare: validate required changes for display %lu: %s (%d)",
+ displayId, to_string(static_cast<HWC2::Error>(error)).c_str(),
+ error);
+ return;
+ }
+
+ error = hwc2_compat_display_accept_changes(hwcDisplay);
+ if (error != HWC2_ERROR_NONE) {
+ HYBRIS_ERROR("prepare: acceptChanges failed: %s",
+ to_string(static_cast<HWC2::Error>(error)).c_str());
+ return;
+ }
+
+ hwc2_compat_display_set_client_target(hwcDisplay, /* slot */0, buffer,
+ getFenceBufferFd(buffer),
+ HAL_DATASPACE_UNKNOWN);
+
+ int presentFence;
+ hwc2_compat_display_present(hwcDisplay, &presentFence);
+
+ if (error != HWC2_ERROR_NONE) {
+ HYBRIS_ERROR("presentAndGetReleaseFences: failed for display %lu: %s (%d)",
+ displayId,
+ to_string(static_cast<HWC2::Error>(error)).c_str(), error);
+ return;
+ }
+
+ hwc2_compat_out_fences_t* fences;
+ error = hwc2_compat_display_get_release_fences(
+ hwcDisplay, &fences);
+
+ if (error != HWC2_ERROR_NONE) {
+ HYBRIS_ERROR("presentAndGetReleaseFences: Failed to get release fences "
+ "for display %lu: %s (%d)",
+ displayId, to_string(static_cast<HWC2::Error>(error)).c_str(),
+ error);
+ return;
+ }
+
+ int fenceFd = hwc2_compat_out_fences_get_fence(fences, layer);
+ if (fenceFd != -1)
+ setFenceBufferFd(buffer, fenceFd);
+
+ hwc2_compat_out_fences_destroy(fences);
+
+ if (lastPresentFence != -1) {
+ sync_wait(lastPresentFence, -1);
+ close(lastPresentFence);
+ }
+ lastPresentFence = presentFence;
+}
+
+void onVsyncReceived(HWC2EventListener* listener, int32_t sequenceId,
+ hwc2_display_t display, int64_t timestamp)
+{
+}
+
+void onHotplugReceived(HWC2EventListener* listener, int32_t sequenceId,
+ hwc2_display_t display, bool connected,
+ bool primaryDisplay)
+{
+ HYBRIS_INFO("onHotplugReceived(%d, %" PRIu64 ", %s, %s)",
+ sequenceId, display,
+ connected ? "connected" : "disconnected",
+ primaryDisplay ? "primary" : "external");
+
+ hwc2_compat_device_on_hotplug(hwcDevice, display, connected);
+}
+
+void onRefreshReceived(HWC2EventListener* listener,
+ int32_t sequenceId, hwc2_display_t display)
+{
+}
+
+HWC2EventListener eventListener = {
+ &onVsyncReceived,
+ &onHotplugReceived,
+ &onRefreshReceived
+};
+
+HWComposer *create_hwcomposer2_window()
+{
+ int composerSequenceId = 0;
+
+ hwcDevice = hwc2_compat_device_new(false);
+ assert(hwcDevice);
+
+ hwc2_compat_device_register_callback(hwcDevice, &eventListener,
+ composerSequenceId);
+
+ hwc2_compat_display_t* hwcDisplay;
+ for (int i = 0; i < 5 * 1000; ++i) {
+ /* Wait at most 5s for hotplug events */
+ if ((hwcDisplay = hwc2_compat_device_get_display_by_id(hwcDevice, 0)))
+ break;
+ usleep(1000);
+ }
+ assert(hwcDisplay);
+
+ hwc2_compat_display_set_power_mode(hwcDisplay, HWC2_POWER_MODE_ON);
+
+ HWC2DisplayConfig* config = hwc2_compat_display_get_active_config(hwcDisplay);
+
+ printf("width: %i height: %i\n", config->width, config->height);
+
+ hwc2_compat_layer_t* layer = hwc2_compat_display_create_layer(hwcDisplay);
+
+ hwc2_compat_layer_set_composition_type(layer, HWC2_COMPOSITION_CLIENT);
+ hwc2_compat_layer_set_blend_mode(layer, HWC2_BLEND_MODE_NONE);
+ hwc2_compat_layer_set_source_crop(layer, 0.0f, 0.0f, config->width,
+ config->height);
+ hwc2_compat_layer_set_display_frame(layer, 0, 0, config->width,
+ config->height);
+ hwc2_compat_layer_set_visible_region(layer, 0, 0, config->width,
+ config->height);
+
+ HWComposer2 *win = new HWComposer2(config->width, config->height,
+ HAL_PIXEL_FORMAT_RGBA_8888, hwcDisplay,
+ layer);
+ return win;
+}
+#endif
+
+// Hwcomposer 1
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/tests/test_common.h
^
|
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2020 Matti Lehtimäki <matti.lehtimaki@gmail.com>
+ * Copyright (C) 2018 TheKit <nekit1000@gmail.com>
+ * Copyright (c) 2012 Carsten Munk <carsten.munk@gmail.com>
+ *
+ * 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 __LIBHYBRIS_TEST_COMMON_H
+#define __LIBHYBRIS_TEST_COMMON_H
+
+#include <EGL/egl.h>
+
+#ifdef GL_ES_VERSION_3_0
+#include <GLES3/gl3.h>
+#include <GLES3/gl3ext.h>
+#else
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#endif
+
+#if USE_HWCOMPOSER
+
+#include <hwcomposer_window.h>
+#if HAS_HWCOMPOSER2_HEADERS
+
+#include <hybris/hwc2/hwc2_compatibility_layer.h>
+#endif
+
+#ifdef __cplusplus
+
+class HWComposer : public HWComposerNativeWindow
+{
+public:
+ HWComposer(unsigned int width, unsigned int height, unsigned int format)
+ : HWComposerNativeWindow(width, height, format)
+ {
+ }
+
+protected:
+ virtual void present(HWComposerNativeWindowBuffer *buffer) = 0;
+};
+
+#if HAS_HWCOMPOSER2_HEADERS
+
+// Hwcomposer 2
+class HWComposer2 : public HWComposer
+{
+private:
+ hwc2_compat_layer_t *layer;
+ hwc2_compat_display_t *hwcDisplay;
+ int lastPresentFence = -1;
+protected:
+ void present(HWComposerNativeWindowBuffer *buffer);
+
+public:
+ HWComposer2(unsigned int width, unsigned int height, unsigned int format,
+ hwc2_compat_display_t *display, hwc2_compat_layer_t *layer);
+};
+
+#endif
+
+#include <hwcomposer_window.h>
+#include <hardware/hardware.h>
+#include <hardware/hwcomposer.h>
+
+// Hwcomposer 1
+class HWComposer1 : public HWComposer
+{
+private:
+ hwc_layer_1_t *fblayer;
+ hwc_composer_device_1_t *hwcdevice;
+ hwc_display_contents_1_t **mlist;
+protected:
+ void present(HWComposerNativeWindowBuffer *buffer);
+
+public:
+ HWComposer1(unsigned int width, unsigned int height, unsigned int format,
+ hwc_composer_device_1_t *device, hwc_display_contents_1_t **mList, hwc_layer_1_t *layer);
+};
+
+HWComposer *create_hwcomposer_window();
+
+#endif
+
+#endif // USE_HWCOMPOSER
+
+GLuint create_program(const char* pVertexSource, const char* pFragmentSource);
+
+#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/tests/test_egl.cpp
^
|
(renamed from libhybris/hybris/tests/test_egl.c)
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/tests/test_glesv2.cpp
^
|
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2012 Carsten Munk <carsten.munk@gmail.com>
+ *
+ * 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 <EGL/egl.h>
+#include <GLES2/gl2.h>
+#include <assert.h>
+#include <stdio.h>
+#include <math.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+#include "test_common.h"
+
+const char vertex_src [] =
+" \
+ attribute vec4 position; \
+ varying mediump vec2 pos; \
+ uniform vec4 offset; \
+ \
+ void main() \
+ { \
+ gl_Position = position + offset; \
+ pos = position.xy; \
+ } \
+";
+
+
+const char fragment_src [] =
+" \
+ varying mediump vec2 pos; \
+ uniform mediump float phase; \
+ \
+ void main() \
+ { \
+ gl_FragColor = vec4( 1., 0.9, 0.7, 1.0 ) * \
+ cos( 30.*sqrt(pos.x*pos.x + 1.5*pos.y*pos.y) \
+ + atan(pos.y,pos.x) - phase ); \
+ } \
+";
+
+
+GLfloat norm_x = 0.0;
+GLfloat norm_y = 0.0;
+GLfloat offset_x = 0.0;
+GLfloat offset_y = 0.0;
+GLfloat p1_pos_x = 0.0;
+GLfloat p1_pos_y = 0.0;
+
+GLint phase_loc;
+GLint offset_loc;
+GLint position_loc;
+
+const float vertexArray[] = {
+ 0.0, 1.0, 0.0,
+ -1., 0.0, 0.0,
+ 0.0, -1.0, 0.0,
+ 1., 0.0, 0.0,
+ 0.0, 1., 0.0
+};
+
+
+int main(int argc, char **argv)
+{
+ EGLDisplay display;
+ EGLConfig ecfg;
+ EGLint num_config;
+ EGLint attr[] = { // some attributes to set up our egl-interface
+ EGL_BUFFER_SIZE, 32,
+ EGL_RENDERABLE_TYPE,
+ EGL_OPENGL_ES2_BIT,
+ EGL_NONE
+ };
+ EGLSurface surface;
+ EGLint ctxattr[] = {
+ EGL_CONTEXT_CLIENT_VERSION, 2,
+ EGL_NONE
+ };
+ EGLContext context;
+
+ EGLBoolean rv;
+
+ HWComposer *win = create_hwcomposer_window();
+
+ if (!win) {
+ printf("Failed to create native window\n");
+ return 1;
+ }
+
+ display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+ assert(eglGetError() == EGL_SUCCESS);
+ assert(display != EGL_NO_DISPLAY);
+
+ rv = eglInitialize(display, 0, 0);
+ assert(eglGetError() == EGL_SUCCESS);
+ assert(rv == EGL_TRUE);
+
+ eglChooseConfig((EGLDisplay) display, attr, &ecfg, 1, &num_config);
+ assert(eglGetError() == EGL_SUCCESS);
+ assert(rv == EGL_TRUE);
+
+ surface = eglCreateWindowSurface((EGLDisplay) display, ecfg,
+ (EGLNativeWindowType) static_cast<ANativeWindow *> (win), NULL);
+ assert(eglGetError() == EGL_SUCCESS);
+ assert(surface != EGL_NO_SURFACE);
+
+ context = eglCreateContext((EGLDisplay) display, ecfg, EGL_NO_CONTEXT, ctxattr);
+ assert(eglGetError() == EGL_SUCCESS);
+ assert(context != EGL_NO_CONTEXT);
+
+ assert(eglMakeCurrent((EGLDisplay) display, surface, surface, context) == EGL_TRUE);
+
+ const char *version = (const char *)glGetString(GL_VERSION);
+ assert(version);
+ printf("%s\n",version);
+
+ GLuint shaderProgram = create_program(vertex_src, fragment_src);
+ glUseProgram ( shaderProgram ); // and select it for usage
+
+ //// now get the locations (kind of handle) of the shaders variables
+ position_loc = glGetAttribLocation ( shaderProgram , "position" );
+ phase_loc = glGetUniformLocation ( shaderProgram , "phase" );
+ offset_loc = glGetUniformLocation ( shaderProgram , "offset" );
+ if ( position_loc < 0 || phase_loc < 0 || offset_loc < 0 ) {
+ return 1;
+ }
+
+ //glViewport ( 0 , 0 , 800, 600); // commented out so it uses the initial window dimensions
+ glClearColor ( 1. , 1. , 1. , 1.); // background color
+ float phase = 0;
+ int frames = -1;
+ if(argc == 2) {
+ frames = atoi(argv[1]);
+ }
+ if(frames < 0) {
+ frames = 30 * 60;
+ }
+
+ int i;
+ for (i = 0; i < frames; ++i) {
+ if(i % 60 == 0) printf("frame:%i\n", i);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glUniform1f ( phase_loc , phase ); // write the value of phase to the shaders phase
+ phase = fmodf ( phase + 0.5f , 2.f * 3.141f ); // and update the local variable
+
+ glUniform4f ( offset_loc , offset_x , offset_y , 0.0 , 0.0 );
+
+ glVertexAttribPointer ( position_loc, 3, GL_FLOAT, GL_FALSE, 0, vertexArray );
+ glEnableVertexAttribArray ( position_loc );
+ glDrawArrays ( GL_TRIANGLE_STRIP, 0, 5 );
+
+ eglSwapBuffers ( (EGLDisplay) display, surface ); // get the rendered buffer to the screen
+ }
+
+ printf("stop\n");
+
+#if 0
+(*egldestroycontext)((EGLDisplay) display, context);
+ printf("destroyed context\n");
+
+ (*egldestroysurface)((EGLDisplay) display, surface);
+ printf("destroyed surface\n");
+ (*eglterminate)((EGLDisplay) display);
+ printf("terminated\n");
+ android_dlclose(baz);
+#endif
+ return 0;
+}
+
+// vim:ts=4:sw=4:noexpandtab
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/tests/test_glesv3.cpp
^
|
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) 2020 Matti Lehtimäki <matti.lehtimaki@gmail.com>
+ * Copyright (c) 2017 Franz-Josef Haider <f_haider@gmx.at>
+ * Copyright (c) 2012 Carsten Munk <carsten.munk@gmail.com>
+ *
+ * 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 <EGL/egl.h>
+#include <GLES3/gl3.h>
+#include <assert.h>
+#include <stdio.h>
+#include <math.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+#include "test_common.h"
+
+const char vertex_src [] =
+"#version 300 es \n"
+"in vec4 position; \n"
+"out mediump vec2 pos; \n"
+"uniform vec4 offset; \n"
+" \n"
+"void main() \n"
+"{ \n"
+" gl_Position = position + offset; \n"
+" gl_Position.x += float(gl_InstanceID) * 0.5; \n"
+" gl_Position.y += float(gl_InstanceID) * 0.5; \n"
+" pos = position.xy; \n"
+"} \n";
+
+const char fragment_src [] =
+"#version 300 es \n"
+"in mediump vec2 pos; \n"
+"uniform mediump float phase; \n"
+"out mediump vec4 fragColor; \n"
+" \n"
+"void main() \n"
+"{ \n"
+" fragColor = vec4( 1., 0.9, 0.7, 1.0 ) * \n"
+" cos( 30.*sqrt(pos.x*pos.x + 1.5*pos.y*pos.y) \n"
+" + atan(pos.y,pos.x) - phase ); \n"
+"} \n";
+
+
+GLfloat norm_x = 0.0;
+GLfloat norm_y = 0.0;
+GLfloat offset_x = -0.5;
+GLfloat offset_y = -0.5;
+GLfloat p1_pos_x = 0.0;
+GLfloat p1_pos_y = 0.0;
+
+GLint phase_loc;
+GLint offset_loc;
+GLint position_loc;
+
+const float vertexArray[] = {
+ 0.0, 0.5, 0.0,
+ -0.5, 0.0, 0.0,
+ 0.0, -0.5, 0.0,
+ 0.5, 0.0, 0.0,
+ 0.0, 0.5, 0.0
+};
+
+int main(int argc, char **argv)
+{
+ EGLDisplay display;
+ EGLConfig ecfg;
+ EGLint num_config;
+ EGLint attr[] = { // some attributes to set up our egl-interface
+ EGL_BUFFER_SIZE, 32,
+ EGL_RENDERABLE_TYPE,
+ EGL_OPENGL_ES3_BIT,
+ EGL_NONE
+ };
+ EGLSurface surface;
+ EGLint ctxattr[] = {
+ EGL_CONTEXT_CLIENT_VERSION, 3,
+ EGL_NONE
+ };
+ EGLContext context;
+
+ EGLBoolean rv;
+
+ HWComposer *win = create_hwcomposer_window();
+
+ if (!win) {
+ printf("Failed to create native window\n");
+ return 1;
+ }
+
+ display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+ assert(eglGetError() == EGL_SUCCESS);
+ assert(display != EGL_NO_DISPLAY);
+
+ rv = eglInitialize(display, 0, 0);
+ assert(eglGetError() == EGL_SUCCESS);
+ assert(rv == EGL_TRUE);
+
+ eglChooseConfig((EGLDisplay) display, attr, &ecfg, 1, &num_config);
+ assert(eglGetError() == EGL_SUCCESS);
+ assert(rv == EGL_TRUE);
+
+ surface = eglCreateWindowSurface((EGLDisplay) display, ecfg,
+ (EGLNativeWindowType) static_cast<ANativeWindow *> (win), NULL);
+ assert(eglGetError() == EGL_SUCCESS);
+ assert(surface != EGL_NO_SURFACE);
+
+ context = eglCreateContext((EGLDisplay) display, ecfg, EGL_NO_CONTEXT, ctxattr);
+ assert(eglGetError() == EGL_SUCCESS);
+ assert(context != EGL_NO_CONTEXT);
+
+ assert(eglMakeCurrent((EGLDisplay) display, surface, surface, context) == EGL_TRUE);
+
+ const char *version = (const char *)glGetString(GL_VERSION);
+ assert(version);
+ printf("%s\n",version);
+
+ GLuint shaderProgram = create_program(vertex_src, fragment_src);
+ glUseProgram(shaderProgram); // and select it for usage
+
+ //// now get the locations (kind of handle) of the shaders variables
+ position_loc = glGetAttribLocation(shaderProgram, "position");
+ phase_loc = glGetUniformLocation(shaderProgram, "phase");
+ offset_loc = glGetUniformLocation(shaderProgram, "offset");
+
+ if (position_loc < 0 || phase_loc < 0 || offset_loc < 0) {
+ return 1;
+ }
+
+ glClearColor (1., 1., 1., 1.); // background color
+ float phase = 0;
+ int frames = -1;
+ if (argc == 2) {
+ frames = atoi(argv[1]);
+ }
+ if (frames < 0) {
+ frames = 30 * 60;
+ }
+
+ int i;
+ for (i = 0; i < frames; ++i) {
+ if (i % 60 == 0) printf("frame:%i\n", i);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glUniform1f(phase_loc, phase); // write the value of phase to the shaders phase
+ phase = fmodf(phase + 0.5f, 2.f * 3.141f); // and update the local variable
+
+ glUniform4f(offset_loc, offset_x, offset_y, 0.0, 0.0);
+
+ glVertexAttribPointer(position_loc, 3, GL_FLOAT, GL_FALSE, 0, vertexArray);
+ glEnableVertexAttribArray(position_loc);
+ glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 5, 3);
+
+ eglSwapBuffers((EGLDisplay) display, surface); // get the rendered buffer to the screen
+ }
+
+ printf("stop\n");
+
+ return 0;
+}
+
+// vim:ts=4:sw=4:noexpandtab
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/tests/test_hwcomposer.cpp
^
|
@@ -26,11 +26,9 @@
#include <stdio.h>
#include <math.h>
#include <stddef.h>
-#include <hwcomposer_window.h>
-#include <hardware/hardware.h>
-#include <hardware/hwcomposer.h>
#include <malloc.h>
-#include <sync/sync.h>
+
+#include "test_common.h"
const char vertex_src [] =
" \
@@ -59,16 +57,6 @@
} \
";
-GLuint load_shader(const char *shader_source, GLenum type)
-{
- GLuint shader = glCreateShader(type);
-
- glShaderSource(shader, 1, &shader_source, NULL);
- glCompileShader(shader);
-
- return shader;
-}
-
GLfloat norm_x = 0.0;
GLfloat norm_y = 0.0;
@@ -89,64 +77,6 @@
0.0, 1., 0.0
};
-
-class HWComposer : public HWComposerNativeWindow
-{
- private:
- hwc_layer_1_t *fblayer;
- hwc_composer_device_1_t *hwcdevice;
- hwc_display_contents_1_t **mlist;
- protected:
- void present(HWComposerNativeWindowBuffer *buffer);
-
- public:
-
- HWComposer(unsigned int width, unsigned int height, unsigned int format, hwc_composer_device_1_t *device, hwc_display_contents_1_t **mList, hwc_layer_1_t *layer);
- void set();
-};
-
-HWComposer::HWComposer(unsigned int width, unsigned int height, unsigned int format, hwc_composer_device_1_t *device, hwc_display_contents_1_t **mList, hwc_layer_1_t *layer) : HWComposerNativeWindow(width, height, format)
-{
- fblayer = layer;
- hwcdevice = device;
- mlist = mList;
-}
-
-void HWComposer::present(HWComposerNativeWindowBuffer *buffer)
-{
- int oldretire = mlist[0]->retireFenceFd;
- mlist[0]->retireFenceFd = -1;
- fblayer->handle = buffer->handle;
- fblayer->acquireFenceFd = getFenceBufferFd(buffer);
- fblayer->releaseFenceFd = -1;
- int err = hwcdevice->prepare(hwcdevice, HWC_NUM_DISPLAY_TYPES, mlist);
- assert(err == 0);
-
- err = hwcdevice->set(hwcdevice, HWC_NUM_DISPLAY_TYPES, mlist);
- // in android surfaceflinger ignores the return value as not all display types may be supported
- setFenceBufferFd(buffer, fblayer->releaseFenceFd);
-
- if (oldretire != -1)
- {
- sync_wait(oldretire, -1);
- close(oldretire);
- }
-}
-
-inline static uint32_t interpreted_version(hw_device_t *hwc_device)
-{
- uint32_t version = hwc_device->version;
-
- if ((version & 0xffff0000) == 0) {
- // Assume header version is always 1
- uint32_t header_version = 1;
-
- // Legacy version encoding
- version = (version << 16) | header_version;
- }
- return version;
-}
-
int main(int argc, char **argv)
{
EGLDisplay display;
@@ -167,134 +97,7 @@
EGLBoolean rv;
- int err;
-
- hw_module_t const* module = NULL;
- err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
- assert(err == 0);
- framebuffer_device_t* fbDev = NULL;
- framebuffer_open(module, &fbDev);
-
- hw_module_t *hwcModule = 0;
- hwc_composer_device_1_t *hwcDevicePtr = 0;
-
- err = hw_get_module(HWC_HARDWARE_MODULE_ID, (const hw_module_t **) &hwcModule);
- assert(err == 0);
-
- err = hwc_open_1(hwcModule, &hwcDevicePtr);
- assert(err == 0);
-
- hw_device_t *hwcDevice = &hwcDevicePtr->common;
-
- uint32_t hwc_version = interpreted_version(hwcDevice);
-
-#ifdef HWC_DEVICE_API_VERSION_1_4
- if (hwc_version == HWC_DEVICE_API_VERSION_1_4) {
- hwcDevicePtr->setPowerMode(hwcDevicePtr, 0, HWC_POWER_MODE_NORMAL);
- } else
-#endif
-#ifdef HWC_DEVICE_API_VERSION_1_5
- if (hwc_version == HWC_DEVICE_API_VERSION_1_5) {
- hwcDevicePtr->setPowerMode(hwcDevicePtr, 0, HWC_POWER_MODE_NORMAL);
- } else
-#endif
- hwcDevicePtr->blank(hwcDevicePtr, 0, 0);
-
- uint32_t configs[5];
- size_t numConfigs = 5;
-
- err = hwcDevicePtr->getDisplayConfigs(hwcDevicePtr, 0, configs, &numConfigs);
- assert (err == 0);
-
- int32_t attr_values[2];
- uint32_t attributes[] = { HWC_DISPLAY_WIDTH, HWC_DISPLAY_HEIGHT, HWC_DISPLAY_NO_ATTRIBUTE };
-
- hwcDevicePtr->getDisplayAttributes(hwcDevicePtr, 0,
- configs[0], attributes, attr_values);
-
- printf("width: %i height: %i\n", attr_values[0], attr_values[1]);
-
- size_t size = sizeof(hwc_display_contents_1_t) + 2 * sizeof(hwc_layer_1_t);
- hwc_display_contents_1_t *list = (hwc_display_contents_1_t *) malloc(size);
- hwc_display_contents_1_t **mList = (hwc_display_contents_1_t **) malloc(HWC_NUM_DISPLAY_TYPES * sizeof(hwc_display_contents_1_t *));
- const hwc_rect_t r = { 0, 0, attr_values[0], attr_values[1] };
-
- int counter = 0;
- for (; counter < HWC_NUM_DISPLAY_TYPES; counter++)
- mList[counter] = NULL;
-
- // Assign the layer list only to the first display,
- // otherwise HWC might freeze if others are disconnected
- mList[0] = list;
-
- hwc_layer_1_t *layer = &list->hwLayers[0];
- memset(layer, 0, sizeof(hwc_layer_1_t));
- layer->compositionType = HWC_FRAMEBUFFER;
- layer->hints = 0;
- layer->flags = 0;
- layer->handle = 0;
- layer->transform = 0;
- layer->blending = HWC_BLENDING_NONE;
-#ifdef HWC_DEVICE_API_VERSION_1_3
- layer->sourceCropf.top = 0.0f;
- layer->sourceCropf.left = 0.0f;
- layer->sourceCropf.bottom = (float) attr_values[1];
- layer->sourceCropf.right = (float) attr_values[0];
-#else
- layer->sourceCrop = r;
-#endif
- layer->displayFrame = r;
- layer->visibleRegionScreen.numRects = 1;
- layer->visibleRegionScreen.rects = &layer->displayFrame;
- layer->acquireFenceFd = -1;
- layer->releaseFenceFd = -1;
-#if (ANDROID_VERSION_MAJOR >= 4) && (ANDROID_VERSION_MINOR >= 3) || (ANDROID_VERSION_MAJOR >= 5)
- // We've observed that qualcomm chipsets enters into compositionType == 6
- // (HWC_BLIT), an undocumented composition type which gives us rendering
- // glitches and warnings in logcat. By setting the planarAlpha to non-
- // opaque, we attempt to force the HWC into using HWC_FRAMEBUFFER for this
- // layer so the HWC_FRAMEBUFFER_TARGET layer actually gets used.
- bool tryToForceGLES = getenv("QPA_HWC_FORCE_GLES") != NULL;
- layer->planeAlpha = tryToForceGLES ? 1 : 255;
-#endif
-#ifdef HWC_DEVICE_API_VERSION_1_5
- layer->surfaceDamage.numRects = 0;
-#endif
-
- layer = &list->hwLayers[1];
- memset(layer, 0, sizeof(hwc_layer_1_t));
- layer->compositionType = HWC_FRAMEBUFFER_TARGET;
- layer->hints = 0;
- layer->flags = 0;
- layer->handle = 0;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/tests/test_input.c
^
|
@@ -79,4 +79,5 @@
android_input_stack_stop();
android_input_stack_shutdown();
+ return 0;
}
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/tests/test_media.cpp
^
|
@@ -0,0 +1,299 @@
+/*
+ * 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: Jim Hodapp <jim.hodapp@canonical.com>
+ * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
+ */
+
+#include <hybris/media/media_compatibility_layer.h>
+#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
+
+#include <EGL/egl.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdbool.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "test_common.h"
+
+enum {
+ OK = 0,
+ NO_ERROR = 0,
+};
+
+static float DestWidth = 0.0, DestHeight = 0.0;
+// Actual video dimmensions
+static int Width = 0, Height = 0;
+
+static GLuint gProgram;
+static GLuint gaPositionHandle, gaTexHandle, gsTextureHandle, gmTexMatrix;
+
+static GLfloat positionCoordinates[8];
+
+struct MediaPlayerWrapper *player = NULL;
+
+void calculate_position_coordinates()
+{
+ // Assuming cropping output for now
+ float x = 1, y = 1;
+
+ // Black borders
+ x = (float) (Width / DestWidth);
+ y = (float) (Height / DestHeight);
+
+ // Make the larger side be 1
+ if (x > y) {
+ y /= x;
+ x = 1;
+ } else {
+ x /= y;
+ y = 1;
+ }
+
+ positionCoordinates[0] = -x;
+ positionCoordinates[1] = y;
+ positionCoordinates[2] = -x;
+ positionCoordinates[3] = -y;
+ positionCoordinates[4] = x;
+ positionCoordinates[5] = -y;
+ positionCoordinates[6] = x;
+ positionCoordinates[7] = y;
+}
+
+struct ClientWithSurface
+{
+ struct SfClient* client;
+ struct SfSurface* surface;
+};
+
+struct ClientWithSurface client_with_surface(bool setup_surface_with_egl)
+{
+ struct ClientWithSurface cs;
+
+ cs.client = sf_client_create();
+
+ if (!cs.client) {
+ printf("Problem creating client ... aborting now.");
+ return cs;
+ }
+
+ static const size_t primary_display = 0;
+
+ DestWidth = sf_get_display_width(primary_display);
+ DestHeight = sf_get_display_height(primary_display);
+ printf("Primary display width: %f, height: %f\n", DestWidth, DestHeight);
+
+ SfSurfaceCreationParameters params = {
+ 0,
+ 0,
+ (int)DestWidth,
+ (int)DestHeight,
+ -1, //PIXEL_FORMAT_RGBA_8888,
+ 15000,
+ 0.5f,
+ setup_surface_with_egl, // Do not associate surface with egl, will be done by camera HAL
+ "MediaCompatLayerTestSurface"
+ };
+
+ cs.surface = sf_surface_create(cs.client, ¶ms);
+
+ if (!cs.surface) {
+ printf("Problem creating surface ... aborting now.");
+ return cs;
+ }
+
+ sf_surface_make_current(cs.surface);
+
+ return cs;
+}
+
+static const char *vertex_shader()
+{
+ return
+ "attribute vec4 a_position; \n"
+ "attribute vec2 a_texCoord; \n"
+ "uniform mat4 m_texMatrix; \n"
+ "varying vec2 v_texCoord; \n"
+ "varying float topDown; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_Position = a_position; \n"
+ " v_texCoord = (m_texMatrix * vec4(a_texCoord, 0.0, 1.0)).xy;\n"
+ "} \n";
+}
+
+static const char *fragment_shader()
+{
+ return
+ "#extension GL_OES_EGL_image_external : require \n"
+ "precision mediump float; \n"
+ "varying vec2 v_texCoord; \n"
+ "uniform samplerExternalOES s_texture; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_FragColor = texture2D( s_texture, v_texCoord );\n"
+ "} \n";
+}
+
+static int setup_video_texture(struct ClientWithSurface *cs, GLuint *preview_texture_id)
+{
+ assert(cs != NULL);
+ assert(preview_texture_id != NULL);
+
+ sf_surface_make_current(cs->surface);
+
+ glGenTextures(1, preview_texture_id);
+ glClearColor(0, 0, 0, 0);
+ glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+
+ android_media_set_preview_texture(player, *preview_texture_id);
+
+ return 0;
+}
+
+void set_video_size_cb(int height, int width, void *context)
+{
+ printf("Video height: %d, width: %d\n", height, width);
+ printf("Video dest height: %f, width: %f\n", DestHeight, DestWidth);
+
+ Height = height;
+ Width = width;
+}
+
+void media_prepared_cb(void *context)
+{
+ printf("Media is prepared for playback.\n");
+}
+
+int main(int argc, char **argv)
+{
+ if (argc < 2) {
+ printf("Usage: test_media <video_to_play>\n");
+ return EXIT_FAILURE;
+ }
+
+ player = android_media_new_player();
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/tests/test_recorder.cpp
^
|
@@ -0,0 +1,417 @@
+/*
+ * 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: Jim Hodapp <jim.hodapp@canonical.com>
+ * Guenter Schwann <guenter.schwann@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/media/recorder_compatibility_layer.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/surface_flinger/surface_flinger_compatibility_layer.h>
+
+#include <EGL/egl.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdbool.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "test_common.h"
+
+int shot_counter = 1;
+int32_t current_zoom_level = 1;
+bool new_camera_frame_available = true;
+struct MediaRecorderWrapper *mr = 0;
+GLuint preview_texture_id = 0;
+
+static GLuint gProgram;
+static GLuint gaPositionHandle, gaTexHandle, gsTextureHandle, gmTexMatrix;
+
+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__);
+
+ 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: %u \n", __PRETTY_FUNCTION__, data_size);
+}
+
+void jpeg_data_cb(void* data, uint32_t data_size, void* context)
+{
+ printf("%s: %u \n", __PRETTY_FUNCTION__, data_size);
+ struct CameraControl* cc = (struct 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(struct 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);
+
+ struct CameraControl* cc = (struct CameraControl*) context;
+
+ int ret;
+ switch (event->details.key.key_code) {
+ case ISCL_KEYCODE_VOLUME_UP:
+ printf("Starting video recording\n");
+
+ android_camera_unlock(cc);
+
+ ret = android_recorder_setCamera(mr, cc);
+ if (ret < 0) {
+ printf("android_recorder_setCamera() failed\n");
+ return;
+ }
+ //state initial / idle
+ ret = android_recorder_setAudioSource(mr, ANDROID_AUDIO_SOURCE_CAMCORDER);
+ if (ret < 0) {
+ printf("android_recorder_setAudioSource() failed\n");
+ return;
+ }
+ ret = android_recorder_setVideoSource(mr, ANDROID_VIDEO_SOURCE_CAMERA);
+ if (ret < 0) {
+ printf("android_recorder_setVideoSource() failed\n");
+ return;
+ }
+ //state initialized
+ ret = android_recorder_setOutputFormat(mr, ANDROID_OUTPUT_FORMAT_MPEG_4);
+ if (ret < 0) {
+ printf("android_recorder_setOutputFormat() failed\n");
+ return;
+ }
+ //state DataSourceConfigured
+ ret = android_recorder_setAudioEncoder(mr, ANDROID_AUDIO_ENCODER_AAC);
+ if (ret < 0) {
+ printf("android_recorder_setAudioEncoder() failed\n");
+ return;
+ }
+ ret = android_recorder_setVideoEncoder(mr, ANDROID_VIDEO_ENCODER_H264);
+ if (ret < 0) {
+ printf("android_recorder_setVideoEncoder() failed\n");
+ return;
+ }
+
+ int fd;
+ fd = open("/tmp/test_video_recorder.avi", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
+ if (fd < 0) {
+ printf("Could not open file for video recording\n");
+ printf("FD: %i\n", fd);
+ return;
+ }
+ ret = android_recorder_setOutputFile(mr, fd);
+ if (ret < 0) {
+ printf("android_recorder_setOutputFile() failed\n");
+ return;
+ }
+
+ ret = android_recorder_setVideoSize(mr, 1280, 720);
+ if (ret < 0) {
+ printf("android_recorder_setVideoSize() failed\n");
+ return;
+ }
+ ret = android_recorder_setVideoFrameRate(mr, 30);
+ if (ret < 0) {
+ printf("android_recorder_setVideoFrameRate() failed\n");
+ return;
+ }
+
+ ret = android_recorder_prepare(mr);
+ if (ret < 0) {
+ printf("android_recorder_prepare() failed\n");
+ return;
+ }
+ //state prepared
+ ret = android_recorder_start(mr);
+ if (ret < 0) {
+ printf("android_recorder_start() failed\n");
+ return;
+ }
+ break;
+ case ISCL_KEYCODE_VOLUME_DOWN:
+ printf("Stoping video recording\n");
+ ret = android_recorder_stop(mr);
+
+ printf("Stoping video recording returned\n");
+ if (ret < 0) {
+ printf("android_recorder_stop() failed\n");
+ return;
+ }
+ printf("Stopped video recording\n");
+ ret = android_recorder_reset(mr);
+ if (ret < 0) {
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/tests/test_sf.cpp
^
|
@@ -0,0 +1,180 @@
+/*
+ * 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 <android-config.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <limits.h>
+
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
+#include "test_common.h"
+
+struct SfSurface* sf_surface_create(struct SfClient* client, SfSurfaceCreationParameters* params);
+EGLSurface sf_surface_get_egl_surface(struct SfSurface*);
+void sf_surface_make_current(struct SfSurface* surface);
+
+void sf_surface_move_to(struct SfSurface* surface, int x, int y);
+void sf_surface_set_layer(struct SfSurface* surface, int layer);
+void sf_surface_set_alpha(struct SfSurface* surface, float alpha);
+
+double rotation_increment = 0.01;
+
+/* 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 */
+int setupGraphics()
+{
+ vertex_data = triangle;
+ color_data = color_triangle;
+
+ gProgram = create_program(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 1;
+}
+
+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 += rotation_increment;
+ return;
+}
+
+int main(int argc, char** argv)
+{
+ struct SfClient* sf_client = sf_client_create();
+
+ if (!sf_client) {
+ printf("Problem creating client ... aborting now.");
+ return 1;
+ }
+
+ int x = getenv("X") ? atoi(getenv("X")) : 200;
+ int y = getenv("Y") ? atoi(getenv("Y")) : 200;
+
+ int w = getenv("W") ? atoi(getenv("W")) : 500;
+ int h = getenv("H") ? atoi(getenv("H")) : 500;
+
+ float opacity = getenv("O") ? atof(getenv("O")) : 0.5;
+ rotation_increment = getenv("RI") ? atof(getenv("RI")) : 0.01;
+
+ SfSurfaceCreationParameters params = {
+ x,
+ y,
+ w,
+ h,
+ -1, // PIXEL_FORMAT_RGBA_8888,
+ INT_MAX,
+ opacity,
+ 1,
+ "A test surface"
+ };
+
+ struct SfSurface* sf_surface = sf_surface_create(sf_client, ¶ms);
+
+ if (!sf_surface) {
+ printf("Problem creating surface ... aborting now.");
+ return 1;
+ }
+
+ sf_surface_make_current(sf_surface);
+
+ EGLDisplay disp = sf_client_get_egl_display(sf_client);
+ EGLSurface surface = sf_surface_get_egl_surface(sf_surface);
+
+ setupGraphics();
+
+ printf("Turning off screen\n");
+ sf_blank(0);
+
+ sleep(1);
+
+ printf("Turning on screen\n");
+ sf_unblank(0);
+
+ for (;;) {
+ hw_render(disp, surface);
+ hw_step();
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/hybris/tests/test_wifi.c
^
|
@@ -20,6 +20,7 @@
#include <android-config.h>
+int is_wifi_driver_loaded();
int wifi_load_driver();
int wifi_unload_driver();
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/utils/generate_glesv1/generate_wrappers.py
^
|
@@ -31,7 +31,6 @@
#
import re
-import os
import sys
funcs = []
@@ -45,7 +44,6 @@
'GLfixed eqn[4]': 'GLfixed[4]',
'GLfixed mantissa[16]': 'GLfixed[16]',
'GLint exponent[16]': 'GLint[16]',
- 'GLfloat eqn[4]': 'GLfloat[4]',
'GLvoid **': 'GLvoid **',
'GLfloat *': 'GLfloat *',
'GLfixed *': 'GLfixed *',
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.37.tar.bz2/libhybris/utils/travis-build.sh
^
|
@@ -2,7 +2,7 @@
run_first_stage() {
docker pull ubuntu:16.04
- docker run -i -t -v $PWD:/libhybris ubuntu:16.04 /libhybris/utils/travis-build.sh --second-stage
+ docker run -i -t -v "$PWD":/libhybris ubuntu:16.04 /libhybris/utils/travis-build.sh --second-stage
}
run_second_stage() {
|