Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b034cbf1 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android Git Automerger
Browse files

am c0fa2a3b: Merge "rework a bit how we manage EGL extensions" into ics-mr1

* commit 'c0fa2a3bce40d52c0f1cccd87f8b0816a6faa6a7':
  rework a bit how we manage EGL extensions
parents 5381517a 7288f914
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -229,14 +229,6 @@ struct ANativeWindowBuffer;
#define EGL_NATIVE_BUFFER_ANDROID               0x3140  /* eglCreateImageKHR target */
#endif

#ifndef EGL_ANDROID_swap_rectangle
#define EGL_ANDROID_swap_rectangle 1
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglSetSwapRectangleANDROID (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSWAPRECTANGLEANDROIDPROC) (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height);
#endif

#ifndef EGL_ANDROID_recordable
#define EGL_ANDROID_recordable 1
#define EGL_RECORDABLE_ANDROID                  0x3142  /* EGLConfig attribute */
+5 −0
Original line number Diff line number Diff line
@@ -49,6 +49,11 @@
#undef NELEM
#define NELEM(x) (sizeof(x)/sizeof(*(x)))


EGLBoolean EGLAPI eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw,
        EGLint left, EGLint top, EGLint width, EGLint height);


// ----------------------------------------------------------------------------
namespace android {
// ----------------------------------------------------------------------------

opengl/libagl2/Android.mk

deleted100644 → 0
+0 −56
Original line number Diff line number Diff line
LOCAL_PATH:= $(call my-dir)

#
# Build the software OpenGL ES library
#

include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
	src/api.cpp \
	src/egl.cpp \
    src/get.cpp \
	src/shader.cpp \
	src/state.cpp \
	src/texture.cpp \
	src/vertex.cpp

LOCAL_C_INCLUDES :=	\
    $(LOCAL_PATH) \
    external/mesa3d/include \
    external/mesa3d/src \
    external/stlport/stlport \
    bionic
    
#LOCAL_CFLAGS += -DLOG_TAG=\"libagl2\"
#LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
#LOCAL_CFLAGS += -fvisibility=hidden
#LOCAL_CFLAGS += -O0 -g -DDEBUG -UNDEBUG
LOCAL_CFLAGS += -O3
LOCAL_STATIC_LIBRARIES := libMesa
LOCAL_SHARED_LIBRARIES := libstlport libcutils libhardware libutils libbcc libdl
LOCAL_LDLIBS := -lpthread

ifeq ($(TARGET_ARCH),arm)
	LOCAL_CFLAGS += -fstrict-aliasing
endif

ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
    LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
endif

# we need to access the private Bionic header <bionic_tls.h>
# on ARM platforms, we need to mirror the ARCH_ARM_HAVE_TLS_REGISTER
# behavior from the bionic Android.mk file
ifeq ($(TARGET_ARCH)-$(ARCH_ARM_HAVE_TLS_REGISTER),arm-true)
    LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
endif
LOCAL_C_INCLUDES += bionic/libc/private

LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
#replace libagl for now
LOCAL_MODULE:= libGLES_android
LOCAL_MODULE_TAGS := eng

## Disable this makefile for now
## include $(BUILD_SHARED_LIBRARY)

opengl/libagl2/README

deleted100644 → 0
+0 −26
Original line number Diff line number Diff line
libAgl2 provides software GL ES 2.0 implementation using Pixelflinger2 in external/mesa3d

To build, enable Android.mk, which builds libGLES_android.so, then replace the one built from libAgl in system/lib/egl.
ES 1.0 functions are not implemented and will cause exit, so do not setprop debug.egl.hw 0 until launcher is loaded.

All functions have little to none error checking.
Not thread safe, Pixelflinger2 uses some static data.

Most shader functions are implemented, however, most Get* functions for shaders/programs/uniforms/attribs are not.
No name system for shaders/programs, just using the pointers as names.

Basic glTexImage2D, glTexSubImage2D, glCopyImage2D and glCopySubImage2D are implemented, with a range of 8/16/24/32bpp formats.
Cube map support is minimal. No mipmapping.
TexParameter is mostly implemented, supports texcoord wrap modes, and only linear for both min and mag, or nearest for both min and mag filtering.
Texture names are implemented, but bad.

Frame buffer and render buffers are not implemented.

Depth and stencil are implemented, but not tested.
Blending seems to work.
Colorbuffer supports RGBA_8888 and RGB_565.

Vertex buffer objects are implemented.
Some GL_TRIANGLES and GL_TRIANGLE_STRIPS modes for glDrawArrays and glDrawElements are implemented, but vertex order is probably wrong so culling is disabled.

Basic apps should work, and some libhwui should work, except for frame buffer operations, which will cause exit.

opengl/libagl2/libagl2.project

deleted100644 → 0
+0 −108
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<CodeLite_Project Name="libagl2" InternalType="Console">
  <Plugins>
    <Plugin Name="qmake">
      <![CDATA[00010001N0005Debug000000000000]]>
    </Plugin>
  </Plugins>
  <Description/>
  <Dependencies/>
  <Dependencies Name="Release"/>
  <VirtualDirectory Name="src">
    <File Name="src/egl.cpp"/>
    <File Name="src/api.cpp"/>
    <File Name="src/gles2context.h"/>
    <File Name="src/shader.cpp"/>
    <File Name="src/vertex.cpp"/>
    <File Name="src/state.cpp"/>
    <File Name="src/texture.cpp"/>
    <File Name="src/get.cpp"/>
  </VirtualDirectory>
  <VirtualDirectory Name="include"/>
  <Settings Type="Executable">
    <Configuration Name="Debug" CompilerType="gnu gcc" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
      <Compiler Options="-g;-m32" Required="yes" PreCompiledHeader="">
        <IncludePath Value="/usr/include/c++/4.4"/>
        <IncludePath Value="/usr/include/c++/4.4/ext"/>
        <IncludePath Value="."/>
        <IncludePath Value="include"/>
        <IncludePath Value="../../../../external/mesa3d/include"/>
        <IncludePath Value="../../../../external/mesa3d/src"/>
        <IncludePath Value="../../../../hardware/libhardware/include"/>
        <IncludePath Value="../../../../system/core/include"/>
        <IncludePath Value="../include"/>
        <IncludePath Value="../../include"/>
        <IncludePath Value="../../../../development/ndk/platforms/android-9/include"/>
        <IncludePath Value="../../../../bionic/libc/include/"/>
        <IncludePath Value="/../../../../development/ndk/platforms/android-5/arch-x86/include"/>
        <IncludePath Value="../../../../bionic/libc/arch-x86/include"/>
        <IncludePath Value="../../../../bionic/libc/kernel/arch-x86"/>
        <IncludePath Value="/../../../../external/kernel-headers/original"/>
        <IncludePath Value="../../../../prebuilt/ndk/android-ndk-r4/platforms/android-8/arch-x86/usr/include"/>
      </Compiler>
      <Linker Options="-m32;-lstdc++" Required="yes"/>
      <ResourceCompiler Options="" Required="no"/>
      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
        <PostConnectCommands/>
        <StartupCommands/>
      </Debugger>
      <PreBuild/>
      <PostBuild/>
      <CustomBuild Enabled="no">
        <RebuildCommand/>
        <CleanCommand/>
        <BuildCommand/>
        <PreprocessFileCommand/>
        <SingleFileCommand/>
        <MakefileGenerationCommand/>
        <ThirdPartyToolName>None</ThirdPartyToolName>
        <WorkingDirectory/>
      </CustomBuild>
      <AdditionalRules>
        <CustomPostBuild/>
        <CustomPreBuild/>
      </AdditionalRules>
    </Configuration>
    <Configuration Name="Release" CompilerType="gnu gcc" DebuggerType="GNU gdb debugger" Type="" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
      <Compiler Options="" Required="yes" PreCompiledHeader="">
        <IncludePath Value="."/>
      </Compiler>
      <Linker Options="-O2" Required="yes"/>
      <ResourceCompiler Options="" Required="no"/>
      <General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release" Command="./$(ProjectName)" CommandArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
      <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
        <PostConnectCommands/>
        <StartupCommands/>
      </Debugger>
      <PreBuild/>
      <PostBuild/>
      <CustomBuild Enabled="no">
        <RebuildCommand/>
        <CleanCommand/>
        <BuildCommand/>
        <PreprocessFileCommand/>
        <SingleFileCommand/>
        <MakefileGenerationCommand/>
        <ThirdPartyToolName>None</ThirdPartyToolName>
        <WorkingDirectory/>
      </CustomBuild>
      <AdditionalRules>
        <CustomPostBuild/>
        <CustomPreBuild/>
      </AdditionalRules>
    </Configuration>
    <GlobalSettings>
      <Compiler Options="">
        <IncludePath Value="."/>
      </Compiler>
      <Linker Options="">
        <LibraryPath Value="."/>
      </Linker>
      <ResourceCompiler Options=""/>
    </GlobalSettings>
  </Settings>
  <Dependencies Name="Debug">
    <Project Name="libMesa"/>
  </Dependencies>
</CodeLite_Project>
Loading