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

Commit 1d7c1ae2 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

surfaceflinger: allow targets to override the electronbeam duration

The Electron beam animation is constrained by the framerate the device
can achieve on GL. On adreno200, and even 205, the original 24 frames
resulted in a fairly smooth animation; on Tegra2, the animation is just
too fast.
From experimentation, I'd say the total number of frames should never be
less than half the attainable framerate (i.e., a half-second animation).

To use this, set TARGET_ELECTRONBEAM_FRAMES to half the desired value
(the default is 12 for a 24-frame animation)

Change-Id: I875b74ee3969ba0c8d38c234f7cb0f4402581ffb
parent 6b3e9b1a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -46,6 +46,10 @@ ifeq ($(BOARD_AVOID_DRAW_TEXTURE_EXTENSION), true)
	LOCAL_CFLAGS += -DAVOID_DRAW_TEXTURE
endif

ifneq ($(TARGET_ELECTRONBEAM_FRAMES),)
	LOCAL_CFLAGS += -DELECTRONBEAM_FRAMES=$(TARGET_ELECTRONBEAM_FRAMES)
endif

# need "-lrt" on Linux simulator to pick up clock_gettime
ifeq ($(TARGET_SIMULATOR),true)
	ifeq ($(HOST_OS),linux)
+6 −2
Original line number Diff line number Diff line
@@ -1708,6 +1708,10 @@ status_t SurfaceFlinger::renderScreenToTextureLocked(DisplayID dpy,

// ---------------------------------------------------------------------------

#ifndef ELECTRONBEAM_FRAMES
 #define ELECTRONBEAM_FRAMES 12
#endif

status_t SurfaceFlinger::electronBeamOffAnimationImplLocked()
{
    status_t result = PERMISSION_DENIED;
@@ -1790,8 +1794,8 @@ status_t SurfaceFlinger::electronBeamOffAnimationImplLocked()
        }
    };

    // the full animation is 24 frames
    const int nbFrames = 12;
    // the full animation is 2*ELECTRONBEAM_FRAMES frames
    const int nbFrames = ELECTRONBEAM_FRAMES;
    s_curve_interpolator itr(nbFrames, 7.5f);
    s_curve_interpolator itg(nbFrames, 8.0f);
    s_curve_interpolator itb(nbFrames, 8.5f);