opengl : add new API for the API type of statistics table, and add exception code. 28/28728/1
authorHyunjong.park <phjwithyou.park@samsung.com>
Wed, 15 Oct 2014 04:02:15 +0000 (13:02 +0900)
committerHyunjong.park <phjwithyou.park@samsung.com>
Wed, 15 Oct 2014 04:05:55 +0000 (13:05 +0900)
Signed-off-by: Hyunjong.park <phjwithyou.park@samsung.com>
Change-Id: I283a22840016910422bff8513e55113d37a5897f

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameRateChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStatisticsDataManager.java

index b608cc2..d108407 100644 (file)
@@ -91,7 +91,7 @@ public class GLFrameRateChart extends GLChart {
        }
 
        private void checkStartFrameRateTime(double startIndex, List<GLChartDBType> chartDataList) {
-               if (startIndex != 0) {
+               if (startIndex != 0 || chartDataList.size() == 0) {
                        return;
                }
                int frameRateStartTime = chartDataList.get(0).getChartTime();
index c0631c6..c90762b 100644 (file)
@@ -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<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();
                }
@@ -101,7 +104,8 @@ public class GLStatisticsDataManager {
 
        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;
@@ -110,7 +114,8 @@ public class GLStatisticsDataManager {
        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;
@@ -118,18 +123,20 @@ public class GLStatisticsDataManager {
 
        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()));
@@ -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();
        }