Loading cmds/bootanimation/Android.mk +2 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ ifeq ($(TARGET_SIMULATOR),true) endif endif LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES LOCAL_SHARED_LIBRARIES := \ libcutils \ libutils \ Loading cmds/bootanimation/BootAnimation.cpp +11 −12 Original line number Diff line number Diff line Loading @@ -14,8 +14,6 @@ * limitations under the License. */ #define LOG_TAG "BootAnimation" #include <stdint.h> #include <sys/types.h> #include <math.h> Loading @@ -35,7 +33,7 @@ #include <ui/DisplayInfo.h> #include <ui/ISurfaceComposer.h> #include <ui/ISurfaceFlingerClient.h> #include <ui/EGLNativeWindowSurface.h> #include <ui/FramebufferNativeWindow.h> #include <core/SkBitmap.h> #include <images/SkImageDecoder.h> Loading Loading @@ -130,12 +128,15 @@ status_t BootAnimation::readyToRun() { return -1; // create the native surface sp<Surface> s = session()->createSurface(getpid(), 0, dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565, ISurfaceComposer::eGPU); sp<SurfaceControl> control = session()->createSurface( getpid(), 0, dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565, ISurfaceComposer::eGPU); session()->openTransaction(); s->setLayer(0x40000000); control->setLayer(0x40000000); session()->closeTransaction(); sp<Surface> s = control->getSurface(); // initialize opengl and egl const EGLint attribs[] = { EGL_RED_SIZE, 5, EGL_GREEN_SIZE, 6, EGL_BLUE_SIZE, 5, EGL_DEPTH_SIZE, 0, EGL_NONE }; Loading @@ -150,9 +151,7 @@ status_t BootAnimation::readyToRun() { eglInitialize(display, 0, 0); eglChooseConfig(display, attribs, &config, 1, &numConfigs); mNativeWindowSurface = new EGLNativeWindowSurface(s); surface = eglCreateWindowSurface(display, config, mNativeWindowSurface.get(), NULL); surface = eglCreateWindowSurface(display, config, s.get(), NULL); context = eglCreateContext(display, config, NULL, NULL); eglQuerySurface(display, surface, EGL_WIDTH, &w); Loading @@ -163,6 +162,7 @@ status_t BootAnimation::readyToRun() { mSurface = surface; mWidth = w; mHeight = h; mFlingerSurfaceControl = control; mFlingerSurface = s; // initialize GL Loading @@ -178,8 +178,8 @@ bool BootAnimation::threadLoop() { eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglDestroyContext(mDisplay, mContext); eglDestroySurface(mDisplay, mSurface); mNativeWindowSurface.clear(); mFlingerSurface.clear(); mFlingerSurfaceControl.clear(); eglTerminate(mDisplay); IPCThreadState::self()->stopProcess(); return r; Loading @@ -200,8 +200,7 @@ bool BootAnimation::android() { const Rect updateRect(xc, yc, xc + mAndroid[0].w, yc + mAndroid[0].h); // draw and update only what we need mNativeWindowSurface->setSwapRectangle(updateRect.left, updateRect.top, updateRect.width(), updateRect.height()); mFlingerSurface->setSwapRectangle(updateRect); glEnable(GL_SCISSOR_TEST); glScissor(updateRect.left, mHeight - updateRect.bottom, updateRect.width(), Loading cmds/bootanimation/BootAnimation.h +1 −2 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ class SkBitmap; namespace android { class AssetManager; class EGLNativeWindowSurface; // --------------------------------------------------------------------------- Loading Loading @@ -68,8 +67,8 @@ private: EGLDisplay mDisplay; EGLDisplay mContext; EGLDisplay mSurface; sp<SurfaceControl> mFlingerSurfaceControl; sp<Surface> mFlingerSurface; sp<EGLNativeWindowSurface> mNativeWindowSurface; }; // --------------------------------------------------------------------------- Loading core/java/android/view/Surface.java +7 −3 Original line number Diff line number Diff line Loading @@ -127,6 +127,8 @@ public class Surface implements Parcelable { @SuppressWarnings("unused") private int mSurface; @SuppressWarnings("unused") private int mSurfaceControl; @SuppressWarnings("unused") private int mSaveCount; @SuppressWarnings("unused") private Canvas mCanvas; Loading Loading @@ -270,7 +272,7 @@ public class Surface implements Parcelable { @Override public String toString() { return "Surface(native-token=" + mSurface + ")"; return "Surface(native-token=" + mSurfaceControl + ")"; } private Surface(Parcel source) throws OutOfResourcesException { Loading Loading @@ -304,7 +306,7 @@ public class Surface implements Parcelable { /* no user serviceable parts here ... */ @Override protected void finalize() throws Throwable { clear(); release(); } private native void init(SurfaceSession s, Loading @@ -312,4 +314,6 @@ public class Surface implements Parcelable { throws OutOfResourcesException; private native void init(Parcel source); private native void release(); } core/jni/Android.mk +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ ifneq ($(USE_CUSTOM_RUNTIME_HEAP_MAX),) LOCAL_CFLAGS += -DCUSTOM_RUNTIME_HEAP_MAX=$(USE_CUSTOM_RUNTIME_HEAP_MAX) endif LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES LOCAL_SRC_FILES:= \ ActivityManager.cpp \ AndroidRuntime.cpp \ Loading Loading
cmds/bootanimation/Android.mk +2 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ ifeq ($(TARGET_SIMULATOR),true) endif endif LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES LOCAL_SHARED_LIBRARIES := \ libcutils \ libutils \ Loading
cmds/bootanimation/BootAnimation.cpp +11 −12 Original line number Diff line number Diff line Loading @@ -14,8 +14,6 @@ * limitations under the License. */ #define LOG_TAG "BootAnimation" #include <stdint.h> #include <sys/types.h> #include <math.h> Loading @@ -35,7 +33,7 @@ #include <ui/DisplayInfo.h> #include <ui/ISurfaceComposer.h> #include <ui/ISurfaceFlingerClient.h> #include <ui/EGLNativeWindowSurface.h> #include <ui/FramebufferNativeWindow.h> #include <core/SkBitmap.h> #include <images/SkImageDecoder.h> Loading Loading @@ -130,12 +128,15 @@ status_t BootAnimation::readyToRun() { return -1; // create the native surface sp<Surface> s = session()->createSurface(getpid(), 0, dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565, ISurfaceComposer::eGPU); sp<SurfaceControl> control = session()->createSurface( getpid(), 0, dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565, ISurfaceComposer::eGPU); session()->openTransaction(); s->setLayer(0x40000000); control->setLayer(0x40000000); session()->closeTransaction(); sp<Surface> s = control->getSurface(); // initialize opengl and egl const EGLint attribs[] = { EGL_RED_SIZE, 5, EGL_GREEN_SIZE, 6, EGL_BLUE_SIZE, 5, EGL_DEPTH_SIZE, 0, EGL_NONE }; Loading @@ -150,9 +151,7 @@ status_t BootAnimation::readyToRun() { eglInitialize(display, 0, 0); eglChooseConfig(display, attribs, &config, 1, &numConfigs); mNativeWindowSurface = new EGLNativeWindowSurface(s); surface = eglCreateWindowSurface(display, config, mNativeWindowSurface.get(), NULL); surface = eglCreateWindowSurface(display, config, s.get(), NULL); context = eglCreateContext(display, config, NULL, NULL); eglQuerySurface(display, surface, EGL_WIDTH, &w); Loading @@ -163,6 +162,7 @@ status_t BootAnimation::readyToRun() { mSurface = surface; mWidth = w; mHeight = h; mFlingerSurfaceControl = control; mFlingerSurface = s; // initialize GL Loading @@ -178,8 +178,8 @@ bool BootAnimation::threadLoop() { eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglDestroyContext(mDisplay, mContext); eglDestroySurface(mDisplay, mSurface); mNativeWindowSurface.clear(); mFlingerSurface.clear(); mFlingerSurfaceControl.clear(); eglTerminate(mDisplay); IPCThreadState::self()->stopProcess(); return r; Loading @@ -200,8 +200,7 @@ bool BootAnimation::android() { const Rect updateRect(xc, yc, xc + mAndroid[0].w, yc + mAndroid[0].h); // draw and update only what we need mNativeWindowSurface->setSwapRectangle(updateRect.left, updateRect.top, updateRect.width(), updateRect.height()); mFlingerSurface->setSwapRectangle(updateRect); glEnable(GL_SCISSOR_TEST); glScissor(updateRect.left, mHeight - updateRect.bottom, updateRect.width(), Loading
cmds/bootanimation/BootAnimation.h +1 −2 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ class SkBitmap; namespace android { class AssetManager; class EGLNativeWindowSurface; // --------------------------------------------------------------------------- Loading Loading @@ -68,8 +67,8 @@ private: EGLDisplay mDisplay; EGLDisplay mContext; EGLDisplay mSurface; sp<SurfaceControl> mFlingerSurfaceControl; sp<Surface> mFlingerSurface; sp<EGLNativeWindowSurface> mNativeWindowSurface; }; // --------------------------------------------------------------------------- Loading
core/java/android/view/Surface.java +7 −3 Original line number Diff line number Diff line Loading @@ -127,6 +127,8 @@ public class Surface implements Parcelable { @SuppressWarnings("unused") private int mSurface; @SuppressWarnings("unused") private int mSurfaceControl; @SuppressWarnings("unused") private int mSaveCount; @SuppressWarnings("unused") private Canvas mCanvas; Loading Loading @@ -270,7 +272,7 @@ public class Surface implements Parcelable { @Override public String toString() { return "Surface(native-token=" + mSurface + ")"; return "Surface(native-token=" + mSurfaceControl + ")"; } private Surface(Parcel source) throws OutOfResourcesException { Loading Loading @@ -304,7 +306,7 @@ public class Surface implements Parcelable { /* no user serviceable parts here ... */ @Override protected void finalize() throws Throwable { clear(); release(); } private native void init(SurfaceSession s, Loading @@ -312,4 +314,6 @@ public class Surface implements Parcelable { throws OutOfResourcesException; private native void init(Parcel source); private native void release(); }
core/jni/Android.mk +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ ifneq ($(USE_CUSTOM_RUNTIME_HEAP_MAX),) LOCAL_CFLAGS += -DCUSTOM_RUNTIME_HEAP_MAX=$(USE_CUSTOM_RUNTIME_HEAP_MAX) endif LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES LOCAL_SRC_FILES:= \ ActivityManager.cpp \ AndroidRuntime.cpp \ Loading