From: Hyunjong.park Date: Wed, 15 Oct 2014 04:02:15 +0000 (+0900) Subject: opengl : add new API for the API type of statistics table, and add exception code. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff8071f756f274155d6c3d93dde67f600955daa1;p=sdk%2Ftools%2Fdynamic-analyzer.git opengl : add new API for the API type of statistics table, and add exception code. Signed-off-by: Hyunjong.park Change-Id: I283a22840016910422bff8513e55113d37a5897f --- diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameRateChart.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameRateChart.java index b608cc2..d108407 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameRateChart.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameRateChart.java @@ -91,7 +91,7 @@ public class GLFrameRateChart extends GLChart { } private void checkStartFrameRateTime(double startIndex, List chartDataList) { - if (startIndex != 0) { + if (startIndex != 0 || chartDataList.size() == 0) { return; } int frameRateStartTime = chartDataList.get(0).getChartTime(); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStatisticsDataManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStatisticsDataManager.java index c0631c6..c90762b 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStatisticsDataManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStatisticsDataManager.java @@ -41,8 +41,8 @@ import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStatisticsDataType; 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$ @@ -64,8 +64,8 @@ public class GLStatisticsDataManager { 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()); @@ -79,21 +79,24 @@ public class GLStatisticsDataManager { } public void selectRedundantData() { - List redundantList = GLDataManager.getInstance().getRedundantDBTable() - .select(); + List 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(); } @@ -101,7 +104,8 @@ public class GLStatisticsDataManager { public List getRedundantTableData() { List returnList = new ArrayList(); - for (Map.Entry entry : redundantHsahMap.entrySet()) { + for (Map.Entry entry : redundantHsahMap + .entrySet()) { returnList.add(entry.getValue()); } return returnList; @@ -110,7 +114,8 @@ public class GLStatisticsDataManager { public List getStatisticsTableData() { List returnList = new ArrayList(); LinkedHashMap statisticsHashMap = getStatisticDataFromRedundantHashMap(); - for (Map.Entry entry : statisticsHashMap.entrySet()) { + for (Map.Entry entry : statisticsHashMap + .entrySet()) { returnList.add(entry.getValue()); } return returnList; @@ -118,18 +123,20 @@ public class GLStatisticsDataManager { private LinkedHashMap getStatisticDataFromRedundantHashMap() { LinkedHashMap returnStatisticsHsahMap = new LinkedHashMap(); - for (Map.Entry entry : redundantHsahMap.entrySet()) { + for (Map.Entry 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())); @@ -151,7 +158,7 @@ public class GLStatisticsDataManager { 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$ @@ -160,7 +167,8 @@ public class GLStatisticsDataManager { 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)) { @@ -182,15 +190,18 @@ public class GLStatisticsDataManager { || 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(); }