public final class

FramerateMonitor

extends Object
java.lang.Object
   ↳ com.htc.utils.perf.FramerateMonitor

Class Overview

Instance of FramerateMonitor can help to monitor frame rate of several types of animation. It's mainly used to monitor Sense 4.0 animations currently

Summary

Constants
int ID_ANIMATION Animation type ID
int ID_LISTVIEW_FLING Deprecated, do not use it
int ID_LISTVIEW_INTRO Deprecated, do not use it
int ID_LISTVIEW_SCROLL Deprecated, do not use it
int ID_WINDOW_TRANSITION Deprecated, do not use it
int MONITOR_TYPE_GLSURFACEVIEW Monitor type for GLSurfaceview, mainly used in OpenGL views
int MONITOR_TYPE_SURFACEFLINGER Monitor type for SurfaceFlinger, mainly used in 3D animations.
int MONITOR_TYPE_VIEWROOT Monitor type for ViewRoot, mainly used in conventional 2D views
Public Methods
static FramerateMonitor newFramerateMonitor(int monitorType, View view, int animationType, String description)
Animation owners should call this function to get a new instance of FramerateMonitor before start logging.
boolean startLogFps()
Call this function to start frame rate logging.
void stopLogFps()
Stop logging and also output result to device log.
void updateFrame()
Animation owners should never call this API.
static void updateFrameByType(int monitorType)
{@Hide } Animation owners should never call this API.
Protected Methods
void finalize()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int ID_ANIMATION

Animation type ID

Constant Value: 1501 (0x000005dd)

public static final int ID_LISTVIEW_FLING

Deprecated, do not use it

Constant Value: 1003 (0x000003eb)

public static final int ID_LISTVIEW_INTRO

Deprecated, do not use it

Constant Value: 1007 (0x000003ef)

public static final int ID_LISTVIEW_SCROLL

Deprecated, do not use it

Constant Value: 1001 (0x000003e9)

public static final int ID_WINDOW_TRANSITION

Deprecated, do not use it

Constant Value: 1005 (0x000003ed)

public static final int MONITOR_TYPE_GLSURFACEVIEW

Monitor type for GLSurfaceview, mainly used in OpenGL views

Constant Value: 3 (0x00000003)

public static final int MONITOR_TYPE_SURFACEFLINGER

Monitor type for SurfaceFlinger, mainly used in 3D animations. We prefer MONITOR_TYPE_VIEWROOT and MONITOR_TYPE_GLSURFACEVIEW if possible, becuase MONITOR_TYPE_SURFACEFLINGER refers to whole screen update but not only target view.

Constant Value: 2 (0x00000002)

public static final int MONITOR_TYPE_VIEWROOT

Monitor type for ViewRoot, mainly used in conventional 2D views

Constant Value: 1 (0x00000001)

Public Methods

public static FramerateMonitor newFramerateMonitor (int monitorType, View view, int animationType, String description)

Animation owners should call this function to get a new instance of FramerateMonitor before start logging. It returns null when parameters are not valid or in non-debug build. So, you should always check nullity before using the returned instance.

Parameters
monitorType One of monitor types scecified in field.
view Target view.
animationType Always use FramerateMonitor.ID_ANIMATION here.
description Information about animation type.
Returns
  • This function returns a new instance of FramerateMonitor or null.

public boolean startLogFps ()

Call this function to start frame rate logging.

Returns
  • True if start logging successfully, false if fail to start logging.

public void stopLogFps ()

Stop logging and also output result to device log.

public void updateFrame ()

Animation owners should never call this API. It's called in framework component to update frame rate of some record, lower level will call timer function to get elapsed time.

public static void updateFrameByType (int monitorType)

{@Hide } Animation owners should never call this API. It's called by framework to update frame rate of all record with specified type, lower level will call timer function to get elapsed time.

Protected Methods

protected void finalize ()

Since: API Level

Throws
Throwable