import org.tizen.dynamicanalyzer.util.Logger;
public class GLStatisticsDataManager {
- private static final String SPLIT = CommonConstants.SPACE + CommonConstants.CMD_SPLIT
- + CommonConstants.SPACE;
+ private static final String SPLIT = CommonConstants.SPACE
+ + CommonConstants.CMD_SPLIT + CommonConstants.SPACE;
private static final String STATE_CHANGE = "State Change";//$NON-NLS-1$
private static final String MATRIX = "Matrix";//$NON-NLS-1$
private static final String TEXTURE = "Texture";//$NON-NLS-1$
if (null == savedHash) {
redundantHsahMap.put(
hashKey,
- new GLRedundantDataType(logData.getApiId(), logData.getArgs(), 1, logData
- .getElapsedTime()));
+ new GLRedundantDataType(logData.getApiId(), logData
+ .getArgs(), 1, logData.getElapsedTime()));
} else {
savedHash.addCallCount();
savedHash.addElapsedTime(logData.getElapsedTime());
}
public void selectRedundantData() {
- List<GLRedundantDataType> redundantList = GLDataManager.getInstance().getRedundantDBTable()
- .select();
+ List<GLRedundantDataType> redundantList = GLDataManager.getInstance()
+ .getRedundantDBTable().select();
if (null == redundantList) {
return;
}
for (GLRedundantDataType data : redundantList) {
- String hashKey = Global.getFunctionName(data.getApiID()) + data.getArgs();
+ String hashKey = Global.getFunctionName(data.getApiID())
+ + data.getArgs();
GLRedundantDataType savedHash = redundantHsahMap.get(hashKey);
if (null == savedHash) {
redundantHsahMap.put(
hashKey,
- new GLRedundantDataType(data.getApiID(), data.getArgs(), data
- .getCallCount(), data.getElapsedTime()));
+ new GLRedundantDataType(data.getApiID(),
+ data.getArgs(), data.getCallCount(), data
+ .getElapsedTime()));
} else {
- savedHash.setCallCount(savedHash.getCallCount() + data.getCallCount());
+ savedHash.setCallCount(savedHash.getCallCount()
+ + data.getCallCount());
}
totalAPICount += data.getCallCount();
}
public List<GLRedundantDataType> getRedundantTableData() {
List<GLRedundantDataType> returnList = new ArrayList<GLRedundantDataType>();
- for (Map.Entry<String, GLRedundantDataType> entry : redundantHsahMap.entrySet()) {
+ for (Map.Entry<String, GLRedundantDataType> entry : redundantHsahMap
+ .entrySet()) {
returnList.add(entry.getValue());
}
return returnList;
public List<GLStatisticsDataType> getStatisticsTableData() {
List<GLStatisticsDataType> returnList = new ArrayList<GLStatisticsDataType>();
LinkedHashMap<String, GLStatisticsDataType> statisticsHashMap = getStatisticDataFromRedundantHashMap();
- for (Map.Entry<String, GLStatisticsDataType> entry : statisticsHashMap.entrySet()) {
+ for (Map.Entry<String, GLStatisticsDataType> entry : statisticsHashMap
+ .entrySet()) {
returnList.add(entry.getValue());
}
return returnList;
private LinkedHashMap<String, GLStatisticsDataType> getStatisticDataFromRedundantHashMap() {
LinkedHashMap<String, GLStatisticsDataType> returnStatisticsHsahMap = new LinkedHashMap<String, GLStatisticsDataType>();
- for (Map.Entry<String, GLRedundantDataType> entry : redundantHsahMap.entrySet()) {
+ for (Map.Entry<String, GLRedundantDataType> entry : redundantHsahMap
+ .entrySet()) {
GLRedundantDataType redundantDataType = entry.getValue();
String hashKey = redundantDataType.getAPIName();
- GLStatisticsDataType savedHash = returnStatisticsHsahMap.get(hashKey);
+ GLStatisticsDataType savedHash = returnStatisticsHsahMap
+ .get(hashKey);
if (null == savedHash) {
- returnStatisticsHsahMap.put(
- hashKey,
- new GLStatisticsDataType(redundantDataType.getApiID(), redundantDataType
- .getArgs(), getRate(redundantDataType.getCallCount()),
- redundantDataType.getCallCount(), redundantDataType
- .getElapsedTime(), getAPIType(redundantDataType
- .getAPIName())));
+ returnStatisticsHsahMap.put(hashKey,
+ new GLStatisticsDataType(redundantDataType.getApiID(),
+ redundantDataType.getArgs(),
+ getRate(redundantDataType.getCallCount()),
+ redundantDataType.getCallCount(),
+ redundantDataType.getElapsedTime(),
+ getAPIType(redundantDataType.getAPIName())));
} else {
savedHash.addCallCount(redundantDataType.getCallCount());
savedHash.setRate(getRate(savedHash.getCallCount()));
if (apiName.contains(TEXTURE) || apiName.contains("Tex")) {//$NON-NLS-1$
returnBuffer.append(TEXTURE).append(SPLIT);
}
- if (apiName.contains(BUFFER) || apiName.contains(CLEAR) ) {
+ if (apiName.contains(BUFFER) || apiName.contains(CLEAR)) {
returnBuffer.append(BUFFER).append(SPLIT);
}
if (apiName.contains(GET) || apiName.contains("glHint")) {//$NON-NLS-1$
if (apiName.contains(IS)) {
returnBuffer.append(IS).append(SPLIT);
}
- if (apiName.contains(DRAW) || apiName.contains("glFinish") || apiName.contains("glFlush")) {//$NON-NLS-1$//$NON-NLS-2$
+ if (apiName.contains(DRAW)
+ || apiName.contains("glFinish") || apiName.contains("glFlush")) {//$NON-NLS-1$//$NON-NLS-2$
returnBuffer.append(DRAW).append(SPLIT);
}
if (apiName.contains(DELETE)) {
|| apiName.contains("glScissor") || apiName.contains("glViewport")) {//$NON-NLS-1$//$NON-NLS-2$
returnBuffer.append(STATE_CHANGE).append(SPLIT);
}
- if (apiName.contains(EVAS_GL)) {
+ if (apiName.contains(EVAS_GL)
+ || apiName.contains("elm_glview_gl_api_get")) {//$NON-NLS-1$
returnBuffer.append(EVAS_GL);
}
if (returnBuffer.length() == 0) {
Logger.error("Not Define API Type of Statistics : " + apiName);
return CommonConstants.EMPTY;
}
- if (returnBuffer.lastIndexOf(SPLIT) == returnBuffer.length() - SPLIT.length()) {
- returnBuffer.delete(returnBuffer.length() - SPLIT.length(), returnBuffer.length());
+ if (returnBuffer.lastIndexOf(SPLIT) == returnBuffer.length()
+ - SPLIT.length()) {
+ returnBuffer.delete(returnBuffer.length() - SPLIT.length(),
+ returnBuffer.length());
}
return returnBuffer.toString();
}