From: Hyunjong,park Date: Fri, 16 May 2014 08:05:48 +0000 (+0900) Subject: OpenGL : data module of OpenGL page was modified to use the DB X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32b85bd783ec1628ff6d2dd2e6946ec4bf4925e6;p=sdk%2Ftools%2Fdynamic-analyzer.git OpenGL : data module of OpenGL page was modified to use the DB and show multi context value Signed-off-by: Hyunjong,park Change-Id: Ic8e582d57b61ec4e4bd79d34c4a43dde9539fc5f --- diff --git a/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/resources/ImageResources.java b/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/resources/ImageResources.java index 77a4510..f55b9b1 100644 --- a/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/resources/ImageResources.java +++ b/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/resources/ImageResources.java @@ -228,7 +228,15 @@ public class ImageResources { public static final Image DYNANMIC_ANALYZER_ICON = getPngImage("64_DA_icon"); //$NON-NLS-1$ public static final Image ABOUT_TIZEN_SDK = getPngImage("about_Tizen_SDK");//$NON-NLS-1$ public static final Image LICENSE_TIZEN_SDK = getPngImage("license_banner");//$NON-NLS-1$ - + + /* OpenGL */ + public static final Image OPEN_GL_PRE_NAVI_HOVER = getPngImage("btn_nav_r_hover"); //$NON-NLS-1$ + public static final Image OPEN_GL_PRE_NAVI_NORMAL = getPngImage("btn_nav_r_normal"); //$NON-NLS-1$ + public static final Image OPEN_GL_PRE_NAVI_PUSH = getPngImage("btn_nav_r_push"); //$NON-NLS-1$ + public static final Image OPEN_GL_NEXT_NAVI_HOVER = getPngImage("btn_nav_f_hover"); //$NON-NLS-1$ + public static final Image OPEN_GL_NEXT_NAVI_NORMAL = getPngImage("btn_nav_f_normal"); //$NON-NLS-1$ + public static final Image OPEN_GL_NEXT_NAVI_PUSH = getPngImage("btn_nav_f_push"); //$NON-NLS-1$ + /* configuration */ public static final Image WELCONE_BANNER_IMAGE = getPngImage("welcome_banner"); //$NON-NLS-1$ public static final Image CONFIGURATION_BANNER_IMAGE = getPngImage("settings_banner"); //$NON-NLS-1$ diff --git a/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/view/DAViewComposite.java b/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/view/DAViewComposite.java index 0a86769..1eebfe1 100755 --- a/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/view/DAViewComposite.java +++ b/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/view/DAViewComposite.java @@ -81,6 +81,9 @@ public abstract class DAViewComposite extends DABaseComposite { contentArea.setLayoutData(data); } + public Canvas getTitleArea(){ + return titleBar; + } public Composite getContentArea() { return contentArea; } diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_f_hover.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_f_hover.png new file mode 100644 index 0000000..5db9701 Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_f_hover.png differ diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_f_normal.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_f_normal.png new file mode 100644 index 0000000..7b5e3e8 Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_f_normal.png differ diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_f_push.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_f_push.png new file mode 100644 index 0000000..f8e23a7 Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_f_push.png differ diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_ff_hover.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_ff_hover.png new file mode 100644 index 0000000..f4ce619 Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_ff_hover.png differ diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_ff_normal.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_ff_normal.png new file mode 100644 index 0000000..f779730 Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_ff_normal.png differ diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_ff_push.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_ff_push.png new file mode 100644 index 0000000..a0f4a11 Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_ff_push.png differ diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_fr_hover.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_fr_hover.png new file mode 100644 index 0000000..d08ba26 Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_fr_hover.png differ diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_fr_normal.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_fr_normal.png new file mode 100644 index 0000000..0e353a6 Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_fr_normal.png differ diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_fr_push.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_fr_push.png new file mode 100644 index 0000000..6b7b148 Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_fr_push.png differ diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_r_hover.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_r_hover.png new file mode 100644 index 0000000..6321c42 Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_r_hover.png differ diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_r_normal.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_r_normal.png new file mode 100644 index 0000000..4ec5276 Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_r_normal.png differ diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_r_push.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_r_push.png new file mode 100644 index 0000000..c30f5fb Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_nav_r_push.png differ diff --git a/org.tizen.dynamicanalyzer.common/src/org/tizen/dynamicanalyzer/constant/CommonConstants.java b/org.tizen.dynamicanalyzer.common/src/org/tizen/dynamicanalyzer/constant/CommonConstants.java index 45288b5..43afc97 100644 --- a/org.tizen.dynamicanalyzer.common/src/org/tizen/dynamicanalyzer/constant/CommonConstants.java +++ b/org.tizen.dynamicanalyzer.common/src/org/tizen/dynamicanalyzer/constant/CommonConstants.java @@ -48,6 +48,8 @@ public class CommonConstants { public static final String UNDERBAR = "_"; //$NON-NLS-1$ public static final String OPEN_BRACKET = "("; //$NON-NLS-1$ public static final String CLOSE_BRACKET = ")"; //$NON-NLS-1$ + public static final String OPEN_CURLY_BRACKET = "{"; //$NON-NLS-1$ + public static final String CLOSE_CURLY_BRACKET = "}"; //$NON-NLS-1$ public static final String OPEN_SQUARE_BRACKET = "["; //$NON-NLS-1$ public static final String CLOSE_SQUARE_BRACKET = "]"; //$NON-NLS-1$ public static final String TILDE = "~"; //$NON-NLS-1$ @@ -62,6 +64,8 @@ public class CommonConstants { public static final String OFF = "off"; //$NON-NLS-1$ public static final String PLUS = "+"; //$NON-NLS-1$ public static final String QUESION_MARK = "?"; //$NON-NLS-1$ + public static final String DISABLE = "DISABLE"; //$NON-NLS-1$ + public static final String ENABLE = "ENABLE"; //$NON-NLS-1$ public static final String EOS = "\0";//$NON-NLS-1$ public static final String HEX_PREFIX = "0x";//$NON-NLS-1$ diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartSeriesItem.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartSeriesItem.java index 48823af..77a5395 100644 --- a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartSeriesItem.java +++ b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartSeriesItem.java @@ -42,11 +42,20 @@ public class DAChartSeriesItem { private Color gradationForegroundColor = null; private Image image = null; private String tooltipText; - + private boolean showTimeInfo = true; + public DAChartSeriesItem(double x, double y) { this.x = x; this.y = y; } + + public DAChartSeriesItem(double x, double y, String tooltipText, + boolean showTimeInfo) { + this.x = x; + this.y = y; + this.tooltipText = tooltipText; + this.showTimeInfo = showTimeInfo; + } public DAChartSeriesItem(double x, double y, String tooltipText) { this.x = x; @@ -62,6 +71,15 @@ public class DAChartSeriesItem { this.tooltipText = tooltipText; } + public DAChartSeriesItem(double x, double y, Color color, + String tooltipText, boolean showTimeInfo) { + this.x = x; + this.y = y; + this.color = color; + this.tooltipText = tooltipText; + this.showTimeInfo = showTimeInfo; + } + public DAChartSeriesItem(double x, double y, Color gradationForegroundColor, Color gradationBackgroundColor, String tooltipText) { @@ -125,6 +143,10 @@ public class DAChartSeriesItem { public Color getGradationForegroundColor() { return gradationForegroundColor; } + + public boolean isShowTimeInfo() { + return showTimeInfo; + } public void setGradationForegroundColor( Color gradationForegroundColor) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/database/DBConstants.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/database/DBConstants.java index e8610ea..b36fe41 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/database/DBConstants.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/database/DBConstants.java @@ -19,6 +19,7 @@ public class DBConstants { public static final int BIGBIG_TEXT_LEN = 16384; // types type constant + public static final String BOOLEAN = "BOOLEAN";//$NON-NLS-1$ public static final String VARCHAR = "VARCHAR";//$NON-NLS-1$ public static final String TEXT = "VARCHAR(" + TEXT_LEN + ")";//$NON-NLS-1$ public static final String BIG_TEXT = "VARCHAR(" + BIG_TEXT_LEN + ")";//$NON-NLS-1$ @@ -26,12 +27,18 @@ public class DBConstants { public static final String INTEGER = "INTEGER";//$NON-NLS-1$ public static final String LONG = "BIGINT";//$NON-NLS-1$ public static final String FLOAT = "DOUBLE"; - + public static final String TEXT_LIB_NAME = "VARCHAR(1024)";//$NON-NLS-1$ + // common column name - public static final String COMMON_COLUMN_RID = "Rid";//$NON-NLS-1$ - public static final String COMMON_COLUMN_ID = "Id";//$NON-NLS-1$ - public static final String COMMON_COLUMN_SEQ = "SeqNumber";//$NON-NLS-1$ - public static final String COMMON_COLUMN_TIME = "Time";//$NON-NLS-1$ - public static final String COMMON_COLUMN_PID = "Pid";//$NON-NLS-1$ - public static final String COMMON_COLUMN_TID = "Tid";//$NON-NLS-1$ + public static final String COMMON_COLUMN_RID = "RID";//$NON-NLS-1$ + public static final String COMMON_COLUMN_ID = "ID";//$NON-NLS-1$ + public static final String COMMON_COLUMN_SEQ = "SEQ";//$NON-NLS-1$ + public static final String COMMON_COLUMN_TIME = "TIME";//$NON-NLS-1$ + public static final String COMMON_COLUMN_PID = "PID";//$NON-NLS-1$ + public static final String COMMON_COLUMN_TID = "TID";//$NON-NLS-1$ + public static final String COMMON_COLUMN_ARG = "ARG";//$NON-NLS-1$ + public static final String COMMON_COLUMN_ERROR = "ERROR";//$NON-NLS-1$ + public static final String COMMON_COLUMN_CALLER_PC_ADDRESS = "CALLER_PC_ADDRESS";//$NON-NLS-1$ + public static final String COMMON_COLUMN_CALLER_LIB_NAME = "LIB_NAME";//$NON-NLS-1$ + } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/database/SqlConnectionManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/database/SqlConnectionManager.java index 5710241..81033dc 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/database/SqlConnectionManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/database/SqlConnectionManager.java @@ -178,9 +178,10 @@ public class SqlConnectionManager { } else { prep.setLong(i + 1, (Long) col); } - } else if (columnType.get(i).equals(DBConstants.FLOAT)) { - if (col == null) { - DA_LOG.error("[ERR] FLOAT column data is null !!"); + } else if (columnType.get(i).equals( + DBConstants.FLOAT)) { + if (col == null) { + DA_LOG.error("[ERR] FLOAT column data is null !!"); isPrepared = false; break; } else { @@ -305,8 +306,11 @@ public class SqlConnectionManager { .contains(DBConstants.VARCHAR)) { rowData.add(rs.getString(i)); } else if (rsMetaData.getColumnTypeName(i) - .contains(DBConstants.FLOAT)) { - rowData.add(new Float(rs.getFloat(i))); + .contains(DBConstants.FLOAT)) { + rowData.add(new Float(rs.getFloat(i))); + } else if (rsMetaData.getColumnTypeName(i) + .contains(DBConstants.BOOLEAN)) { + rowData.add(rs.getBoolean(i)); } else { DA_LOG.error("undefined type : " + rsMetaData.getColumnTypeName(i)); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java index b99b678..e7fc4ef 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java @@ -56,6 +56,7 @@ import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage; import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData; import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit; import org.tizen.dynamicanalyzer.ui.network.data.NetworkDataManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; import org.tizen.dynamicanalyzer.ui.range.RangeDataManager; import org.tizen.dynamicanalyzer.ui.range.RangePage; import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker; @@ -99,8 +100,8 @@ public class OpenTraceHandler extends AbstractHandler { } project.loadSaveFormat(pInfo); - OpenTraceProgressManager.getInstance().openTracePrgressStart( - AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING); +// OpenTraceProgressManager.getInstance().openTracePrgressStart( +// AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING); if (!DACommunicator.isDeviceConnected()) { Display.getDefault().syncExec(new Runnable() { @@ -177,6 +178,7 @@ public class OpenTraceHandler extends AbstractHandler { SqlManager.getInstance().closeConnection(); NetworkDataManager.getInstance().openProcess(); + GLDataManager.getInstance().openProcess(); return null; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/listeners/SummaryMouseDoubleClickListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/listeners/SummaryMouseDoubleClickListener.java index 062c97d..7c70b67 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/listeners/SummaryMouseDoubleClickListener.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/listeners/SummaryMouseDoubleClickListener.java @@ -40,7 +40,7 @@ import org.tizen.dynamicanalyzer.swap.model.data.ThreadData; import org.tizen.dynamicanalyzer.swap.model.data.UIEventData; import org.tizen.dynamicanalyzer.ui.file.FilePage; import org.tizen.dynamicanalyzer.ui.network.NetworkPage; -import org.tizen.dynamicanalyzer.ui.opengl.ui.GLPage; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; import org.tizen.dynamicanalyzer.ui.thread.ThreadPage; import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea; import org.tizen.dynamicanalyzer.ui.userinterface.UIPage; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogInserter.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogInserter.java index f363d6a..d83e9d9 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogInserter.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogInserter.java @@ -102,7 +102,7 @@ public class LogInserter implements Runnable { int logId = logIds.get(i); Logs logs = logPack.getLogs(logId); if (null != logs - && logId == DataChannelConstants.MSG_DATA_RECORD) { + && (logId == DataChannelConstants.MSG_DATA_RECORD || logId == DataChannelConstants.MSG_PROBE_GLES20)) { continue; } if (null != logs) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/GLPageLabels.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/GLPageLabels.java index 524d080..4c9368b 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/GLPageLabels.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/GLPageLabels.java @@ -4,6 +4,7 @@ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: + * Hyunjong Park * Sanghyun Lee * Juyoung Kim * @@ -31,10 +32,10 @@ import org.eclipse.osgi.util.NLS; public class GLPageLabels extends NLS { private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.GLPageLabels"; //$NON-NLS-1$ + /* GL chart view */ public static String GL_CHART_TITLE_FRAME_RATE; public static String GL_CHART_TITLE_FRAME_TIME; - - public static String GL_DETAILS_VIEW_TITLE; + /* GL API List view */ public static String GL_API_LIST_VIEW_TITLE; @@ -48,100 +49,44 @@ public class GLPageLabels extends NLS { public static String GL_API_LIST_VIEW_PID; public static String GL_API_LIST_VIEW_TID; + /* GL detail view */ + public static String GL_DETAILS_VIEW_TITLE; + public static String GL_DETAILS_VIEW_FRAME; + public static String GL_DETAILS_VIEW_ELAPSED_TIME; + public static String GL_DETAILS_VIEW_ELAPSED_TIME_APIS; + public static String GL_DETAILS_VIEW_ELAPSED_TIME_ERROR; + /* GL context view */ public static String GL_CONTEXT_VIEW_TITLE; public static String GL_CONTEXT_VIEW_NAME; - public static String GL_CONTEXT_VIEW_VALUE; - public static String GL_CONTEXT_VIEW_NAVI; + public static String GL_CONTEXT_VIEW_DEFAULT_VALUE; + public static String GL_CONTEXT_VIEW_CURRENT_VALUE; - public static String GL_CONTEXT_V0; - public static String GL_CONTEXT_V1; - public static String GL_CONTEXT_V2; - public static String GL_CONTEXT_V3; - public static String GL_CONTEXT_ENABLED; - public static String GL_CONTEXT_DISABLED; - public static String GL_CONTEXT_ACTIVATED; - public static String GL_CONTEXT_DEACTIVATED; + public static String GL_CONTEXT; + public static String GL_PROGRAM; + public static String GL_SHADER; + public static String GL_VERTEX; + public static String GL_FRAGMENT; + public static String GL_FRAME; + public static String GL_TEXTURE; - public static String GL_CONTEXT_VERTEX_INFO; - public static String GL_CONTEXT_GENERIC_VERTEX_ATTRIBUTE; - public static String GL_CONTEXT_ATTRIBUTES; - public static String GL_CONTEXT_ATTRIBUTE_ARRAYS; - public static String GL_CONTEXT_SIZE; - public static String GL_CONTEXT_TYPE; - public static String GL_CONTEXT_NORMALIZED; - public static String GL_CONTEXT_STRIDE; - public static String GL_CONTEXT_POINTER; - public static String GL_CONTEXT_VERTEX_BUFFER_OBJECT; - public static String GL_CONTEXT_TARGET; - public static String GL_CONTEXT_DATA; - public static String GL_CONTEXT_USAGE; - public static String GL_CONTEXT_TRANSFORMATION; - public static String GL_CONTEXT_VIEWPORT; - public static String GL_CONTEXT_X; - public static String GL_CONTEXT_Y; - public static String GL_CONTEXT_WIDTH; - public static String GL_CONTEXT_HEIGHT; - public static String GL_CONTEXT_DEPTH_RANGE; - public static String GL_CONTEXT_NEAR; - public static String GL_CONTEXT_FAR; - public static String GL_CONTEXT_RASTERIZATION; - public static String GL_CONTEXT_LINE_WIDTH; - public static String GL_CONTEXT_CULLING; - public static String GL_CONTEXT_ORIENTATION; - public static String GL_CONTEXT_MODE; - public static String GL_CONTEXT_POLYGON_OFFSET; - public static String GL_CONTEXT_FACTOR; - public static String GL_CONTEXT_UNITS; - public static String GL_CONTEXT_FRAGMENT_OPERATION; - public static String GL_CONTEXT_SCISSOR; - public static String GL_CONTEXT_STENCIL; - public static String GL_CONTEXT_FRONT; - public static String GL_CONTEXT_FUNCTION; - public static String GL_CONTEXT_REFERENCE; - public static String GL_CONTEXT_MASK; - public static String GL_CONTEXT_STENCIL_TEST_FAIL_ACTION; - public static String GL_CONTEXT_DEPTH_TEST_FAIL_ACTION; - public static String GL_CONTEXT_DEPTH_TEST_PASS_ACTION; - public static String GL_CONTEXT_BACK; - public static String GL_CONTEXT_DEPTH; - public static String GL_CONTEXT_BLENDING; - public static String GL_CONTEXT_SOURCE; - public static String GL_CONTEXT_RGB_FACTOR; - public static String GL_CONTEXT_ALPHA_FACTOR; - public static String GL_CONTEXT_DESTINATION; - public static String GL_CONTEXT_RGB_EQUATION; - public static String GL_CONTEXT_ALPHA_EQUATION; - public static String GL_CONTEXT_BLEND_COLOR; - public static String GL_CONTEXT_DITHER; - public static String GL_CONTEXT_PIXEL; - public static String GL_CONTEXT_PACK_ALIGNMENT; - public static String GL_CONTEXT_UNPACK_ALIGNMENT; - public static String GL_CONTEXT_TEXTURE; - public static String GL_CONTEXT_TEXTURE_UNITS; - public static String GL_CONTEXT_2D_BINDING; - public static String GL_CONTEXT_CUBEMAP_BINDING; - public static String GL_CONTEXT_TEXTURE_OBJECT; - public static String GL_CONTEXT_MAG_FUNCTION; - public static String GL_CONTEXT_MIN_FUNCTION; - public static String GL_CONTEXT_WRAP_MODE_S; - public static String GL_CONTEXT_WRAP_MODE_T; - public static String GL_CONTEXT_MIPMAP_LEVEL; - public static String GL_CONTEXT_FORMAT; - public static String GL_CONTEXT_PROGRAM_OBJ; - public static String GL_CONTEXT_VERTEX_SHADER; - public static String GL_CONTEXT_FRAGMENT_SHADER; - public static String GL_CONTEXT_ATTRIBUTE; - public static String GL_CONTEXT_NAME; - public static String GL_CONTEXT_INDEX; - public static String GL_CONTEXT_UNIFORM; - public static String GL_CONTEXT_VALUE; - public static String GL_CONTEXT_SHADER_OBJECT; - public static String GL_CONTEXT_FRAMEBUFFER_STATE; - public static String GL_CONTEXT_FRAMEBUFER_BINDING; + public static String GL_PROGRAMS_VIEW_TITLE; + public static String GL_STATE_PROGRAM_VIEW_CONTEXT_NAME; + public static String GL_STATE_PROGRAM_VIEW_ID; + public static String GL_STATE_PROGRAM_VIEW_VERTEX_SHADER; + public static String GL_STATE_PROGRAM_VIEW_FRAGMENT_SHADER; + + + public static String GL_TEXTURE_VIEW_TITLE; + public static String GL_TEXTURE_VIEW_CONTEXT_NAME; + public static String GL_TEXTURE_VIEW_CONTEXT_ID; + public static String GL_TEXTURE_VIEW_CONTEXT_TYPE; + public static String GL_TEXTURE_VIEW_CONTEXT_WRAP_S; + public static String GL_TEXTURE_VIEW_CONTEXT_WRAP_T; + public static String GL_TEXTURE_VIEW_CONTEXT_MIN_FILTER; + public static String GL_TEXTURE_VIEW_CONTEXT_MAG_FILTER; static { - // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, GLPageLabels.class); } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/GLPageLabels.properties b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/GLPageLabels.properties index bd447ea..5416ac3 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/GLPageLabels.properties +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/GLPageLabels.properties @@ -1,8 +1,6 @@ GL_CHART_TITLE_FRAME_RATE=Frame Rate GL_CHART_TITLE_FRAME_TIME=Frame Time -GL_DETAILS_VIEW_TITLE=Details - GL_API_LIST_VIEW_TITLE=API List GL_API_LIST_VIEW_SEQ=# GL_API_LIST_VIEW_FRAME=Frame @@ -14,121 +12,37 @@ GL_API_LIST_VIEW_ERROR=Error GL_API_LIST_VIEW_PID=PID GL_API_LIST_VIEW_TID=TID +GL_DETAILS_VIEW_TITLE=Details +GL_DETAILS_VIEW_FRAME=Frame# : +GL_DETAILS_VIEW_ELAPSED_TIME=Elapsed time : +GL_DETAILS_VIEW_ELAPSED_TIME_APIS= API(s) +GL_DETAILS_VIEW_ELAPSED_TIME_ERROR= error(s) + GL_CONTEXT_VIEW_TITLE=Context GL_CONTEXT_VIEW_NAME=Name -GL_CONTEXT_VIEW_VALUE=Value -GL_CONTEXT_VIEW_NAVI=Navigate +GL_CONTEXT_VIEW_DEFAULT_VALUE=Default state +GL_CONTEXT_VIEW_CURRENT_VALUE=Current state + +GL_CONTEXT=context +GL_PROGRAM=program +GL_SHADER=shader +GL_VERTEX=vertex +GL_FRAGMENT=fragment +GL_FRAME=frames +GL_TEXTURE=texture + +GL_PROGRAMS_VIEW_TITLE=Program +GL_STATE_PROGRAM_VIEW_CONTEXT_NAME=Context id +GL_STATE_PROGRAM_VIEW_ID=Id +GL_STATE_PROGRAM_VIEW_VERTEX_SHADER=Vertex shader +GL_STATE_PROGRAM_VIEW_FRAGMENT_SHADER=Fragment shader -GL_CONTEXT_V0=V0 -GL_CONTEXT_V1=V1 -GL_CONTEXT_V2=V2 -GL_CONTEXT_V3=V3 -GL_CONTEXT_ENABLED=Enabled -GL_CONTEXT_DISABLED=Disabled -GL_CONTEXT_ACTIVATED=Activated -GL_CONTEXT_DEACTIVATED=Deactivated - -GL_CONTEXT_VERTEX_INFO=Vertex Info - GL_CONTEXT_GENERIC_VERTEX_ATTRIBUTE=Generic Vertex Attribute -GL_CONTEXT_ATTRIBUTES=Attributes - # index - # v0~ -GL_CONTEXT_ATTRIBUTE_ARRAYS=Attribute Arrays - GL_CONTEXT_SIZE=Size - GL_CONTEXT_TYPE=Type - GL_CONTEXT_NORMALIZED=Normalized - GL_CONTEXT_STRIDE=Stride - GL_CONTEXT_POINTER=Pointer - GL_CONTEXT_VERTEX_BUFFER_OBJECT=Vertex Buffer Object - GL_CONTEXT_TARGET=Target - # Size - GL_CONTEXT_DATA=Data - GL_CONTEXT_USAGE=Usage -GL_CONTEXT_TRANSFORMATION=Transformation - GL_CONTEXT_VIEWPORT=Viewport - GL_CONTEXT_X=X - GL_CONTEXT_Y=Y - GL_CONTEXT_WIDTH=Width - GL_CONTEXT_HEIGHT=Height - GL_CONTEXT_DEPTH_RANGE=Depth Range - GL_CONTEXT_NEAR=Near - GL_CONTEXT_FAR=Far -GL_CONTEXT_RASTERIZATION=Rasterization - GL_CONTEXT_LINE_WIDTH=Line Width - GL_CONTEXT_CULLING=Culling - GL_CONTEXT_ORIENTATION=Orientation - GL_CONTEXT_MODE=Mode - GL_CONTEXT_POLYGON_OFFSET=Polygon Offset - GL_CONTEXT_FACTOR=Factor -GL_CONTEXT_UNITS=Units -GL_CONTEXT_FRAGMENT_OPERATION=Fragment Operation - GL_CONTEXT_SCISSOR=Scissor - # X - # Y - # Width - # Height - GL_CONTEXT_STENCIL=Stencil - GL_CONTEXT_FRONT=Front - GL_CONTEXT_FUNCTION=Function - GL_CONTEXT_REFERENCE=Reference - GL_CONTEXT_MASK=Mask - GL_CONTEXT_STENCIL_TEST_FAIL_ACTION=Stencil Test Fail Action - GL_CONTEXT_DEPTH_TEST_FAIL_ACTION=Depth Test Fail Action - GL_CONTEXT_DEPTH_TEST_PASS_ACTION=Depth Test Pass Action - GL_CONTEXT_BACK=Back - # Function - # Reference - # Mask - # Stencil Test Fail Action - # Depth Test Fail Action - # Depth Test Pass Action - GL_CONTEXT_DEPTH=Depth - # Function - GL_CONTEXT_BLENDING=Blending - GL_CONTEXT_SOURCE=Source - GL_CONTEXT_RGB_FACTOR=RGB Factor - GL_CONTEXT_ALPHA_FACTOR=Alpha Factor - GL_CONTEXT_DESTINATION=Destination - # RGB Factor - # Alpha Factor - GL_CONTEXT_RGB_EQUATION=RGB Equation - GL_CONTEXT_ALPHA_EQUATION=Alpha Equation - GL_CONTEXT_BLEND_COLOR=Blend Color - GL_CONTEXT_DITHER=Dither -GL_CONTEXT_PIXEL=Pixel - GL_CONTEXT_PACK_ALIGNMENT=Pack Alignment - GL_CONTEXT_UNPACK_ALIGNMENT=Unpack Alignment -GL_CONTEXT_TEXTURE=Texture - GL_CONTEXT_TEXTURE_UNITS=Texture Units - GL_CONTEXT_2D_BINDING=2D Binding - GL_CONTEXT_CUBEMAP_BINDING=Cubemap Binding - GL_CONTEXT_TEXTURE_OBJECT=Texture Objects - GL_CONTEXT_MAG_FUNCTION=Mag. Function - GL_CONTEXT_MIN_FUNCTION=Min. Function - GL_CONTEXT_WRAP_MODE_S=Wrap Mode s - GL_CONTEXT_WRAP_MODE_T=Wrap Mode t - GL_CONTEXT_MIPMAP_LEVEL=Mipmap Level - # Target - # Width - # Height - GL_CONTEXT_FORMAT=Format - # Type -GL_CONTEXT_PROGRAM_OBJ=Program Objects - GL_CONTEXT_VERTEX_SHADER=Vertex Shader - GL_CONTEXT_FRAGMENT_SHADER=Fragment Shader - GL_CONTEXT_ATTRIBUTE=Attributes - GL_CONTEXT_NAME=Name - GL_CONTEXT_INDEX=Index - GL_CONTEXT_UNIFORM=Uniforms - # Name - GL_CONTEXT_VALUE=Value -GL_CONTEXT_SHADER_OBJECT=Shader Objects - # Type - # Source -GL_CONTEXT_FRAMEBUFFER_STATE=Framebuffer State - GL_CONTEXT_FRAMEBUFER_BINDING=Framebuffer Binding - - - - \ No newline at end of file +GL_TEXTURE_VIEW_TITLE=Texture +GL_TEXTURE_VIEW_CONTEXT_NAME=Context id +GL_TEXTURE_VIEW_CONTEXT_ID=Id +GL_TEXTURE_VIEW_CONTEXT_TYPE=Type +GL_TEXTURE_VIEW_CONTEXT_WRAP_S=WRAP_S +GL_TEXTURE_VIEW_CONTEXT_WRAP_T=WRAP_T +GL_TEXTURE_VIEW_CONTEXT_MIN_FILTER=MIN_FILTER +GL_TEXTURE_VIEW_CONTEXT_MAG_FILTER=MAG_FILTER \ No newline at end of file diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutKeyBindingHandler.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutKeyBindingHandler.java index 561f0df..b8681d0 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutKeyBindingHandler.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutKeyBindingHandler.java @@ -37,7 +37,7 @@ import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler; import org.tizen.dynamicanalyzer.ui.file.FilePage; import org.tizen.dynamicanalyzer.ui.kernel.KernelPage; import org.tizen.dynamicanalyzer.ui.network.NetworkPage; -import org.tizen.dynamicanalyzer.ui.opengl.ui.GLPage; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; import org.tizen.dynamicanalyzer.ui.range.RangeDataManager; import org.tizen.dynamicanalyzer.ui.range.RangePage; import org.tizen.dynamicanalyzer.ui.summary.SummaryPage; @@ -51,9 +51,9 @@ import org.tizen.dynamicanalyzer.ui.toolbar.opentrace.OpenTraceDialog; import org.tizen.dynamicanalyzer.ui.toolbar.replayEditor.ReplayEditDialog; import org.tizen.dynamicanalyzer.ui.userinterface.UIPage; import org.tizen.dynamicanalyzer.util.CommonUtil; +import org.tizen.dynamicanalyzer.util.DALogger; import org.tizen.dynamicanalyzer.util.WorkbenchUtil; import org.tizen.dynamicanalyzer.utils.AnalyzerUtil; -import org.tizen.dynamicanalyzer.util.DALogger; import org.tizen.dynamicanalyzer.widgets.button.DACustomButton; import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomToggleButton; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java index 0a6e3fc..5465080 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java @@ -30,7 +30,6 @@ import java.util.ArrayList; import java.util.List; import org.tizen.dynamicanalyzer.constant.CommonConstants; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLContextDBEnum; public class DBTableManager { @@ -47,10 +46,8 @@ public class DBTableManager { private static final String TABLE_NAME_PROCESS_INFO = "ProcessInfo";//$NON-NLS-1$ private static final String TABLE_NAME_LIB_OBJ = "LibraryObject";//$NON-NLS-1$ private static final String TABLE_NAME_APINAME = "ApiName";//$NON-NLS-1$ - private static final String TABLE_NAME_GLES20_CONTEXT_DATA = "Gles20ContextData";//$NON-NLS-1$ - private static final String TABLE_NAME_CONTEXT_SWITCH_DATA = "ContextSwitchData";//$NON-NLS-1$ - private static final String TABLE_NAME_FUNCTION_CALL_DATA = "FunctionCallData";//$NON-NLS-1$ - // private static final String TABLE_NAME_GLES20_CAHNGE_INFO = "Gles20ChangeInfo";//$NON-NLS-1$ + // private static final String TABLE_NAME_CONTEXT_SWITCH_DATA = "ContextSwitchData";//$NON-NLS-1$ + // private static final String TABLE_NAME_FUNCTION_CALL_DATA = "FunctionCallData";//$NON-NLS-1$ private static List tableInfos; @@ -65,10 +62,8 @@ public class DBTableManager { public static final int TABLE_INDEX_PROCESS_INFO = 8; public static final int TABLE_INDEX_LIB_OBJ = 9; public static final int TABLE_INDEX_APINAME = 10; - public static final int TABLE_INDEX_GLES20_CONTEXT_DATA = 11; - public static final int TABLE_INDEX_CONTEXT_SWITCH_DATA = 12; - public static final int TABLE_INDEX_FUNCTION_CALL_DATA = 13; - // public static final int TABLE_INDEX_GLES20_CHANGE_INFO = 12; + // public static final int TABLE_INDEX_CONTEXT_SWITCH_DATA = 12; + // public static final int TABLE_INDEX_FUNCTION_CALL_DATA = 13; public static final String EMPTY = CommonConstants.EMPTY; public static final String TEXT = "VARCHAR(256)";//$NON-NLS-1$ @@ -316,56 +311,6 @@ public class DBTableManager { tableInfos.add(apiName); } - { - // gles20 context data table info - GLContextDBEnum[] glContextDBEnum = GLContextDBEnum.values(); - int length = glContextDBEnum.length; - - String[] names = new String[length + 1]; - String[] options = new String[length + 1]; - String[] types = new String[length + 1]; - for (int i = 0; i < length; i++) { - names[i] = glContextDBEnum[i].getcolumnName(); - options[i] = EMPTY; - if (i == GLContextDBEnum.FRAME_INDEX.ordinal()) { - types[i] = INTEGER; - } else if (i == GLContextDBEnum.SHADER_SRC.ordinal()) { - types[i] = "VARCHAR(20000)"; - } else if (i == GLContextDBEnum.SHADER_TYPE.ordinal()) { - types[i] = "VARCHAR(20000)"; - } else if (i == GLContextDBEnum.PROGRAM_ATTRIB_NAME.ordinal()) { - types[i] = "VARCHAR(20000)"; - } else if (i == GLContextDBEnum.PROGRAM_ATTRIB_TYPE.ordinal()) { - types[i] = "VARCHAR(20000)"; - } else if (i == GLContextDBEnum.PROGRAM_UNIFORM_NAME.ordinal()) { - types[i] = "VARCHAR(20000)"; - } else if (i == GLContextDBEnum.PROGRAM_UNIFORM_TYPE.ordinal()) { - types[i] = "VARCHAR(20000)"; - } else if (i == GLContextDBEnum.TEXTURE_OBJ_MIN_FUNC.ordinal()) { - types[i] = "VARCHAR(20000)"; - } else if (i == GLContextDBEnum.TEXTURE_UNIT_2D.ordinal()) { - types[i] = "VARCHAR(2000)"; - } else if (i == GLContextDBEnum.TEXTURE_UNIT_CUBE.ordinal()) { - types[i] = "VARCHAR(2000)"; - } else { - types[i] = TEXT; - } - } - - names[length] = "Seq";//$NON-NLS-1$] - options[length] = NOT_NULL; - types[length] = TEXT; - - DBTableInfo Gles20ContextTableInfo = new DBTableInfo( - TABLE_NAME_GLES20_CONTEXT_DATA, names, options, types); - tableInfos.add(Gles20ContextTableInfo); - - // // gles20 context change info - // DBTableInfo Gles20ChangeInfoTableInfo = new DBTableInfo( - // TABLE_NAME_GLES20_CAHNGE_INFO, names, options, types); - // tableInfos.set(TABLE_INDEX_GLES20_CHANGE_INFO, - // Gles20ChangeInfoTableInfo); - } /* * // context switch data { String[] names = { COMMON_COLUMN_SEQ_NUMBER, * COMMON_COLUMN_PID, COMMON_COLUMN_TID, "CpuNum", diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/SWAPCallStackManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/SWAPCallStackManager.java index 88bd011..164956c 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/SWAPCallStackManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/SWAPCallStackManager.java @@ -355,7 +355,7 @@ public class SWAPCallStackManager extends BaseCallstackManager { probeCallstack.set(size - 1, new CallStackItem( callerCallstackUnit)); } else { - DA_LOG.debug("probe caller is not the same as top of user callstack"); //$NON-NLS-1$ + // DA_LOG.debug("probe caller is not the same as top of user callstack"); //$NON-NLS-1$ } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/GLES20LogData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/GLES20LogData.java index 3898e9f..68accde 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/GLES20LogData.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/GLES20LogData.java @@ -8,7 +8,7 @@ import org.tizen.dynamicanalyzer.constant.CommonConstants; import org.tizen.dynamicanalyzer.swap.model.ByteUtils; public class GLES20LogData extends ProbeCommonData { - long glCurrentContextName = 0; + protected long glCurrentContextName = 0; int apiType = 0; long elapsedTime = 0; String contextValue = ""; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/LogData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/LogData.java index afa5a11..0304b6f 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/LogData.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/LogData.java @@ -47,8 +47,8 @@ public abstract class LogData implements Cloneable { protected int index = 0; int id = -1; - int seq = -1; - long time = 0; + protected int seq = -1; + protected long time = 0; protected String libName = null; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/LogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/LogFormat.java index 13b8004..a46c83f 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/LogFormat.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/LogFormat.java @@ -119,7 +119,7 @@ public class LogFormat { logFormats.add(ThreadLogFormat.getInstance()); logFormats.add(UIEventLogFormat.getInstance()); logFormats.add(UserFunctionLogFormat.getInstance()); - logFormats.add(GLES20LogFormat.getInstance()); + // logFormats.add(GLES20LogFormat.getInstance()); } return logFormats; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/callstack/CallstackTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/callstack/CallstackTable.java index 159ea90..169e159 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/callstack/CallstackTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/callstack/CallstackTable.java @@ -40,6 +40,7 @@ import org.tizen.dynamicanalyzer.common.DASelectionData; import org.tizen.dynamicanalyzer.model.TableInput; import org.tizen.dynamicanalyzer.swap.model.data.LogData; import org.tizen.dynamicanalyzer.ui.file.FilePage; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; import org.tizen.dynamicanalyzer.ui.page.ScreenshotTabComposite; import org.tizen.dynamicanalyzer.ui.range.RangePage; import org.tizen.dynamicanalyzer.ui.summary.SummaryPage; @@ -86,6 +87,11 @@ public class CallstackTable extends DATableComposite { if (null == viewId || viewId.isEmpty() || viewId.equals(FilePage.chartViewID) // || viewId.equals(UIPage.profilingViewID) + || viewId.equals(GLPage.chartViewID) + || viewId.equals(GLPage.contextViewID) + || viewId.equals(GLPage.contextHistoryID) + || viewId.equals(GLPage.programViewID) + || viewId.equals(UIPage.profilingViewID) || viewId.equals(RangePage.profilingViewID) || viewId.equals(SummaryPage.profilingViewID)) { return; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/screenshot/ScreenshotView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/screenshot/ScreenshotView.java index ba931b6..d4e9de1 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/screenshot/ScreenshotView.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/screenshot/ScreenshotView.java @@ -59,8 +59,13 @@ import org.tizen.dynamicanalyzer.sql.SqlManager; import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry; import org.tizen.dynamicanalyzer.swap.model.data.LogData; import org.tizen.dynamicanalyzer.swap.model.data.SystemData; +import org.tizen.dynamicanalyzer.ui.file.FilePage; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; import org.tizen.dynamicanalyzer.ui.page.ScreenshotTabComposite; +import org.tizen.dynamicanalyzer.ui.range.RangePage; +import org.tizen.dynamicanalyzer.ui.summary.SummaryPage; import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea; +import org.tizen.dynamicanalyzer.ui.userinterface.UIPage; import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite; import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite; @@ -310,6 +315,10 @@ public class ScreenshotView extends DAViewComposite { public void updateView(DAViewData data) { if (data instanceof DASelectionData) { DASelectionData selData = (DASelectionData) data; + if (null == selData.getViewID() || selData.getViewID().isEmpty() + || selData.getViewID().equals(GLPage.chartViewID)) { + return; + } setLatestButtonEnable(true); long selStartTime = selData.getStartTime(); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLConstantMap.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLConstantMap.java deleted file mode 100644 index 08f8df5..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLConstantMap.java +++ /dev/null @@ -1,167 +0,0 @@ -package org.tizen.dynamicanalyzer.ui.opengl; - -import java.util.HashMap; - -public class GLConstantMap { - private static HashMap constantMap = null; - - private static void initialize() { - constantMap = new HashMap(); - /* DataType */ - constantMap.put("5120", "GL_BYTE"); - constantMap.put("5121", "GL_UNSIGNED_BYTE"); - constantMap.put("5122", "GL_SHORT"); - constantMap.put("5123", "GL_UNSIGNED_SHORT"); - constantMap.put("5124", "GL_INT"); - constantMap.put("5125", "GL_UNSIGNED_INT"); - constantMap.put("5126", "GL_FLOAT"); - constantMap.put("5132", "GL_FIXED"); - /* BlendingFactorDest */ - constantMap.put("0", "GL_ZERO"); - constantMap.put("1", "GL_ONE"); - constantMap.put("768", "GL_SRC_COLOR"); - constantMap.put("769", "GL_ONE_MINUS_SRC_COLOR"); - constantMap.put("770", "GL_SRC_ALPHA"); - constantMap.put("771", "GL_ONE_MINUS_SRC_ALPHA"); - constantMap.put("772", "GL_DST_ALPHA"); - constantMap.put("773", "GL_ONE_MINUS_DST_ALPHA"); - /* BlendingFactorSrc */ - constantMap.put("774", "GL_DST_COLOR"); - constantMap.put("775", "GL_ONE_MINUS_DST_COLOR"); - constantMap.put("776", "GL_SRC_ALPHA_SATURATE"); - /* BlendEquationSeparate */ - constantMap.put("32774", "GL_FUNC_ADD"); - constantMap.put("32777", "GL_BLEND_EQUATION"); - constantMap.put("32777", "GL_BLEND_EQUATION_RGB");// FIXME - constantMap.put("34877", "GL_BLEND_EQUATION_ALPHA"); - /* BlendSubtract */ - constantMap.put("32778", "GL_FUNC_SUBTRACT"); - constantMap.put("32779", "GL_FUNC_REVERSE_SUBTRACT"); - /* Separate Blend Functions */ - constantMap.put("32968", "GL_BLEND_DST_RGB"); - constantMap.put("32969", "GL_BLEND_SRC_RGB"); - constantMap.put("32970", "GL_BLEND_DST_ALPHA"); - constantMap.put("32971", "GL_BLEND_SRC_ALPHA"); - constantMap.put("32769", "GL_CONSTANT_COLOR"); - constantMap.put("32770", "GL_ONE_MINUS_CONSTANT_COLOR"); - constantMap.put("32771", "GL_CONSTANT_ALPHA"); - constantMap.put("32772", "GL_ONE_MINUS_CONSTANT_ALPHA"); - constantMap.put("32773", "GL_BLEND_COLOR"); - /* FrontFaceDirection */ - constantMap.put("2304", "GL_CW"); - constantMap.put("2305", "GL_CCW"); - /* CullFaceMode */ - constantMap.put("1028", "GL_FRONT"); - constantMap.put("1029", "GL_BACK"); - constantMap.put("1030", "GL_FRONT_AND_BACK"); - /* StencilFunction */ - constantMap.put("512", "GL_NEVER"); - constantMap.put("513", "GL_LESS"); - constantMap.put("514", "GL_EQUAL"); - constantMap.put("515", "GL_LEQUAL"); - constantMap.put("516", "GL_GREATER"); - constantMap.put("517", "GL_NOTEQUAL"); - constantMap.put("518", "GL_GEQUAL"); - constantMap.put("519", "GL_ALWAYS"); - /* StencilOp */ - constantMap.put("7680", "GL_KEEP"); - constantMap.put("7681", "GL_REPLACE"); - constantMap.put("7682", "GL_INCR"); - constantMap.put("7683", "GL_DECR"); - constantMap.put("7690", "GL_INVERT"); - constantMap.put("7687", "GL_INCR_WRAP"); - constantMap.put("7688", "GL_DECR_WRAP"); - /* TextureUnit */ - constantMap.put("33984", "GL_TEXTURE0"); - constantMap.put("33985", "GL_TEXTURE1"); - constantMap.put("33986", "GL_TEXTURE2"); - constantMap.put("33987", "GL_TEXTURE3"); - constantMap.put("33988", "GL_TEXTURE4"); - constantMap.put("33989", "GL_TEXTURE5"); - constantMap.put("33990", "GL_TEXTURE6"); - constantMap.put("33991", "GL_TEXTURE7"); - constantMap.put("33992", "GL_TEXTURE8"); - constantMap.put("33993", "GL_TEXTURE9"); - constantMap.put("33994", "GL_TEXTURE10"); - constantMap.put("33995", "GL_TEXTURE11"); - constantMap.put("33996", "GL_TEXTURE12"); - constantMap.put("33997", "GL_TEXTURE13"); - constantMap.put("33998", "GL_TEXTURE14"); - constantMap.put("33999", "GL_TEXTURE15"); - constantMap.put("34000", "GL_TEXTURE16"); - constantMap.put("34001", "GL_TEXTURE17"); - constantMap.put("34002", "GL_TEXTURE18"); - constantMap.put("34003", "GL_TEXTURE19"); - constantMap.put("34004", "GL_TEXTURE20"); - constantMap.put("34005", "GL_TEXTURE21"); - constantMap.put("34006", "GL_TEXTURE22"); - constantMap.put("34007", "GL_TEXTURE23"); - constantMap.put("34008", "GL_TEXTURE24"); - constantMap.put("34009", "GL_TEXTURE25"); - constantMap.put("34010", "GL_TEXTURE26"); - constantMap.put("34011", "GL_TEXTURE27"); - constantMap.put("34012", "GL_TEXTURE28"); - constantMap.put("34013", "GL_TEXTURE29"); - constantMap.put("34014", "GL_TEXTURE30"); - constantMap.put("34015", "GL_TEXTURE31"); - constantMap.put("34016", "GL_ACTIVE_TEXTURE"); - /* Shaders */ - constantMap.put("35632", "GL_FRAGMENT_SHADER"); - constantMap.put("35633", "GL_VERTEX_SHADER"); - /* Uniform Types */ - constantMap.put("35664", "GL_FLOAT_VEC2"); - constantMap.put("35665", "GL_FLOAT_VEC3"); - constantMap.put("35666", "GL_FLOAT_VEC4"); - constantMap.put("35667", "GL_INT_VEC2"); - constantMap.put("35668", "GL_INT_VEC3"); - constantMap.put("35669", "GL_INT_VEC4"); - constantMap.put("35670", "GL_BOOL"); - constantMap.put("35671", "GL_BOOL_VEC2"); - constantMap.put("35672", "GL_BOOL_VEC3"); - constantMap.put("35673", "GL_BOOL_VEC4"); - constantMap.put("35674", "GL_FLOAT_MAT2"); - constantMap.put("35675", "GL_FLOAT_MAT3"); - constantMap.put("35676", "GL_FLOAT_MAT4"); - constantMap.put("35678", "GL_SAMPLER_2D"); - constantMap.put("35680", "GL_SAMPLER_CUBE"); - /* TextureParameterName */ - constantMap.put("10240", "GL_TEXTURE_MAG_FILTER"); - constantMap.put("10241", "GL_TEXTURE_MIN_FILTER"); - constantMap.put("10242", "GL_TEXTURE_WRAP_S"); - constantMap.put("10243", "GL_TEXTURE_WRAP_T"); - /* TextureTarget */ - constantMap.put("3553", "GL_TEXTURE_2D"); - constantMap.put("34067", "GL_TEXTURE_CUBE_MAP"); - /* TextureMagFilter */ - constantMap.put("9728", "GL_NEAREST"); - constantMap.put("9729", "GL_LINEAR"); - /* TextureMinFilter */ - /* GL_NEAREST */ - /* GL_LINEAR */ - constantMap.put("9984", "GL_NEAREST_MIPMAP_NEAREST"); - constantMap.put("9985", "GL_LINEAR_MIPMAP_NEAREST"); - constantMap.put("9986", "GL_NEAREST_MIPMAP_LINEAR"); - constantMap.put("9987", "GL_LINEAR_MIPMAP_LINEAR"); - /* TextureWrapMode */ - constantMap.put("10497", "GL_REPEAT"); - constantMap.put("33071", "GL_CLAMP_TO_EDGE"); - constantMap.put("33648", "GL_MIRRORED_REPEAT"); - /* Buffer Objects */ - constantMap.put("34962", "GL_ARRAY_BUFFER"); - constantMap.put("34963", "GL_ELEMENT_ARRAY_BUFFER"); - constantMap.put("34964", "GL_ARRAY_BUFFER_BINDING"); - constantMap.put("34965", "GL_ELEMENT_ARRAY_BUFFER_BINDING"); - - constantMap.put("35040", "GL_STREAM_DRAW"); - constantMap.put("35044", "GL_STATIC_DRAW"); - constantMap.put("35048", "GL_DYNAMIC_DRAW"); - } - - public static String getConstantString(String key) { - if (constantMap == null) { - initialize(); - } - - return constantMap.get(key); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLDetailsView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLDetailsView.java new file mode 100644 index 0000000..6bf2b7b --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLDetailsView.java @@ -0,0 +1,329 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.nebula.widgets.grid.GridItem; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.ExtendedModifyEvent; +import org.eclipse.swt.custom.ExtendedModifyListener; +import org.eclipse.swt.custom.StyleRange; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; +import org.eclipse.swt.layout.FormLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.nl.GLPageLabels; +import org.tizen.dynamicanalyzer.resources.ColorResources; +import org.tizen.dynamicanalyzer.resources.FontResources; +import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPINameDefine; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLES20ErrorDefine; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLFrameType; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateShaderType; +import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; +import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite; +import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData; + +public class GLDetailsView extends DAViewComposite { + + private final String PROGRAM_PUNCTUATION = "#";//$NON-NLS-1$ + + private Composite contents = null; + private StyledText detailText; + + private final static String leftFormAttachment = CommonConstants.SPACE + + CommonConstants.SPACE; + private final static String heightFormAttachment = CommonConstants.NEW_LINE + + CommonConstants.NEW_LINE; + + private void init() { + detailText.setText(CommonConstants.EMPTY); + } + + public GLDetailsView(Composite parent, int style) { + super(parent, style, true); + this.setLayout(new FillLayout()); + + setTitle(GLPageLabels.GL_DETAILS_VIEW_TITLE); + + Composite detailCom = getContentArea(); + detailCom.setBackground(ColorResources.VIEW_BG_COLOR); + detailCom.setLayout(new FormLayout()); + FormData labelData = new FormData(); + labelData.top = new FormAttachment(0, 0); + labelData.left = new FormAttachment(0, 0); + labelData.right = new FormAttachment(100, 0); + labelData.bottom = new FormAttachment(100, 0); + detailCom.setLayoutData(labelData); + + Composite contents = detailCom; + contents.setBackground(ColorResources.VIEW_BG_COLOR); + contents.setLayout(new FormLayout()); + + detailText = new StyledText(contents, SWT.BORDER | SWT.V_SCROLL + | SWT.H_SCROLL | SWT.READ_ONLY); + detailText.setBackground(ColorResources.VIEW_BG_COLOR); + detailText.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR); + detailText.setFont(FontResources.DETAIL_INFO_FONT); + + FormData buttonData = new FormData(); + buttonData.top = new FormAttachment(0, 0); + buttonData.left = new FormAttachment(0, 0); + buttonData.right = new FormAttachment(100, 0); + buttonData.bottom = new FormAttachment(100, 0); + detailText.setLayoutData(buttonData); + detailText.getVerticalBar().setVisible(false); + detailText.getHorizontalBar().setVisible(false); + } + + @Override + public void updateView(DAViewData vdata) { + + if (vdata instanceof GLSelectionData) { + GLSelectionData data = (GLSelectionData) vdata; + String id = vdata.getViewID(); + if (id.equals(GLPage.chartViewID) + && vdata instanceof GLSelectionData) { + updateChartInfo(data); + } else if (id.equals(GLPage.apiListViewID)) { + updateAPITableInfo(data); + } else if (id.equals(GLPage.contextViewID)) { + updateContextTableInfo(data); + } else if (id.equals(GLPage.programViewID)) { + updateProgramTableInfo(data); + } + } + + } + + @Override + public void updateView() { + } + + private void updateChartInfo(GLSelectionData data) { + int frameIndex = data.getFrameTimeIndex(); + GLFrameType glFrameData = GLDataManager.getInstance().getFrameData( + frameIndex); + if (null == glFrameData) { + return; + } + + StringBuffer strDetailView = new StringBuffer(); + strDetailView.append(CommonConstants.NEW_LINE); + strDetailView.append(leftFormAttachment + + GLPageLabels.GL_DETAILS_VIEW_FRAME + + String.valueOf(frameIndex) + heightFormAttachment); + strDetailView.append(leftFormAttachment + + GLPageLabels.GL_DETAILS_VIEW_ELAPSED_TIME + + glFrameData.getFrametime() + "(μs)" + heightFormAttachment);//$NON-NLS-1$ + strDetailView.append(leftFormAttachment + + glFrameData.getGLApiDataList().size() + + GLPageLabels.GL_DETAILS_VIEW_ELAPSED_TIME_APIS + + heightFormAttachment); + strDetailView.append(leftFormAttachment + glFrameData.getErrorCount() + + GLPageLabels.GL_DETAILS_VIEW_ELAPSED_TIME_ERROR + + heightFormAttachment); + detailText.setText(strDetailView.toString()); + } + + private void updateAPITableInfo(GLSelectionData data) { + GridItem[] gridItems = (GridItem[]) data.getData(); + DATableDataFormat tableDataFormat = (DATableDataFormat) gridItems[0] + .getData(); + GLES20LogData logData = (GLES20LogData) tableDataFormat.getLogData(); + + StringBuffer strDetailView = new StringBuffer(); + String apiName = logData.getApiName(); + strDetailView.append(CommonConstants.NEW_LINE); + strDetailView.append(leftFormAttachment + apiName + + heightFormAttachment); + long error = logData.getErrno(); + if (error == 0) { + strDetailView.append(leftFormAttachment + + GLES20ErrorDefine.getErrorDescription(String + .valueOf(error)) + heightFormAttachment); + } else { + strDetailView.append(leftFormAttachment + + getErrorDescription(apiName, + GLES20ErrorDefine.getError(error)) + + heightFormAttachment); + } + detailText.setText(strDetailView.toString()); + } + + private void updateContextTableInfo(GLSelectionData data) { + StringBuffer strDetailView = new StringBuffer(); + GridItem[] items = (GridItem[]) data.getData(); + if (null == items) { + return; + } + strDetailView.append(CommonConstants.NEW_LINE); + strDetailView.append(leftFormAttachment + items[0].getText(0) + + heightFormAttachment); + detailText.setText(strDetailView.toString()); + } + + private void updateProgramTableInfo(GLSelectionData data) { + detailText.addExtendedModifyListener(programExtendedModifyListener); + + GridItem[] items = (GridItem[]) data.getData(); + if (null == items) { + return; + } + + String vertexShaderID = items[0].getText(2) + .replace(GLPageLabels.GL_SHADER, CommonConstants.EMPTY).trim(); + String fragmentID = items[0].getText(3) + .replace(GLPageLabels.GL_SHADER, CommonConstants.EMPTY).trim(); + + String vertexSrc = CommonConstants.EMPTY; + String fragmentSrc = CommonConstants.EMPTY; + + List shaderList = GLDataManager.getInstance() + .getStateDataMagerInstance().getShaderList(); + for (int i = 0; i < shaderList.size(); i++) { + if (shaderList.get(i).getId() == Integer.parseInt(vertexShaderID)) { + vertexSrc = shaderList.get(i).getShaderSrc(); + } else if (shaderList.get(i).getId() == Integer + .parseInt(fragmentID)) { + fragmentSrc = shaderList.get(i).getShaderSrc(); + } + } + + StringBuffer strDetailView = new StringBuffer(); + strDetailView.append(CommonConstants.NEW_LINE); + strDetailView.append(PROGRAM_PUNCTUATION + items[0].getText(1) + + heightFormAttachment); + + strDetailView.append(PROGRAM_PUNCTUATION + GLPageLabels.GL_VERTEX + + CommonConstants.SPACE + items[0].getText(2) + + heightFormAttachment); + strDetailView.append(vertexSrc + heightFormAttachment); + + strDetailView.append(PROGRAM_PUNCTUATION + GLPageLabels.GL_FRAGMENT + + CommonConstants.SPACE + items[0].getText(3) + + heightFormAttachment); + strDetailView.append(fragmentSrc + heightFormAttachment); + + detailText.setText(strDetailView.toString()); + detailText.getVerticalBar().setVisible(true); + detailText.getHorizontalBar().setVisible(true); + detailText.removeExtendedModifyListener(programExtendedModifyListener); + } + + private ExtendedModifyListener programExtendedModifyListener = new ExtendedModifyListener() { + public void modifyText(ExtendedModifyEvent event) { + int end = event.start + event.length - 1; + if (event.start <= end) { + String text = detailText.getText(event.start, end); + + String[] lineStr = text.split(CommonConstants.NEW_LINE); + int lineSize = lineStr.length; + + java.util.List ranges = new java.util.ArrayList(); + + List containChar = new ArrayList(); + for (int i = 0; i < lineSize; i++) { + String lineText = lineStr[i]; + if (lineText.contains(PROGRAM_PUNCTUATION)) { + containChar.add(lineText); + } + } + + int containCharIndex = 0; + for (int i = 0, n = text.length(); i < n; i++) { + if (containCharIndex > 2) { + break; + } + if (PROGRAM_PUNCTUATION.indexOf(text.charAt(i)) > -1) { + ranges.add(new StyleRange(event.start + i, containChar + .get(containCharIndex).length(), + ColorResources.NAVY, null, SWT.ITALIC)); + containCharIndex++; + } + } + if (!ranges.isEmpty()) { + detailText.replaceStyleRanges(event.start, event.length, + ranges.toArray(new StyleRange[0])); + } + } + } + }; + + private String getErrorDescription(String apiName, String errorName) { + if (apiName.equals("glDisable")) {//$NON-NLS-1$ + apiName.equals("glEnable");//$NON-NLS-1$ + } else if (apiName.equals(GLAPINameDefine.API_GL_DISABLE_VAA)) { + apiName = GLAPINameDefine.API_GL_ENABLE_VAA; + } else if (apiName.equals("glGetBooleanv")//$NON-NLS-1$ + || apiName.equals("glGetFloatv")//$NON-NLS-1$ + || apiName.equals("glGetIntegerv")) {//$NON-NLS-1$ + apiName = "glGet";//$NON-NLS-1$ + } else if (apiName.startsWith("glGetTexParameter")) {//$NON-NLS-1$ + apiName = "glGetTexParameter";//$NON-NLS-1$ + } else if (apiName.startsWith("glGetUniform") && !apiName.endsWith("n")) {//$NON-NLS-1$ + apiName = "glGetUniform";//$NON-NLS-1$ + } else if (apiName.startsWith("glGetVertexAttrib")//$NON-NLS-1$ + && !apiName.endsWith("rv")) {//$NON-NLS-1$ + apiName = "glGetVertexAttrib";//$NON-NLS-1$ + } else if (apiName.startsWith("glTexParameter")) {//$NON-NLS-1$ + apiName = "glTexParameter";//$NON-NLS-1$ + } else if (apiName.startsWith("glUniform")) {//$NON-NLS-1$ + apiName = "glUniform";//$NON-NLS-1$ + } else if (apiName.startsWith("glVertexAttrib")//$NON-NLS-1$ + && (apiName.endsWith("f") || apiName.endsWith("v"))) { + apiName = "glVertexAttrib";//$NON-NLS-1$ + } + + String errorDescription = GLES20ErrorDefine.getErrorDescription(apiName + + errorName); + + if (errorDescription == null) { + return errorName; + } else { + return errorDescription; + } + } + + @Override + public Control getControl() { + return contents; + } + + @Override + public void clear() { + init(); + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLES20ErrorInformation.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLES20ErrorInformation.java deleted file mode 100644 index 9bf7a05..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLES20ErrorInformation.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl; - -import java.util.HashMap; - -public class GLES20ErrorInformation { - private static HashMap gles20ErrorMap = null; - private static HashMap gles20ErrorDescriptionMap = null; - - private static void initialize() { - gles20ErrorMap = new HashMap(); - gles20ErrorMap.put(new Long(0), "No error"); - gles20ErrorMap.put(new Long(1280), "GL_INVALID_ENUM"); - gles20ErrorMap.put(new Long(1281), "GL_INVALID_VALUE"); - gles20ErrorMap.put(new Long(1282), "GL_INVALID_OPERATION"); - gles20ErrorMap.put(new Long(1285), "GL_OUT_OF_MEMORY"); - gles20ErrorMap.put(new Long(1286), "GL_INVALID_FRAMEBUFFER_OPERATION"); - - gles20ErrorDescriptionMap = new HashMap(); - gles20ErrorDescriptionMap.put("0", "No error"); - gles20ErrorDescriptionMap - .put("500", - "An unacceptable value is specified for an enumerated argument. The offending command is ignored and has no other side effect than to set the error flag."); - gles20ErrorDescriptionMap - .put("501", - "A numeric argument is out of range. The offending command is ignored and has no other side effect than to set the error flag."); - gles20ErrorDescriptionMap - .put("502", - "The specified operation is not allowed in the current state. The offending command is ignored and has no other side effect than to set the error flag."); - gles20ErrorDescriptionMap - .put("505", - "There is not enough memory left to execute the command. The state of the GL is undefined, except for the state of the error flags, after this error is recorded."); - gles20ErrorDescriptionMap - .put("506", - "The command is trying to render to or read from the framebuffer while the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE). The offending command is ignored and has no other side effect than to set the error flag."); - - gles20ErrorDescriptionMap.put("glActiveTextureGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if texture is not one of GL_TEXTUREi, where i ranges from 0 to (GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1)."); - gles20ErrorDescriptionMap.put("glAttachShaderGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if either program or shader is not a value generated by OpenGL."); - gles20ErrorDescriptionMap.put("glAttachShaderGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if program is not a program object.\n2. if shader is not a shader object.\n3. if shader is already attached to program, or if another shader object of the same type as shader is already attached to program."); - gles20ErrorDescriptionMap.put("glBindAttribLocationGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.\n2. if program is not a value"); - gles20ErrorDescriptionMap.put("glBindAttribLocationGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if name starts with the reserved prefix \"gl_\".\n2. if program is not a program object."); - gles20ErrorDescriptionMap.put("glBindBufferGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if target is not one of the allowable values."); - gles20ErrorDescriptionMap.put("glBindFramebufferGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if target is not GL_FRAMEBUFFER."); - gles20ErrorDescriptionMap.put("glBindRenderbufferGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER."); - gles20ErrorDescriptionMap.put("glBindTextureGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if target is not one of the allowable values."); - gles20ErrorDescriptionMap.put("glBindTextureGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if texture was previously created with a target that doesn't match that of target."); - gles20ErrorDescriptionMap.put("glBlendEquationGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if mode is not one of GL_FUNC_ADD, GL_FUNC_SUBTRACT, or GL_FUNC_REVERSE_SUBTRACT."); - gles20ErrorDescriptionMap.put("glBlendEquationSeparateGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if either modeRGB or modeAlpha is not one of GL_FUNC_ADD, GL_FUNC_SUBTRACT, or GL_FUNC_REVERSE_SUBTRACT."); - gles20ErrorDescriptionMap.put("glBlendFuncGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value."); - gles20ErrorDescriptionMap.put("glBlendFuncSeparateGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if srcRGB, dstRGB, srcAlpha, or dstAlpha is not an accepted value."); - gles20ErrorDescriptionMap.put("glBufferDataGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if size is negative."); - gles20ErrorDescriptionMap.put("glBufferDataGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if target is not GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER.\n2. if usage is not GL_STREAM_DRAW, GL_STATIC_DRAW, or GL_DYNAMIC_DRAW."); - gles20ErrorDescriptionMap.put("glBufferDataGL_OUT_OF_MEMORY", "GL_OUT_OF_MEMORY is generated if the GL is unable to create a data store with the specified size."); - gles20ErrorDescriptionMap.put("glBufferDataGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target."); - gles20ErrorDescriptionMap.put("glBufferSubDataGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if offset or size is negative, or if together they define a region of memory that extends beyond the buffer object's allocated data store."); - gles20ErrorDescriptionMap.put("glBufferSubDataGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if target is not GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER."); - gles20ErrorDescriptionMap.put("glBufferSubDataGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target."); - gles20ErrorDescriptionMap.put("glCheckFramebufferStatusGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if target is not GL_FRAMEBUFFER."); - gles20ErrorDescriptionMap.put("glClearGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if any bit other than the three defined bits is set in mask."); - gles20ErrorDescriptionMap.put("glCompileShaderGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL."); - gles20ErrorDescriptionMap.put("glCompileShaderGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if a shader compiler is not supported.\n2. if shader is not a shader object."); - gles20ErrorDescriptionMap.put("glCompressedTexImage2DGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if level is less than 0.\n2. if level is greater than log 2 ? max , where max is the returned value of GL_MAX_TEXTURE_SIZE when target is GL_TEXTURE_2D or GL_MAX_CUBE_MAP_TEXTURE_SIZE when target is not GL_TEXTURE_2D.\n3. if width or height is less than 0 or greater than GL_MAX_TEXTURE_SIZE when target is GL_TEXTURE_2D or GL_MAX_CUBE_MAP_TEXTURE_SIZE when target is not GL_TEXTURE_2D.\n4. if border is not 0.\n5. if imageSize is not consistent with the format, dimensions, and contents of the specified compressed image data."); - gles20ErrorDescriptionMap.put("glCompressedTexImage2DGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if target is not GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.\n2. if internalformat is not a supported format returned in GL_COMPRESSED_TEXTURE_FORMATS."); - gles20ErrorDescriptionMap.put("glCompressedTexImage2DGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if parameter combinations are not supported by the specific compressed internal format as specified in the specific texture compression extension."); - gles20ErrorDescriptionMap.put("glCompressedTexSubImage2DGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if level is less than 0.\n2. if level is greater than log 2 ? max , where max is the returned value of GL_MAX_TEXTURE_SIZE when target is GL_TEXTURE_2D or GL_MAX_CUBE_MAP_TEXTURE_SIZE when target is not GL_TEXTURE_2D.\n3. if xoffset < 0 , xoffset + width > w , yoffset < 0 , or yoffset + height > h , where w is the width and h is the height of the texture image being modified.\n4. if width or height is less than 0.\n5. if imageSize is not consistent with the format, dimensions, and contents of the specified compressed image data."); - gles20ErrorDescriptionMap.put("glCompressedTexSubImage2DGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if target is not GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.\n2. if format is not a supported format returned in GL_COMPRESSED_TEXTURE_FORMATS."); - gles20ErrorDescriptionMap.put("glCompressedTexSubImage2DGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if the texture array has not been defined by a previous glCompressedTexImage2D operation whose internalformat matches the format of glCompressedTexSubImage2D.\n2. if parameter combinations are not supported by the specific compressed internal format as specified in the specific texture compression extension."); - gles20ErrorDescriptionMap.put("glCopyTexImage2DGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if target is one of the six cube map 2D image targets and the width and height parameters are not equal.\n2. if level is less than 0.\n3. if level is greater than log 2 ? max , where max is the returned value of GL_MAX_TEXTURE_SIZE when target is GL_TEXTURE_2D or GL_MAX_CUBE_MAP_TEXTURE_SIZE when target is not GL_TEXTURE_2D.\n4. if width or height is less than 0 or greater than GL_MAX_TEXTURE_SIZE when target is GL_TEXTURE_2D or GL_MAX_CUBE_MAP_TEXTURE_SIZE when target is not GL_TEXTURE_2D.\n5. if border is not 0."); - gles20ErrorDescriptionMap.put("glCopyTexImage2DGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if target is not GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.\n2. if internalformat is not an accepted format."); - gles20ErrorDescriptionMap.put("glCopyTexImage2DGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if the currently bound framebuffer's format does not contain a superset of the components required by the base format of internalformat."); - gles20ErrorDescriptionMap.put("glCopyTexImage2DGL_INVALID_FRAMEBUFFER_OPERATION", "GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE)."); - gles20ErrorDescriptionMap.put("glCopyTexSubImage2DGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if level is less than 0.\n2. if level > log 2 ? max , where max is the returned value of GL_MAX_TEXTURE_SIZE.\n3. if xoffset < 0 , xoffset + width > w , yoffset < 0 , or yoffset + height > h , where w is the width and h is the height of the texture image being modified.\n4. if width or height is less than 0."); - gles20ErrorDescriptionMap.put("glCopyTexSubImage2DGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if target is not GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z."); - gles20ErrorDescriptionMap.put("glCopyTexSubImage2DGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if the texture array has not been defined by a previous glTexImage2D or glCopyTexImage2D operation.\n2. if the currently bound framebuffer's format does not contain a superset of the components required by the texture's base internal format."); - gles20ErrorDescriptionMap.put("glCopyTexSubImage2DGL_INVALID_FRAMEBUFFER_OPERATION", "GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE)."); - gles20ErrorDescriptionMap.put("glCreateShaderGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if shaderType is not an accepted value."); - gles20ErrorDescriptionMap.put("glCullFaceGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if mode is not an accepted value."); - gles20ErrorDescriptionMap.put("glDeleteBuffersGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if n is negative."); - gles20ErrorDescriptionMap.put("glDeleteFramebuffersGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if n is negative."); - gles20ErrorDescriptionMap.put("glDeleteProgramGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); - gles20ErrorDescriptionMap.put("glDeleteRenderbuffersGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if n is negative."); - gles20ErrorDescriptionMap.put("glDeleteShaderGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL."); - gles20ErrorDescriptionMap.put("glDeleteTexturesGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if n is negative."); - gles20ErrorDescriptionMap.put("glDepthFuncGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if func is not an accepted value."); - gles20ErrorDescriptionMap.put("glDetachShaderGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if either program or shader is a value that was not generated by OpenGL."); - gles20ErrorDescriptionMap.put("glDetachShaderGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if program is not a program object.\n2. if shader is not a shader object.\n3. if shader is not attached to program."); - gles20ErrorDescriptionMap.put("glDrawArraysGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if count is negative."); - gles20ErrorDescriptionMap.put("glDrawArraysGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if mode is not an accepted value."); - gles20ErrorDescriptionMap.put("glDrawArraysGL_INVALID_FRAMEBUFFER_OPERATION", "GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE)."); - gles20ErrorDescriptionMap.put("glDrawElementsGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if count is negative."); - gles20ErrorDescriptionMap.put("glDrawElementsGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if mode is not an accepted value.\n2. if type is not GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT."); - gles20ErrorDescriptionMap.put("glDrawElementsGL_INVALID_FRAMEBUFFER_OPERATION", "GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE)."); - gles20ErrorDescriptionMap.put("glEnableGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if cap is not one of the values listed previously."); - gles20ErrorDescriptionMap.put("glEnableVertexAttribArrayGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS."); - gles20ErrorDescriptionMap.put("glFramebufferRenderbufferGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if target is not GL_FRAMEBUFFER.\n2. if renderbuffertarget is not GL_RENDERBUFFER and renderbuffer is not 0.\n3. if attachment is not an accepted attachment point."); - gles20ErrorDescriptionMap.put("glFramebufferRenderbufferGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if the default framebuffer object name 0 is bound.\n2. if renderbuffer is neither 0 nor the name of an existing renderbuffer object."); - gles20ErrorDescriptionMap.put("glFramebufferTexture2DGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if level is not 0 and texture is not 0."); - gles20ErrorDescriptionMap.put("glFramebufferTexture2DGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if target is not GL_FRAMEBUFFER.\n2. if textarget is not an accepted texture target and texture is not 0.\n3. if attachment is not an accepted attachment point."); - gles20ErrorDescriptionMap.put("glFramebufferTexture2DGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if the default framebuffer object name 0 is bound.\n2. if texture is neither 0 nor the name of an existing texture object.\n3. if texture is the name of an existing two-dimensional texture object but textarget is not GL_TEXTURE_2D or if texture is the name of an existing cube map texture object but textarget is GL_TEXTURE_2D."); - gles20ErrorDescriptionMap.put("glFrontFaceGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if mode is not an accepted value."); - gles20ErrorDescriptionMap.put("glGenBuffersGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if n is negative."); - gles20ErrorDescriptionMap.put("glGenFramebuffersGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if n is negative."); - gles20ErrorDescriptionMap.put("glGenRenderbuffersGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if n is negative."); - gles20ErrorDescriptionMap.put("glGenTexturesGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if n is negative."); - gles20ErrorDescriptionMap.put("glGenerateMipmapGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if target is not GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP."); - gles20ErrorDescriptionMap.put("glGenerateMipmapGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if the texture bound to target is a cube map, but its six faces do not share indentical widths, heights, formats, and types.\n2. if either the width or height of the zero level array is not a power of two.\n3. if the zero level array is stored in a compressed internal format."); - gles20ErrorDescriptionMap.put("glGetGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if pname is not one of the values listed previously."); - gles20ErrorDescriptionMap.put("glGetActiveAttribGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if program is not a value\n2. if index is greater than or equal to the number of active attribute variables in program.\n3. if bufSize is less than 0."); - gles20ErrorDescriptionMap.put("glGetActiveAttribGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if program is not a program object."); - gles20ErrorDescriptionMap.put("glGetActiveUniformGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if program is not a value\n2. if index is greater than or equal to the number of active uniform variables in program.\n3. if bufSize is less than 0."); - gles20ErrorDescriptionMap.put("glGetActiveUniformGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if program is not a program object."); - gles20ErrorDescriptionMap.put("glGetAttachedShadersGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if program is not a value\n2. if maxCount is less than 0."); - gles20ErrorDescriptionMap.put("glGetAttachedShadersGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if program is not a program object."); - gles20ErrorDescriptionMap.put("glGetAttribLocationGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if program is not a value\n2. if program is not a program object.\n3. if program has not been successfully linked."); - gles20ErrorDescriptionMap.put("glGetBufferParameterivGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if target or value is not an accepted value."); - gles20ErrorDescriptionMap.put("glGetBufferParameterivGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target."); - gles20ErrorDescriptionMap.put("glGetFramebufferAttachmentParameterivGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if target is not GL_FRAMEBUFFER.\n2. if attachment is not GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, or GL_STENCIL_ATTACHMENT.\n3. if the attached object at the named attachment point is GL_RENDERBUFFER and pname is not GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE or GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.\n4. if the attached object at the named attachment point is GL_TEXTURE and pname is not GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, or GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.\n5. if there is no attached object at the named attachment point and pname is not GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE."); - gles20ErrorDescriptionMap.put("glGetFramebufferAttachmentParameterivGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if the default framebuffer object name 0 is bound."); - gles20ErrorDescriptionMap.put("glGetProgramInfoLogGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if program is not a value\n2. if maxLength is less than 0."); - gles20ErrorDescriptionMap.put("glGetProgramInfoLogGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if program is not a program object."); - gles20ErrorDescriptionMap.put("glGetProgramivGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); - gles20ErrorDescriptionMap.put("glGetProgramivGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if pname is not an accepted value."); - gles20ErrorDescriptionMap.put("glGetProgramivGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if program does not refer to a program object."); - gles20ErrorDescriptionMap.put("glGetRenderbufferParameterivGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if target is not GL_RENDERBUFFER.\n2. if pname is not GL_RENDERBUFFER_WIDTH, GL_RENDERBUFFER_HEIGHT, GL_RENDERBUFFER_INTERNAL_FORMAT, GL_RENDERBUFFER_RED_SIZE, GL_RENDERBUFFER_GREEN_SIZE, GL_RENDERBUFFER_BLUE_SIZE, GL_RENDERBUFFER_ALPHA_SIZE, GL_RENDERBUFFER_DEPTH_SIZE, or GL_RENDERBUFFER_STENCIL_SIZE."); - gles20ErrorDescriptionMap.put("glGetRenderbufferParameterivGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if the reserved renderbuffer object name 0 is bound."); - gles20ErrorDescriptionMap.put("glGetShaderInfoLogGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if shader is not a value\n2. if maxLength is less than 0."); - gles20ErrorDescriptionMap.put("glGetShaderInfoLogGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if shader is not a shader object."); - gles20ErrorDescriptionMap.put("glGetShaderPrecisionFormatGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if shaderType or precisionType is not an accepted value."); - gles20ErrorDescriptionMap.put("glGetShaderPrecisionFormatGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if a shader compiler is not supported."); - gles20ErrorDescriptionMap.put("glGetShaderSourceGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if shader is not a value\n2. if bufSize is less than 0."); - gles20ErrorDescriptionMap.put("glGetShaderSourceGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if shader is not a shader object."); - gles20ErrorDescriptionMap.put("glGetShaderivGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL."); - gles20ErrorDescriptionMap.put("glGetShaderivGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if pname is not an accepted value."); - gles20ErrorDescriptionMap.put("glGetShaderivGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if pname is GL_COMPILE_STATUS, GL_INFO_LOG_LENGTH, or GL_SHADER_SOURCE_LENGTH but a shader compiler is not supported.\n2. if shader does not refer to a shader object."); - gles20ErrorDescriptionMap.put("glGetStringGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if name is not an accepted value."); - gles20ErrorDescriptionMap.put("glGetTexParameterGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if target or pname is not an accepted value."); - gles20ErrorDescriptionMap.put("glGetUniformGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); - gles20ErrorDescriptionMap.put("glGetUniformGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if program is not a program object.\n2. if program has not been successfully linked.\n3. if location does not correspond to a valid uniform variable location for the specified program object."); - gles20ErrorDescriptionMap.put("glGetUniformLocationGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); - gles20ErrorDescriptionMap.put("glGetUniformLocationGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if program is not a program object.\n2. if program has not been successfully linked."); - gles20ErrorDescriptionMap.put("glGetVertexAttribGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS."); - gles20ErrorDescriptionMap.put("glGetVertexAttribGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if pname is not an accepted value."); - gles20ErrorDescriptionMap.put("glGetVertexAttribPointervGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS."); - gles20ErrorDescriptionMap.put("glGetVertexAttribPointervGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if pname is not an accepted value."); - gles20ErrorDescriptionMap.put("glHintGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if either target or mode is not an accepted value."); - gles20ErrorDescriptionMap.put("glIsEnabledGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if cap is not an accepted value."); - gles20ErrorDescriptionMap.put("glLineWidthGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if width is less than or equal to 0."); - gles20ErrorDescriptionMap.put("glLinkProgramGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); - gles20ErrorDescriptionMap.put("glLinkProgramGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if program is not a program object."); - gles20ErrorDescriptionMap.put("glPixelStoreiGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if alignment is specified as other than 1, 2, 4, or 8."); - gles20ErrorDescriptionMap.put("glPixelStoreiGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if pname is not an accepted value."); - gles20ErrorDescriptionMap.put("glReadPixelsGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if either width or height is negative."); - gles20ErrorDescriptionMap.put("glReadPixelsGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if format or type is not an accepted value."); - gles20ErrorDescriptionMap.put("glReadPixelsGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if type is GL_UNSIGNED_SHORT_5_6_5 and format is not GL_RGB.\n2. if type is GL_UNSIGNED_SHORT_4_4_4_4 or GL_UNSIGNED_SHORT_5_5_5_1 and format is not GL_RGBA.\n3. if format and type are neither GL_RGBA and GL_UNSIGNED_BYTE, respectively, nor the format/type pair returned by querying GL_IMPLEMENTATION_COLOR_READ_FORMAT and GL_IMPLEMENTATION_COLOR_READ_TYPE."); - gles20ErrorDescriptionMap.put("glReadPixelsGL_INVALID_FRAMEBUFFER_OPERATION", "GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE)."); - gles20ErrorDescriptionMap.put("glReleaseShaderCompilerGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if a shader compiler is not supported."); - gles20ErrorDescriptionMap.put("glRenderbufferStorageGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if width or height is less than zero or greater than GL_MAX_RENDERBUFFER_SIZE."); - gles20ErrorDescriptionMap.put("glRenderbufferStorageGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if target is not GL_RENDERBUFFER.\n2. if internalformat is not an accepted format."); - gles20ErrorDescriptionMap.put("glRenderbufferStorageGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if the reserved renderbuffer object name 0 is bound."); - gles20ErrorDescriptionMap.put("glRenderbufferStorageGL_OUT_OF_MEMORY", "GL_OUT_OF_MEMORY is generated if the implementation is unable to create a data store with the requested width and height."); - gles20ErrorDescriptionMap.put("glScissorGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if either width or height is negative."); - gles20ErrorDescriptionMap.put("glShaderBinaryGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if any value in shaders is not a vlue\n2. if the format of the data pointed to by binary does not match binaryformat.\n3. if n or length is negative."); - gles20ErrorDescriptionMap.put("glShaderBinaryGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if binaryformat is not a supported format returned in GL_SHADER_BINARY_FORMATS."); - gles20ErrorDescriptionMap.put("glShaderBinaryGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if any value in shaders is not a shader object, or if there is more than one vertex shader object handle or more than one fragment shader object handle in shaders."); - gles20ErrorDescriptionMap.put("glShaderSourceGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if shader is not a value\n2. if count is less than 0."); - gles20ErrorDescriptionMap.put("glShaderSourceGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if a shader compiler is not supported.\n2. if shader is not a shader object."); - gles20ErrorDescriptionMap.put("glStencilFuncGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if func is not one of the eight accepted values."); - gles20ErrorDescriptionMap.put("glStencilFuncSeparateGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if face is not GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.\n2. if func is not one of the eight accepted values."); - gles20ErrorDescriptionMap.put("glStencilMaskSeparateGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if face is not GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK."); - gles20ErrorDescriptionMap.put("glStencilOpGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if sfail, dpfail, or dppass is any value other than the eight defined symbolic constant values."); - gles20ErrorDescriptionMap.put("glStencilOpSeparateGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if face is any value other than GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.\n2. if sfail, dpfail, or dppass is any value other than the eight defined symbolic constant values."); - gles20ErrorDescriptionMap.put("glTexImage2DGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if target is one of the six cube map 2D image targets and the width and height parameters are not equal.\n2. if level is less than 0.\n3. if level is greater than log 2 ? max , where max is the returned value of GL_MAX_TEXTURE_SIZE when target is GL_TEXTURE_2D or GL_MAX_CUBE_MAP_TEXTURE_SIZE when target is not GL_TEXTURE_2D.\n4. if internalformat is not an accepted format.\n5. if width or height is less than 0 or greater than GL_MAX_TEXTURE_SIZE when target is GL_TEXTURE_2D or GL_MAX_CUBE_MAP_TEXTURE_SIZE when target is not GL_TEXTURE_2D.\n6. if border is not 0."); - gles20ErrorDescriptionMap.put("glTexImage2DGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if target is not GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.\n2. if format or type is not an accepted value."); - gles20ErrorDescriptionMap.put("glTexImage2DGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if format does not match internalformat.\n2. if type is GL_UNSIGNED_SHORT_5_6_5 and format is not GL_RGB.\n3. if type is GL_UNSIGNED_SHORT_4_4_4_4 or GL_UNSIGNED_SHORT_5_5_5_1 and format is not GL_RGBA."); - gles20ErrorDescriptionMap.put("glTexParameterGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if target or pname is not one of the accepted defined values.\n2. if params should have a defined symbolic constant value (based on the value of pname) and does not."); - gles20ErrorDescriptionMap.put("glTexSubImage2DGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if level is less than 0.\n2. if level is greater than log 2 max, where max is the returned value of GL_MAX_TEXTURE_SIZE.\n3. if xoffset < 0 , xoffset + width > w , yoffset < 0 , or yoffset + height > h , where w is the width and h is the height of the texture image being modified.\n4. if width or height is less than 0."); - gles20ErrorDescriptionMap.put("glTexSubImage2DGL_INVALID_ENUM", "GL_INVALID_ENUM is generated \n1. if target is not GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.\n2. if format or type is not an accepted value."); - gles20ErrorDescriptionMap.put("glTexSubImage2DGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if the texture array has not been defined by a previous glTexImage2D or glCopyTexImage2D operation whose internalformat matches the format of glTexSubImage2D.\n2. if type is GL_UNSIGNED_SHORT_5_6_5 and format is not GL_RGB.\n3. if type is GL_UNSIGNED_SHORT_4_4_4_4 or GL_UNSIGNED_SHORT_5_5_5_1 and format is not GL_RGBA."); - gles20ErrorDescriptionMap.put("glUniformGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if count is less than 0.\n2. if transpose is not GL_FALSE."); - gles20ErrorDescriptionMap.put("glUniformGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if there is no current program object.\n2. if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.\n3. if one of the integer variants of this function is used to load a uniform variable of type float, vec2, vec3, vec4, or an array of these, or if one of the floating-point variants of this function is used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.\n4. if location is an invalid uniform location for the current program object and location is not equal to -1.\n5. if count is greater than 1 and the indicated uniform variable is not an array variable.\n6. if a sampler is loaded using a command other than glUniform1i and glUniform1iv."); - gles20ErrorDescriptionMap.put("glUseProgramGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if program is neither 0 nor a value generated by OpenGL."); - gles20ErrorDescriptionMap.put("glUseProgramGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated \n1. if program is not a program object.\n2. if program could not be made part of current state."); - gles20ErrorDescriptionMap.put("glValidateProgramGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); - gles20ErrorDescriptionMap.put("glValidateProgramGL_INVALID_OPERATION", "GL_INVALID_OPERATION is generated if program is not a program object."); - gles20ErrorDescriptionMap.put("glVertexAttribGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS."); - gles20ErrorDescriptionMap.put("glVertexAttribPointerGL_INVALID_VALUE", "GL_INVALID_VALUE is generated \n1. if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.\n2. if size is not 1, 2, 3, or 4.\n3. if stride is negative."); - gles20ErrorDescriptionMap.put("glVertexAttribPointerGL_INVALID_ENUM", "GL_INVALID_ENUM is generated if type is not an accepted value."); - gles20ErrorDescriptionMap.put("glViewportGL_INVALID_VALUE", "GL_INVALID_VALUE is generated if either width or height is negative."); - } - - public static String getError(Long key) { - if(gles20ErrorMap == null) { - initialize(); - } - return gles20ErrorMap.get(key); - } - - public static String getErrorDescription(String key) { - if(gles20ErrorDescriptionMap == null) { - initialize(); - } - return gles20ErrorDescriptionMap.get(key); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/GLPage.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLPage.java similarity index 64% rename from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/GLPage.java rename to org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLPage.java index d632b63..5507f15 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/GLPage.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLPage.java @@ -4,6 +4,7 @@ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: + * Hyunjong Park * Sanghyun Lee * Juyoung Kim * @@ -24,7 +25,7 @@ * */ -package org.tizen.dynamicanalyzer.ui.opengl.ui; +package org.tizen.dynamicanalyzer.ui.opengl; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; @@ -34,38 +35,48 @@ import org.tizen.dynamicanalyzer.common.AnalyzerConstants; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; import org.tizen.dynamicanalyzer.shortcut.ShortCutManager; import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataMaker; -import org.tizen.dynamicanalyzer.ui.opengl.ui.apiList.GLAPIListView; -import org.tizen.dynamicanalyzer.ui.opengl.ui.chart.GLChartView; -import org.tizen.dynamicanalyzer.ui.opengl.ui.context.GLContextView; +import org.tizen.dynamicanalyzer.ui.opengl.chart.GLChartView; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; +import org.tizen.dynamicanalyzer.ui.opengl.table.api.GLAPIListView; +import org.tizen.dynamicanalyzer.ui.opengl.table.state.GLContextTableView; +import org.tizen.dynamicanalyzer.ui.opengl.table.state.GLProgramTableView; +import org.tizen.dynamicanalyzer.ui.opengl.table.state.GLTextureTableView; import org.tizen.dynamicanalyzer.ui.page.ScreenshotTabComposite; import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite; +import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite; public class GLPage extends DAPageComposite { public static final String pageID = GLPage.class.getName(); public static final String chartViewID = GLChartView.class.getName(); - public static final String contextViewID = GLContextView.class.getName(); - public static final String listViewID = GLAPIListView.class.getName(); - public static final String listViewSubID = GLAPIListView.class.getName() - + ".sub"; + public static final String apiListViewID = GLAPIListView.class.getName(); public static final String detailViewID = GLDetailsView.class.getName(); - private GLDataMaker glDataMaker; + public static final String stateTabID = "GLStateTablID.id";//$NON-NLS-1$ + public static final String contextViewID = GLContextTableView.class + .getName(); + public static final String contextHistoryID = "contextHistoryID.id"; //$NON-NLS-1$ + + public static final String programViewID = GLProgramTableView.class + .getName(); + + public static final String textureViewID = GLTextureTableView.class + .getName(); SashForm baseForm; + SashForm rightForm; SashForm leftForm; SashForm bottomForm; - SashForm rightForm; GLChartView glChartView; GLAPIListView glAPIListView; - GLContextView glStateView; + + GLContextTableView glContextView; + GLProgramTableView glProgramView; + GLTextureTableView glTextureView; public GLPage(Composite parent, int style) { super(parent, style); - glDataMaker = GLDataMaker.getInstance(); - setTitle(AnalyzerLabels.COOLBAR_AREA_OPENGLES); this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_GRAPHICS_TOOLTIP); @@ -83,8 +94,25 @@ public class GLPage extends DAPageComposite { glAPIListView = new GLAPIListView(bottomForm, SWT.NONE); addView(glAPIListView); - glStateView = new GLContextView(bottomForm, SWT.NONE); - addView(glStateView); + DATabComposite glStateTabView = new DATabComposite(bottomForm, + SWT.NONE, false); + addView(stateTabID, glStateTabView); + { + glContextView = new GLContextTableView( + glStateTabView.getContentComposite(), SWT.NONE); + addView(glContextView); + glStateTabView.addView(glContextView, false); + + glProgramView = new GLProgramTableView( + glStateTabView.getContentComposite(), SWT.NONE); + addView(glProgramView); + glStateTabView.addView(glProgramView, false); + + glTextureView = new GLTextureTableView( + glStateTabView.getContentComposite(), SWT.NONE); + addView(glTextureView); + glStateTabView.addView(glTextureView, false); + } leftForm.setWeights(new int[] { 30, 70 }); bottomForm.setWeights(new int[] { 50, 50 }); @@ -94,9 +122,9 @@ public class GLPage extends DAPageComposite { ScreenshotTabComposite tabView = new ScreenshotTabComposite(rightForm, SWT.NONE, GLPage.pageID); tabView.setObservingViews(ScreenshotTabComposite.screenshotViewID, - new String[] { GLPage.listViewID }); + new String[] { GLPage.apiListViewID }); tabView.setObservingViews(ScreenshotTabComposite.callstackViewID, - new String[] { GLPage.listViewID }); + new String[] { GLPage.apiListViewID }); addView(tabView); GLDetailsView detailsView = new GLDetailsView(rightForm, SWT.NONE); @@ -110,7 +138,8 @@ public class GLPage extends DAPageComposite { rightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH); bottomForm.setSashWidth(AnalyzerConstants.SASH_WIDTH); - DataManagerRegistry.registerPageDataManager(glDataMaker); + DataManagerRegistry + .registerPageDataManager(GLDataManager.getInstance()); } @Override @@ -131,6 +160,6 @@ public class GLPage extends DAPageComposite { @Override public void clear() { super.clear(); - glDataMaker.clear(); + GLDataManager.getInstance().clear(); } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLChart.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLChart.java new file mode 100644 index 0000000..e13551a --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLChart.java @@ -0,0 +1,157 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.chart; + +import java.util.List; + +import org.eclipse.swt.graphics.Image; +import org.tizen.dynamicanalyzer.nl.TimelineChartLabels; +import org.tizen.dynamicanalyzer.resources.FontResources; +import org.tizen.dynamicanalyzer.resources.ImageResources; +import org.tizen.dynamicanalyzer.swap.logparser.LogPackage; +import org.tizen.dynamicanalyzer.ui.common.PopupAnalysisMenuItemClickListener; +import org.tizen.dynamicanalyzer.ui.common.PopupClearMenuItemClickListener; +import org.tizen.dynamicanalyzer.ui.common.PopupEndMenuItemClickListener; +import org.tizen.dynamicanalyzer.ui.common.PopupFromSelectionMenuItemClickListener; +import org.tizen.dynamicanalyzer.ui.common.PopupStartMenuItemClickListener; +import org.tizen.dynamicanalyzer.widgets.chart.DAChart; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries; +import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard; +import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem; +import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu; +import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem; + +public abstract class GLChart { + protected DAChart chart; + protected int chartType; + protected int chartStyle = DAChart.CHART_STYLE_NORMAL; + protected int probeType; + protected String chartName; + protected Image chartIcon; + protected Image addIcon; + protected DAPopupMenu popupMenu; + + public abstract void parseLogPackage(LogPackage logPack); + + public DAChartBoardItem createBoardItem(final DAChartBoard chartBoard, boolean enablePopupMenu) { + DAChartBoardItem item = new DAChartBoardItem(chartBoard, chartName, + chartIcon, chartStyle); + chart = item.getChart(); + + setChartStyle(); + if(enablePopupMenu){ + popupMenu = new DAPopupMenu(chart); + initPopupMenu(chartBoard, popupMenu); + } + return item; + } + + protected void initPopupMenu(DAChartBoard chartBoard, DAPopupMenu popupMenu) { + popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT); + DAPopupMenuItem startItem = new DAPopupMenuItem(popupMenu); + startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START); + startItem.addListener(new PopupStartMenuItemClickListener(startItem, + chartBoard)); + + DAPopupMenuItem endItem = new DAPopupMenuItem(popupMenu); + endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END); + endItem.addListener(new PopupEndMenuItemClickListener(endItem, + chartBoard)); + + DAPopupMenuItem fromSelectionItem = new DAPopupMenuItem(popupMenu); + fromSelectionItem + .setText(TimelineChartLabels.RANGE_CONTEXT_SET_FROM_SELECTION); + fromSelectionItem + .addListener(new PopupFromSelectionMenuItemClickListener( + fromSelectionItem, chartBoard)); + + DAPopupMenuItem analysisItem = new DAPopupMenuItem(popupMenu); + analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS); + analysisItem.addListener(new PopupAnalysisMenuItemClickListener()); + + DAPopupMenuItem clearItem = new DAPopupMenuItem(popupMenu); + clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR); + clearItem.addListener(new PopupClearMenuItemClickListener()); + } + + public void clear() { + List seriesList = chart.getSeriesList(); + for (DAChartSeries series : seriesList) { + series.clear(); + } + } + + public List getBaseDASeriesList() { + return chart.getSeriesList(); + } + + protected void setChartStyle() { + DAChartPlot plot = chart.getPlot(); + if (null == plot) { + return; + } + plot.setBackgroundImage(ImageResources.BG_GRADIENT); + plot.setAutoHeightRange(AutoRangeType.SEMI_AUTO); + DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1); + tooltip.setFont(FontResources.CHART_TOOLTIP_FONT); + plot.setTooltip(tooltip); + plot.setAxisFont(FontResources.CHART_AXIS_FONT); + } + + public void update() { + if (chart != null && !chart.isDisposed()) { + chart.redraw(); + } + } + + public int getChartType() { + return chartType; + } + + public String getChartName() { + return chartName; + } + + public Image getChartIcon() { + return chartIcon; + } + + public Image getAddIcon() { + return addIcon; + } + + public int getProbeType() { + return probeType; + } + + public DAPopupMenu getPopupMenu() { + return popupMenu; + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLChartBoard.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLChartBoard.java new file mode 100644 index 0000000..96d9468 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLChartBoard.java @@ -0,0 +1,77 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.chart; + +import org.eclipse.swt.widgets.Composite; +import org.tizen.dynamicanalyzer.resources.ColorResources; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker; +import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard; + +public abstract class GLChartBoard extends DAChartBoard { + + public GLChartBoard(Composite parent, String title, int boardStyle) { + super(parent, title, boardStyle); + // TODO Auto-generated constructor stub + } + + protected abstract void updateViewFromDBData(); + + @Override + protected void callBackScaleChanged() { + super.callBackScaleChanged(); + updateViewFromDBData(); + } + + @Override + protected void callBackScrollChanged() { + super.callBackScrollChanged(); + updateViewFromDBData(); + } + + public void initIntervalMarkers() { + // selection marker + DAChartPlotIntervalMarker selectionMarker = new DAChartPlotIntervalMarker( + -1, -1, DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_AREA); + selectionMarker.setBackgroundColor(ColorResources.SELECTION_RANGE); + selectionMarker.setAlpha((int) (255 * 0.25)); + addIntervalMarker(selectionMarker); + + // range analysis marker + DAChartPlotIntervalMarker rangeAnalyzeMarker = new DAChartPlotIntervalMarker( + -1, -1, DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_AREA); + rangeAnalyzeMarker.setBackgroundColor(ColorResources.YELLOW); + rangeAnalyzeMarker.setAlpha((int) (255 * 0.25)); + addIntervalMarker(rangeAnalyzeMarker); + + // range marker + DAChartPlotIntervalMarker rangeMarker = new DAChartPlotIntervalMarker( + -1, -1, DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_LINE); + rangeMarker.setForegroundColor(ColorResources.RED); + rangeMarker.setAlpha((int) (255 * 0.25)); + addIntervalMarker(rangeMarker); + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLChartView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLChartView.java new file mode 100644 index 0000000..8866b77 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLChartView.java @@ -0,0 +1,293 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.chart; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.StackLayout; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.tizen.dynamicanalyzer.nl.GLPageLabels; +import org.tizen.dynamicanalyzer.nl.ThreadPageLabels; +import org.tizen.dynamicanalyzer.resources.ColorResources; +import org.tizen.dynamicanalyzer.resources.FontResources; +import org.tizen.dynamicanalyzer.resources.ImageResources; +import org.tizen.dynamicanalyzer.ui.common.SetRangeMarkerMouseMoveListener; +import org.tizen.dynamicanalyzer.ui.common.UICommonConstants; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData; +import org.tizen.dynamicanalyzer.ui.range.RangeDataManager; +import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser; +import org.tizen.dynamicanalyzer.ui.widgets.TitleComboPopupRenderer; +import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker; +import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard; +import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo; +import org.tizen.dynamicanalyzer.widgets.combo.DACustomComboSelectionListener; +import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite; +import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData; +import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline; + +public class GLChartView extends DAViewComposite { + public static final String ID = GLChartView.class.getName(); + private static final int COMBO_HEIGHT = 24; + + private final Composite contents; + private GLFrameTimeChartBoard frameTimeChartBoard; + private GLFrameRateChartBoard frameRateChartBoard; + private DACustomCombo frameTimeCombo; + private DACustomCombo frameRateCombo; + private final StackLayout stackLayout; + + public GLChartView(Composite parent, int style) { + super(parent, style, false); + setLayout(new FillLayout()); + + setTitle(ThreadPageLabels.THREAD_CHART_TITLE); + + contents = getContentArea(); + contents.setBackground(ColorResources.WINDOW_BG_COLOR); + + stackLayout = new StackLayout(); + contents.setLayout(stackLayout); + + initFrameTimeChart(); + initFrameRateChart(); + + stackLayout.topControl = frameRateChartBoard; + + frameTimeChartBoard.setSelectable(false); + frameRateChartBoard.setSelectable(false); + + initializeCharts(); + + DATimeline frameTimeline = frameTimeChartBoard.getTimeline(); + frameTimeline.setTimeTickFont(FontResources.TIMELINE_TICK_FONT); + frameTimeline.setTimeBalloonFont(FontResources.TIMELINE_BALLOON_FONT); + frameTimeline.addMouseMoveListener(new SetRangeMarkerMouseMoveListener( + RangeDataManager.getInstance(), frameTimeChartBoard, + frameTimeline)); + + DATimeline frameRateline = frameRateChartBoard.getTimeline(); + frameRateline.setTimeTickFont(FontResources.TIMELINE_TICK_FONT); + frameRateline.setTimeBalloonFont(FontResources.TIMELINE_BALLOON_FONT); + LifecycleLogParser.getInstance().registerLifecycleBar( + frameRateChartBoard.getLifecycleBar()); + LifecycleLogParser.getInstance().registerTimeline(frameRateline); + frameRateline.addMouseMoveListener(new SetRangeMarkerMouseMoveListener( + RangeDataManager.getInstance(), frameRateChartBoard, + frameRateline)); + + } + + private void initFrameTimeChart() { + frameTimeChartBoard = new GLFrameTimeChartBoard(contents, + GLPageLabels.GL_CHART_TITLE_FRAME_TIME, + DAChartBoard.BOARD_STYLE_FRAME); + frameTimeChartBoard.setNameFont(FontResources.CHART_NAME_FONT); + + frameTimeCombo = new DACustomCombo(frameTimeChartBoard.getTitleComp(), + SWT.NONE); + frameTimeCombo.setImages(ImageResources.TIMELINE_DROPDOWN_NORMAL, + ImageResources.TIMELINE_DROPDOWN_HOVER, + ImageResources.TIMELINE_DROPDOWN_PUSH, + ImageResources.TIMELINE_DROPDOWN_NORMAL); + frameTimeCombo.add(GLPageLabels.GL_CHART_TITLE_FRAME_RATE); + frameTimeCombo.add(GLPageLabels.GL_CHART_TITLE_FRAME_TIME); + frameTimeCombo.setTextAlign(DACustomCombo.TEXT_ALIGN_CENTER); + frameTimeCombo.select(1); + frameTimeCombo.setComboButtonGradation( + ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_START, + ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_END, + ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_START, + ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_END, + ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_START, + ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_END, + ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_START, + ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_END); + frameTimeCombo.setButtonImages(ImageResources.COMBO_DROPDOWN_UP, + ImageResources.COMBO_DROPDOWN_DOWN); + frameTimeCombo.setEnabled(true); + frameTimeCombo.setItemHeight(COMBO_HEIGHT); + frameTimeCombo.setComboRender(new GLTitleComboRenderer()); + frameTimeCombo.setComboPopupRender(new TitleComboPopupRenderer()); + frameTimeCombo.setButtonRenderer(new DACustomButtonRenderer()); + frameTimeCombo + .addSelectionListener(new DACustomComboSelectionListener() { + @Override + public void selectionEvent(DACustomCombo combo) { + String selected = combo.getText(); + if (null == selected || selected.isEmpty()) { + return; + } + if (selected + .equals(GLPageLabels.GL_CHART_TITLE_FRAME_RATE)) { + changeComboRateToTime(); + } else { + return; + } + } + }); + } + + private void initFrameRateChart() { + + frameRateChartBoard = new GLFrameRateChartBoard(contents, + GLPageLabels.GL_CHART_TITLE_FRAME_RATE, + DAChartBoard.BOARD_STYLE_TIME); + frameRateChartBoard.setNameFont(FontResources.CHART_NAME_FONT); + + frameRateCombo = new DACustomCombo(frameRateChartBoard.getTitleComp(), + SWT.NONE); + + frameRateCombo.setImages(ImageResources.TIMELINE_DROPDOWN_NORMAL, + ImageResources.TIMELINE_DROPDOWN_HOVER, + ImageResources.TIMELINE_DROPDOWN_PUSH, + ImageResources.TIMELINE_DROPDOWN_NORMAL); + frameRateCombo.add(GLPageLabels.GL_CHART_TITLE_FRAME_RATE); + frameRateCombo.add(GLPageLabels.GL_CHART_TITLE_FRAME_TIME); + frameRateCombo.setTextAlign(DACustomCombo.TEXT_ALIGN_CENTER); + frameRateCombo.select(0); + frameRateCombo.setComboButtonGradation( + ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_START, + ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_END, + ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_START, + ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_END, + ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_START, + ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_END, + ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_START, + ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_END); + frameRateCombo.setButtonImages(ImageResources.COMBO_DROPDOWN_UP, + ImageResources.COMBO_DROPDOWN_DOWN); + frameRateCombo.setEnabled(true); + frameRateCombo.setItemHeight(COMBO_HEIGHT); + frameRateCombo.setComboRender(new GLTitleComboRenderer()); + frameRateCombo.setComboPopupRender(new TitleComboPopupRenderer()); + frameRateCombo.setButtonRenderer(new DACustomButtonRenderer()); + frameRateCombo + .addSelectionListener(new DACustomComboSelectionListener() { + @Override + public void selectionEvent(DACustomCombo combo) { + String selected = combo.getText(); + if (null == selected || selected.isEmpty()) { + return; + } + if (selected + .equals(GLPageLabels.GL_CHART_TITLE_FRAME_TIME)) { + changeComboTimeToRate(); + } else { + return; + } + } + }); + } + + private void changeComboRateToTime() { + stackLayout.topControl = frameRateChartBoard; + GLDataManager.getInstance().setShowFrameRateChart(true); + contents.layout(); + frameRateCombo.setText(GLPageLabels.GL_CHART_TITLE_FRAME_RATE); + frameRateChartBoard.setScaleVal(frameTimeChartBoard.getScaleVal()); + frameRateChartBoard.setVisibleStart(frameTimeChartBoard + .getVisibleStart()); + frameRateChartBoard.setItemsHeightMode(frameTimeChartBoard + .isItemMinimized()); + updateView(); + } + + private void changeComboTimeToRate() { + stackLayout.topControl = frameTimeChartBoard; + GLDataManager.getInstance().setShowFrameRateChart(false); + contents.layout(); + frameTimeCombo.setText(GLPageLabels.GL_CHART_TITLE_FRAME_TIME); + frameTimeChartBoard.setScaleVal(frameRateChartBoard.getScaleVal()); + frameTimeChartBoard.setVisibleStart(frameRateChartBoard + .getVisibleStart()); + frameTimeChartBoard.setItemsHeightMode(frameRateChartBoard + .isItemMinimized()); + updateView(); + } + + @Override + public void updateView() { + if (stackLayout.topControl == frameTimeChartBoard) { + frameTimeChartBoard.updateView(); + } else { + frameRateChartBoard.updateView(); + } + + } + + @Override + public void updateView(DAViewData vdata) { + if (vdata instanceof GLSelectionData) { + GLSelectionData data = (GLSelectionData) vdata; + String id = data.getViewID(); + if (id.equals(GLPage.contextHistoryID)) { + DAChartPlotIntervalMarker intervalMarker = null; + if (stackLayout.topControl == frameTimeChartBoard) { + int frameIndex = data.getFrameTimeIndex(); + frameTimeChartBoard.setVisibleMiddleTime(frameIndex); + intervalMarker = (DAChartPlotIntervalMarker) frameTimeChartBoard + .getMarkers().get( + UICommonConstants.SELECTION_MARKER_INDEX); + intervalMarker.setInterval(frameIndex, frameIndex); + + frameTimeChartBoard.updateViewFromDBData(); + } else { + int chartIndex = data.getFrameRateIndex(); + if (chartIndex == 1) { + chartIndex = GLDataManager.getInstance() + .getStartFrameRateTime(); + } + frameRateChartBoard.setVisibleMiddleTime(chartIndex); + intervalMarker = (DAChartPlotIntervalMarker) frameRateChartBoard + .getMarkers().get( + UICommonConstants.SELECTION_MARKER_INDEX); + intervalMarker.setInterval(chartIndex, chartIndex); + + frameRateChartBoard.updateViewFromDBData(); + } + } + } + } + + @Override + public void clear() { + frameTimeChartBoard.contentsClear(); + frameTimeChartBoard.clear(); + frameRateChartBoard.contentsClear(); + frameRateChartBoard.clear(); + initializeCharts(); + } + + private void initializeCharts() { + frameRateChartBoard.initializeCharts(); + frameTimeChartBoard.initializeCharts(); + } +} 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 new file mode 100644 index 0000000..7f29fe8 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameRateChart.java @@ -0,0 +1,130 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.chart; + +import java.util.List; + +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.nl.GLPageLabels; +import org.tizen.dynamicanalyzer.resources.ColorResources; +import org.tizen.dynamicanalyzer.resources.ImageResources; +import org.tizen.dynamicanalyzer.swap.logparser.LogPackage; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLFrameRateDBTableManager; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem; +import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard; +import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem; + +public class GLFrameRateChart extends GLChart { + private static GLFrameRateChart instance = null; + private static final String FRAMES = GLPageLabels.GL_FRAME; + + private DAChartSeries frameRateSeries = null; + + public static GLFrameRateChart getInstance() { + if (instance == null) { + instance = new GLFrameRateChart(); + } + return instance; + } + + private GLFrameRateChart() { + chartName = GLPageLabels.GL_CHART_TITLE_FRAME_TIME; + chartIcon = ImageResources.CHART_FRAME_RATE; + frameRateSeries = new DAChartSeries(chartName, + DAChartSeries.SERIES_STYLE_BAR, + ColorResources.SERIES_COLOR_CPU_APP); + } + + @Override + public DAChartBoardItem createBoardItem(DAChartBoard chartBoard, + boolean enablePopupMenu) { + DAChartBoardItem item = super.createBoardItem(chartBoard, + enablePopupMenu); + chart.addSeries(frameRateSeries); + chart.getPlot().setSeriesHeightRange(true); + chart.getPlot().setAutoHeightRange(AutoRangeType.AUTO); + chart.getPlot().setAxisUnit(FRAMES); + chart.getPlot().setAxisUnitType(DAChartPlot.UnitType.DECIMAL); + chart.getPlot().setShowAxis(true); + return item; + } + + public void updateView(double startIndex, double endIndex) { + frameRateSeries.getSeriesItemList().clear(); + + List> chartDataList = GLDataManager.getInstance() + .getFrameRateDBTableManager() + .selectFrameRate(startIndex, endIndex); + if (null == chartDataList || chartDataList.size() == 0 + || chartDataList.get(0).size() == 0) { + return; + } + if (startIndex == 0) { + int frameRateStartTime = (Integer) chartDataList.get(0).get( + GLFrameRateDBTableManager.TABLE_CHART_TIME_INDEX); + if (GLDataManager.getInstance().getStartFrameRateTime() < frameRateStartTime) { + GLDataManager.getInstance().setStartFrameRateTime( + frameRateStartTime); + } + } + + for (int i = 0; i < chartDataList.size(); i++) { + List chartData = chartDataList.get(i); + + addData((Integer) chartData + .get(GLFrameRateDBTableManager.TABLE_CHART_TIME_INDEX), + (Integer) chartData + .get(GLFrameRateDBTableManager.TABLE_FRAME_INDEX_INDEX), + (Integer) chartData + .get(GLFrameRateDBTableManager.TABLE_FRAME_COUNT_INDEX), + (Integer) chartData + .get(GLFrameRateDBTableManager.TABLE_ERROR_INFO_INDEX)); + } + } + + @Override + public void parseLogPackage(LogPackage logPack) { + } + + public void addData(final int frameNumber, int startFrameIndex, + int frameCount, int drawError) { + + String tooltipMessage = startFrameIndex + CommonConstants.DASH + + (startFrameIndex + frameCount) + FRAMES; + if (drawError > 0) { + frameRateSeries.addSeriesItem(new DAChartSeriesItem(frameNumber, + frameCount, ColorResources.RED, tooltipMessage, false)); + } else { + frameRateSeries.addSeriesItem(new DAChartSeriesItem(frameNumber, + frameCount, tooltipMessage, false)); + } + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameRateChartBoard.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameRateChartBoard.java new file mode 100644 index 0000000..d796053 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameRateChartBoard.java @@ -0,0 +1,103 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.chart; + +import org.eclipse.swt.widgets.Composite; +import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter; +import org.tizen.dynamicanalyzer.ui.common.UICommonConstants; +import org.tizen.dynamicanalyzer.ui.opengl.chart.listener.GLFrameRateMouseListener; +import org.tizen.dynamicanalyzer.ui.range.RangeDataManager; +import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants; +import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea; +import org.tizen.dynamicanalyzer.widgets.chart.DAChart; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker; +import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem; + +public class GLFrameRateChartBoard extends GLChartBoard { + + public GLFrameRateChartBoard(Composite parent, String title, int boardStyle) { + super(parent, title, boardStyle); + } + + public void updateView() { + + long totalEndTime = ToolbarArea.getInstance().getTime(); + setTotalEndTime(totalEndTime); + + double timelineMarkerStartTime = RangeDataManager.getInstance() + .getMarkerStartTime() / TimelineConstants.MEGA_DOUBLE; + double timelineMarkerEndTime = RangeDataManager.getInstance() + .getMarkerEndTime() / TimelineConstants.MEGA_DOUBLE; + + setTimelineMarkerStartTime(timelineMarkerStartTime); + setTimelineMarkerEndTime(timelineMarkerEndTime); + + double analysisStartTime = RangeDataManager.getInstance() + .getAnalysisStartTime() / TimelineConstants.MEGA_DOUBLE; + double analysisEndTime = RangeDataManager.getInstance() + .getAnalysisEndTime() / TimelineConstants.MEGA_DOUBLE; + + if (RangeDataManager.getInstance().isBeingAnalyzed()) { + + ((DAChartPlotIntervalMarker) getMarkers().get( + UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX)) + .setInterval(analysisStartTime, analysisEndTime); + } else { + ((DAChartPlotIntervalMarker) getMarkers().get( + UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX)) + .setInterval(-1, -1); + } + updateViewFromDBData(); + + } + + public void initializeCharts() { + initIntervalMarkers(); + + GLFrameRateChart frameRateChart = GLFrameRateChart.getInstance(); + DAChartBoardItem frameRateChartItem = frameRateChart.createBoardItem( + this, true); + DAChart frameRateChartWidget = frameRateChartItem.getChart(); + + GLFrameRateMouseListener glFrameRateMouseEventListener = new GLFrameRateMouseListener( + frameRateChart.getPopupMenu(), getTimeline()); + frameRateChartWidget.getPlot().setMarkers(getMarkers()); + frameRateChartWidget.addMouseListener(glFrameRateMouseEventListener); + frameRateChartWidget + .addMouseMoveListener(glFrameRateMouseEventListener); + frameRateChartWidget + .addMouseTrackListener(new TimelineChartMouseTrackAdapter( + getTimeline())); + } + + protected void updateViewFromDBData() { + GLFrameRateChart.getInstance().updateView(getVisibleStartTime(), + getVisibleEndTime()); + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLFrameTimeChart.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameTimeChart.java similarity index 54% rename from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLFrameTimeChart.java rename to org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameTimeChart.java index 33396e6..c73d8a9 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLFrameTimeChart.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameTimeChart.java @@ -4,7 +4,7 @@ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: - * Sanghyun Lee + * Hyunjong Park * Juyoung Kim * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,12 +24,17 @@ * */ -package org.tizen.dynamicanalyzer.ui.opengl.ui.chart; +package org.tizen.dynamicanalyzer.ui.opengl.chart; +import java.util.List; + +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.nl.GLPageLabels; import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.resources.ImageResources; import org.tizen.dynamicanalyzer.swap.logparser.LogPackage; -import org.tizen.dynamicanalyzer.ui.timeline.chart.TimelineChart; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLFrameTimeDBTableManager; import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot; import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType; import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries; @@ -37,9 +42,10 @@ import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem; import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard; import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem; -public class GLFrameTimeChart extends TimelineChart { +public class GLFrameTimeChart extends GLChart { private static GLFrameTimeChart instance = null; - private static final String MS = "ms"; + private static final String MS = "ms";//$NON-NLS-1$ + private static final String FPS = "fps";//$NON-NLS-1$ private DAChartSeries frameTimeSeries; @@ -47,12 +53,11 @@ public class GLFrameTimeChart extends TimelineChart { if (instance == null) { instance = new GLFrameTimeChart(); } - return instance; } private GLFrameTimeChart() { - chartName = "Frame time"; + chartName = GLPageLabels.GL_CHART_TITLE_FRAME_TIME; chartIcon = ImageResources.CHART_FRAME_TIME; frameTimeSeries = new DAChartSeries(chartName, DAChartSeries.SERIES_STYLE_BAR, @@ -60,11 +65,12 @@ public class GLFrameTimeChart extends TimelineChart { } @Override - public DAChartBoardItem createBoardItem(DAChartBoard chartBoard) { - DAChartBoardItem item = super.createBoardItem(chartBoard); + public DAChartBoardItem createBoardItem(DAChartBoard chartBoard, + boolean enablePopupMenu) { + DAChartBoardItem item = super.createBoardItem(chartBoard, + enablePopupMenu); chart.addSeries(frameTimeSeries); - chart.getPlot().setSeriesHeightRange(true); chart.getPlot().setAutoHeightRange(AutoRangeType.AUTO); chart.getPlot().setAxisUnit(MS); @@ -73,16 +79,45 @@ public class GLFrameTimeChart extends TimelineChart { return item; } - - public void addData(final int frameNumber, long frameTime, boolean drawError) { + + public void updateView(double startIndex, double endIndex) { + frameTimeSeries.getSeriesItemList().clear(); + List> chartDataList = GLDataManager.getInstance() + .getFrameTimeDBTableManager() + .selectFrameTime(startIndex, endIndex); + if (null == chartDataList) { + return; + } else { + for (int i = 0; i < chartDataList.size(); i++) { + List chartData = chartDataList.get(i); + addData((Integer) chartData + .get(GLFrameTimeDBTableManager.TABLE_CHART_TIME_INDEX), + (Integer) chartData + .get(GLFrameTimeDBTableManager.TABLE_VALUE_INDEX), + (Integer) chartData + .get(GLFrameTimeDBTableManager.TABLE_ERROR_INFO_INDEX)); + } + } + } + + @Override + public void parseLogPackage(LogPackage logPack) { + } + + public void addData(final int frameNumber, int frameTime, int drawError) { double fps = Math.round(1000 / (double) frameTime); - if (drawError) { + if (drawError > 0) { frameTimeSeries.addSeriesItem(new DAChartSeriesItem(frameNumber, - frameTime, ColorResources.RED, frameTime + MS + "(" + fps - + "fps)")); + frameTime, ColorResources.RED, frameTime + MS + + CommonConstants.OPEN_BRACKET + fps + FPS + + CommonConstants.CLOSE_BRACKET, false)); } else { - frameTimeSeries.addSeriesItem(new DAChartSeriesItem(frameNumber, - frameTime, frameTime + MS + "(" + fps + "fps)")); + frameTimeSeries + .addSeriesItem(new DAChartSeriesItem(frameNumber, + frameTime, frameTime + MS + + CommonConstants.OPEN_BRACKET + fps + FPS + + CommonConstants.CLOSE_BRACKET, false)); } } + } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameTimeChartBoard.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameTimeChartBoard.java new file mode 100644 index 0000000..d631e7e --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLFrameTimeChartBoard.java @@ -0,0 +1,121 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.chart; + +import org.eclipse.swt.widgets.Composite; +import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter; +import org.tizen.dynamicanalyzer.ui.common.UICommonConstants; +import org.tizen.dynamicanalyzer.ui.opengl.chart.listener.GLFrameTimeBoundMouseListener; +import org.tizen.dynamicanalyzer.ui.opengl.chart.listener.GLFrameTimeMouseListener; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; +import org.tizen.dynamicanalyzer.ui.range.RangeDataManager; +import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants; +import org.tizen.dynamicanalyzer.widgets.chart.DAChart; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker; +import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem; + +public class GLFrameTimeChartBoard extends GLChartBoard { + + public GLFrameTimeChartBoard(Composite parent, String title, int boardStyle) { + super(parent, title, boardStyle); + // TODO Auto-generated constructor stub + } + + public void updateView() { + + long totalEndTime = GLDataManager.getInstance().getFrameSize() + * TimelineConstants.MEGA_LONG; + setTotalEndTime(totalEndTime); + + double timelineMarkerStartTime = RangeDataManager.getInstance() + .getMarkerStartTime() / TimelineConstants.MEGA_DOUBLE; + double timelineMarkerEndTime = RangeDataManager.getInstance() + .getMarkerEndTime() / TimelineConstants.MEGA_DOUBLE; + + setTimelineMarkerStartTime(timelineMarkerStartTime); + setTimelineMarkerEndTime(timelineMarkerEndTime); + + double analysisStartTime = RangeDataManager.getInstance() + .getAnalysisStartTime() / TimelineConstants.MEGA_DOUBLE; + double analysisEndTime = RangeDataManager.getInstance() + .getAnalysisEndTime() / TimelineConstants.MEGA_DOUBLE; + + if (RangeDataManager.getInstance().isBeingAnalyzed()) { + ((DAChartPlotIntervalMarker) getMarkers().get( + UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX)) + .setInterval(analysisStartTime, analysisEndTime); + } else { + ((DAChartPlotIntervalMarker) getMarkers().get( + UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX)) + .setInterval(-1, -1); + } + + ((DAChartPlotIntervalMarker) getMarkers().get( + UICommonConstants.RANGE_MARKER_INDEX)).setInterval( + timelineMarkerStartTime, timelineMarkerEndTime); + + ((DAChartPlotIntervalMarker) getMarkers().get( + UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX)).setInterval(-1, + -1); + + updateViewFromDBData(); + + } + + public void initializeCharts() { + initIntervalMarkers(); + + GLFrameTimeChart frameTimeChart = GLFrameTimeChart.getInstance(); + DAChartBoardItem frameTimeChartItem = frameTimeChart.createBoardItem( + this, false); + DAChart frameTimeChartWidget = frameTimeChartItem.getChart(); + + GLFrameTimeMouseListener glFrameChartMouseEventListener = new GLFrameTimeMouseListener( + frameTimeChart.getPopupMenu(), getTimeline()); + + frameTimeChartWidget.getPlot().setMarkers(getMarkers()); + frameTimeChartWidget.addMouseListener(glFrameChartMouseEventListener); + frameTimeChartWidget + .addMouseMoveListener(glFrameChartMouseEventListener); + frameTimeChartWidget + .addMouseTrackListener(new TimelineChartMouseTrackAdapter( + getTimeline())); + + GLFrameTimeBoundMouseListener upperBoundLineEventListener = new GLFrameTimeBoundMouseListener( + frameTimeChartWidget, DAChartPlot.BoundType.UPPER); + frameTimeChartWidget.addMouseListener(upperBoundLineEventListener); + frameTimeChartWidget.addMouseMoveListener(upperBoundLineEventListener); + frameTimeChartWidget.addMouseTrackListener(upperBoundLineEventListener); + } + + protected void updateViewFromDBData() { + GLFrameTimeChart.getInstance().updateView(getVisibleStartTime(), + getVisibleEndTime()); + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLTitleComboRenderer.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLTitleComboRenderer.java similarity index 61% rename from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLTitleComboRenderer.java rename to org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLTitleComboRenderer.java index 4dc01e4..1d1d629 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLTitleComboRenderer.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLTitleComboRenderer.java @@ -1,4 +1,31 @@ -package org.tizen.dynamicanalyzer.ui.opengl.ui.chart; +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.chart; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Font; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/GLTimeChartMouseEventListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/listener/GLChartMouseListener.java similarity index 64% rename from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/GLTimeChartMouseEventListener.java rename to org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/listener/GLChartMouseListener.java index ddf7dd2..45d7fda 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/GLTimeChartMouseEventListener.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/listener/GLChartMouseListener.java @@ -4,6 +4,7 @@ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: + * Hyunjong Park * Sanghyun Lee * Juyoung Kim * @@ -24,7 +25,7 @@ * */ -package org.tizen.dynamicanalyzer.ui.opengl.eventListner; +package org.tizen.dynamicanalyzer.ui.opengl.chart.listener; import java.util.List; @@ -34,15 +35,10 @@ import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseMoveListener; import org.tizen.dynamicanalyzer.common.AnalyzerManager; import org.tizen.dynamicanalyzer.common.DASelectionData; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataMaker; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLSelectionData; -import org.tizen.dynamicanalyzer.ui.opengl.data.model.FrameCountInfo; -import org.tizen.dynamicanalyzer.ui.opengl.ui.GLPage; import org.tizen.dynamicanalyzer.ui.range.RangeDataManager; import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage; import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants; import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea; -import org.tizen.dynamicanalyzer.util.DALogger; import org.tizen.dynamicanalyzer.widgets.chart.DAChart; import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot; import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker; @@ -51,13 +47,10 @@ import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip; import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries; import org.tizen.dynamicanalyzer.widgets.chart.DAUIEventChartPlot; import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu; -import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem; import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline; -public class GLTimeChartMouseEventListener extends MouseAdapter implements +public class GLChartMouseListener extends MouseAdapter implements MouseMoveListener { - private static final DALogger DA_LOG = DALogger.getInstance(); - protected RangeDataManager rangeDataManager = RangeDataManager .getInstance(); protected DAPopupMenu menu; @@ -65,101 +58,14 @@ public class GLTimeChartMouseEventListener extends MouseAdapter implements protected double baseTime = TimelineConstants.NOT_INITED; protected static final int SELECTION_MARKER_INDEX = 0; + protected int clickChartIndex = 0; - public GLTimeChartMouseEventListener(DAPopupMenu menu, DATimeline timeline) { + public GLChartMouseListener(DAPopupMenu menu, DATimeline timeline) { this.menu = menu; this.timeline = timeline; } @Override - public void mouseDown(MouseEvent e) { - DAChart chart = (DAChart) e.widget; - DAChartPlot plot = chart.getPlot(); - DAChartPlotMarker marker = plot.getMarkers() - .get(SELECTION_MARKER_INDEX); - if (!(marker instanceof DAChartPlotIntervalMarker)) { - return; - } - DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) marker; - - double eventTime = plot.getXFromXPixcel(e.x); - - if (e.button == 3) { - List itemList = menu.getItems(); - DAPopupMenuItem startItem = itemList.get(0); - DAPopupMenuItem endItem = itemList.get(1); - DAPopupMenuItem fromSelectionItem = itemList.get(2); - DAPopupMenuItem analysisItem = itemList.get(3); - DAPopupMenuItem clearItem = itemList.get(4); - - if (ToolbarArea.getInstance() == null) { - DA_LOG.debug("toolbar area is null");//$NON-NLS-1$ - return; - } - - if (eventTime * TimelineConstants.MEGA_DOUBLE <= ToolbarArea - .getInstance().getTime()) { - startItem.setEnabled(true); - endItem.setEnabled(true); - analysisItem.setEnabled(rangeDataManager.isAnalyzable()); - clearItem.setEnabled(rangeDataManager.isBeingAnalyzed()); - - startItem.setDoubleData(eventTime); - endItem.setDoubleData(eventTime); - } else { - startItem.setEnabled(false); - endItem.setEnabled(false); - analysisItem.setEnabled(rangeDataManager.isAnalyzable()); - clearItem.setEnabled(rangeDataManager.isBeingAnalyzed()); - } - - if (intervalMarker.getStartVal() != intervalMarker.getEndVal()) { - fromSelectionItem.setEnabled(true); - } else { - fromSelectionItem.setEnabled(false); - } - - return; - } - - boolean bShift = false; - if ((e.stateMask & SWT.SHIFT) != 0) { - bShift = true; - } - - if (bShift && intervalMarker.getStartVal() != -1) { - if (baseTime > eventTime) { - intervalMarker.setInterval(eventTime, baseTime); - } else { - intervalMarker.setInterval(baseTime, eventTime); - } - } else { - intervalMarker.setInterval(eventTime, eventTime); - baseTime = eventTime; - } - - chart.redraw(); - - int index = chart.getSeriesList().get(0) - .getPrevIndexByXvalue(plot.getXFromXPixcel(e.x)); - if (index < 0) { - return; - } - - // TODO - FrameCountInfo frameCountInfo = GLDataMaker.getInstance() - .getFrameCountInfo(index); - DA_LOG.debug("start : " + frameCountInfo.getStartFrameIndex() - + ", count : " + frameCountInfo.getFrameCount()); - - AnalyzerManager.getCurrentPage().updateView( - new GLSelectionData(GLPage.chartViewID, frameCountInfo - .getStartFrameIndex(), frameCountInfo - .getStartFrameIndex() + frameCountInfo.getFrameCount(), - null)); - } - - @Override public void mouseUp(MouseEvent e) { if (e.button == 3) { return; @@ -211,6 +117,10 @@ public class GLTimeChartMouseEventListener extends MouseAdapter implements sendSelectionTimes(intervalMarker.getStartVal(), intervalMarker.getEndVal()); timeline.setDetailFrame(frame); + + + + } @Override @@ -220,7 +130,7 @@ public class GLTimeChartMouseEventListener extends MouseAdapter implements DAChartPlotMarker marker = plot.getMarkers() .get(SELECTION_MARKER_INDEX); if (!(marker instanceof DAChartPlotIntervalMarker)) { - DA_LOG.debug("mouseMove !IntervalMarker"); + System.out.println("mouseMove !IntervalMarker"); return; } DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) marker; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/GLFrameChartMouseEventListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/listener/GLFrameRateMouseListener.java similarity index 72% rename from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/GLFrameChartMouseEventListener.java rename to org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/listener/GLFrameRateMouseListener.java index af5cdf8..75666ee 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/GLFrameChartMouseEventListener.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/listener/GLFrameRateMouseListener.java @@ -4,6 +4,7 @@ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: + * Hyunjong Park * Sanghyun Lee * Juyoung Kim * @@ -24,21 +25,19 @@ * */ -package org.tizen.dynamicanalyzer.ui.opengl.eventListner; +package org.tizen.dynamicanalyzer.ui.opengl.chart.listener; import java.util.List; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseEvent; import org.tizen.dynamicanalyzer.common.AnalyzerManager; -import org.tizen.dynamicanalyzer.common.DASelectionData; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataMaker; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLSelectionData; -import org.tizen.dynamicanalyzer.ui.opengl.ui.GLPage; -import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.FrameCountInfoType; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData; import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants; import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea; -import org.tizen.dynamicanalyzer.util.DALogger; import org.tizen.dynamicanalyzer.widgets.chart.DAChart; import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot; import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker; @@ -47,11 +46,9 @@ import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu; import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem; import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline; -public class GLFrameChartMouseEventListener extends - GLTimeChartMouseEventListener { - private static final DALogger DA_LOG = DALogger.getInstance(); +public class GLFrameRateMouseListener extends GLChartMouseListener { - public GLFrameChartMouseEventListener(DAPopupMenu menu, DATimeline timeline) { + public GLFrameRateMouseListener(DAPopupMenu menu, DATimeline timeline) { super(menu, timeline); } @@ -66,7 +63,7 @@ public class GLFrameChartMouseEventListener extends } DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) marker; - double eventFrameIndex = plot.getXFromXPixcel(e.x); + double eventTime = plot.getXFromXPixcel(e.x); if (e.button == 3) { List itemList = menu.getItems(); @@ -77,19 +74,19 @@ public class GLFrameChartMouseEventListener extends DAPopupMenuItem clearItem = itemList.get(4); if (ToolbarArea.getInstance() == null) { - DA_LOG.debug("toolbar area is null");//$NON-NLS-1$ + System.out.println("toolbar area is null"); return; } - if (eventFrameIndex * TimelineConstants.MEGA_DOUBLE <= ToolbarArea + if (eventTime * TimelineConstants.MEGA_DOUBLE <= ToolbarArea .getInstance().getTime()) { startItem.setEnabled(true); endItem.setEnabled(true); analysisItem.setEnabled(rangeDataManager.isAnalyzable()); clearItem.setEnabled(rangeDataManager.isBeingAnalyzed()); - startItem.setDoubleData(eventFrameIndex); - endItem.setDoubleData(eventFrameIndex); + startItem.setDoubleData(eventTime); + endItem.setDoubleData(eventTime); } else { startItem.setEnabled(false); endItem.setEnabled(false); @@ -112,26 +109,23 @@ public class GLFrameChartMouseEventListener extends } if (bShift && intervalMarker.getStartVal() != -1) { - if (baseTime > eventFrameIndex) { - intervalMarker.setInterval(eventFrameIndex, baseTime); + if (baseTime > eventTime) { + intervalMarker.setInterval(eventTime, baseTime); } else { - intervalMarker.setInterval(baseTime, eventFrameIndex); + intervalMarker.setInterval(baseTime, eventTime); } } else { - intervalMarker.setInterval(eventFrameIndex, eventFrameIndex); - baseTime = eventFrameIndex; + intervalMarker.setInterval(eventTime, eventTime); + baseTime = eventTime; } chart.redraw(); - int index = chart.getSeriesList().get(0) + clickChartIndex = chart.getSeriesList().get(0) .getPrevIndexByXvalue(plot.getXFromXPixcel(e.x)); - if (index < 0) { + if (clickChartIndex < 0) { return; } - - AnalyzerManager.getCurrentPage().updateView( - new GLSelectionData(GLPage.chartViewID, index, -1, null)); } @Override @@ -161,7 +155,7 @@ public class GLFrameChartMouseEventListener extends markerEndVal = eventFrameIndex; } - int lastFrame = GLDataMaker.getInstance().getFrameSize() - 1; + int lastFrame = GLDataManager.getInstance().getFrameSize(); if (markerStartVal < 0) { markerStartVal = 0; @@ -175,21 +169,29 @@ public class GLFrameChartMouseEventListener extends markerEndVal = 0; } + int startIndex = 0; + int endIndex = 0; + if (markerEndVal <= plot.getVisibleEndX()) { intervalMarker.setInterval(markerStartVal, markerEndVal); + startIndex = (int) markerStartVal; + endIndex = (int) markerEndVal; } else { intervalMarker.setInterval(markerStartVal, plot.getVisibleEndX()); + startIndex = (int) markerStartVal; + endIndex = (int) plot.getVisibleEndX(); } - int frame = (int) eventFrameIndex <= lastFrame ? (int) eventFrameIndex - : lastFrame; - try { - long time = GLDataMaker.getInstance().getFrameData(frame) - .getGLApiDataList().get(0).getTime(); - AnalyzerManager.getCurrentPage().updateView( - new DASelectionData(TimelinePage.timelineViewID, time, - time, null, null)); - } catch (IndexOutOfBoundsException ie) { + FrameCountInfoType selectionFrameCountInfo = GLDataManager + .getInstance().getFrameRateStartIndex(startIndex, endIndex); + if (null == selectionFrameCountInfo) { + return; } + + AnalyzerManager.getCurrentPage().updateView( + new GLSelectionData(GLPage.chartViewID, selectionFrameCountInfo + .getStartFrameIndex(), selectionFrameCountInfo + .getEndFrameIndex(), null)); } + } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/BoundLineEventListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/listener/GLFrameTimeBoundMouseListener.java similarity index 92% rename from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/BoundLineEventListener.java rename to org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/listener/GLFrameTimeBoundMouseListener.java index 649927c..c36ef73 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/BoundLineEventListener.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/listener/GLFrameTimeBoundMouseListener.java @@ -4,6 +4,7 @@ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: + * Hyunjong Park * Sanghyun Lee * Juyoung Kim * @@ -24,7 +25,7 @@ * */ -package org.tizen.dynamicanalyzer.ui.opengl.eventListner; +package org.tizen.dynamicanalyzer.ui.opengl.chart.listener; import java.util.Timer; import java.util.TimerTask; @@ -44,8 +45,8 @@ import org.tizen.dynamicanalyzer.widgets.chart.DAChart; import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot; import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.BoundType; -public class BoundLineEventListener implements MouseListener, MouseMoveListener, - MouseTrackListener { +public class GLFrameTimeBoundMouseListener implements MouseListener, + MouseMoveListener, MouseTrackListener { private static final int POINT_MAX_SIZE = 12; private static final int HOLE_INIT_SIZE = -4; private static final int LINE_MAX_WIDTH = 4; @@ -66,7 +67,8 @@ public class BoundLineEventListener implements MouseListener, MouseMoveListener, private boolean isExpanded = false; private boolean isDirty = false; - public BoundLineEventListener(final DAChart chart, final BoundType boundType) { + public GLFrameTimeBoundMouseListener(final DAChart chart, + final BoundType boundType) { this.chart = chart; plot = chart.getPlot(); plot.setBoundType(boundType); @@ -75,11 +77,11 @@ public class BoundLineEventListener implements MouseListener, MouseMoveListener, @Override public void paintControl(PaintEvent e) { double max = plot.getVisibleEndY(); - if(boundType == BoundType.UPPER && !isDirty) { + if (boundType == BoundType.UPPER && !isDirty) { boundValue = max * 0.9; plot.setBoundValue(boundValue); } - + if (!isExpanded) { plot.setBoundExpanded(false); @@ -92,7 +94,7 @@ public class BoundLineEventListener implements MouseListener, MouseMoveListener, String boundText = String.valueOf(boundValue) + plot.getAxisUnit(); -// chart.redrawForce(); + // chart.redrawForce(); int boundTextHeight = e.gc.textExtent(boundText).y; int boundTextPosition; @@ -111,11 +113,10 @@ public class BoundLineEventListener implements MouseListener, MouseMoveListener, e.gc.drawString(boundText, 0, boundTextPosition, true); } else { - e.gc.drawString("^" + boundText, 0, 0, true); + e.gc.drawString("^" + boundText, 0, 0, true);//$NON-NLS-1$ } } - } // end of !isExpanded - else { + } else { plot.setBoundExpanded(true); } @@ -181,11 +182,12 @@ public class BoundLineEventListener implements MouseListener, MouseMoveListener, double linePosition = 1.0 - boundValue / max; int gap = (int) Math.round(Math.abs(e.y - chart.getBounds().height * linePosition)); - if ((max != plot.getVisibleStartY()) && (gap < 5 || (boundValue > max && e.y <= 5))) { + if ((max != plot.getVisibleStartY()) + && (gap < 5 || (boundValue > max && e.y <= 5))) { boundLineWidth = (int) ((double) LINE_MAX_WIDTH / ((double) POINT_MAX_SIZE / (double) pointSize)); redrawLineArea(); - - if(boundLineWidth == LINE_MAX_WIDTH) { + + if (boundLineWidth == LINE_MAX_WIDTH) { isDirty = true; } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/listener/GLFrameTimeMouseListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/listener/GLFrameTimeMouseListener.java new file mode 100644 index 0000000..3461321 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/listener/GLFrameTimeMouseListener.java @@ -0,0 +1,146 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.chart.listener; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.MouseEvent; +import org.tizen.dynamicanalyzer.common.AnalyzerManager; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData; +import org.tizen.dynamicanalyzer.widgets.chart.DAChart; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker; +import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotMarker; +import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu; +import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline; + +public class GLFrameTimeMouseListener extends GLChartMouseListener { + + public GLFrameTimeMouseListener(DAPopupMenu menu, DATimeline timeline) { + super(menu, timeline); + } + + @Override + public void mouseDown(MouseEvent e) { + DAChart chart = (DAChart) e.widget; + DAChartPlot plot = chart.getPlot(); + DAChartPlotMarker marker = plot.getMarkers() + .get(SELECTION_MARKER_INDEX); + if (!(marker instanceof DAChartPlotIntervalMarker)) { + return; + } + DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) marker; + + double eventTime = plot.getXFromXPixcel(e.x); + + boolean bShift = false; + if ((e.stateMask & SWT.SHIFT) != 0) { + bShift = true; + } + + if (bShift && intervalMarker.getStartVal() != -1) { + if (baseTime > eventTime) { + intervalMarker.setInterval(eventTime, baseTime); + } else { + intervalMarker.setInterval(baseTime, eventTime); + } + } else { + intervalMarker.setInterval(eventTime, eventTime); + baseTime = eventTime; + } + + chart.redraw(); + + clickChartIndex = chart.getSeriesList().get(0) + .getPrevIndexByXvalue(plot.getXFromXPixcel(e.x)); + if (clickChartIndex < 0) { + return; + } + } + + @Override + public void mouseUp(MouseEvent e) { + if (e.button == 3) { + return; + } + + DAChart chart = (DAChart) e.widget; + DAChartPlot plot = chart.getPlot(); + DAChartPlotMarker marker = plot.getMarkers() + .get(SELECTION_MARKER_INDEX); + if (!(marker instanceof DAChartPlotIntervalMarker)) { + return; + } + DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) marker; + + double eventFrameIndex = plot.getXFromXPixcel(e.x); + double markerStartVal; + double markerEndVal; + + if (intervalMarker.getStartVal() >= eventFrameIndex) { + markerStartVal = eventFrameIndex; + markerEndVal = intervalMarker.getEndVal(); + } else { + markerStartVal = intervalMarker.getStartVal(); + markerEndVal = eventFrameIndex; + } + + int lastFrame = GLDataManager.getInstance().getFrameSize(); + + if (markerStartVal < 0) { + markerStartVal = 0; + } else if (markerStartVal > lastFrame) { + markerStartVal = lastFrame; + } + + if (markerEndVal > lastFrame) { + markerEndVal = lastFrame; + } else if (markerEndVal < 0) { + markerEndVal = 0; + } + + int startIndex = 0; + int endIndex = 0; + + if (markerEndVal <= plot.getVisibleEndX()) { + intervalMarker.setInterval(markerStartVal, markerEndVal); + startIndex = (int) markerStartVal; + endIndex = (int) markerEndVal; + } else { + intervalMarker.setInterval(markerStartVal, plot.getVisibleEndX()); + startIndex = (int) markerStartVal; + endIndex = (int) plot.getVisibleEndX(); + } + + AnalyzerManager.getCurrentPage().updateView( + new GLSelectionData(GLPage.chartViewID, startIndex, endIndex, + null)); + + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/CurrentContextValueList.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/CurrentContextValueList.java deleted file mode 100644 index 8529ee5..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/CurrentContextValueList.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.data; - -import java.util.ArrayList; -import java.util.List; - -@SuppressWarnings("serial") -public class CurrentContextValueList extends ArrayList { - private List setIndexList; - - public CurrentContextValueList() { - super(); - setIndexList = new ArrayList(); - } - - public String set(int index, String element) { - setIndexList.add(String.valueOf(index)); - - return super.set(index, element); - } - - public String originalSet(int index, String element) { - return super.set(index, element); - } - - public List getSetIndexList() { - return setIndexList; - } - - public void clearSetIndexList() { - setIndexList.clear(); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLAPIDBTableManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLAPIDBTableManager.java new file mode 100644 index 0000000..6f831d9 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLAPIDBTableManager.java @@ -0,0 +1,241 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ +package org.tizen.dynamicanalyzer.ui.opengl.data; + +import java.io.File; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.AnalyzerManager; +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.database.DBColumn; +import org.tizen.dynamicanalyzer.database.DBConstants; +import org.tizen.dynamicanalyzer.database.DBTable; +import org.tizen.dynamicanalyzer.database.SqlConnectionManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPIType; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLFrameType; + +public class GLAPIDBTableManager extends DBTable { + private static final String TABLENAME = "GL_API";//$NON-NLS-1$ + private static final String SEQ = DBConstants.COMMON_COLUMN_SEQ; + private static final String FRAME_INDEX = "FRAME_INDEX";//$NON-NLS-1$ + private static final String CONTEXT_ID = "CONTEXT_ID";//$NON-NLS-1$ + private static final String TIME = DBConstants.COMMON_COLUMN_TIME; + private static final String API_ID = DBConstants.COMMON_COLUMN_ID; + private static final String ARGUMENT = DBConstants.COMMON_COLUMN_ARG; + private static final String ELAPSED_TIME = "ELAPSED_TIME";//$NON-NLS-1$ + private static final String ERROR = DBConstants.COMMON_COLUMN_ERROR; + private static final String PID = DBConstants.COMMON_COLUMN_PID; + private static final String TID = DBConstants.COMMON_COLUMN_TID; + private static final String CALLER_PC_ADDRESS = DBConstants.COMMON_COLUMN_CALLER_PC_ADDRESS; + private static final String LIB_NAME = DBConstants.COMMON_COLUMN_CALLER_LIB_NAME; + + public final static int TABLE_SEQ_INDEX = 0; + public final static int TABLE_FRAME_INDEX_INDEX = 1; + public final static int TABLE_CONTEXT_ID_INDEX = 2; + public final static int TABLE_TIME_INDEX = 3; + public final static int TABLE_API_ID_INDEX = 4; + public final static int TABLE_ARGUMENT_INDEX = 5; + public final static int TABLE_ELAPSED_TIMEQ_INDEX = 6; + public final static int TABLE_ERROR_INDEX = 7; + public final static int TABLE_PID_INDEX = 8; + public final static int TABLE_TID_INDEX = 9; + public final static int TABLE_CALLER_PC_ADDRESS_INDEX = 10; + public final static int TABLE_LIB_NAME_INDEX = 11; + + private static final String SELECT_API_TABLE_QUERY_FROM_FRAME_TIME_CHART = "select "//$NON-NLS-1$ + + SEQ + + CommonConstants.COMMA + + FRAME_INDEX + + CommonConstants.COMMA + + CONTEXT_ID + + CommonConstants.COMMA + + TIME + + CommonConstants.COMMA + + API_ID + + CommonConstants.COMMA + + ARGUMENT + + CommonConstants.COMMA + + ELAPSED_TIME + + CommonConstants.COMMA + + ERROR + + CommonConstants.COMMA + + PID + + CommonConstants.COMMA + + TID + + CommonConstants.COMMA + + CALLER_PC_ADDRESS + + CommonConstants.COMMA + + LIB_NAME + " from "//$NON-NLS-1$ + + TABLENAME + " where " + FRAME_INDEX + " = '%s'"; + + private static final String SELECT_API_TABLE_QUERY_FROM_FRAME_RATE_CHART = "select "//$NON-NLS-1$ + + SEQ + + CommonConstants.COMMA + + FRAME_INDEX + + CommonConstants.COMMA + + CONTEXT_ID + + CommonConstants.COMMA + + TIME + + CommonConstants.COMMA + + API_ID + + CommonConstants.COMMA + + ARGUMENT + + CommonConstants.COMMA + + ELAPSED_TIME + + CommonConstants.COMMA + + ERROR + + CommonConstants.COMMA + + PID + + CommonConstants.COMMA + + TID + + CommonConstants.COMMA + + CALLER_PC_ADDRESS + + CommonConstants.COMMA + + LIB_NAME + " from "//$NON-NLS-1$ + + TABLENAME + " where '%s' <= "//$NON-NLS-1$ + + FRAME_INDEX + " and " + FRAME_INDEX + " <= '%s'";//$NON-NLS-1$ + + @Override + public String getTableName() { + return TABLENAME; + } + + public GLAPIDBTableManager() { + addColumn(new DBColumn(SEQ, DBConstants.PRIMARY_KEY, + DBConstants.INTEGER)); + addColumn(new DBColumn(CONTEXT_ID, DBConstants.NOT_NULL, + DBConstants.LONG)); + addColumn(new DBColumn(FRAME_INDEX, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(TIME, DBConstants.NOT_NULL, DBConstants.LONG)); + addColumn(new DBColumn(API_ID, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(ARGUMENT, DBConstants.NOT_NULL, DBConstants.TEXT)); + addColumn(new DBColumn(ELAPSED_TIME, DBConstants.NOT_NULL, + DBConstants.LONG)); + addColumn(new DBColumn(ERROR, DBConstants.NOT_NULL, DBConstants.LONG)); + addColumn(new DBColumn(PID, DBConstants.NOT_NULL, DBConstants.INTEGER)); + addColumn(new DBColumn(TID, DBConstants.NOT_NULL, DBConstants.INTEGER)); + addColumn(new DBColumn(CALLER_PC_ADDRESS, DBConstants.NOT_NULL, + DBConstants.LONG)); + addColumn(new DBColumn(LIB_NAME, DBConstants.NOT_NULL, + DBConstants.TEXT_LIB_NAME)); + } + + public void insert(List apiData) { + List> insertDataList = new ArrayList>(); + for (int i = 0; i < apiData.size(); i++) { + insertDataList.add(apiData.get(i).getDBInsertData()); + } + insertData(insertDataList); + } + + public GLFrameType selectOpenGLAPIData(int frameIndex) { + if (null != AnalyzerManager.getProject()) { + SqlConnectionManager.establishConnection(AnalyzerManager + .getProject().getSavePath() + + File.separator + + AnalyzerConstants.DATABASE_NAME); + } + String query = String.format( + SELECT_API_TABLE_QUERY_FROM_FRAME_TIME_CHART, frameIndex); + List> result = SqlConnectionManager.executeQuery(query); + if (null == result || result.size() == 0 || result.get(0).size() == 0) { + return null; + } + GLFrameType frameData = new GLFrameType(frameIndex); + for (List apiList : result) { + frameData.addGLAPIData(new GLAPIType(apiList)); + } + return frameData; + } + + public List> selectOpenGLAPIData(int frameStartIndex, + int frameEndIndex) { + if (null != AnalyzerManager.getProject()) { + SqlConnectionManager.establishConnection(AnalyzerManager + .getProject().getSavePath() + + File.separator + + AnalyzerConstants.DATABASE_NAME); + } + String query = String.format( + SELECT_API_TABLE_QUERY_FROM_FRAME_RATE_CHART, frameStartIndex, + frameEndIndex); + List> result = SqlConnectionManager.executeQuery(query); + if (null == result || result.size() == 0 || result.get(0).size() == 0) { + return null; + } + return result; + } + + @Override + public boolean prepare(PreparedStatement prep, List rowData) { + boolean isPrepared = true; + + int columnsize = getColumnSize(); + if (columnsize != rowData.size()) { + isPrepared = false; + } else { + try { + prep.setInt(TABLE_SEQ_INDEX + 1, + (Integer) (rowData.get(TABLE_SEQ_INDEX))); + prep.setLong(TABLE_FRAME_INDEX_INDEX + 1, + (Long) (rowData.get(TABLE_FRAME_INDEX_INDEX))); + prep.setInt(TABLE_CONTEXT_ID_INDEX + 1, + (Integer) (rowData.get(TABLE_CONTEXT_ID_INDEX))); + prep.setLong(TABLE_TIME_INDEX + 1, + (Long) (rowData.get(TABLE_TIME_INDEX))); + prep.setInt(TABLE_API_ID_INDEX + 1, + (Integer) (rowData.get(TABLE_API_ID_INDEX))); + prep.setString(TABLE_ARGUMENT_INDEX + 1, + (String) (rowData.get(TABLE_ARGUMENT_INDEX))); + prep.setLong(TABLE_ELAPSED_TIMEQ_INDEX + 1, + (Long) (rowData.get(TABLE_ELAPSED_TIMEQ_INDEX))); + prep.setLong(TABLE_ERROR_INDEX + 1, + (Long) (rowData.get(TABLE_ERROR_INDEX))); + prep.setInt(TABLE_PID_INDEX + 1, + (Integer) (rowData.get(TABLE_PID_INDEX))); + prep.setInt(TABLE_TID_INDEX + 1, + (Integer) (rowData.get(TABLE_TID_INDEX))); + prep.setLong(TABLE_CALLER_PC_ADDRESS_INDEX + 1, + (Long) (rowData.get(TABLE_CALLER_PC_ADDRESS_INDEX))); + prep.setString(TABLE_LIB_NAME_INDEX + 1, + (String) (rowData.get(TABLE_LIB_NAME_INDEX))); + + } catch (SQLException e) { + e.printStackTrace(); + isPrepared = false; + } + } + + return isPrepared; + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLContextDBEnum.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLContextDBEnum.java deleted file mode 100644 index bf0942d..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLContextDBEnum.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.data; - - - -public enum GLContextDBEnum { - GVA_V0("gvaV0"),//$NON-NLS-1$ - GVA_V1("gvaV1"),//$NON-NLS-1$ - GVA_V2("gvaV2"),//$NON-NLS-1$ - GVA_V3("gvaV3"),//$NON-NLS-1$ - GVA_ENABLED("gvaEnabled"),//$NON-NLS-1$ - GVA_SIZE("gvaSize"),//$NON-NLS-1$ - GVA_TYPE("gvaType"),//$NON-NLS-1$ - GVA_NORMAL("gvaNormal"),//$NON-NLS-1$ - GVA_STRIDE("gvaStride"),//$NON-NLS-1$ - GVA_POINTER("gvaPointer"),//$NON-NLS-1$ - VBO_BINDING("VBOBinding"),//$NON-NLS-1$ - VBO_ID("VBOID"),//$NON-NLS-1$ - VBO_SIZE("VBOSize"),//$NON-NLS-1$ - VBO_Data("VBOData"),//$NON-NLS-1$ - VBO_Usage("VBOUsage"),//$NON-NLS-1$ - VIEWPORT_X("viewportX"),//$NON-NLS-1$ - VIEWPORT_Y("viewportY"),//$NON-NLS-1$ - VIEWPORT_W("viewportW"),//$NON-NLS-1$ - VIEWPORT_H("viewportH"),//$NON-NLS-1$ - DEPTH_RANGE_N("depthRangeNear"),//$NON-NLS-1$ - DEPTH_RANGE_F("depthRangeFar"),//$NON-NLS-1$ - LINE_W("lineWidth"),//$NON-NLS-1$ - CULLING_ENABLED("cullingEnabled"),//$NON-NLS-1$ - CULLING_ORI("cullingOrientation"),//$NON-NLS-1$ - CULLING_MODE("cullingMode"),//$NON-NLS-1$ - POLY_ENABLED("polygonMode"),//$NON-NLS-1$ - POLY_FACTOR("polygonFactor"),//$NON-NLS-1$ - POLY_UNITS("cullingUnits"),//$NON-NLS-1$ - SCISSOR_ENABLED("scissorEnabled"),//$NON-NLS-1$ - SCISSOR_X("scissorX"),//$NON-NLS-1$ - SCISSOR_Y("scissorY"),//$NON-NLS-1$ - SCISSOR_W("scissorWidth"),//$NON-NLS-1$ - SCISSOR_H("scissorHeight"),//$NON-NLS-1$ - STENCIL_ENABLED("stencilEnabled"),//$NON-NLS-1$ - STENCIL_FRONT_FUNC("stencilFrontFunction"),//$NON-NLS-1$ - STENCIL_FRONT_REF("stencilFrontReference"),//$NON-NLS-1$ - STENCIL_FRONT_MASK("stencilFrontMask"),//$NON-NLS-1$ - STENCIL_FRONT_S_FAIL("stencilFrontStencilFailAction"),//$NON-NLS-1$ - STENCIL_FRONT_D_FAIL("stencilFrontDepthFailAction"),//$NON-NLS-1$ - STENCIL_FRONT_D_PASS("stencilFrontDepthPassAction"),//$NON-NLS-1$ - STENCIL_BACK_FUNC("stencilBackFunction"),//$NON-NLS-1$ - STENCIL_BACK_REF("stencilBackReference"),//$NON-NLS-1$ - STENCIL_BACK_MASK("stencilBackMask"),//$NON-NLS-1$ - STENCIL_BACK_S_FAIL("stencilBackStencilFailAction"),//$NON-NLS-1$ - STENCIL_BACK_D_FAIL("stencilBackDepthFailAction"),//$NON-NLS-1$ - STENCIL_BACK_D_PASS("stencilBackDepthPassAction"),//$NON-NLS-1$ - DEPTH_ENABLED("depthEnabled"),//$NON-NLS-1$ - DEPTH_FUNC("depthFunction"),//$NON-NLS-1$ - BLEND_ENABLED("blendingEnabled"),//$NON-NLS-1$ - BLEND_SRC_RGB("blendingSourceRGBFactor"),//$NON-NLS-1$ - BLEND_SRC_A("blendingSourceAlphaFactor"),//$NON-NLS-1$ - BLEND_DEST_RGB("blendingDestinationRGBFactor"),//$NON-NLS-1$ - BLEND_DEST_A("blendingDestinationAlphaFactor"),//$NON-NLS-1$ - BLEND_RGB_EQ("blendingRGBEquation"),//$NON-NLS-1$ - BLEND_A_EQ("blendingAlphaEquation"),//$NON-NLS-1$ - BLEND_COLOR("blendingColor"),//$NON-NLS-1$ - DITHER_ENABLED("ditherEnabled"),//$NON-NLS-1$ - PACK_ALIGN("packAlignment"),//$NON-NLS-1$ - UNPACK_ALIGN("unpackAlignment"),//$NON-NLS-1$ - TEXTURE_ACTIVE("textureActive"),//$NON-NLS-1$ - TEXTURE_UNIT_2D("textureUnit02dBinding"),//$NON-NLS-1$ - TEXTURE_UNIT_CUBE("textureUnit0CubemapBinding"),//$NON-NLS-1$ - TEXTURE_OBJ_ID("textureObjID"),//$NON-NLS-1$ - TEXTURE_OBJ_MAG_FUNC("textureObjMagFunc"),//$NON-NLS-1$ - TEXTURE_OBJ_MIN_FUNC("textureObjMinFunc"),//$NON-NLS-1$ - TEXTURE_OBJ_WRAP_S("textureObjWrapS"),//$NON-NLS-1$ - TEXTURE_OBJ_WRAP_T("textureObjWrapT"),//$NON-NLS-1$ - PROGRAM_OBJ_CURRENT("currentProgramObject"),//$NON-NLS-1$ - PROGRAM_OBJ_ID("programObjectID"),//$NON-NLS-1$ - PROGRAM_OBJ_V_SHADER("programVShader"),//$NON-NLS-1$ - PROGRAM_OBJ_F_SHADER("programFShader"),//$NON-NLS-1$ - PROGRAM_ATTRIB_INDEX("programAttribIndex"),//$NON-NLS-1$ - PROGRAM_ATTRIB_NAME("programAttribName"),//$NON-NLS-1$ - PROGRAM_ATTRIB_SIZE("programAttribSize"),//$NON-NLS-1$ - PROGRAM_ATTRIB_TYPE("programAttribType"),//$NON-NLS-1$ - PROGRAM_UNIFORM_INDEX("programUniformIndex"),//$NON-NLS-1$ - PROGRAM_UNIFORM_NAME("programUniformName"),//$NON-NLS-1$ - PROGRAM_UNIFORM_SIZE("programUniformSize"),//$NON-NLS-1$ - PROGRAM_UNIFORM_TYPE("programUniformType"),//$NON-NLS-1$ - FRAME_BUFFER_BINDING("frameBufferBinding"),//$NON-NLS-1$ - SHADER_OBJ_ID("shaderObjIndex"),//$NON-NLS-1$ - SHADER_TYPE("shaderType"),//$NON-NLS-1$ - SHADER_SRC("shaderSource"),//$NON-NLS-1$ - INVOLVED_ORDINAL("involvedOrdinal"),//$NON-NLS-1$ - INVOLVED_INDEX1("involvedIndex1"),//$NON-NLS-1$ - INVOLVED_INDEX2("involvedIndex2"),//$NON-NLS-1$ - FRAME_INDEX("frameIndex");//$NON-NLS-1$ - - private String columnName; - - private GLContextDBEnum(String columnName) { - this.columnName = columnName; - } - - public String getcolumnName() { - return columnName; - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLContextTreeNodeData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLContextTreeNodeData.java deleted file mode 100644 index f1684da..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLContextTreeNodeData.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.data; - -import java.util.ArrayList; -import java.util.List; - -import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; - -public class GLContextTreeNodeData extends DATableDataFormat { - private List involvedDBColumnIndexList; - private int dbColumnIndex; - private int insideColumnIndex1; - private int insideColumnIndex2; - private String nodeName; - - public GLContextTreeNodeData(int selectionKey, int columnIndex, - String nodeName, int... involvedDBColumnIndexs) { - this(selectionKey, columnIndex, -1, -1, nodeName, - involvedDBColumnIndexs); - } - - public GLContextTreeNodeData(int selectionKey, int columnIndex, - int insideColumnIndex1, String nodeName, - int... involvedDBColumnIndexs) { - this(selectionKey, columnIndex, insideColumnIndex1, -1, nodeName, - involvedDBColumnIndexs); - } - - public GLContextTreeNodeData(int selectionKey, int columnIndex, - int insideColumnIndex1, int insideColumnIndex2, String nodeName, - int... involvedDBColumnIndexs) { - super(selectionKey); - involvedDBColumnIndexList = new ArrayList(); - involvedDBColumnIndexList.add(columnIndex); - this.dbColumnIndex = columnIndex; - this.insideColumnIndex1 = insideColumnIndex1; - this.insideColumnIndex2 = insideColumnIndex2; - this.nodeName = nodeName; - obj = nodeName; - - for (int involvedDBColumnIndex : involvedDBColumnIndexs) { - involvedDBColumnIndexList.add(involvedDBColumnIndex); - } - } - - public String getNodeName() { - return nodeName; - } - - public int getDBColumnIndex() { - return dbColumnIndex; - } - - public int getInsideColumnIndex1() { - return insideColumnIndex1; - } - - public int getInsideColumnIndex2() { - return insideColumnIndex2; - } - - public List getInvolvedDBColumnIndexList() { - return involvedDBColumnIndexList; - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLDataMaker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLDataMaker.java deleted file mode 100644 index 5a11cbf..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLDataMaker.java +++ /dev/null @@ -1,1445 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.data; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Set; - -import org.tizen.dynamicanalyzer.common.AnalyzerManager; -import org.tizen.dynamicanalyzer.nl.GLPageLabels; -import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants; -import org.tizen.dynamicanalyzer.swap.logparser.LogPackage; -import org.tizen.dynamicanalyzer.swap.logparser.Logs; -import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager; -import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData; -import org.tizen.dynamicanalyzer.swap.model.data.LogData; -import org.tizen.dynamicanalyzer.ui.opengl.GLConstantMap; -import org.tizen.dynamicanalyzer.ui.opengl.data.inserter.GLContextDataInserter; -import org.tizen.dynamicanalyzer.ui.opengl.data.model.FrameCountInfo; -import org.tizen.dynamicanalyzer.ui.opengl.data.model.GLAPIData; -import org.tizen.dynamicanalyzer.ui.opengl.data.model.GLFrameData; -import org.tizen.dynamicanalyzer.ui.opengl.ui.chart.GLFPSChart; -import org.tizen.dynamicanalyzer.ui.opengl.ui.chart.GLFrameTimeChart; -import org.tizen.dynamicanalyzer.ui.opengl.ui.context.GLContextTreeTable; -import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants; -import org.tizen.dynamicanalyzer.util.DALogger; - -public class GLDataMaker extends PageDataManager { - private static final DALogger DA_LOG = DALogger.getInstance(); - - public static final String DELIMITER = "`,"; - public static final String EMPTY = ""; - private static final String SPACE = " "; - public static final String COMMA = ","; - private static final String ZERO = "0"; - private static final String ONE = "1"; - private static final String FOUR = "4"; - private static final String ENABLED = "Enabled"; - private static final String DISABLED = "Disabled"; - private static final String FALSE = "False"; - private static final String GL_FLOAT = "GL_FLOAT"; - - private static int API_TYPE_INIT = 0; - private static int API_TYPE_CONTEXT = 1; - // private static int API_TYPE_NO_CONTEXT = 2; - /* EnableCap */ - private static final String GL_TEXTURE_2D = "de1"; - private static final String GL_CULL_FACE = "b44"; - private static final String GL_BLEND = "be2"; - private static final String GL_DITHER = "bd0"; - private static final String GL_STENCIL_TEST = "b90"; - private static final String GL_DEPTH_TEST = "b71"; - private static final String GL_SCISSOR_TEST = "c11"; - private static final String GL_POLYGON_OFFSET_FILL = "8037"; - // private static final String GL_SAMPLE_ALPHA_TO_COVERAGE ="809e"; - // private static final String GL_SAMPLE_COVERAGE ="80a0"; - /* CullFaceMode */ - private static final String GL_FRONT = "404"; - private static final String GL_BACK = "405"; - private static final String GL_FRONT_AND_BACK = "408"; - /* Pixel */ - private static final String GL_PACK_ALIGNMENT = "d05"; - private static final String GL_UNPACK_ALIGNMENT = "cf5"; - /* TextureBinding */ - private static final String GL_TEXTURE_CUBE_MAP = "8513"; - /* TextureParameterName */ - private static final String GL_TEXTURE_MAG_FILTER = "2800"; - private static final String GL_TEXTURE_MIN_FILTER = "2801"; - private static final String GL_TEXTURE_WRAP_S = "2802"; - private static final String GL_TEXTURE_WRAP_T = "2803"; - - /* GL APIs */ - private static final String API_GL_BLEND_COLOR = "glBlendColor"; - private static final String API_GL_BLEND_EQ = "glBlendEquation"; - private static final String API_GL_BLEND_EQ_SEP = "glBlendEquationSeparate"; - private static final String API_GL_BLEND_FUNC = "glBlendFunc"; - private static final String API_GL_BLEND_FUNC_SEP = "glBlendFuncSeparate"; - private static final String API_GL_BUFFER_BIND = "glBindBuffer "; - private static final String API_GL_BUFFER_DATA = "glBufferData"; - private static final String API_GL_BUFFER_GEN = "glGenBuffers"; - private static final String API_GL_BUFFER_DEL = "glDeleteBuffers"; - private static final String API_GL_CULLFACE = "glFrontFace"; - private static final String API_GL_DEPTH_FUNC = "glDepthFunc"; - private static final String API_GL_DEPTH_RANGEF = "glDepthRangef"; - public static final String API_GL_DISABLE_VAA = "glDisableVertexAttribArray"; - private static final String API_GL_ENABLE = "glEnable"; - public static final String API_GL_ENABLE_VAA = "glEnableVertexAttribArray"; - private static final String API_GL_FRONTFACE = "glFrontFace"; - private static final String API_GL_PIXEL_STOREI = "glPixelStorei"; - private static final String API_GL_POLY_OFFSET = "glPolygonOffset"; - private static final String API_GL_PROGRAM_CREATE = "glCreateProgram"; - private static final String API_GL_PROGRAM_DEL = "glDeleteProgram"; - private static final String API_GL_PROGRAM_LINK = "glLinkProgram"; - private static final String API_GL_PROGRAM_USE = "glUseProgram"; - private static final String API_GL_PROGRAM_ATTACH_SHADER = "glAttachShader"; - private static final String API_GL_PROGRAM_DETATCH_SHADER = "glDetachShader"; - private static final String API_GL_LINEWIDTH = "glLineWidth"; - private static final String API_GL_SCISSOR = "glScissor"; - private static final String API_GL_SHADER_CREATE = "glCreateShader"; - private static final String API_GL_SHADER_DEL = "glDeleteShader"; - private static final String API_GL_SHADER_SOURCE = "glShaderSource"; - private static final String API_GL_STENCIL_FUNC = "glStencilFunc"; - private static final String API_GL_STENCIL_FUNC_SEP = "glStencilFuncSeparate"; - private static final String API_GL_STENCIL_OP = "glStencilOp"; - private static final String API_GL_STENCIL_OP_SEP = "glStencilOpSeparate"; - private static final String API_GL_TEXTURE_BIND = "glBindTexture"; - private static final String API_GL_TEXTURE_ACTIVE = "glActiveTexture"; - private static final String API_GL_TEXTURE_GEN = "glGenTextures"; - private static final String API_GL_TEXTURE_DEL = "glDeleteTextures"; - private static final String API_GL_TEXTURE_PARAM_F = "glTexParameterf"; - private static final String API_GL_TEXTURE_PARAM_FV = "glTexParameterfv"; - private static final String API_GL_TEXTURE_PARAM_I = "glTexParameteri"; - private static final String API_GL_TEXTURE_PARAM_IV = "glTexParameteriv"; - private static final String API_GL_VERTEX_ATTRIB1F = "glVertexAttrib1f"; - private static final String API_GL_VERTEX_ATTRIB2F = "glVertexAttrib2f"; - private static final String API_GL_VERTEX_ATTRIB3F = "glVertexAttrib3f"; - private static final String API_GL_VERTEX_ATTRIB4F = "glVertexAttrib4f"; - private static final String API_GL_VERTEX_ATTRIB1FV = "glVertexAttrib1fv"; - private static final String API_GL_VERTEX_ATTRIB2FV = "glVertexAttrib2fv"; - private static final String API_GL_VERTEX_ATTRIB3FV = "glVertexAttrib3fv"; - private static final String API_GL_VERTEX_ATTRIB4FV = "glVertexAttrib4fv"; - private static final String API_GL_VERTEX_ATTRIB_POINTER = "glVertexAttribPointer"; - private static final String API_GL_VIEWPORT = "glViewport"; - - private static final String API_EGL_SWAPBUFFERS = "eglSwapBuffers"; - private static final String API_SGL_SWAPBUFFERS = "_SglSwapBuffers"; - - private static GLDataMaker instance = null; - private static final int CONTEXT_VALUE_SIZE = GLContextDBEnum.values().length; - - private int currentFrameIndex; - private List glFrameDataList; - private List frameCountInfoList; - - private CurrentContextValueList currentContextValueList; - private ArrayList> contextValueDBInputList; - private ArrayList> contextValueChangeList; - private ArrayList> contextValueSetList; - private ArrayList> contextChangeInfoDBInputList; - - private List gvaV0ValueList; - private List gvaV1ValueList; - private List gvaV2ValueList; - private List gvaV3ValueList; - - private List gvaEnabledValueList; - private List gvaSizeValueList; - private List gvaTypeValueList; - private List gvaNormalValueList; - private List gvaStrideValueList; - private List gvaPointerValueList; - - private LinkedHashMap programIDMap; - private LinkedHashMap programVShaderMap; - private LinkedHashMap programFShaderMap; - private LinkedHashMap> programAttribIndexMap; - private LinkedHashMap> programAttribNameMap; - private LinkedHashMap> programAttribSizeMap; - private LinkedHashMap> programAttribTypeMap; - private LinkedHashMap> programUniformIndexMap; - private LinkedHashMap> programUniformNameMap; - private LinkedHashMap> programUniformSizeMap; - private LinkedHashMap> programUniformTypeMap; - - private LinkedHashMap shaderIDMap; - private LinkedHashMap shaderTypeMap; - private LinkedHashMap shaderSourceMap; - - private String vboBindingArray; - private String vboBindingElementArray; - private LinkedHashMap vboIDMap; - private LinkedHashMap vboSizeMap; - private LinkedHashMap vboDataMap; - private LinkedHashMap vboUsageMap; - - private List textureUnit2dValueList; - private List textureUnitCubeValueList; - private LinkedHashMap textureObjIDMap; - private LinkedHashMap textureObjMagFuncMap; - private LinkedHashMap textureObjMinFuncMap; - private LinkedHashMap textureObjWrapSMap; - private LinkedHashMap textureObjWrapTMap; - - public static GLDataMaker getInstance() { - if (instance == null) { - instance = new GLDataMaker(); - } - - return instance; - } - - private GLDataMaker() { - currentFrameIndex = 0; - glFrameDataList = new ArrayList(); - glFrameDataList.add(new GLFrameData(1)); - frameCountInfoList = new ArrayList(); - frameCountInfoList.add(new FrameCountInfo(0)); - - currentContextValueList = new CurrentContextValueList(); - for (int i = 0; i <= CONTEXT_VALUE_SIZE; i++) { - currentContextValueList.add(EMPTY); - } - - contextValueDBInputList = new ArrayList>(); - - contextValueChangeList = new ArrayList>(); - for (int i = 0; i < CONTEXT_VALUE_SIZE; i++) { - contextValueChangeList.add(new ArrayList()); - } - - contextValueSetList = new ArrayList>(); - for (int i = 0; i < CONTEXT_VALUE_SIZE; i++) { - contextValueSetList.add(new ArrayList()); - } - - contextChangeInfoDBInputList = new ArrayList>(); - - gvaV0ValueList = new ArrayList(); - gvaV1ValueList = new ArrayList(); - gvaV2ValueList = new ArrayList(); - gvaV3ValueList = new ArrayList(); - - gvaEnabledValueList = new ArrayList(); - gvaSizeValueList = new ArrayList(); - gvaTypeValueList = new ArrayList(); - gvaNormalValueList = new ArrayList(); - gvaStrideValueList = new ArrayList(); - gvaPointerValueList = new ArrayList(); - programIDMap = new LinkedHashMap(); - programVShaderMap = new LinkedHashMap(); - programFShaderMap = new LinkedHashMap(); - programAttribIndexMap = new LinkedHashMap>(); - programAttribNameMap = new LinkedHashMap>(); - programAttribSizeMap = new LinkedHashMap>(); - programAttribTypeMap = new LinkedHashMap>(); - programUniformIndexMap = new LinkedHashMap>(); - programUniformNameMap = new LinkedHashMap>(); - programUniformSizeMap = new LinkedHashMap>(); - programUniformTypeMap = new LinkedHashMap>(); - shaderIDMap = new LinkedHashMap(); - shaderTypeMap = new LinkedHashMap(); - shaderSourceMap = new LinkedHashMap(); - vboBindingArray = ZERO; - vboBindingElementArray = ZERO; - vboIDMap = new LinkedHashMap(); - vboSizeMap = new LinkedHashMap(); - vboDataMap = new LinkedHashMap(); - vboUsageMap = new LinkedHashMap(); - textureUnit2dValueList = new ArrayList(); - textureUnitCubeValueList = new ArrayList(); - textureObjIDMap = new LinkedHashMap(); - textureObjMagFuncMap = new LinkedHashMap(); - textureObjMinFuncMap = new LinkedHashMap(); - textureObjWrapSMap = new LinkedHashMap(); - textureObjWrapTMap = new LinkedHashMap(); - } - - public void clear() { - currentFrameIndex = 0; - glFrameDataList.clear(); - glFrameDataList.add(new GLFrameData(0)); - frameCountInfoList.clear(); - frameCountInfoList.add(new FrameCountInfo(0)); - - currentContextValueList.clear(); - for (int i = 0; i <= CONTEXT_VALUE_SIZE; i++) { - currentContextValueList.add(EMPTY); - } - - contextValueChangeList.clear(); - for (int i = 0; i < CONTEXT_VALUE_SIZE; i++) { - contextValueChangeList.add(new ArrayList()); - } - - contextValueSetList.clear(); - for (int i = 0; i < CONTEXT_VALUE_SIZE; i++) { - contextValueSetList.add(new ArrayList()); - } - - currentContextValueList.set(GLContextDBEnum.VBO_BINDING.ordinal(), - "(0/0)"); - - currentContextValueList.set(GLContextDBEnum.VIEWPORT_X.ordinal(), ZERO); - currentContextValueList.set(GLContextDBEnum.VIEWPORT_Y.ordinal(), ZERO); - currentContextValueList.set(GLContextDBEnum.VIEWPORT_W.ordinal(), "?"); - currentContextValueList.set(GLContextDBEnum.VIEWPORT_H.ordinal(), "?"); - - currentContextValueList.set(GLContextDBEnum.DEPTH_RANGE_N.ordinal(), - ZERO); - currentContextValueList.set(GLContextDBEnum.DEPTH_RANGE_F.ordinal(), - ONE); - - currentContextValueList.set(GLContextDBEnum.LINE_W.ordinal(), "1"); - - currentContextValueList.set(GLContextDBEnum.CULLING_ENABLED.ordinal(), - DISABLED); - currentContextValueList.set(GLContextDBEnum.CULLING_ORI.ordinal(), - "GL_CCW"); - currentContextValueList.set(GLContextDBEnum.CULLING_MODE.ordinal(), - "GL_BACK"); - - currentContextValueList.set(GLContextDBEnum.POLY_ENABLED.ordinal(), - DISABLED); - currentContextValueList - .set(GLContextDBEnum.POLY_FACTOR.ordinal(), ZERO); - currentContextValueList.set(GLContextDBEnum.POLY_UNITS.ordinal(), ZERO); - - currentContextValueList.set(GLContextDBEnum.SCISSOR_ENABLED.ordinal(), - DISABLED); - currentContextValueList.set(GLContextDBEnum.SCISSOR_X.ordinal(), ZERO); - currentContextValueList.set(GLContextDBEnum.SCISSOR_Y.ordinal(), ZERO); - currentContextValueList.set(GLContextDBEnum.SCISSOR_W.ordinal(), "?"); - currentContextValueList.set(GLContextDBEnum.SCISSOR_H.ordinal(), "?"); - - currentContextValueList.set(GLContextDBEnum.STENCIL_ENABLED.ordinal(), - DISABLED); - currentContextValueList.set( - GLContextDBEnum.STENCIL_FRONT_FUNC.ordinal(), "GL_ALWAYS"); - currentContextValueList.set( - GLContextDBEnum.STENCIL_FRONT_REF.ordinal(), "1"); - currentContextValueList.set( - GLContextDBEnum.STENCIL_FRONT_MASK.ordinal(), "?"); - currentContextValueList.set( - GLContextDBEnum.STENCIL_FRONT_S_FAIL.ordinal(), "GL_KEEP"); - currentContextValueList.set( - GLContextDBEnum.STENCIL_FRONT_D_FAIL.ordinal(), "GL_KEEP"); - currentContextValueList.set( - GLContextDBEnum.STENCIL_FRONT_D_PASS.ordinal(), "GL_KEEP"); - - currentContextValueList.set( - GLContextDBEnum.STENCIL_BACK_FUNC.ordinal(), "GL_ALWAYS"); - currentContextValueList.set(GLContextDBEnum.STENCIL_BACK_REF.ordinal(), - "1"); - currentContextValueList.set( - GLContextDBEnum.STENCIL_BACK_MASK.ordinal(), "?"); - currentContextValueList.set( - GLContextDBEnum.STENCIL_BACK_S_FAIL.ordinal(), "GL_KEEP"); - currentContextValueList.set( - GLContextDBEnum.STENCIL_BACK_D_FAIL.ordinal(), "GL_KEEP"); - currentContextValueList.set( - GLContextDBEnum.STENCIL_BACK_D_PASS.ordinal(), "GL_KEEP"); - - currentContextValueList.set(GLContextDBEnum.DEPTH_ENABLED.ordinal(), - DISABLED); - currentContextValueList.set(GLContextDBEnum.DEPTH_FUNC.ordinal(), - "GL_LESS"); - - currentContextValueList.set(GLContextDBEnum.BLEND_ENABLED.ordinal(), - DISABLED); - currentContextValueList.set(GLContextDBEnum.BLEND_SRC_RGB.ordinal(), - "GL_ONE"); - currentContextValueList.set(GLContextDBEnum.BLEND_SRC_A.ordinal(), - "GL_ONE"); - currentContextValueList.set(GLContextDBEnum.BLEND_DEST_RGB.ordinal(), - "GL_ZERO"); - currentContextValueList.set(GLContextDBEnum.BLEND_DEST_A.ordinal(), - "GL_ZERO"); - currentContextValueList.set(GLContextDBEnum.BLEND_RGB_EQ.ordinal(), - "GL_FUNC_ADD"); - currentContextValueList.set(GLContextDBEnum.BLEND_A_EQ.ordinal(), - "GL_FUNC_ADD"); - currentContextValueList.set(GLContextDBEnum.BLEND_COLOR.ordinal(), - "0,0,0,0"); - - currentContextValueList.set(GLContextDBEnum.DITHER_ENABLED.ordinal(), - ENABLED); - - currentContextValueList.set(GLContextDBEnum.PACK_ALIGN.ordinal(), "4"); - currentContextValueList - .set(GLContextDBEnum.UNPACK_ALIGN.ordinal(), "4"); - - currentContextValueList.set(GLContextDBEnum.TEXTURE_ACTIVE.ordinal(), - "GL_TEXTURE0"); - - contextValueDBInputList.clear(); - contextChangeInfoDBInputList.clear(); - - gvaV0ValueList.clear(); - gvaV1ValueList.clear(); - gvaV2ValueList.clear(); - gvaV3ValueList.clear(); - - gvaEnabledValueList.clear(); - gvaSizeValueList.clear(); - gvaTypeValueList.clear(); - gvaNormalValueList.clear(); - gvaStrideValueList.clear(); - gvaPointerValueList.clear(); - - programIDMap.clear(); - programVShaderMap.clear(); - programFShaderMap.clear(); - programAttribIndexMap.clear(); - programAttribNameMap.clear(); - programAttribSizeMap.clear(); - programAttribTypeMap.clear(); - programUniformIndexMap.clear(); - programUniformNameMap.clear(); - programUniformSizeMap.clear(); - programUniformTypeMap.clear(); - - shaderIDMap.clear(); - shaderTypeMap.clear(); - shaderSourceMap.clear(); - - vboBindingArray = ZERO; - vboBindingElementArray = ZERO; - vboIDMap.clear(); - vboSizeMap.clear(); - vboDataMap.clear(); - vboUsageMap.clear(); - - textureUnit2dValueList.clear(); - textureUnitCubeValueList.clear(); - - textureObjIDMap.clear(); - textureObjMagFuncMap.clear(); - textureObjMinFuncMap.clear(); - textureObjWrapSMap.clear(); - textureObjWrapTMap.clear(); - } - - @SuppressWarnings("unchecked") - public void addGLAPIData(GLES20LogData logData) { - int apiType = logData.getApiType(); - String seq = String.valueOf(logData.getSeq()); - String apiName = logData.getApiName(); - String parameter = logData.getArgs(); - long errorNo = logData.getErrno(); - - // FIXME - if (apiName.equals(API_SGL_SWAPBUFFERS) - || apiName.equals(API_EGL_SWAPBUFFERS)) { - errorNo = 0; - logData.setErrNo(0); - logData.setApiName(API_EGL_SWAPBUFFERS); - } - - if (apiType != API_TYPE_INIT) { - glFrameDataList.get(currentFrameIndex).addGLAPIData( - new GLAPIData(logData)); - } - - if (apiType == API_TYPE_INIT) { - String contextValues[] = logData.getContextValue().split(COMMA); - int maxVertexAttribs = Integer.parseInt(contextValues[0]); - int maxTextureUnits = Integer.parseInt(contextValues[1].trim()); - - /* GVA */ - for (int i = 0; i < maxVertexAttribs; i++) { - gvaV0ValueList.add(ZERO); - gvaV1ValueList.add(ZERO); - gvaV2ValueList.add(ZERO); - gvaV3ValueList.add(ONE); - - gvaEnabledValueList.add(DISABLED); - gvaSizeValueList.add(FOUR); - gvaTypeValueList.add(GL_FLOAT); - gvaNormalValueList.add(FALSE); - gvaStrideValueList.add(ONE); - gvaPointerValueList.add(ZERO); - } - currentContextValueList.set(GLContextDBEnum.GVA_V0.ordinal(), - makeSeperatedString(gvaV0ValueList)); - currentContextValueList.set(GLContextDBEnum.GVA_V1.ordinal(), - makeSeperatedString(gvaV1ValueList)); - currentContextValueList.set(GLContextDBEnum.GVA_V2.ordinal(), - makeSeperatedString(gvaV2ValueList)); - currentContextValueList.set(GLContextDBEnum.GVA_V3.ordinal(), - makeSeperatedString(gvaV3ValueList)); - currentContextValueList.set(GLContextDBEnum.GVA_ENABLED.ordinal(), - makeSeperatedString(gvaEnabledValueList)); - currentContextValueList.set(GLContextDBEnum.GVA_SIZE.ordinal(), - makeSeperatedString(gvaSizeValueList)); - currentContextValueList.set(GLContextDBEnum.GVA_TYPE.ordinal(), - makeSeperatedString(gvaTypeValueList)); - currentContextValueList.set(GLContextDBEnum.GVA_NORMAL.ordinal(), - makeSeperatedString(gvaNormalValueList)); - currentContextValueList.set(GLContextDBEnum.GVA_STRIDE.ordinal(), - makeSeperatedString(gvaStrideValueList)); - currentContextValueList.set(GLContextDBEnum.GVA_POINTER.ordinal(), - makeSeperatedString(gvaPointerValueList)); - GLContextTreeTable.getInstance().initGVA(maxVertexAttribs); - - /* texture unit */ - for (int i = 0; i < maxTextureUnits; i++) { - textureUnit2dValueList.add(ZERO); - textureUnitCubeValueList.add(ZERO); - } - currentContextValueList.set( - GLContextDBEnum.TEXTURE_UNIT_2D.ordinal(), - makeSeperatedString(textureUnit2dValueList)); - currentContextValueList.set( - GLContextDBEnum.TEXTURE_UNIT_CUBE.ordinal(), - makeSeperatedString(textureUnitCubeValueList)); - GLContextTreeTable.getInstance().initTextureUnit(maxTextureUnits); - } else if (apiType == API_TYPE_CONTEXT && errorNo == 0) { - currentContextValueList.clearSetIndexList(); - int involvedIndex1 = -1; - int involvedIndex2 = -1; - - String parameters[] = parameter.split(COMMA + SPACE); - String contextValues[] = logData.getContextValue().split(COMMA); - - if (apiName.equals(API_SGL_SWAPBUFFERS) - || apiName.equals(API_EGL_SWAPBUFFERS)) { - GLFrameData currentFrameData = glFrameDataList - .get(currentFrameIndex); - int frameNumber = currentFrameData.getFrameNumber(); - - GLFPSChart.getInstance().addData(frameNumber, - currentFrameData.getFrametime(), - currentFrameData.hasError()); - - GLFrameTimeChart.getInstance().addData( - frameNumber, - currentFrameData.getFrametime() - / TimelineConstants.KILO_LONG, - currentFrameData.hasError()); - - int time = (int) (logData.getTime() / TimelineConstants.MEGA_LONG); - if (time >= frameCountInfoList.size()) { - int size = time - frameCountInfoList.size(); - for (int i = 0; i <= size; i++) { - frameCountInfoList.add(new FrameCountInfo( - currentFrameIndex)); - } - } - - frameCountInfoList.get(time).addFrameCount(); - - glFrameDataList.add(new GLFrameData(++currentFrameIndex)); - } else if (apiName.equals(API_GL_BLEND_COLOR)) { - setContextValueList(seq, GLContextDBEnum.BLEND_COLOR.ordinal(), - parameters[0] + COMMA + parameters[1] + COMMA - + parameters[2] + COMMA + parameters[3]); - } else if (apiName.equals(API_GL_BLEND_EQ)) { - setContextValueList(seq, - GLContextDBEnum.BLEND_RGB_EQ.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, GLContextDBEnum.BLEND_A_EQ.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - } else if (apiName.equals(API_GL_BLEND_EQ_SEP)) { - setContextValueList(seq, - GLContextDBEnum.BLEND_RGB_EQ.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, GLContextDBEnum.BLEND_A_EQ.ordinal(), - GLConstantMap.getConstantString(parameters[1])); - } else if (apiName.equals(API_GL_BLEND_FUNC)) { - setContextValueList(seq, - GLContextDBEnum.BLEND_SRC_RGB.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, GLContextDBEnum.BLEND_SRC_A.ordinal(), - GLConstantMap.getConstantString(parameters[1])); - - setContextValueList(seq, - GLContextDBEnum.BLEND_DEST_RGB.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, - GLContextDBEnum.BLEND_DEST_A.ordinal(), - GLConstantMap.getConstantString(parameters[1])); - } else if (apiName.equals(API_GL_BLEND_FUNC_SEP)) { - setContextValueList(seq, - GLContextDBEnum.BLEND_SRC_RGB.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, - GLContextDBEnum.BLEND_DEST_RGB.ordinal(), - GLConstantMap.getConstantString(parameters[1])); - setContextValueList(seq, GLContextDBEnum.BLEND_SRC_A.ordinal(), - GLConstantMap.getConstantString(parameters[2])); - setContextValueList(seq, - GLContextDBEnum.BLEND_DEST_A.ordinal(), - GLConstantMap.getConstantString(parameters[3])); - } else if (apiName.equals(API_GL_BUFFER_GEN)) { - int num = Integer.parseInt(parameters[0]); - - for (int i = 0; i < num; i++) { - vboIDMap.put(contextValues[i], contextValues[i]); - vboSizeMap.put(contextValues[i], "0"); - vboDataMap.put(contextValues[i], "?"); - vboUsageMap.put(contextValues[i], "GL_STATIC_DRAW"); - } - - setContextValueList(seq, GLContextDBEnum.VBO_ID.ordinal(), - makeSeperatedString(vboIDMap)); - setContextValueList(seq, GLContextDBEnum.VBO_SIZE.ordinal(), - makeSeperatedString(vboSizeMap)); - setContextValueList(seq, GLContextDBEnum.VBO_Data.ordinal(), - makeSeperatedString(vboDataMap)); - setContextValueList(seq, GLContextDBEnum.VBO_Usage.ordinal(), - makeSeperatedString(vboUsageMap)); - } else if (apiName.equals(API_GL_BUFFER_DEL)) { - int num = Integer.parseInt(parameters[0]); - - for (int i = 0; i < num; i++) { - vboIDMap.remove(contextValues[i]); - vboSizeMap.remove(contextValues[i]); - vboDataMap.remove(contextValues[i]); - vboUsageMap.remove(contextValues[i]); - } - - setContextValueList(seq, GLContextDBEnum.VBO_ID.ordinal(), - makeSeperatedString(vboIDMap)); - setContextValueList(seq, GLContextDBEnum.VBO_SIZE.ordinal(), - makeSeperatedString(vboSizeMap)); - setContextValueList(seq, GLContextDBEnum.VBO_Data.ordinal(), - makeSeperatedString(vboDataMap)); - setContextValueList(seq, GLContextDBEnum.VBO_Usage.ordinal(), - makeSeperatedString(vboUsageMap)); - } else if (apiName.equals(API_GL_BUFFER_BIND)) { - if (GLConstantMap.getConstantString(parameters[0]).equals( - "GL_ARRAY_BUFFER")) { - vboBindingArray = parameters[1]; - } else { - vboBindingElementArray = parameters[1]; - } - setContextValueList(seq, GLContextDBEnum.VBO_BINDING.ordinal(), - vboBindingArray + "/" + vboBindingElementArray); - } else if (apiName.equals(API_GL_BUFFER_DATA)) { - String vboId; - if (GLConstantMap.getConstantString(parameters[0]).equals( - "GL_ARRAY_BUFFER")) { - vboId = vboBindingArray; - } else { - vboId = vboBindingElementArray; - } - vboSizeMap.put(vboId, parameters[1]); - vboDataMap.put(vboId, "?"); - vboUsageMap.put(vboId, - GLConstantMap.getConstantString(parameters[3])); - - setContextValueList(seq, GLContextDBEnum.VBO_ID.ordinal(), - makeSeperatedString(vboIDMap)); - setContextValueList(seq, GLContextDBEnum.VBO_SIZE.ordinal(), - makeSeperatedString(vboSizeMap)); - setContextValueList(seq, GLContextDBEnum.VBO_Data.ordinal(), - makeSeperatedString(vboDataMap)); - setContextValueList(seq, GLContextDBEnum.VBO_Usage.ordinal(), - makeSeperatedString(vboUsageMap)); - } else if (apiName.equals(API_GL_CULLFACE)) { - setContextValueList(seq, - GLContextDBEnum.CULLING_MODE.ordinal(), parameters[0]); - } else if (apiName.equals(API_GL_DEPTH_FUNC)) { - setContextValueList(seq, GLContextDBEnum.DEPTH_FUNC.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - } else if (apiName.equals(API_GL_DEPTH_RANGEF)) { - setContextValueList(seq, - GLContextDBEnum.DEPTH_RANGE_N.ordinal(), parameters[0]); - setContextValueList(seq, - GLContextDBEnum.DEPTH_RANGE_F.ordinal(), parameters[1]); - } else if (apiName.equals(API_GL_DISABLE_VAA)) { - involvedIndex1 = Integer.parseInt(parameter); - gvaEnabledValueList.set(involvedIndex1, DISABLED); - setContextValueList(seq, GLContextDBEnum.GVA_ENABLED.ordinal(), - makeSeperatedString(gvaEnabledValueList)); - } else if (apiName.equals(API_GL_ENABLE)) { - if (parameter.equals(GL_BLEND)) { - setContextValueList(seq, - GLContextDBEnum.BLEND_ENABLED.ordinal(), - GLPageLabels.GL_CONTEXT_ENABLED); - } else if (parameter.equals(GL_CULL_FACE)) { - setContextValueList(seq, - GLContextDBEnum.CULLING_ENABLED.ordinal(), - GLPageLabels.GL_CONTEXT_ENABLED); - } else if (parameter.equals(GL_DEPTH_TEST)) { - setContextValueList(seq, - GLContextDBEnum.DEPTH_ENABLED.ordinal(), - GLPageLabels.GL_CONTEXT_ENABLED); - } else if (parameter.equals(GL_DITHER)) { - setContextValueList(seq, - GLContextDBEnum.DITHER_ENABLED.ordinal(), - GLPageLabels.GL_CONTEXT_ENABLED); - } else if (parameter.equals(GL_POLYGON_OFFSET_FILL)) { - setContextValueList(seq, - GLContextDBEnum.POLY_ENABLED.ordinal(), - GLPageLabels.GL_CONTEXT_ENABLED); - } else if (parameter.equals(GL_SCISSOR_TEST)) { - setContextValueList(seq, - GLContextDBEnum.SCISSOR_ENABLED.ordinal(), - GLPageLabels.GL_CONTEXT_ENABLED); - } else if (parameter.equals(GL_STENCIL_TEST)) { - setContextValueList(seq, - GLContextDBEnum.STENCIL_ENABLED.ordinal(), - GLPageLabels.GL_CONTEXT_ENABLED); - } - } else if (apiName.equals(API_GL_ENABLE_VAA)) { - involvedIndex1 = Integer.parseInt(parameter); - gvaEnabledValueList.set(involvedIndex1, ENABLED); - setContextValueList(seq, GLContextDBEnum.GVA_ENABLED.ordinal(), - makeSeperatedString(gvaEnabledValueList)); - } else if (apiName.equals(API_GL_FRONTFACE)) { - setContextValueList(seq, GLContextDBEnum.CULLING_ORI.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - } else if (apiName.equals(API_GL_LINEWIDTH)) { - setContextValueList(seq, GLContextDBEnum.LINE_W.ordinal(), - parameters[0]); - } else if (apiName.equals(API_GL_PIXEL_STOREI)) { - if (parameters[0].equals(GL_PACK_ALIGNMENT)) { - setContextValueList(seq, - GLContextDBEnum.PACK_ALIGN.ordinal(), - GLConstantMap.getConstantString(parameters[1])); - } else if (parameters[0].equals(GL_UNPACK_ALIGNMENT)) { - setContextValueList(seq, - GLContextDBEnum.UNPACK_ALIGN.ordinal(), - GLConstantMap.getConstantString(parameters[1])); - } - } else if (apiName.equals(API_GL_PROGRAM_CREATE)) { - String programID = String.valueOf(logData.getReturn()); - programIDMap.put(programID, programID); - programVShaderMap.put(programID, EMPTY); - programFShaderMap.put(programID, EMPTY); - - involvedIndex1 = programIDMap.size() - 1; - setContextValueList(seq, - GLContextDBEnum.PROGRAM_OBJ_ID.ordinal(), - makeSeperatedString(programIDMap)); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_OBJ_V_SHADER.ordinal(), - makeSeperatedString(programVShaderMap)); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_OBJ_F_SHADER.ordinal(), - makeSeperatedString(programFShaderMap)); - } else if (apiName.equals(API_GL_PROGRAM_DEL)) { - programIDMap.remove(parameter); - programVShaderMap.remove(parameter); - programFShaderMap.remove(parameter); - - setContextValueList(seq, - GLContextDBEnum.PROGRAM_OBJ_ID.ordinal(), - makeSeperatedString(programIDMap)); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_OBJ_V_SHADER.ordinal(), - makeSeperatedString(programVShaderMap)); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_OBJ_F_SHADER.ordinal(), - makeSeperatedString(programFShaderMap)); - } else if (apiName.equals(API_GL_PROGRAM_LINK)) { - String programID = parameter; - int contextValueIndex = 0; - if (contextValues.length > 0) { - int attribNum = Integer - .parseInt(contextValues[contextValueIndex++]); - for (int i = 0; i < attribNum; i++) { - String index = contextValues[contextValueIndex++]; - String name = contextValues[contextValueIndex++]; - String size = contextValues[contextValueIndex++]; - String type = GLConstantMap - .getConstantString(contextValues[contextValueIndex++]); - - putMapValue(programAttribIndexMap, programID, index, - index); - putMapValue(programAttribNameMap, programID, name, - index); - putMapValue(programAttribSizeMap, programID, size, - index); - putMapValue(programAttribTypeMap, programID, type, - index); - } - - involvedIndex1 = getIndexByKey(programIDMap, programID); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_ATTRIB_INDEX.ordinal(), - makeSeperatedString2(programAttribIndexMap)); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_ATTRIB_NAME.ordinal(), - makeSeperatedString2(programAttribNameMap)); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_ATTRIB_SIZE.ordinal(), - makeSeperatedString2(programAttribSizeMap)); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_ATTRIB_TYPE.ordinal(), - makeSeperatedString2(programAttribTypeMap)); - } - - if (contextValues.length > 0) { - int uniformNum = Integer - .parseInt(contextValues[contextValueIndex++]); - for (int i = 0; i < uniformNum; i++) { - String index = contextValues[contextValueIndex++]; - String name = contextValues[contextValueIndex++]; - String size = contextValues[contextValueIndex++]; - String type = GLConstantMap - .getConstantString(contextValues[contextValueIndex++]); - - putMapValue(programUniformIndexMap, programID, index, - index); - putMapValue(programUniformNameMap, programID, name, - index); - putMapValue(programUniformSizeMap, programID, size, - index); - putMapValue(programUniformTypeMap, programID, type, - index); - } - - involvedIndex1 = getIndexByKey(programIDMap, programID); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_UNIFORM_INDEX.ordinal(), - makeSeperatedString2(programUniformIndexMap)); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_UNIFORM_NAME.ordinal(), - makeSeperatedString2(programUniformNameMap)); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_UNIFORM_SIZE.ordinal(), - makeSeperatedString2(programUniformSizeMap)); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_UNIFORM_TYPE.ordinal(), - makeSeperatedString2(programUniformTypeMap)); - } - } else if (apiName.equals(API_GL_PROGRAM_USE)) { - setContextValueList(seq, - GLContextDBEnum.PROGRAM_OBJ_CURRENT.ordinal(), - parameter); - } else if (apiName.equals(API_GL_PROGRAM_ATTACH_SHADER)) { - String programID = parameters[0]; - String shaderID = parameters[1]; - involvedIndex1 = getIndexByKey(programIDMap, programID); - - if (shaderTypeMap.get(shaderID).equals("GL_VERTEX_SHADER")) { - programVShaderMap.put(programID, shaderID); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_OBJ_V_SHADER.ordinal(), - makeSeperatedString(programVShaderMap)); - } else if (shaderTypeMap.get(shaderID).equals( - "GL_FRAGMENT_SHADER")) { - programFShaderMap.put(programID, shaderID); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_OBJ_F_SHADER.ordinal(), - makeSeperatedString(programFShaderMap)); - } - } else if (apiName.equals(API_GL_PROGRAM_DETATCH_SHADER)) { - String programID = parameters[0]; - String shaderID = parameters[1]; - involvedIndex1 = getIndexByKey(programIDMap, programID); - - if (programVShaderMap.get(programID).equals(shaderID)) { - programVShaderMap.put(programID, EMPTY); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_OBJ_V_SHADER.ordinal(), - makeSeperatedString(programVShaderMap)); - } else if (programFShaderMap.get(programID).equals(shaderID)) { - programFShaderMap.put(programID, EMPTY); - setContextValueList(seq, - GLContextDBEnum.PROGRAM_OBJ_F_SHADER.ordinal(), - makeSeperatedString(programFShaderMap)); - } - } else if (apiName.equals(API_GL_POLY_OFFSET)) { - setContextValueList(seq, GLContextDBEnum.POLY_FACTOR.ordinal(), - parameters[0]); - setContextValueList(seq, GLContextDBEnum.POLY_UNITS.ordinal(), - parameters[1]); - } else if (apiName.equals(API_GL_SCISSOR)) { - setContextValueList(seq, GLContextDBEnum.SCISSOR_X.ordinal(), - parameters[0]); - setContextValueList(seq, GLContextDBEnum.SCISSOR_Y.ordinal(), - parameters[1]); - setContextValueList(seq, GLContextDBEnum.SCISSOR_W.ordinal(), - parameters[2]); - setContextValueList(seq, GLContextDBEnum.SCISSOR_H.ordinal(), - parameters[3]); - } else if (apiName.equals(API_GL_SHADER_CREATE)) { - String shaderID = logData.getReturn(); - shaderIDMap.put(shaderID, shaderID); - shaderTypeMap.put(shaderID, - GLConstantMap.getConstantString(parameter)); - shaderSourceMap.put(shaderID, SPACE); - involvedIndex1 = shaderIDMap.size() - 1; - - setContextValueList(seq, - GLContextDBEnum.SHADER_OBJ_ID.ordinal(), - makeSeperatedString(shaderIDMap)); - setContextValueList(seq, GLContextDBEnum.SHADER_TYPE.ordinal(), - makeSeperatedString(shaderTypeMap)); - currentContextValueList.originalSet( - GLContextDBEnum.SHADER_SRC.ordinal(), - makeSeperatedString(shaderSourceMap)); - } else if (apiName.equals(API_GL_SHADER_DEL)) { - shaderIDMap.remove(parameter); - shaderTypeMap.remove(parameter); - shaderSourceMap.remove(parameter); - - setContextValueList(seq, - GLContextDBEnum.SHADER_OBJ_ID.ordinal(), - makeSeperatedString(shaderIDMap)); - setContextValueList(seq, GLContextDBEnum.SHADER_TYPE.ordinal(), - makeSeperatedString(shaderTypeMap)); - setContextValueList(seq, GLContextDBEnum.SHADER_SRC.ordinal(), - makeSeperatedString(shaderSourceMap)); - } else if (apiName.equals(API_GL_SHADER_SOURCE)) { - shaderSourceMap.put(parameters[0], logData.getContextValue()); - - int i = 0; - for (String shaderID : shaderIDMap.values()) { - if (shaderID.equals(parameters[0])) { - involvedIndex1 = i; - break; - } - i++; - } - setContextValueList(seq, GLContextDBEnum.SHADER_SRC.ordinal(), - makeSeperatedString(shaderSourceMap)); - } else if (apiName.equals(API_GL_STENCIL_FUNC)) { - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_FUNC.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_REF.ordinal(), - parameters[1]); - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_MASK.ordinal(), - parameters[2]); - - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_FUNC.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_REF.ordinal(), - parameters[1]); - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_MASK.ordinal(), - parameters[2]); - } else if (apiName.equals(API_GL_STENCIL_FUNC_SEP)) { - if (parameters[0].equals(GL_FRONT)) { - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_FUNC.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_REF.ordinal(), - parameters[1]); - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_MASK.ordinal(), - parameters[2]); - } else if (parameters[0].equals(GL_BACK)) { - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_FUNC.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_REF.ordinal(), - parameters[1]); - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_MASK.ordinal(), - parameters[2]); - } else if (parameters[0].equals(GL_FRONT_AND_BACK)) { - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_FUNC.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_REF.ordinal(), - parameters[1]); - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_MASK.ordinal(), - parameters[2]); - - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_FUNC.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_REF.ordinal(), - parameters[1]); - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_MASK.ordinal(), - parameters[2]); - } - } else if (apiName.equals(API_GL_STENCIL_OP)) { - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_S_FAIL.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_D_FAIL.ordinal(), - GLConstantMap.getConstantString(parameters[1])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_D_PASS.ordinal(), - GLConstantMap.getConstantString(parameters[2])); - - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_S_FAIL.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_D_FAIL.ordinal(), - GLConstantMap.getConstantString(parameters[1])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_D_PASS.ordinal(), - GLConstantMap.getConstantString(parameters[2])); - } else if (apiName.equals(API_GL_STENCIL_OP_SEP)) { - if (apiName.equals(GL_FRONT)) { - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_S_FAIL.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_D_FAIL.ordinal(), - GLConstantMap.getConstantString(parameters[1])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_D_PASS.ordinal(), - GLConstantMap.getConstantString(parameters[2])); - } else if (apiName.equals(GL_BACK)) { - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_S_FAIL.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_D_FAIL.ordinal(), - GLConstantMap.getConstantString(parameters[1])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_D_PASS.ordinal(), - GLConstantMap.getConstantString(parameters[2])); - } else if (apiName.equals(GL_FRONT_AND_BACK)) { - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_S_FAIL.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_D_FAIL.ordinal(), - GLConstantMap.getConstantString(parameters[1])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_FRONT_D_PASS.ordinal(), - GLConstantMap.getConstantString(parameters[2])); - - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_S_FAIL.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_D_FAIL.ordinal(), - GLConstantMap.getConstantString(parameters[1])); - setContextValueList(seq, - GLContextDBEnum.STENCIL_BACK_D_PASS.ordinal(), - GLConstantMap.getConstantString(parameters[2])); - } - } else if (apiName.equals(API_GL_TEXTURE_ACTIVE)) { - setContextValueList(seq, - GLContextDBEnum.TEXTURE_ACTIVE.ordinal(), - GLConstantMap.getConstantString(parameters[0])); - } else if (apiName.equals(API_GL_TEXTURE_BIND)) { - int activeTextureUnit = Integer - .parseInt(currentContextValueList.get( - GLContextDBEnum.TEXTURE_ACTIVE.ordinal()) - .split("GL_TEXTURE")[1]); - involvedIndex1 = activeTextureUnit; - if (parameters[0].equals(GL_TEXTURE_2D)) { - textureUnit2dValueList - .set(activeTextureUnit, parameters[1]); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_UNIT_2D.ordinal(), - makeSeperatedString(textureUnit2dValueList)); - } else if (parameters[0].equals(GL_TEXTURE_CUBE_MAP)) { - textureUnitCubeValueList.set(activeTextureUnit, - parameters[1]); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_UNIT_CUBE.ordinal(), - makeSeperatedString(textureUnitCubeValueList)); - } - } else if (apiName.equals(API_GL_TEXTURE_GEN)) { - int num = Integer.parseInt(parameters[0]); - - for (int i = 0; i < num; i++) { - textureObjIDMap.put(contextValues[i], contextValues[i]); - textureObjMagFuncMap.put(contextValues[i], "GL_LINEAR"); - textureObjMinFuncMap.put(contextValues[i], - "GL_NEAREST_MIPMAP_LINEAR"); - textureObjWrapSMap.put(contextValues[i], "GL_REPEAT"); - textureObjWrapTMap.put(contextValues[i], "GL_REPEAT"); - } - - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_ID.ordinal(), - makeSeperatedString(textureObjIDMap)); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_MAG_FUNC.ordinal(), - makeSeperatedString(textureObjMagFuncMap)); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_MIN_FUNC.ordinal(), - makeSeperatedString(textureObjMinFuncMap)); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_WRAP_S.ordinal(), - makeSeperatedString(textureObjWrapSMap)); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_WRAP_T.ordinal(), - makeSeperatedString(textureObjWrapTMap)); - } else if (apiName.equals(API_GL_TEXTURE_DEL)) { - int num = Integer.parseInt(parameters[0]); - - for (int i = 0; i < num; i++) { - textureObjIDMap.remove(contextValues[i]); - textureObjMagFuncMap.remove(contextValues[i]); - textureObjMinFuncMap.remove(contextValues[i]); - textureObjWrapSMap.remove(contextValues[i]); - textureObjWrapTMap.remove(contextValues[i]); - } - - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_ID.ordinal(), - makeSeperatedString(textureObjIDMap)); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_MAG_FUNC.ordinal(), - makeSeperatedString(textureObjMagFuncMap)); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_MIN_FUNC.ordinal(), - makeSeperatedString(textureObjMinFuncMap)); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_WRAP_S.ordinal(), - makeSeperatedString(textureObjWrapSMap)); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_WRAP_T.ordinal(), - makeSeperatedString(textureObjWrapTMap)); - } else if (apiName.equals(API_GL_TEXTURE_PARAM_F) - || apiName.equals(API_GL_TEXTURE_PARAM_I)) { - String textureObjID; - int activeTextureUnit = Integer - .parseInt(currentContextValueList.get( - GLContextDBEnum.TEXTURE_ACTIVE.ordinal()) - .split("GL_TEXTURE")[1]); - if (parameters[0].equals(GL_TEXTURE_2D)) { - textureObjID = textureUnit2dValueList - .get(activeTextureUnit); - } else { - textureObjID = textureUnitCubeValueList - .get(activeTextureUnit); - } - - involvedIndex1 = getIndexByKey(textureObjIDMap, textureObjID); - - if (parameters[1].equals(GL_TEXTURE_MAG_FILTER)) { - textureObjMagFuncMap.put(textureObjID, - GLConstantMap.getConstantString(parameters[2])); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_MAG_FUNC.ordinal(), - makeSeperatedString(textureObjMagFuncMap)); - } else if (parameters[1].equals(GL_TEXTURE_MIN_FILTER)) { - textureObjMinFuncMap.put(textureObjID, - GLConstantMap.getConstantString(parameters[2])); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_MIN_FUNC.ordinal(), - makeSeperatedString(textureObjMinFuncMap)); - } else if (parameters[1].equals(GL_TEXTURE_WRAP_S)) { - textureObjWrapSMap.put(textureObjID, - GLConstantMap.getConstantString(parameters[2])); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_WRAP_S.ordinal(), - makeSeperatedString(textureObjWrapSMap)); - } else if (parameters[1].equals(GL_TEXTURE_WRAP_T)) { - textureObjWrapTMap.put(textureObjID, - GLConstantMap.getConstantString(parameters[2])); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_WRAP_T.ordinal(), - makeSeperatedString(textureObjWrapTMap)); - } - } else if (apiName.equals(API_GL_TEXTURE_PARAM_FV) - || apiName.equals(API_GL_TEXTURE_PARAM_IV)) { - // TODO - String textureObjID; - int activeTextureUnit = Integer - .parseInt(currentContextValueList.get( - GLContextDBEnum.TEXTURE_ACTIVE.ordinal()) - .split("GL_TEXTURE")[1]); - if (parameters[0].equals(GL_TEXTURE_2D)) { - textureObjID = textureUnit2dValueList - .get(activeTextureUnit); - } else { - textureObjID = textureUnitCubeValueList - .get(activeTextureUnit); - } - - involvedIndex1 = getIndexByKey(textureObjIDMap, textureObjID); - - if (parameters[1].equals(GL_TEXTURE_MAG_FILTER)) { - textureObjMagFuncMap.put(textureObjID, - GLConstantMap.getConstantString(contextValues[0])); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_MAG_FUNC.ordinal(), - makeSeperatedString(textureObjMagFuncMap)); - } else if (parameters[1].equals(GL_TEXTURE_MIN_FILTER)) { - textureObjMinFuncMap.put(textureObjID, - GLConstantMap.getConstantString(contextValues[0])); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_MIN_FUNC.ordinal(), - makeSeperatedString(textureObjMinFuncMap)); - } else if (parameters[1].equals(GL_TEXTURE_WRAP_S)) { - textureObjWrapSMap.put(textureObjID, - GLConstantMap.getConstantString(contextValues[0])); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_WRAP_S.ordinal(), - makeSeperatedString(textureObjWrapSMap)); - } else if (parameters[1].equals(GL_TEXTURE_WRAP_T)) { - textureObjWrapTMap.put(textureObjID, - GLConstantMap.getConstantString(contextValues[0])); - setContextValueList(seq, - GLContextDBEnum.TEXTURE_OBJ_WRAP_T.ordinal(), - makeSeperatedString(textureObjWrapTMap)); - } - } else if (apiName.equals(API_GL_VERTEX_ATTRIB1F) - || apiName.equals(API_GL_VERTEX_ATTRIB2F) - || apiName.equals(API_GL_VERTEX_ATTRIB3F) - || apiName.equals(API_GL_VERTEX_ATTRIB4F) - || apiName.equals(API_GL_VERTEX_ATTRIB1FV) - || apiName.equals(API_GL_VERTEX_ATTRIB2FV) - || apiName.equals(API_GL_VERTEX_ATTRIB3FV) - || apiName.equals(API_GL_VERTEX_ATTRIB4FV)) { - // TODO IndexOutOfBoundsException - involvedIndex1 = Integer.parseInt(parameters[0]); - gvaV0ValueList.set(involvedIndex1, contextValues[0]); - gvaV1ValueList.set(involvedIndex1, contextValues[1]); - gvaV2ValueList.set(involvedIndex1, contextValues[2]); - gvaV3ValueList.set(involvedIndex1, contextValues[3]); - setContextValueList(seq, GLContextDBEnum.GVA_V0.ordinal(), - makeSeperatedString(gvaV0ValueList)); - setContextValueList(seq, GLContextDBEnum.GVA_V1.ordinal(), - makeSeperatedString(gvaV1ValueList)); - setContextValueList(seq, GLContextDBEnum.GVA_V2.ordinal(), - makeSeperatedString(gvaV2ValueList)); - setContextValueList(seq, GLContextDBEnum.GVA_V3.ordinal(), - makeSeperatedString(gvaV3ValueList)); - } else if (apiName.equals(API_GL_VERTEX_ATTRIB_POINTER)) { - involvedIndex1 = Integer.parseInt(parameters[0]); - gvaSizeValueList.set(involvedIndex1, parameters[1]); - gvaTypeValueList.set(involvedIndex1, - GLConstantMap.getConstantString(parameters[2])); - gvaNormalValueList.set(involvedIndex1, parameters[3]); - gvaStrideValueList.set(involvedIndex1, parameters[4]); - gvaPointerValueList.set(involvedIndex1, parameters[5]); - setContextValueList(seq, GLContextDBEnum.GVA_SIZE.ordinal(), - makeSeperatedString(gvaSizeValueList)); - setContextValueList(seq, GLContextDBEnum.GVA_TYPE.ordinal(), - makeSeperatedString(gvaTypeValueList)); - setContextValueList(seq, GLContextDBEnum.GVA_NORMAL.ordinal(), - makeSeperatedString(gvaNormalValueList)); - setContextValueList(seq, GLContextDBEnum.GVA_STRIDE.ordinal(), - makeSeperatedString(gvaStrideValueList)); - setContextValueList(seq, GLContextDBEnum.GVA_POINTER.ordinal(), - makeSeperatedString(gvaPointerValueList)); - } else if (apiName.equals(API_GL_VIEWPORT)) { - setContextValueList(seq, GLContextDBEnum.VIEWPORT_X.ordinal(), - parameters[0]); - setContextValueList(seq, GLContextDBEnum.VIEWPORT_Y.ordinal(), - parameters[1]); - setContextValueList(seq, GLContextDBEnum.VIEWPORT_W.ordinal(), - parameters[2]); - setContextValueList(seq, GLContextDBEnum.VIEWPORT_H.ordinal(), - parameters[3]); - } - - currentContextValueList.set(GLContextDBEnum.INVOLVED_ORDINAL - .ordinal(), makeSeperatedString(currentContextValueList - .getSetIndexList())); - currentContextValueList.set( - GLContextDBEnum.INVOLVED_INDEX1.ordinal(), - String.valueOf(involvedIndex1)); - currentContextValueList.set( - GLContextDBEnum.INVOLVED_INDEX2.ordinal(), - String.valueOf(involvedIndex2)); - } else { - currentContextValueList.set( - GLContextDBEnum.INVOLVED_ORDINAL.ordinal(), EMPTY); - currentContextValueList.set( - GLContextDBEnum.INVOLVED_INDEX1.ordinal(), EMPTY); - currentContextValueList.set( - GLContextDBEnum.INVOLVED_INDEX2.ordinal(), EMPTY); - } - - currentContextValueList.set(CONTEXT_VALUE_SIZE, seq); - currentContextValueList.set(GLContextDBEnum.FRAME_INDEX.ordinal(), - String.valueOf(currentFrameIndex)); - contextValueDBInputList.add((List) currentContextValueList - .clone()); - } - - private void setContextValueList(String seq, int index, String value) { - if (!currentContextValueList.get(index).equals(value)) { - contextValueChangeList.get(index).add( - currentFrameIndex + DELIMITER + seq); - } - - contextValueSetList.get(index).add(currentFrameIndex + DELIMITER + seq); - - currentContextValueList.set(index, value); - } - - public GLFrameData getFrameData(int index) { - return glFrameDataList.get(index); - } - - public int getFrameSize() { - return glFrameDataList.size(); - } - - public List> getContextValueDAInputListAndClear() { - @SuppressWarnings("unchecked") - List> ret = (List>) contextValueDBInputList - .clone(); - contextValueDBInputList.clear(); - - return ret; - } - - private String makeSeperatedString(List list) { - if (list.size() == 0) { - return EMPTY; - } - - StringBuilder sb = new StringBuilder(); - for (String string : list) { - sb.append(string); - sb.append(DELIMITER); - } - - sb.deleteCharAt(sb.length() - 1); - sb.deleteCharAt(sb.length() - 1); - return sb.toString(); - } - - private String makeSeperatedString2( - LinkedHashMap> map) { - if (map.size() == 0) { - return EMPTY; - } - - StringBuilder sb = new StringBuilder(); - for (LinkedHashMap mapValue : map.values()) { - for (String string : mapValue.values()) { - sb.append(string); - sb.append(COMMA); - } - sb.append(DELIMITER); - } - - sb.deleteCharAt(sb.length() - 1); - sb.deleteCharAt(sb.length() - 1); - sb.deleteCharAt(sb.length() - 1); - return sb.toString(); - } - - private String makeSeperatedString(LinkedHashMap map) { - if (map.size() == 0) { - return EMPTY; - } - - StringBuilder sb = new StringBuilder(); - for (String string : map.values()) { - sb.append(string); - sb.append(DELIMITER); - } - - sb.deleteCharAt(sb.length() - 1); - sb.deleteCharAt(sb.length() - 1); - return sb.toString(); - } - - private int getIndexByKey(LinkedHashMap map, String key) { - Set keySet = map.keySet(); - Iterator iter = keySet.iterator(); - int i = -1; - - while (iter.hasNext()) { - i++; - if (iter.next().equals(key)) { - return i; - } - } - - return -1; - } - - private void putMapValue( - LinkedHashMap> map, - String key, String value, String index) { - if (map.get(key) == null) { - map.put(key, new LinkedHashMap()); - } - - map.get(key).put(index, value); - } - - public FrameCountInfo getFrameCountInfo(int index) { - return frameCountInfoList.get(index); - } - - public int getFrameCountInfoListSize() { - return frameCountInfoList.size(); - } - - public int getFrameCountListIndex(int frameIndex) { - int tempIndex = 0; - for (int i = 0; i < frameCountInfoList.size(); i++) { - tempIndex += frameCountInfoList.get(i).getFrameCount(); - if (tempIndex > frameIndex) { - return i; - } - } - - return -1; - } - - public ArrayList getContextValueChangeList(int columnIndex) { - return contextValueChangeList.get(columnIndex); - } - - public ArrayList getContextValueSetList(int columnIndex) { - return contextValueSetList.get(columnIndex); - } - - @Override - public void run() { - while (!AnalyzerManager.isExit()) { - LogPackage pack = pollPack(); - if(pack == null) // stop thread - break; - - Logs glesLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_GLES20); - if (glesLogs != null && glesLogs.getRawLogs().size() != 0) { - List logDataList = glesLogs.getRawLogs(); - - for (LogData logData : logDataList) { - addGLAPIData((GLES20LogData) logData); - } - - GLContextDataInserter.getContextDataQueue().push( - getContextValueDAInputListAndClear()); - GLContextDataInserter.startinserterThread(); - } - } - - DA_LOG.debug(getName() + " thread ended!"); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLDataManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLDataManager.java new file mode 100644 index 0000000..2c2dd9e --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLDataManager.java @@ -0,0 +1,325 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.data; + +import java.util.ArrayList; +import java.util.List; + +import org.tizen.dynamicanalyzer.common.AnalyzerManager; +import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants; +import org.tizen.dynamicanalyzer.swap.logparser.LogPackage; +import org.tizen.dynamicanalyzer.swap.logparser.Logs; +import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager; +import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData; +import org.tizen.dynamicanalyzer.swap.model.data.LogData; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.FrameCountInfoType; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPINameDefine; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPIType; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLFrameType; +import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants; +import org.tizen.dynamicanalyzer.util.DALogger; + +public class GLDataManager extends PageDataManager { + private static final DALogger DA_LOG = DALogger.getInstance(); + private static GLDataManager instance = null; + private GLStateDataMaker GLStateDataMagerInstance = null; + + private GLFrameType glFrameData = null; + private List frameInfoList; + private int currentFrameTimeIndex = 1; + private int startFrameRateTime = 1; + private int selectedContextID = -1; + + private GLAPIDBTableManager apiDBTable = null; + private GLFrameRateDBTableManager frameRateDBTable = null; + private GLFrameTimeDBTableManager frameTimeDBTable = null; + private GLStateDBTableManager contextDBTable = null; + private GLStateProgramDBTableManager stateProgramDBTable = null; + private GLStateHistoryDBTableManager stateHistoryDBTable = null; + private GLStateTextureDBTableManager stateTextureDBTable = null; + + private boolean isShowFrameRateChart = true; + + public static GLDataManager getInstance() { + if (instance == null) { + instance = new GLDataManager(); + } + + return instance; + } + + private GLDataManager() { + currentFrameTimeIndex = 1; + glFrameData = new GLFrameType(currentFrameTimeIndex); + frameInfoList = new ArrayList(); + GLStateDataMagerInstance = new GLStateDataMaker(); + apiDBTable = new GLAPIDBTableManager(); + addDBTable(apiDBTable); + frameRateDBTable = new GLFrameRateDBTableManager(); + addDBTable(frameRateDBTable); + frameTimeDBTable = new GLFrameTimeDBTableManager(); + addDBTable(frameTimeDBTable); + contextDBTable = new GLStateDBTableManager(); + addDBTable(contextDBTable); + stateProgramDBTable = new GLStateProgramDBTableManager(); + addDBTable(stateProgramDBTable); + stateHistoryDBTable = new GLStateHistoryDBTableManager(); + addDBTable(stateHistoryDBTable); + stateTextureDBTable = new GLStateTextureDBTableManager(); + addDBTable(stateTextureDBTable); + } + + public void clear() { + currentFrameTimeIndex = 1; + glFrameData = new GLFrameType(currentFrameTimeIndex); + frameInfoList = new ArrayList(); + GLStateDataMagerInstance.clear(); + } + + public void openProcess() { + updateFrameTimeChartEndTime(); + stateProgramDBTable.initProgramData(); + } + + public void stopProcess() { + insertStopFrameRateChartData(); + stateProgramDBTable.insertData(); + } + + @Override + public void run() { + while (!AnalyzerManager.isExit()) { + LogPackage pack = pollPack(); + if (pack == null) // stop thread + break; + + Logs glesLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_GLES20); + if (glesLogs != null && glesLogs.getRawLogs().size() != 0) { + makeGLData(glesLogs); + } + } + DA_LOG.debug(getName() + " thread ended!"); + } + + public void makeGLData(Logs glesLogs) { + List logDataList = glesLogs.getRawLogs(); + List> insetFrameTimeChartDataList = new ArrayList>(); + for (LogData data : logDataList) { + GLES20LogData logData = (GLES20LogData) data; + + glFrameData.addGLAPIData(new GLAPIType(logData)); + + String apiName = logData.getApiName(); + if (apiName.equals(GLAPINameDefine.API_SGL_SWAPBUFFERS) + || apiName.equals(GLAPINameDefine.API_EGL_SWAPBUFFERS)) { + { + logData.setErrNo(0); + logData.setApiName(GLAPINameDefine.API_EGL_SWAPBUFFERS); + } + + makeFrameRateChartDataList(logData); + insetFrameTimeChartDataList + .add(makeFrameTimeChartData(logData)); + insertAPIData(); + + insertTraceFrameRateChartData(logData); + glFrameData.initFrameIndex(++currentFrameTimeIndex); + } + + int frameRateIndex = getTimeLieTime(logData); + if (currentFrameTimeIndex == 1) { + frameRateIndex = 1; + } + GLStateDataMagerInstance.addGLAPIData(logData, frameRateIndex, + currentFrameTimeIndex); + } + + frameTimeDBTable.insertData(insetFrameTimeChartDataList); + } + + private void makeFrameRateChartDataList(GLES20LogData logData) { + int time = getTimeLieTime(logData); + for (FrameCountInfoType data : frameInfoList) { + if (data.getTime() == time) { + data.addFrameCount(); + return; + } + } + + FrameCountInfoType frameRateData = new FrameCountInfoType(); + frameRateData.setTime(time); + frameRateData.setStartFrameIndex(currentFrameTimeIndex); + frameRateData.setErrno(glFrameData.hasError()); + frameRateData.addFrameCount(); + frameInfoList.add(frameRateData); + } + + public void insertTraceFrameRateChartData(GLES20LogData logData) { + List> insetData = new ArrayList>(); + List removeframeInfoList = new ArrayList(); + for (FrameCountInfoType data : frameInfoList) { + if (getTimeLieTime(logData) > data.getTime()) { + List framRateChartData = new ArrayList(); + framRateChartData.add(data.getTime()); + framRateChartData.add(data.getFrameCount() - 1); + framRateChartData.add(data.getStartFrameIndex()); + framRateChartData.add(data.hasErrno()); + insetData.add(framRateChartData); + removeframeInfoList.add(data); + + } + } + frameInfoList.removeAll(removeframeInfoList); + + if (insetData.size() > 0) { + frameRateDBTable.insert(insetData); + } + } + + public void insertStopFrameRateChartData() { + List> insetData = new ArrayList>(); + List removeframeInfoList = new ArrayList(); + for (FrameCountInfoType data : frameInfoList) { + List framRateChartData = new ArrayList(); + framRateChartData.add(data.getTime()); + framRateChartData.add(data.getFrameCount()); + framRateChartData.add(data.getStartFrameIndex()); + framRateChartData.add(data.hasErrno()); + insetData.add(framRateChartData); + removeframeInfoList.add(data); + } + frameInfoList.removeAll(removeframeInfoList); + + if (insetData.size() > 0) { + frameRateDBTable.insert(insetData); + } + } + + private List makeFrameTimeChartData(GLES20LogData logData) { + int frameNumber = glFrameData.getFrameNumber(); + long frameValue = glFrameData.getFrametime() + / TimelineConstants.KILO_LONG; + List framTimeChartData = new ArrayList(); + framTimeChartData.add(frameNumber); + framTimeChartData.add(getTimeLieTime(logData)); + framTimeChartData.add((int) frameValue); + framTimeChartData.add(glFrameData.hasError()); + framTimeChartData.add(glFrameData.getStartSeq()); + framTimeChartData.add(glFrameData.getEndSeq()); + return framTimeChartData; + } + + private void insertAPIData() { + List insetData = new ArrayList(); + for (GLAPIType apiData : glFrameData.getGLApiDataList()) { + apiData.setFrameIndex(currentFrameTimeIndex); + insetData.add(apiData); + } + glFrameData.getGLApiDataList().clear(); + apiDBTable.insert(insetData); + } + + private int getTimeLieTime(GLES20LogData logData) { + return (int) (logData.getTime() / TimelineConstants.MEGA_DOUBLE) + 1; + } + + public GLFrameType getFrameData(int index) { + return apiDBTable.selectOpenGLAPIData(index); + } + + public int getFrameSize() { + return currentFrameTimeIndex; + } + + private void updateFrameTimeChartEndTime() { + if (currentFrameTimeIndex == 1) { + currentFrameTimeIndex = frameTimeDBTable.getFrameSize(); + } + } + + public FrameCountInfoType getFrameRateStartIndex(int startIndex, + int endIndex) { + return frameRateDBTable.selectFrameCountInfo(startIndex, endIndex); + } + + public int getSelectedContextID() { + return selectedContextID; + } + + public void setSelectedContextID(int selectedContextID) { + this.selectedContextID = selectedContextID; + } + + public GLAPIDBTableManager getAPIDataMagerInstance() { + return apiDBTable; + } + + public GLStateDataMaker getStateDataMagerInstance() { + return GLStateDataMagerInstance; + } + + public GLFrameRateDBTableManager getFrameRateDBTableManager() { + return frameRateDBTable; + } + + public GLFrameTimeDBTableManager getFrameTimeDBTableManager() { + return frameTimeDBTable; + } + + public GLStateDBTableManager getContextDBTableManage() { + return contextDBTable; + } + + public GLStateProgramDBTableManager getStateProgramDBTableManage() { + return stateProgramDBTable; + } + + public GLStateHistoryDBTableManager getStateHistoryDBTableManage() { + return stateHistoryDBTable; + } + + public GLStateTextureDBTableManager getStateTextureDBTableManage() { + return stateTextureDBTable; + } + + public boolean isShowFrameRateChart() { + return isShowFrameRateChart; + } + + public void setShowFrameRateChart(boolean isShowFrameRateChart) { + this.isShowFrameRateChart = isShowFrameRateChart; + } + + public int getStartFrameRateTime() { + return startFrameRateTime; + } + + public void setStartFrameRateTime(int startFrameRateTime) { + this.startFrameRateTime = startFrameRateTime; + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLFrameRateDBTableManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLFrameRateDBTableManager.java new file mode 100644 index 0000000..3fc5d1f --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLFrameRateDBTableManager.java @@ -0,0 +1,159 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ +package org.tizen.dynamicanalyzer.ui.opengl.data; + +import java.io.File; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.List; + +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.AnalyzerManager; +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.database.DBColumn; +import org.tizen.dynamicanalyzer.database.DBConstants; +import org.tizen.dynamicanalyzer.database.DBTable; +import org.tizen.dynamicanalyzer.database.SqlConnectionManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.FrameCountInfoType; + +public class GLFrameRateDBTableManager extends DBTable { + private static final String TABLENAME = "GL_FRAME_RATE";//$NON-NLS-1$ + + public static final String CHART_TIME = "CHART_TIME";//$NON-NLS-1$ + public static final String FRAME_COUNT = "FRAME_COUNT";//$NON-NLS-1$ + public static final String FRAME_INDEX = "FRAME_INDEX";//$NON-NLS-1$ + public static final String ERROR_INFO = "ERROR_INFO";//$NON-NLS-1$ + + public final static int TABLE_CHART_TIME_INDEX = 0; + public final static int TABLE_FRAME_COUNT_INDEX = 1; + public final static int TABLE_FRAME_INDEX_INDEX = 2; + public final static int TABLE_ERROR_INFO_INDEX = 3; + + private static final String SELECT_FRAME_RATE_TABLE_QUERY = "select "//$NON-NLS-1$ + + CHART_TIME + CommonConstants.COMMA + + FRAME_COUNT + + CommonConstants.COMMA + FRAME_INDEX + + CommonConstants.COMMA + + ERROR_INFO + " from "//$NON-NLS-1$ + + TABLENAME + " where '%s' <= " + CHART_TIME + " and " + CHART_TIME//$NON-NLS-1$ //$NON-NLS-2$ + + " <= '%s'";//$NON-NLS-1$ + + @Override + public String getTableName() { + return TABLENAME; + } + + public GLFrameRateDBTableManager() { + addColumn(new DBColumn(CHART_TIME, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(FRAME_COUNT, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(FRAME_INDEX, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(ERROR_INFO, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + } + + public final void insert(List> data) { + insertData(data); + } + + public FrameCountInfoType selectFrameCountInfo(int startIndex, int endIndex) { + if (null != AnalyzerManager.getProject()) { + SqlConnectionManager.establishConnection(AnalyzerManager + .getProject().getSavePath() + + File.separator + + AnalyzerConstants.DATABASE_NAME); + } + String query = String.format(SELECT_FRAME_RATE_TABLE_QUERY, startIndex, + endIndex); + List> result = SqlConnectionManager.executeQuery(query); + if (null == result || result.size() == 0 || result.get(0).size() == 0) { + return null; + } + + FrameCountInfoType returnData = new FrameCountInfoType(); + int startFrameIndex = -1; + int endFrameIndex = -1; + + for (int i = 0; i < result.size(); i++) { + if (i == 0) { + startFrameIndex = (Integer) (result.get(i) + .get(TABLE_FRAME_INDEX_INDEX)); + } + if (i == result.size() - 1) { + endFrameIndex = startFrameIndex + + (Integer) result.get(i).get(TABLE_FRAME_COUNT_INDEX); + } + } + returnData.setStartFrameIndex(startFrameIndex); + returnData.setEndFrameIndex(endFrameIndex); + return returnData; + } + + public List> selectFrameRate(double startIndex, double endIndex) { + if (null != AnalyzerManager.getProject()) { + SqlConnectionManager.establishConnection(AnalyzerManager + .getProject().getSavePath() + + File.separator + + AnalyzerConstants.DATABASE_NAME); + } + if (null != AnalyzerManager.getProject()) { + SqlConnectionManager.establishConnection(AnalyzerManager + .getProject().getSavePath() + + File.separator + + AnalyzerConstants.DATABASE_NAME); + } + String query = String.format(SELECT_FRAME_RATE_TABLE_QUERY, startIndex, + endIndex); + return SqlConnectionManager.executeQuery(query); + } + + @Override + public boolean prepare(PreparedStatement prep, List rowData) { + boolean isPrepared = true; + + int columnsize = getColumnSize(); + if (columnsize != rowData.size()) { + isPrepared = false; + } else { + try { + prep.setInt(TABLE_CHART_TIME_INDEX + 1, + (Integer) (rowData.get(TABLE_CHART_TIME_INDEX))); + prep.setInt(TABLE_FRAME_COUNT_INDEX + 1, + (Integer) (rowData.get(TABLE_FRAME_COUNT_INDEX))); + prep.setInt(TABLE_FRAME_INDEX_INDEX + 1, + (Integer) (rowData.get(TABLE_FRAME_INDEX_INDEX))); + prep.setInt(TABLE_ERROR_INFO_INDEX + 1, + (Integer) (rowData.get(TABLE_ERROR_INFO_INDEX))); + } catch (SQLException e) { + e.printStackTrace(); + isPrepared = false; + } + } + return isPrepared; + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLFrameTimeDBTableManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLFrameTimeDBTableManager.java new file mode 100644 index 0000000..b33b21d --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLFrameTimeDBTableManager.java @@ -0,0 +1,158 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ +package org.tizen.dynamicanalyzer.ui.opengl.data; + +import java.io.File; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.List; + +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.AnalyzerManager; +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.database.DBColumn; +import org.tizen.dynamicanalyzer.database.DBConstants; +import org.tizen.dynamicanalyzer.database.DBTable; +import org.tizen.dynamicanalyzer.database.SqlConnectionManager; + +public class GLFrameTimeDBTableManager extends DBTable { + private static final String TABLENAME = "GL_FRAME_TIME";//$NON-NLS-1$ + + public static final String CHART_TIME = "CHART_TIME";//$NON-NLS-1$ + public static final String FRAME_RATE = "FRAME_RATE_TIME";//$NON-NLS-1$ + public static final String VALUE = "VALUE";//$NON-NLS-1$ + public static final String ERROR_INFO = "ERROR_INFO";//$NON-NLS-1$ + public static final String START_SEQ = "START_SEQ";//$NON-NLS-1$ + public static final String END_SEQ = "END_SEQ";//$NON-NLS-1$ + + public final static int TABLE_CHART_TIME_INDEX = 0; + public final static int TABLE_FRAME_RATE_INDEX = 1; + public final static int TABLE_VALUE_INDEX = 2; + public final static int TABLE_ERROR_INFO_INDEX = 3; + public final static int TABLE_START_SEQ_INDEX = 4; + public final static int TABLE_END_SEQ_INDEX = 5; + + private static final String SELECT_TOTALB_FRAME_TIME_TABLE_QUERY = "select "//$NON-NLS-1$ + + CHART_TIME + + CommonConstants.COMMA + + FRAME_RATE + + CommonConstants.COMMA + + VALUE + + CommonConstants.COMMA + + ERROR_INFO + + CommonConstants.COMMA + + START_SEQ + + CommonConstants.COMMA + END_SEQ + " from "//$NON-NLS-1$ + + TABLENAME; + + private static final String SELECT_FRAME_TIME_TABLE_QUERY = "select "//$NON-NLS-1$ + + CHART_TIME + CommonConstants.COMMA + + FRAME_RATE + + CommonConstants.COMMA + VALUE + + CommonConstants.COMMA + + ERROR_INFO + CommonConstants.COMMA + + START_SEQ + + CommonConstants.COMMA + END_SEQ + " from "//$NON-NLS-1$ + + TABLENAME + " where '%s' <= " + CHART_TIME + " and "//$NON-NLS-1$//$NON-NLS-2$ + + CHART_TIME + " <= '%s'";//$NON-NLS-1$ + + @Override + public String getTableName() { + return TABLENAME; + } + + public GLFrameTimeDBTableManager() { + addColumn(new DBColumn(CHART_TIME, DBConstants.PRIMARY_KEY, + DBConstants.INTEGER)); + addColumn(new DBColumn(FRAME_RATE, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(VALUE, DBConstants.NOT_NULL, DBConstants.INTEGER)); + addColumn(new DBColumn(ERROR_INFO, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(START_SEQ, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(END_SEQ, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + } + + public int getFrameSize() { + if (null != AnalyzerManager.getProject()) { + SqlConnectionManager.establishConnection(AnalyzerManager + .getProject().getSavePath() + + File.separator + + AnalyzerConstants.DATABASE_NAME); + } + List> result = SqlConnectionManager + .executeQuery(SELECT_TOTALB_FRAME_TIME_TABLE_QUERY); + if (null == result || result.size() == 0 || result.get(0).size() == 0) { + return 0; + } else { + return result.size(); + } + } + + public List> selectFrameTime(double startIndex, double endIndex) { + if (null != AnalyzerManager.getProject()) { + SqlConnectionManager.establishConnection(AnalyzerManager + .getProject().getSavePath() + + File.separator + + AnalyzerConstants.DATABASE_NAME); + } + String query = String.format(SELECT_FRAME_TIME_TABLE_QUERY, startIndex, + endIndex); + return SqlConnectionManager.executeQuery(query); + } + + @Override + public boolean prepare(PreparedStatement prep, List rowData) { + boolean isPrepared = true; + + int columnsize = getColumnSize(); + if (columnsize != rowData.size()) { + isPrepared = false; + } else { + try { + prep.setInt(TABLE_CHART_TIME_INDEX + 1, + (Integer) (rowData.get(TABLE_CHART_TIME_INDEX))); + prep.setInt(TABLE_FRAME_RATE_INDEX + 1, + (Integer) (rowData.get(TABLE_FRAME_RATE_INDEX))); + prep.setInt(TABLE_VALUE_INDEX + 1, + (Integer) (rowData.get(TABLE_VALUE_INDEX))); + prep.setInt(TABLE_ERROR_INFO_INDEX + 1, + (Integer) (rowData.get(TABLE_ERROR_INFO_INDEX))); + prep.setInt(TABLE_START_SEQ_INDEX + 1, + (Integer) (rowData.get(TABLE_START_SEQ_INDEX))); + prep.setInt(TABLE_END_SEQ_INDEX + 1, + (Integer) (rowData.get(TABLE_END_SEQ_INDEX))); + + } catch (SQLException e) { + e.printStackTrace(); + isPrepared = false; + } + } + return isPrepared; + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLSelectionData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLSelectionData.java deleted file mode 100644 index 634fa05..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLSelectionData.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.data; - -import org.eclipse.swt.widgets.Control; -import org.tizen.dynamicanalyzer.common.DASelectionData; - -public class GLSelectionData extends DASelectionData { - private int frameIndex; - private int secondFrameIndex = -1; - private String seq; - private String subID; - - public GLSelectionData(String id, int frameIndex, int secondFrameIndex, - String seq) { - super(id, 0, 0, null, null); - this.frameIndex = frameIndex; - this.seq = seq; - this.secondFrameIndex = secondFrameIndex; - } - - public GLSelectionData(String id, String subid, long start, long end, Object data, - Control control, int frameIndex, int secondIndex) { - super(id, start, end, data, control); - this.subID = subid; - this.frameIndex = frameIndex; - this.secondFrameIndex = secondIndex; - this.seq = null; - } - - public int getFrameIndex() { - return frameIndex; - } - - public int getSecondFrameIndex() { - return secondFrameIndex; - } - - public String getSeq() { - return seq; - } - - public String getSubID() { - return subID; - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateDBTableManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateDBTableManager.java new file mode 100644 index 0000000..ee68581 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateDBTableManager.java @@ -0,0 +1,261 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ +package org.tizen.dynamicanalyzer.ui.opengl.data; + +import java.io.File; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.AnalyzerManager; +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.database.DBColumn; +import org.tizen.dynamicanalyzer.database.DBConstants; +import org.tizen.dynamicanalyzer.database.DBTable; +import org.tizen.dynamicanalyzer.database.SqlConnectionManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLContextNameEnum; +import org.tizen.dynamicanalyzer.util.DALogger; + +public class GLStateDBTableManager extends DBTable { + private static final String TABLENAME = "GL_CONTEXT";//$NON-NLS-1$ + private String[] columnName = null; + private int rid = 0; + private static final String SELECT_CONTEXT_TABLE__QUERY = "select * from "//$NON-NLS-1$ + + TABLENAME + + " where SEQ <= '%s' and CONTEXT_ID = '%S' order by rid desc";//$NON-NLS-1$ + + @Override + public String getTableName() { + return TABLENAME; + } + + public GLStateDBTableManager() { + rid = 0; + GLContextNameEnum[] glContextDBEnum = GLContextNameEnum.values(); + int length = glContextDBEnum.length; + + columnName = new String[length + 1]; + String[] options = new String[length + 1]; + String[] types = new String[length + 1]; + for (int i = 0; i < length; i++) { + columnName[i] = glContextDBEnum[i].getcolumnName(); + options[i] = DBConstants.EMPTY; + + if (isIntegerType(i)) { + types[i] = DBConstants.INTEGER; + } else if (isBooleans(i)) { + types[i] = DBConstants.BOOLEAN; + } else if (i == GLContextNameEnum.VIEWPORT.ordinal() + || i == GLContextNameEnum.BLEND_COLOR.ordinal() + || i == GLContextNameEnum.SCISSOR.ordinal()) { + types[i] = "VARCHAR(24)"; + } else if (i == GLContextNameEnum.GVA_ENABLED.ordinal()) { + types[i] = "VARCHAR(144)"; + } else if (i == GLContextNameEnum.GVA_SIZE.ordinal() + || i == GLContextNameEnum.GVA_NORMAL.ordinal() + || i == GLContextNameEnum.GVA_STRIDE.ordinal()) { + types[i] = "VARCHAR(64)"; + } else if (i == GLContextNameEnum.GVA_TYPE.ordinal()) { + types[i] = "VARCHAR(192)"; + } else if (i == GLContextNameEnum.GVA_POINTER.ordinal()) { + types[i] = "VARCHAR(176)"; + } else if (i == GLContextNameEnum.GVA_V0.ordinal() + || i == GLContextNameEnum.GVA_V1.ordinal() + || i == GLContextNameEnum.GVA_V2.ordinal() + || i == GLContextNameEnum.GVA_V3.ordinal()) { + types[i] = "VARCHAR(248)"; + } else if (i == GLContextNameEnum.VBO_BINDING.ordinal()) { + types[i] = "VARCHAR(192)"; + } else if (i == GLContextNameEnum.VBO_SIZE.ordinal() + || i == GLContextNameEnum.VBO_Data.ordinal() + || i == GLContextNameEnum.VBO_ID.ordinal() + || i == GLContextNameEnum.VBO_USAGE.ordinal()) { + types[i] = "VARCHAR(64)"; + } else if (i == GLContextNameEnum.FRAME_BUFFER_BINDING.ordinal()) { + types[i] = "VARCHAR(32)"; + } else { + DALogger.getInstance().error("undefine column : " + i); + } + } + for (int i = 0; i < length; i++) { + addColumn(new DBColumn(columnName[i], options[i], types[i])); + } + } + + public String[] getColumnName() { + return columnName; + } + + public void insertContextData(List insertData) { + List> insertList = new ArrayList>(); + List objextList = new ArrayList(); + int size = insertData.size(); + + for (int i = 0; i < size; i++) { + if (i == GLContextNameEnum.RID.ordinal()) { + objextList.add(rid++); + } else if (isIntegerType(i)) { + objextList.add(Integer.parseInt(insertData.get(i).trim())); + } else if (isBooleans(i)) { + String booleanString = insertData.get(i).trim(); + if (booleanString.equals(CommonConstants.ENABLE)) { + objextList.add(true); + } else { + objextList.add(false); + } + } else { + objextList.add(insertData.get(i).trim()); + } + } + insertList.add(objextList); + insertData(insertList); + } + + public List getContextData(String seq, long contextID) { + if (null != AnalyzerManager.getProject()) { + SqlConnectionManager.establishConnection(AnalyzerManager + .getProject().getSavePath() + + File.separator + + AnalyzerConstants.DATABASE_NAME); + } + String query = String.format(SELECT_CONTEXT_TABLE__QUERY, seq, + contextID); + List> result = SqlConnectionManager.executeQuery(query); + if (null == result || result.size() == 0 || result.get(0).size() == 0) { + return null; + } + + List currentStateList = new ArrayList(); + for (int i = 0; i < result.get(0).size(); i++) { + currentStateList.add(CommonConstants.EMPTY); + } + + for (int i = 0; i < result.get(0).size(); i++) { + if (isIntegerType(i)) { + currentStateList.set(i, + Integer.toString((Integer) result.get(0).get(i))); + } else if (isBooleans(i)) { + boolean booleanResult = (Boolean) result.get(0).get(i); + if (booleanResult) { + currentStateList.set(i, CommonConstants.ENABLE); + } else { + currentStateList.set(i, CommonConstants.DISABLE); + } + } else { + currentStateList.set(i, (String) result.get(0).get(i)); + } + } + return currentStateList; + } + + private boolean isBooleans(int index) { + if (index == GLContextNameEnum.BLEND_ENABLED.ordinal() + || index == GLContextNameEnum.CULLING_ENABLED.ordinal() + || index == GLContextNameEnum.DEPTH_ENABLED.ordinal() + || index == GLContextNameEnum.DITHER_ENABLED.ordinal() + || index == GLContextNameEnum.SCISSOR_ENABLED.ordinal() + || index == GLContextNameEnum.STENCIL_ENABLED.ordinal() + || index == GLContextNameEnum.POLY_ENABLED.ordinal()) { + return true; + } else { + return false; + } + } + + private boolean isIntegerType(int index) { + if (index == GLContextNameEnum.RID.ordinal() + || index == GLContextNameEnum.SEQ.ordinal() + || index == GLContextNameEnum.CONTEXT_ID.ordinal() + || index == GLContextNameEnum.BLEND_EQUATION_RGB.ordinal() + || index == GLContextNameEnum.BLEND_EQUATION_ALPHA.ordinal() + || index == GLContextNameEnum.BLEND_EQUATION_RGB.ordinal() + || index == GLContextNameEnum.BLEND_SRC_RGB.ordinal() + || index == GLContextNameEnum.BLEND_SRC_ALPHA.ordinal() + || index == GLContextNameEnum.BLEND_DEST_RGB.ordinal() + || index == GLContextNameEnum.BLEND_DEST_ALPHA.ordinal() + || index == GLContextNameEnum.CULLING_ORIENTATION.ordinal() + || index == GLContextNameEnum.CULLING_MODE.ordinal() + || index == GLContextNameEnum.DEPTH_RANGE_N.ordinal() + || index == GLContextNameEnum.DEPTH_RANGE_F.ordinal() + || index == GLContextNameEnum.DEPTH_FUNC.ordinal() + || index == GLContextNameEnum.LINE_WIDTH.ordinal() + || index == GLContextNameEnum.POLY_FACTOR.ordinal() + || index == GLContextNameEnum.POLY_UNITS.ordinal() + || index == GLContextNameEnum.STENCIL_FRONT_FUNC.ordinal() + || index == GLContextNameEnum.STENCIL_FRONT_REF.ordinal() + || index == GLContextNameEnum.STENCIL_FRONT_MASK.ordinal() + || index == GLContextNameEnum.STENCIL_FRONT_S_FAIL.ordinal() + || index == GLContextNameEnum.STENCIL_FRONT_D_FAIL.ordinal() + || index == GLContextNameEnum.STENCIL_FRONT_D_PASS.ordinal() + || index == GLContextNameEnum.STENCIL_BACK_FUNC.ordinal() + || index == GLContextNameEnum.STENCIL_BACK_REF.ordinal() + || index == GLContextNameEnum.STENCIL_BACK_MASK.ordinal() + || index == GLContextNameEnum.STENCIL_BACK_S_FAIL.ordinal() + || index == GLContextNameEnum.STENCIL_BACK_D_FAIL.ordinal() + || index == GLContextNameEnum.STENCIL_BACK_D_PASS.ordinal() + || index == GLContextNameEnum.PACK_ALIGN.ordinal() + || index == GLContextNameEnum.UNPACK_ALIGN.ordinal() + || index == GLContextNameEnum.TEXTURE_ACTIVE.ordinal()) { + return true; + } else { + return false; + } + } + + @Override + public boolean prepare(PreparedStatement prep, List rowData) { + boolean isPrepared = true; + int columnsize = getColumnSize(); + if (columnsize != rowData.size()) { + isPrepared = false; + } else { + for (int i = 0; i < columnsize; i++) { + + try { + if (isIntegerType(i)) { + prep.setInt(i + 1, (Integer) (rowData.get(i))); + } else if (isBooleans(i)) { + boolean booleanResutl = (Boolean) (rowData.get(i)); + if (booleanResutl) { + prep.setBoolean(i + 1, true); + } else { + prep.setBoolean(i + 1, false); + } + + } else { + prep.setString(i + 1, (String) (rowData.get(i))); + } + } catch (SQLException e) { + e.printStackTrace(); + isPrepared = false; + } + } + } + return isPrepared; + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateDataMaker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateDataMaker.java new file mode 100644 index 0000000..b986985 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateDataMaker.java @@ -0,0 +1,945 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.data; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; + +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.ContextValueType; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPINameDefine; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLConstantDefine; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLContextNameEnum; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateProgramType; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateShaderType; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateTextureType; +import org.tizen.dynamicanalyzer.util.DALogger; + +public class GLStateDataMaker { + public static int API_TYPE_INIT = 0; + public static int API_TYPE_CONTEXT = 1; + public static int API_TYPE_NO_CONTEXT = 2; + + private List programList; + private List shaderList; + private List textureList; + + private LinkedHashMap contextHashMap; + + public GLStateDataMaker() { + init(); + } + + public void init() { + programList = new ArrayList(); + shaderList = new ArrayList(); + textureList = new ArrayList(); + contextHashMap = new LinkedHashMap(); + } + + public void clear() { + init(); + } + + public void addGLAPIData(GLES20LogData logData, int currentFrameRateIndex, + int currentFrameIndex) { + + int apiType = logData.getApiType(); + String seq = String.valueOf(logData.getSeq()); + String apiName = logData.getApiName(); + String parameter = logData.getArgs(); + long errorNo = logData.getErrno(); + long contextId = logData.getCurrentContextName(); + setContextValueList(contextId, seq, + GLContextNameEnum.CONTEXT_ID.ordinal(), + Long.toString(contextId), currentFrameRateIndex, + currentFrameIndex); + String contextValue = logData.getContextValue().trim(); + ContextValueType curretnContextValue = contextHashMap.get(contextId); + + if (apiName.equals(GLAPINameDefine.API_SGL_SWAPBUFFERS) + || apiName.equals(GLAPINameDefine.API_EGL_SWAPBUFFERS)) { + errorNo = 0; + logData.setErrNo(0); + logData.setApiName(GLAPINameDefine.API_EGL_SWAPBUFFERS); + } + + if (apiType == API_TYPE_INIT) { + String contextValues[] = contextValue.split(CommonConstants.COMMA); + int maxVertexAttribs = Integer.parseInt(contextValues[0]); + int maxTextureUnits = Integer.parseInt(contextValues[1].trim()); + + curretnContextValue.setTextureUnits(maxTextureUnits); + curretnContextValue.setVertexAttribs(maxVertexAttribs); + } else if (apiType == API_TYPE_CONTEXT && errorNo == 0) { + String parameters[] = parameter.split(CommonConstants.COMMA + + CommonConstants.SPACE); + String contextValues[] = contextValue.split(CommonConstants.COMMA); + + if (apiName.equals(GLAPINameDefine.API_SGL_SWAPBUFFERS) + || apiName.equals(GLAPINameDefine.API_EGL_SWAPBUFFERS)) { + } else if (apiName.equals(GLAPINameDefine.API_GL_BLEND_COLOR)) { + setContextValueList(contextId, seq, + GLContextNameEnum.BLEND_COLOR.ordinal(), parameters[0] + + CommonConstants.COMMA + parameters[1] + + CommonConstants.COMMA + parameters[2] + + CommonConstants.COMMA + parameters[3], + currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_BLEND_EQ)) { + setContextValueList(contextId, seq, + GLContextNameEnum.BLEND_EQUATION_RGB.ordinal(), + parameters[0].trim(), currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.BLEND_EQUATION_ALPHA.ordinal(), + parameters[0], currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_BLEND_EQ_SEP)) { + setContextValueList(contextId, seq, + GLContextNameEnum.BLEND_EQUATION_RGB.ordinal(), + parameters[0], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.BLEND_EQUATION_ALPHA.ordinal(), + parameters[1], currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_BLEND_FUNC)) { + setContextValueList(contextId, seq, + GLContextNameEnum.BLEND_SRC_RGB.ordinal(), + parameters[0], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.BLEND_SRC_ALPHA.ordinal(), + parameters[1], currentFrameRateIndex, currentFrameIndex); + + setContextValueList(contextId, seq, + GLContextNameEnum.BLEND_DEST_RGB.ordinal(), + parameters[0], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.BLEND_DEST_ALPHA.ordinal(), + parameters[1], currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_BLEND_FUNC_SEP)) { + setContextValueList(contextId, seq, + GLContextNameEnum.BLEND_SRC_RGB.ordinal(), + parameters[0], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.BLEND_DEST_RGB.ordinal(), + parameters[1], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.BLEND_SRC_ALPHA.ordinal(), + parameters[2], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.BLEND_DEST_ALPHA.ordinal(), + parameters[3], currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_BUFFER_GEN)) { + int num = Integer.parseInt(parameters[0]); + + for (int i = 0; i < num; i++) { + + curretnContextValue.vboIDMap.put(contextValues[i], + contextValues[i]); + curretnContextValue.vboSizeMap.put(contextValues[i], "0"); + curretnContextValue.vboDataMap.put(contextValues[i], "?"); + curretnContextValue.vboUsageMap.put(contextValues[i], + "GL_STATIC_DRAW"); + } + + setContextValueList(contextId, seq, + GLContextNameEnum.VBO_ID.ordinal(), + makeSeperatedString(curretnContextValue.vboIDMap), + currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.VBO_SIZE.ordinal(), + makeSeperatedString(curretnContextValue.vboSizeMap), + currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.VBO_Data.ordinal(), + makeSeperatedString(curretnContextValue.vboDataMap), + currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.VBO_USAGE.ordinal(), + makeSeperatedString(curretnContextValue.vboUsageMap), + currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_BUFFER_DEL)) { + int num = Integer.parseInt(parameters[0]); + + for (int i = 0; i < num; i++) { + curretnContextValue.vboIDMap.remove(contextValues[i]); + curretnContextValue.vboSizeMap.remove(contextValues[i]); + curretnContextValue.vboDataMap.remove(contextValues[i]); + curretnContextValue.vboUsageMap.remove(contextValues[i]); + } + + setContextValueList(contextId, seq, + GLContextNameEnum.VBO_ID.ordinal(), + makeSeperatedString(curretnContextValue.vboIDMap), + currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.VBO_SIZE.ordinal(), + makeSeperatedString(curretnContextValue.vboSizeMap), + currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.VBO_Data.ordinal(), + makeSeperatedString(curretnContextValue.vboDataMap), + currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.VBO_USAGE.ordinal(), + makeSeperatedString(curretnContextValue.vboUsageMap), + currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_BUFFER_BIND)) { + if (GLConstantDefine.getConstantString(parameters[0]).equals( + "GL_ARRAY_BUFFER")) { + curretnContextValue.vboBindingArray = parameters[1]; + } else { + curretnContextValue.vboBindingElementArray = parameters[1]; + } + setContextValueList(contextId, seq, + GLContextNameEnum.VBO_BINDING.ordinal(), + curretnContextValue.vboBindingArray + + CommonConstants.BSLASH + + curretnContextValue.vboBindingElementArray, + currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_BUFFER_DATA)) { + String vboId; + if (GLConstantDefine.getConstantString(parameters[0]).equals( + "GL_ARRAY_BUFFER")) { + vboId = curretnContextValue.vboBindingArray; + } else { + vboId = curretnContextValue.vboBindingElementArray; + } + curretnContextValue.vboSizeMap.put(vboId, parameters[1]); + curretnContextValue.vboDataMap.put(vboId, "0"); + curretnContextValue.vboUsageMap.put(vboId, + GLConstantDefine.getConstantString(parameters[3])); + + setContextValueList(contextId, seq, + GLContextNameEnum.VBO_ID.ordinal(), + makeSeperatedString(curretnContextValue.vboIDMap), + currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.VBO_SIZE.ordinal(), + makeSeperatedString(curretnContextValue.vboSizeMap), + currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.VBO_Data.ordinal(), + makeSeperatedString(curretnContextValue.vboDataMap), + currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.VBO_USAGE.ordinal(), + makeSeperatedString(curretnContextValue.vboUsageMap), + currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_CULLFACE)) { + setContextValueList(contextId, seq, + GLContextNameEnum.CULLING_MODE.ordinal(), + parameters[0], currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_DEPTH_FUNC)) { + setContextValueList(contextId, seq, + GLContextNameEnum.DEPTH_FUNC.ordinal(), parameters[0], + currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_DEPTH_RANGEF)) { + setContextValueList(contextId, seq, + GLContextNameEnum.DEPTH_RANGE_N.ordinal(), + parameters[0], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.DEPTH_RANGE_F.ordinal(), + parameters[1], currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_DISABLE_VAA)) { + curretnContextValue.gvaEnabledValueList.set( + Integer.parseInt(parameter), CommonConstants.DISABLE); + setContextValueList( + contextId, + seq, + GLContextNameEnum.GVA_ENABLED.ordinal(), + makeSeperatedString(curretnContextValue.gvaEnabledValueList), + currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_ENABLE)) { + if (parameter.equals(GLAPINameDefine.GL_BLEND)) { + setContextValueList(contextId, seq, + GLContextNameEnum.BLEND_ENABLED.ordinal(), + CommonConstants.ENABLE, currentFrameRateIndex, + currentFrameIndex); + } else if (parameter.equals(GLAPINameDefine.GL_CULL_FACE)) { + setContextValueList(contextId, seq, + GLContextNameEnum.CULLING_ENABLED.ordinal(), + CommonConstants.ENABLE, currentFrameRateIndex, + currentFrameIndex); + } else if (parameter.equals(GLAPINameDefine.GL_DEPTH_TEST)) { + setContextValueList(contextId, seq, + GLContextNameEnum.DEPTH_ENABLED.ordinal(), + CommonConstants.ENABLE, currentFrameRateIndex, + currentFrameIndex); + } else if (parameter.equals(GLAPINameDefine.GL_DITHER)) { + setContextValueList(contextId, seq, + GLContextNameEnum.DITHER_ENABLED.ordinal(), + CommonConstants.ENABLE, currentFrameRateIndex, + currentFrameIndex); + } else if (parameter + .equals(GLAPINameDefine.GL_POLYGON_OFFSET_FILL)) { + setContextValueList(contextId, seq, + GLContextNameEnum.POLY_ENABLED.ordinal(), + CommonConstants.ENABLE, currentFrameRateIndex, + currentFrameIndex); + } else if (parameter.equals(GLAPINameDefine.GL_SCISSOR_TEST)) { + setContextValueList(contextId, seq, + GLContextNameEnum.SCISSOR_ENABLED.ordinal(), + CommonConstants.ENABLE, currentFrameRateIndex, + currentFrameIndex); + } else if (parameter.equals(GLAPINameDefine.GL_STENCIL_TEST)) { + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_ENABLED.ordinal(), + CommonConstants.ENABLE, currentFrameRateIndex, + currentFrameIndex); + } + } else if (apiName.equals(GLAPINameDefine.API_GL_ENABLE_VAA)) { + curretnContextValue.gvaEnabledValueList.set( + Integer.parseInt(parameter), CommonConstants.ENABLE); + setContextValueList( + contextId, + seq, + GLContextNameEnum.GVA_ENABLED.ordinal(), + makeSeperatedString(curretnContextValue.gvaEnabledValueList), + currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_FRONTFACE)) { + setContextValueList(contextId, seq, + GLContextNameEnum.CULLING_ORIENTATION.ordinal(), + parameters[0], currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_LINEWIDTH)) { + setContextValueList(contextId, seq, + GLContextNameEnum.LINE_WIDTH.ordinal(), parameters[0], + currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_PIXEL_STOREI)) { + if (parameters[0].equals(GLAPINameDefine.GL_PACK_ALIGNMENT)) { + setContextValueList(contextId, seq, + GLContextNameEnum.PACK_ALIGN.ordinal(), + parameters[1], currentFrameRateIndex, + currentFrameIndex); + } else if (parameters[0] + .equals(GLAPINameDefine.GL_UNPACK_ALIGNMENT)) { + setContextValueList(contextId, seq, + GLContextNameEnum.UNPACK_ALIGN.ordinal(), + parameters[1], currentFrameRateIndex, + currentFrameIndex); + } + } else if (apiName.equals(GLAPINameDefine.API_GL_POLY_OFFSET)) { + setContextValueList(contextId, seq, + GLContextNameEnum.POLY_FACTOR.ordinal(), parameters[0], + currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.POLY_UNITS.ordinal(), parameters[1], + currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_SCISSOR)) { + + StringBuffer scissor = new StringBuffer(); + scissor.append(parameters[0]).append(CommonConstants.COMMA) + .append(parameters[1]).append(CommonConstants.COMMA) + .append(parameters[2]).append(CommonConstants.COMMA) + .append(parameters[3]); + setContextValueList(contextId, seq, + GLContextNameEnum.SCISSOR.ordinal(), + scissor.toString(), currentFrameRateIndex, + currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_STENCIL_FUNC)) { + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_FUNC.ordinal(), + parameters[0], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_REF.ordinal(), + parameters[1], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_MASK.ordinal(), + parameters[2], currentFrameRateIndex, currentFrameIndex); + + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_FUNC.ordinal(), + parameters[0], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_REF.ordinal(), + parameters[1], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_MASK.ordinal(), + parameters[2], currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_STENCIL_FUNC_SEP)) { + if (parameters[0].equals(GLAPINameDefine.GL_FRONT)) { + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_FUNC.ordinal(), + parameters[0], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_REF.ordinal(), + parameters[1], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_MASK.ordinal(), + parameters[2], currentFrameRateIndex, + currentFrameIndex); + } else if (parameters[0].equals(GLAPINameDefine.GL_BACK)) { + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_FUNC.ordinal(), + parameters[0], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_REF.ordinal(), + parameters[1], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_MASK.ordinal(), + parameters[2], currentFrameRateIndex, + currentFrameIndex); + } else if (parameters[0] + .equals(GLAPINameDefine.GL_FRONT_AND_BACK)) { + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_FUNC.ordinal(), + parameters[0], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_REF.ordinal(), + parameters[1], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_MASK.ordinal(), + parameters[2], currentFrameRateIndex, + currentFrameIndex); + + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_FUNC.ordinal(), + parameters[0], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_REF.ordinal(), + parameters[1], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_MASK.ordinal(), + parameters[2], currentFrameRateIndex, + currentFrameIndex); + } + } else if (apiName.equals(GLAPINameDefine.API_GL_STENCIL_OP)) { + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_S_FAIL.ordinal(), + parameters[0], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_D_FAIL.ordinal(), + parameters[1], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_D_PASS.ordinal(), + parameters[2], currentFrameRateIndex, currentFrameIndex); + + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_S_FAIL.ordinal(), + parameters[0], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_D_FAIL.ordinal(), + parameters[1], currentFrameRateIndex, currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_D_PASS.ordinal(), + parameters[2], currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_STENCIL_OP_SEP)) { + if (apiName.equals(GLAPINameDefine.GL_FRONT)) { + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_S_FAIL.ordinal(), + parameters[0], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_D_FAIL.ordinal(), + parameters[1], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_D_PASS.ordinal(), + parameters[2], currentFrameRateIndex, + currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.GL_BACK)) { + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_S_FAIL.ordinal(), + parameters[0], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_D_FAIL.ordinal(), + parameters[1], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_D_PASS.ordinal(), + parameters[2], currentFrameRateIndex, + currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.GL_FRONT_AND_BACK)) { + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_S_FAIL.ordinal(), + parameters[0], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_D_FAIL.ordinal(), + parameters[1], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_FRONT_D_PASS.ordinal(), + parameters[2], currentFrameRateIndex, + currentFrameIndex); + + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_S_FAIL.ordinal(), + parameters[0], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_D_FAIL.ordinal(), + parameters[1], currentFrameRateIndex, + currentFrameIndex); + setContextValueList(contextId, seq, + GLContextNameEnum.STENCIL_BACK_D_PASS.ordinal(), + parameters[2], currentFrameRateIndex, + currentFrameIndex); + } + } + + else if (apiName.equals(GLAPINameDefine.API_GL_VERTEX_ATTRIB1F) + || apiName.equals(GLAPINameDefine.API_GL_VERTEX_ATTRIB2F) + || apiName.equals(GLAPINameDefine.API_GL_VERTEX_ATTRIB3F) + || apiName.equals(GLAPINameDefine.API_GL_VERTEX_ATTRIB4F) + || apiName.equals(GLAPINameDefine.API_GL_VERTEX_ATTRIB1FV) + || apiName.equals(GLAPINameDefine.API_GL_VERTEX_ATTRIB2FV) + || apiName.equals(GLAPINameDefine.API_GL_VERTEX_ATTRIB3FV) + || apiName.equals(GLAPINameDefine.API_GL_VERTEX_ATTRIB4FV)) { + int gvaIndex = Integer.parseInt(parameters[0]); + curretnContextValue.gvaV0ValueList.set(gvaIndex, + contextValues[0]); + curretnContextValue.gvaV1ValueList.set(gvaIndex, + contextValues[1]); + curretnContextValue.gvaV2ValueList.set(gvaIndex, + contextValues[2]); + curretnContextValue.gvaV3ValueList.set(gvaIndex, + contextValues[3]); + setContextValueList( + contextId, + seq, + GLContextNameEnum.GVA_V0.ordinal(), + makeSeperatedString(curretnContextValue.gvaV0ValueList), + currentFrameRateIndex, currentFrameIndex); + setContextValueList( + contextId, + seq, + GLContextNameEnum.GVA_V1.ordinal(), + makeSeperatedString(curretnContextValue.gvaV1ValueList), + currentFrameRateIndex, currentFrameIndex); + setContextValueList( + contextId, + seq, + GLContextNameEnum.GVA_V2.ordinal(), + makeSeperatedString(curretnContextValue.gvaV2ValueList), + currentFrameRateIndex, currentFrameIndex); + setContextValueList( + contextId, + seq, + GLContextNameEnum.GVA_V3.ordinal(), + makeSeperatedString(curretnContextValue.gvaV3ValueList), + currentFrameRateIndex, currentFrameIndex); + } else if (apiName + .equals(GLAPINameDefine.API_GL_VERTEX_ATTRIB_POINTER)) { + int gvaIndex = Integer.parseInt(parameters[0]); + curretnContextValue.gvaSizeValueList.set(gvaIndex, + parameters[1]); + curretnContextValue.gvaTypeValueList.set(gvaIndex, + GLConstantDefine.getConstantString(parameters[2])); + curretnContextValue.gvaNormalValueList.set(gvaIndex, + parameters[3]); + curretnContextValue.gvaStrideValueList.set(gvaIndex, + parameters[4]); + curretnContextValue.gvaPointerValueList.set(gvaIndex, + parameters[5]); + setContextValueList( + contextId, + seq, + GLContextNameEnum.GVA_SIZE.ordinal(), + makeSeperatedString(curretnContextValue.gvaSizeValueList), + currentFrameRateIndex, currentFrameIndex); + setContextValueList( + contextId, + seq, + GLContextNameEnum.GVA_TYPE.ordinal(), + makeSeperatedString(curretnContextValue.gvaTypeValueList), + currentFrameRateIndex, currentFrameIndex); + setContextValueList( + contextId, + seq, + GLContextNameEnum.GVA_NORMAL.ordinal(), + makeSeperatedString(curretnContextValue.gvaNormalValueList), + currentFrameRateIndex, currentFrameIndex); + setContextValueList( + contextId, + seq, + GLContextNameEnum.GVA_STRIDE.ordinal(), + makeSeperatedString(curretnContextValue.gvaStrideValueList), + currentFrameRateIndex, currentFrameIndex); + setContextValueList( + contextId, + seq, + GLContextNameEnum.GVA_POINTER.ordinal(), + makeSeperatedString(curretnContextValue.gvaPointerValueList), + currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_VIEWPORT)) { + + StringBuffer viewPort = new StringBuffer(); + viewPort.append(parameters[0]).append(CommonConstants.COMMA) + .append(parameters[1]).append(CommonConstants.COMMA) + .append(parameters[2]).append(CommonConstants.COMMA) + .append(parameters[3]); + + setContextValueList(contextId, seq, + GLContextNameEnum.VIEWPORT.ordinal(), + viewPort.toString(), currentFrameRateIndex, + currentFrameIndex); + } + + programLogManage(logData); + textureLogManager(logData, currentFrameRateIndex, currentFrameIndex); + } + + } + + private void textureLogManager(GLES20LogData logData, + int currentFrameRateIndex, int currentFrameIndex) { + + int apiType = logData.getApiType(); + long errorNo = logData.getErrno(); + if (apiType == API_TYPE_CONTEXT && errorNo == 0) { + + String seq = String.valueOf(logData.getSeq()); + String apiName = logData.getApiName(); + String parameter = logData.getArgs(); + long contextId = logData.getCurrentContextName(); + setContextValueList(contextId, seq, + GLContextNameEnum.CONTEXT_ID.ordinal(), + Long.toString(contextId), currentFrameRateIndex, + currentFrameIndex); + String contextValue = logData.getContextValue().trim(); + String parameters[] = parameter.split(CommonConstants.COMMA + + CommonConstants.SPACE); + String contextValues[] = contextValue.split(CommonConstants.COMMA); + + if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_ACTIVE)) { + setContextValueList(contextId, seq, + GLContextNameEnum.TEXTURE_ACTIVE.ordinal(), + parameters[0], currentFrameRateIndex, currentFrameIndex); + } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_GEN)) { + int num = Integer.parseInt(parameters[0]); + + for (int i = 0; i < num; i++) { + textureList.add(new GLStateTextureType(Integer + .parseInt(contextValues[i].trim()), contextId, + logData.getSeq())); + } + } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_BIND)) { + for (int i = 0; i < textureList.size(); i++) { + if (textureList.get(i).getObjID() == Integer + .parseInt(parameters[1].trim()) + && textureList.get(i).getContextID() == contextId) { + textureList.get(i).setTrxtureType( + Integer.parseInt(parameters[0].trim())); + } + } + } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_DEL)) { + int num = Integer.parseInt(parameters[0]); + + for (int i = 0; i < num; i++) { + for (int j = 0; j < textureList.size(); j++) { + if (textureList.get(j).getObjID() == Integer + .parseInt(parameters[0].trim()) + && textureList.get(j).getContextID() == contextId) { + textureList.get(j).setTrxtureType( + Integer.parseInt(parameters[0].trim())); + } + } + } + } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_PARAM_F) + || apiName.equals(GLAPINameDefine.API_GL_TEXTURE_PARAM_I)) { + + for (int i = 0; i < textureList.size(); i++) { + if (textureList.get(i).getContextID() == contextId) { + if (textureList.get(i).getTrxtureType() == Integer + .parseInt(parameters[0].trim())) { + + if (parameters[1] + .equals(GLAPINameDefine.GL_TEXTURE_MAG_FILTER)) { + textureList.get(i).setMagFilter( + Integer.parseInt(parameters[2])); + } else if (parameters[1] + .equals(GLAPINameDefine.GL_TEXTURE_MIN_FILTER)) { + textureList.get(i).setMinFilter( + Integer.parseInt(parameters[2])); + } else if (parameters[1] + .equals(GLAPINameDefine.GL_TEXTURE_WRAP_S)) { + textureList.get(i).setWrapS( + Integer.parseInt(parameters[2])); + } else if (parameters[1] + .equals(GLAPINameDefine.GL_TEXTURE_WRAP_T)) { + textureList.get(i).setWrapT( + Integer.parseInt(parameters[2])); + } else { + DALogger.getInstance().error( + "undefine type : " + parameters[1]); + } + } + } + } + insertTextureData(); + } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_PARAM_FV) + || apiName.equals(GLAPINameDefine.API_GL_TEXTURE_PARAM_IV)) { + + for (int i = 0; i < textureList.size(); i++) { + if (textureList.get(i).getObjID() == Integer + .parseInt(parameters[0].trim()) + && textureList.get(i).getContextID() == contextId) { + if (textureList.get(i).getTrxtureType() == Integer + .parseInt(parameters[0].trim())) { + + if (parameters[1] + .equals(GLAPINameDefine.GL_TEXTURE_MAG_FILTER)) { + textureList.get(i).setMagFilter( + Integer.parseInt(parameters[2])); + } else if (parameters[1] + .equals(GLAPINameDefine.GL_TEXTURE_MIN_FILTER)) { + textureList.get(i).setMinFilter( + Integer.parseInt(parameters[2])); + } else if (parameters[1] + .equals(GLAPINameDefine.GL_TEXTURE_WRAP_S)) { + textureList.get(i).setWrapS( + Integer.parseInt(parameters[2])); + } else if (parameters[1] + .equals(GLAPINameDefine.GL_TEXTURE_WRAP_T)) { + textureList.get(i).setWrapT( + Integer.parseInt(parameters[2])); + } + } + } + } + insertTextureData(); + } + } + } + + private void insertTextureData() { + for (int i = 0; i < textureList.size(); i++) { + if (textureList.get(i).validInsertState()) { + GLDataManager.getInstance().getStateTextureDBTableManage() + .insertData(textureList.get(i)); + textureList.remove(i); + break; + } + } + + } + + private void programLogManage(GLES20LogData logData) { + int apiType = logData.getApiType(); + long errorNo = logData.getErrno(); + if (apiType == API_TYPE_CONTEXT && errorNo == 0) { + + String apiName = logData.getApiName(); + String parameter = logData.getArgs(); + String contextValue = logData.getContextValue().trim(); + String returnValue = logData.getReturn(); + String parameters[] = parameter.split(CommonConstants.COMMA + + CommonConstants.SPACE); + String contextID = Long.toString(logData.getCurrentContextName()); + + if (apiName.equals(GLAPINameDefine.API_GL_SHADER_CREATE)) { + int shaderID = Integer.parseInt(returnValue); + int shaderType = Integer.parseInt(parameter); + GLStateShaderType stateShaderType = new GLStateShaderType( + shaderID); + stateShaderType.setShaderType(shaderType); + shaderList.add(stateShaderType); + + } else if (apiName.equals(GLAPINameDefine.API_GL_SHADER_SOURCE)) { + int shaderID = Integer.parseInt(parameters[0]); + for (int i = 0; i < shaderList.size(); i++) { + if (shaderList.get(i).getId() == shaderID) { + shaderList.get(i).setShaderSrc(contextValue); + return; + } + } + } else if (apiName.equals(GLAPINameDefine.API_GL_SHADER_COMPILE)) { + int shaderID = Integer.parseInt(parameter); + for (int i = 0; i < shaderList.size(); i++) { + if (shaderList.get(i).getId() == shaderID) { + shaderList.get(i).setCompileStatus(1); + return; + } + } + } + + else if (apiName.equals(GLAPINameDefine.API_GL_SHADER_DEL)) { + int shaderId = Integer.parseInt(parameter); + for (int i = 0; i < shaderList.size(); i++) { + if (shaderList.get(i).getId() == shaderId) { + shaderList.get(i).setDeleteStatus(1); + break; + } + } + } + + else if (apiName.equals(GLAPINameDefine.API_GL_PROGRAM_CREATE)) { + int programID = Integer.parseInt(returnValue); + GLStateProgramType stateProgramType = new GLStateProgramType( + programID); + programList.add(stateProgramType); + } else if (apiName + .equals(GLAPINameDefine.API_GL_PROGRAM_ATTACH_SHADER)) { + int programID = Integer.parseInt(parameters[0]); + int shaderID = Integer.parseInt(parameters[1]); + + boolean isFragementShaser = false; + for (int i = 0; i < shaderList.size(); i++) { + if (shaderList.get(i).getId() == shaderID) { + if (shaderList.get(i).isFragementShader()) { + isFragementShaser = true; + } else { + isFragementShaser = false; + } + break; + } + } + + for (int i = 0; i < programList.size(); i++) { + if (programList.get(i).getId() == programID) { + if (isFragementShaser) { + programList.get(i).setFragmentShaderId(shaderID); + } else { + programList.get(i).setVertexShaderId(shaderID); + } + return; + } + } + } else if (apiName.equals(GLAPINameDefine.API_GL_PROGRAM_LINK)) { + int programID = Integer.parseInt(parameter); + for (int i = 0; i < programList.size(); i++) { + if (programList.get(i).getId() == programID) { + programList.get(i).setLinkStatus(1); + break; + } + } + } else if (apiName + .equals(GLAPINameDefine.API_GL_PROGRAM_DETATCH_SHADER)) { + int programID = Integer.parseInt(parameters[0]); + int shaderID = Integer.parseInt(parameters[1]); + boolean isFragementShaser = false; + for (int i = 0; i < shaderList.size(); i++) { + if (shaderList.get(i).getId() == shaderID) { + if (shaderList.get(i).isFragementShader()) { + isFragementShaser = true; + } else { + isFragementShaser = false; + } + break; + } + } + + for (int i = 0; i < programList.size(); i++) { + if (programList.get(i).getId() == programID) { + if (isFragementShaser) { + programList.get(i).setFragmentShaderId(-1); + } else { + programList.get(i).setVertexShaderId(-1); + } + return; + } + } + + } else if (apiName.equals(GLAPINameDefine.API_GL_PROGRAM_USE)) { + int programId = Integer.parseInt(parameter); + for (int i = 0; i < programList.size(); i++) { + if (programList.get(i).getId() == programId) { + programList.get(i).setContextName( + Integer.parseInt(contextID)); + break; + } + } + + } else if (apiName.equals(GLAPINameDefine.API_GL_PROGRAM_DEL)) { + int programId = Integer.parseInt(parameter); + for (int i = 0; i < programList.size(); i++) { + if (programList.get(i).getId() == programId) { + programList.get(i).setDeleteStatus(1); + break; + } + } + } + } + } + + private void setContextValueList(long contextID, String seq, + int featureIndex, String value, int frameRateIndex, + int frameTimeIndex) { + if (featureIndex == GLContextNameEnum.SEQ.ordinal()) { + return; + } + + ContextValueType contextValue = contextHashMap.get(contextID); + if (null == contextValue) { + contextValue = new ContextValueType(contextID); + contextHashMap.put(contextID, contextValue); + } + contextValue.addContextValue(contextID, seq, featureIndex, value, + frameRateIndex, frameTimeIndex); + } + + private String makeSeperatedString(List list) { + if (list.size() == 0) { + return CommonConstants.EMPTY; + } + StringBuilder sb = new StringBuilder(); + for (String string : list) { + if (!string.equals(CommonConstants.EMPTY)) { + sb.append(CommonConstants.OPEN_CURLY_BRACKET); + sb.append(string); + sb.append(CommonConstants.CLOSE_CURLY_BRACKET); + } + } + return sb.toString(); + } + + private String makeSeperatedString(LinkedHashMap map) { + if (map.size() == 0) { + return CommonConstants.EMPTY; + } + + StringBuilder sb = new StringBuilder(); + for (String string : map.values()) { + if (!string.equals(CommonConstants.EMPTY)) { + sb.append(CommonConstants.OPEN_CURLY_BRACKET); + sb.append(string); + sb.append(CommonConstants.CLOSE_CURLY_BRACKET); + } + } + return sb.toString(); + } + + public List getProgramList() { + return programList; + } + + public List getShaderList() { + return shaderList; + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateHistoryDBTableManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateHistoryDBTableManager.java new file mode 100644 index 0000000..30a2c98 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateHistoryDBTableManager.java @@ -0,0 +1,170 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ +package org.tizen.dynamicanalyzer.ui.opengl.data; + +import java.io.File; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.AnalyzerManager; +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.database.DBColumn; +import org.tizen.dynamicanalyzer.database.DBConstants; +import org.tizen.dynamicanalyzer.database.DBTable; +import org.tizen.dynamicanalyzer.database.SqlConnectionManager; + +public class GLStateHistoryDBTableManager extends DBTable { + private static final String TABLENAME = "GL_HISTORY";//$NON-NLS-1$ + + public static final String CONTEXT_ID = "CONTEXT_ID";//$NON-NLS-1$ + public static final String CONTEXT_DB_INDEX = "CONTEXT_DB_INDEX";//$NON-NLS-1$ + public static final String CHANGE_SEQ = "CHANGE_SEQ";//$NON-NLS-1$ + public static final String FRAME_RATE_INDEX = "FRAME_RATE_INDEX";//$NON-NLS-1$ + public static final String FRAME_TIME_INDEX = "FRAME_TIME_INDEX";//$NON-NLS-1$ + + public final static int TABLE_CONTEXT_ID_INDEX = 0; + public final static int TABLE_CONTEXT_DB_INDEX_INDEX = 1; + public final static int TABLE_CHANGE_SEQ_INDEX = 2; + public final static int TABLE_FRAME_RATE_INDEX_INDEX = 3; + public final static int TABLE_FRAME_TIME_INDEX_INDEX = 4; + + private static final String SELECT_LAST_CHANGED_SEQ_QUERY = "select " + + CONTEXT_ID + CommonConstants.COMMA + CONTEXT_DB_INDEX + + CommonConstants.COMMA + CHANGE_SEQ + CommonConstants.COMMA + + FRAME_RATE_INDEX + CommonConstants.COMMA + FRAME_TIME_INDEX + + " from " + TABLENAME + " where " + CONTEXT_ID + " = '%s' and "//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ + + CONTEXT_DB_INDEX + " = '%s' and " + CHANGE_SEQ//$NON-NLS-1$ + + " < '%s' order by " + CHANGE_SEQ + " desc";//$NON-NLS-1$//$NON-NLS-2$ + + private static final String SELECT_NEXT_CHANGED_SEQ_QUERY = "select "//$NON-NLS-1$ + + CONTEXT_ID + CommonConstants.COMMA + + CONTEXT_DB_INDEX + + CommonConstants.COMMA + CHANGE_SEQ + + CommonConstants.COMMA + + FRAME_RATE_INDEX + CommonConstants.COMMA + + FRAME_TIME_INDEX + + " from " + TABLENAME + " where " + CONTEXT_ID + " = '%s' and "//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ + + CONTEXT_DB_INDEX + " = '%s' and " + CHANGE_SEQ//$NON-NLS-1$ + + " > '%s' order by " + CHANGE_SEQ + " desc";//$NON-NLS-1$//$NON-NLS-2$ + + @Override + public String getTableName() { + return TABLENAME; + } + + public GLStateHistoryDBTableManager() { + addColumn(new DBColumn(CONTEXT_ID, DBConstants.NOT_NULL, + DBConstants.LONG)); + addColumn(new DBColumn(CONTEXT_DB_INDEX, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(CHANGE_SEQ, DBConstants.NOT_NULL, + DBConstants.LONG)); + addColumn(new DBColumn(FRAME_RATE_INDEX, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(FRAME_TIME_INDEX, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + } + + public void insertData(long contextId, int stateIndex, long seq, + int frameRateIndex, int frameTimeIndex) { + List> insertList = new ArrayList>(); + List objectList = new ArrayList(); + objectList.add(contextId); + objectList.add(stateIndex); + objectList.add(seq); + objectList.add(frameRateIndex); + objectList.add(frameTimeIndex); + + insertList.add(objectList); + insertData(insertList); + } + + public List selectLastChangedSeq(long contextId, int stateIndex, + long seq) { + if (null != AnalyzerManager.getProject()) { + SqlConnectionManager.establishConnection(AnalyzerManager + .getProject().getSavePath() + + File.separator + + AnalyzerConstants.DATABASE_NAME); + } + String query = String.format(SELECT_LAST_CHANGED_SEQ_QUERY, contextId, + stateIndex, seq); + List> result = SqlConnectionManager.executeQuery(query); + if (null == result || result.size() == 0 || result.get(0).size() == 0) { + return null; + } + return result.get(0); + } + + public List selectNextChangedSeq(long contextId, int stateIndex, + long seq) { + if (null != AnalyzerManager.getProject()) { + SqlConnectionManager.establishConnection(AnalyzerManager + .getProject().getSavePath() + + File.separator + + AnalyzerConstants.DATABASE_NAME); + + } + String query = String.format(SELECT_NEXT_CHANGED_SEQ_QUERY, contextId, + stateIndex, seq); + List> result = SqlConnectionManager.executeQuery(query); + if (null == result || result.size() == 0 || result.get(0).size() == 0) { + return null; + } + return result.get(0); + } + + @Override + public boolean prepare(PreparedStatement prep, List rowData) { + boolean isPrepared = true; + + int columnsize = getColumnSize(); + if (columnsize != rowData.size()) { + isPrepared = false; + } else { + try { + prep.setLong(TABLE_CONTEXT_ID_INDEX + 1, + (Long) (rowData.get(TABLE_CONTEXT_ID_INDEX))); + prep.setInt(TABLE_CONTEXT_DB_INDEX_INDEX + 1, + (Integer) (rowData.get(TABLE_CONTEXT_DB_INDEX_INDEX))); + prep.setLong(TABLE_CHANGE_SEQ_INDEX + 1, + (Long) (rowData.get(TABLE_CHANGE_SEQ_INDEX))); + prep.setInt(TABLE_FRAME_RATE_INDEX_INDEX + 1, + (Integer) (rowData.get(TABLE_FRAME_RATE_INDEX_INDEX))); + prep.setInt(TABLE_FRAME_TIME_INDEX_INDEX + 1, + (Integer) (rowData.get(TABLE_FRAME_TIME_INDEX_INDEX))); + } catch (SQLException e) { + e.printStackTrace(); + isPrepared = false; + } + } + return isPrepared; + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateProgramDBTableManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateProgramDBTableManager.java new file mode 100644 index 0000000..eca5328 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateProgramDBTableManager.java @@ -0,0 +1,218 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ +package org.tizen.dynamicanalyzer.ui.opengl.data; + +import java.io.File; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.AnalyzerManager; +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.database.DBColumn; +import org.tizen.dynamicanalyzer.database.DBConstants; +import org.tizen.dynamicanalyzer.database.DBTable; +import org.tizen.dynamicanalyzer.database.SqlConnectionManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateProgramType; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateShaderType; + +public class GLStateProgramDBTableManager extends DBTable { + private static final String TABLENAME = "GL_PROGRAM";//$NON-NLS-1$ + private final int TYPE_PROGRAM = 1; + private final int TYPE_SHADER = 2; + + private final int STATUS_NULL = -1; + + public static final String TYPE = "TYPE"; // shader, program//$NON-NLS-1$ + public static final String ID = "ID"; // id of shader or program//$NON-NLS-1$ + public static final String SHADER_SRC = "SHADER_SRC"; // only shader//$NON-NLS-1$ + public static final String DELETE_STATUS = "DELETE_STATUS"; // true, false//$NON-NLS-1$ + public static final String LINK_STATUS = "LINK_STATUS"; // only program//$NON-NLS-1$ + public static final String COMPILE_STATUS = "COMPILE_STATUS"; // only shader//$NON-NLS-1$ + public static final String FRAGMENT_ID = "FRAGMENT_ID"; // only program//$NON-NLS-1$ + public static final String VERTEX_ID = "VERTEX_ID"; // only program//$NON-NLS-1$ + public static final String CONTEXT_NAME = "CONTEXT_NAME"; // only program//$NON-NLS-1$ + + private static final String SELECT_QUERY = "select " + TYPE//$NON-NLS-1$ + + CommonConstants.COMMA + ID + CommonConstants.COMMA + SHADER_SRC + + CommonConstants.COMMA + DELETE_STATUS + CommonConstants.COMMA + + LINK_STATUS + CommonConstants.COMMA + COMPILE_STATUS + + CommonConstants.COMMA + FRAGMENT_ID + CommonConstants.COMMA + + VERTEX_ID + CommonConstants.COMMA + CONTEXT_NAME + " from " + + TABLENAME; + + public final static int TABLE_TYPE_INDEX = 0; + public final static int TABLE_ID_INDEX = 1; + public final static int TABLE_SHADER_SRC_INDEX = 2; + public final static int TABLE_DELETE_STATUS_INDEX = 3; + public final static int TABLE_LINK_STATUS_INDEX = 4; + public final static int TABLE_COMPILE_STATUS_INDEX = 5; + public final static int TABLE_FRAGMENT_ID_INDEX = 6; + public final static int TABLE_VERTEX_ID_INDEX = 7; + public final static int TABLE_CONTEXT_NAME_INDEX = 8; + + @Override + public String getTableName() { + return TABLENAME; + } + + public GLStateProgramDBTableManager() { + addColumn(new DBColumn(TYPE, DBConstants.NOT_NULL, DBConstants.INTEGER)); + addColumn(new DBColumn(ID, DBConstants.NOT_NULL, DBConstants.INTEGER)); + addColumn(new DBColumn(SHADER_SRC, DBConstants.NOT_NULL, + DBConstants.BIGBIG_TEXT)); + addColumn(new DBColumn(DELETE_STATUS, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(COMPILE_STATUS, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(LINK_STATUS, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(FRAGMENT_ID, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(VERTEX_ID, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(CONTEXT_NAME, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + } + + public void insertData() { + List programList = GLDataManager.getInstance() + .getStateDataMagerInstance().getProgramList(); + + List> insertObjectList = new ArrayList>(); + for (int i = 0; i < programList.size(); i++) { + GLStateProgramType programType = programList.get(i); + List itemList = new ArrayList(); + itemList.add(TYPE_PROGRAM); + itemList.add(programType.getId()); + itemList.add(CommonConstants.EMPTY); + itemList.add(programType.getDeleteStatus()); + itemList.add(programType.getLinkStatus()); + itemList.add(STATUS_NULL); + itemList.add(programType.getFragmentShaderId()); + itemList.add(programType.getVertexShaderId()); + itemList.add(programType.getContextName()); + insertObjectList.add(itemList); + } + + List shaderList = GLDataManager.getInstance() + .getStateDataMagerInstance().getShaderList(); + + for (int i = 0; i < shaderList.size(); i++) { + GLStateShaderType shaderType = shaderList.get(i); + List itemList = new ArrayList(); + itemList.add(TYPE_SHADER); + itemList.add(shaderType.getId()); + itemList.add(shaderType.getShaderSrc()); + itemList.add(shaderType.getDeleteStatus()); + itemList.add(STATUS_NULL); + itemList.add(shaderType.getCompileStatus()); + itemList.add(STATUS_NULL); + itemList.add(STATUS_NULL); + itemList.add(STATUS_NULL); + insertObjectList.add(itemList); + } + insertData(insertObjectList); + } + + public void initProgramData() { + if (null != AnalyzerManager.getProject()) { + SqlConnectionManager.establishConnection(AnalyzerManager + .getProject().getSavePath() + + File.separator + + AnalyzerConstants.DATABASE_NAME); + } + List> result = SqlConnectionManager + .executeQuery(SELECT_QUERY); + if (null == result || result.size() == 0 || result.get(0).size() == 0) { + return; + } + + for (int i = 0; i < result.size(); i++) { + if ((Integer) result.get(i).get(TABLE_TYPE_INDEX) == TYPE_PROGRAM) { + GLStateProgramType programType = new GLStateProgramType( + (Integer) result.get(i).get(TABLE_ID_INDEX)); + programType.setDeleteStatus((Integer) result.get(i).get( + TABLE_DELETE_STATUS_INDEX)); + programType.setLinkStatus((Integer) result.get(i).get( + TABLE_LINK_STATUS_INDEX)); + programType.setFragmentShaderId((Integer) result.get(i).get( + TABLE_FRAGMENT_ID_INDEX)); + programType.setVertexShaderId((Integer) result.get(i).get( + TABLE_VERTEX_ID_INDEX)); + programType.setContextName((Integer) result.get(i).get( + TABLE_CONTEXT_NAME_INDEX)); + GLDataManager.getInstance().getStateDataMagerInstance() + .getProgramList().add(programType); + } else { + GLStateShaderType shaderType = new GLStateShaderType( + (Integer) result.get(i).get(1)); + shaderType.setShaderSrc((String) result.get(i).get(2)); + shaderType.setDeleteStatus((Integer) result.get(i).get(3)); + shaderType.setCompileStatus((Integer) result.get(i).get(4)); + GLDataManager.getInstance().getStateDataMagerInstance() + .getShaderList().add(shaderType); + } + } + } + + @Override + public boolean prepare(PreparedStatement prep, List rowData) { + boolean isPrepared = true; + + int columnsize = getColumnSize(); + if (columnsize != rowData.size()) { + isPrepared = false; + } else { + try { + prep.setInt(TABLE_TYPE_INDEX + 1, + (Integer) (rowData.get(TABLE_TYPE_INDEX))); + prep.setInt(TABLE_ID_INDEX + 1, + (Integer) (rowData.get(TABLE_ID_INDEX))); + prep.setString(TABLE_SHADER_SRC_INDEX + 1, + (String) (rowData.get(TABLE_SHADER_SRC_INDEX))); + prep.setInt(TABLE_DELETE_STATUS_INDEX + 1, + (Integer) (rowData.get(TABLE_DELETE_STATUS_INDEX))); + prep.setInt(TABLE_LINK_STATUS_INDEX + 1, + (Integer) (rowData.get(TABLE_LINK_STATUS_INDEX))); + prep.setInt(TABLE_COMPILE_STATUS_INDEX + 1, + (Integer) (rowData.get(TABLE_COMPILE_STATUS_INDEX))); + prep.setInt(TABLE_FRAGMENT_ID_INDEX + 1, + (Integer) (rowData.get(TABLE_FRAGMENT_ID_INDEX))); + prep.setInt(TABLE_VERTEX_ID_INDEX + 1, + (Integer) (rowData.get(TABLE_VERTEX_ID_INDEX))); + prep.setInt(TABLE_CONTEXT_NAME_INDEX + 1, + (Integer) (rowData.get(TABLE_CONTEXT_NAME_INDEX))); + } catch (SQLException e) { + e.printStackTrace(); + isPrepared = false; + } + } + return isPrepared; + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateTextureDBTableManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateTextureDBTableManager.java new file mode 100644 index 0000000..8ff5dd2 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateTextureDBTableManager.java @@ -0,0 +1,193 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ +package org.tizen.dynamicanalyzer.ui.opengl.data; + +import java.io.File; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.AnalyzerManager; +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.database.DBColumn; +import org.tizen.dynamicanalyzer.database.DBConstants; +import org.tizen.dynamicanalyzer.database.DBTable; +import org.tizen.dynamicanalyzer.database.SqlConnectionManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateTextureType; + +public class GLStateTextureDBTableManager extends DBTable { + private static final String TABLENAME = "GL_TEXTURE";//$NON-NLS-1$ + + public static final String CONTEXT_ID = "CONTEXT_ID";//$NON-NLS-1$ + public static final String CHANGE_SEQ = "CHANGE_SEQ";//$NON-NLS-1$ + public static final String TEXTURE_UNIT_TYPE = "TEXTURE_UNIT_TYPE";//$NON-NLS-1$ //1 : TEXTURE_UNIT_2D, 2 :TEXTURE_UNIT_CUBE + public static final String TEXTURE_OBJ_ID = "TEXTURE_OBJ_ID";//$NON-NLS-1$ + public static final String TEXTURE_OBJ_MAG_FUNC = "TEXTURE_OBJ_MAG_FUNC";//$NON-NLS-1$ + public static final String TEXTURE_OBJ_MIN_FUNC = "TEXTURE_OBJ_MIN_FUNC";//$NON-NLS-1$ + public static final String TEXTURE_OBJ_WRAP_S = "TEXTURE_OBJ_WRAP_S";//$NON-NLS-1$ + public static final String TEXTURE_OBJ_WRAP_T = "TEXTURE_OBJ_WRAP_T";//$NON-NLS-1$ + + public final static int TABLE_CONTEXT_ID_INDEX = 0; + public final static int TABLE_CHANGE_SEQ_INDEX = 1; + public final static int TABLE_TEXTURE_UNIT_TYPE_INDEX = 2; + public final static int TABLE_TEXTURE_OBJ_ID_INDEX = 3; + public final static int TABLE_TEXTURE_OBJ_MAG_FUNC_INDEX = 4; + public final static int TABLE_TEXTURE_OBJ_MIN_FUNC_INDEX = 5; + public final static int TABLE_TEXTURE_OBJ_WRAP_S_INDEX = 6; + public final static int TABLE_TEXTURE_OBJ_WRAP_T_INDEX = 7; + + private static final String SELECT_QUERY = "select "//$NON-NLS-1$ + + CONTEXT_ID + CommonConstants.COMMA + + CHANGE_SEQ + + CommonConstants.COMMA + TEXTURE_UNIT_TYPE + + CommonConstants.COMMA + + TEXTURE_OBJ_ID + CommonConstants.COMMA + + TEXTURE_OBJ_MAG_FUNC + + CommonConstants.COMMA + + TEXTURE_OBJ_MIN_FUNC + + CommonConstants.COMMA + + TEXTURE_OBJ_WRAP_S + + CommonConstants.COMMA + TEXTURE_OBJ_WRAP_T + " from " + TABLENAME;//$NON-NLS-1$ + + @Override + public String getTableName() { + return TABLENAME; + } + + public GLStateTextureDBTableManager() { + addColumn(new DBColumn(CONTEXT_ID, DBConstants.NOT_NULL, + DBConstants.LONG)); + addColumn(new DBColumn(CHANGE_SEQ, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(TEXTURE_UNIT_TYPE, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(TEXTURE_OBJ_ID, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(TEXTURE_OBJ_MAG_FUNC, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(TEXTURE_OBJ_MIN_FUNC, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(TEXTURE_OBJ_WRAP_S, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + addColumn(new DBColumn(TEXTURE_OBJ_WRAP_T, DBConstants.NOT_NULL, + DBConstants.INTEGER)); + } + + public void insertData(GLStateTextureType data) { + List> insertList = new ArrayList>(); + List objectList = new ArrayList(); + objectList.add(data.getContextID()); + objectList.add(data.getSeq()); + objectList.add(data.getTrxtureType()); + objectList.add(data.getObjID()); + objectList.add(data.getMagFilter()); + objectList.add(data.getMinFilter()); + objectList.add(data.getWrapS()); + objectList.add(data.getWrapT()); + insertList.add(objectList); + insertData(insertList); + } + + public List select() { + if (null != AnalyzerManager.getProject()) { + SqlConnectionManager.establishConnection(AnalyzerManager + .getProject().getSavePath() + + File.separator + + AnalyzerConstants.DATABASE_NAME); + } + List> result = SqlConnectionManager + .executeQuery(SELECT_QUERY); + if (null == result || result.size() == 0 || result.get(0).size() == 0) { + return null; + } + + List textureList = new ArrayList(); + for (int i = 0; i < result.size(); i++) { + long contextID = (Long) result.get(i).get(TABLE_CONTEXT_ID_INDEX); + int seq = (Integer) result.get(i).get(TABLE_CHANGE_SEQ_INDEX); + int unitType = (Integer) result.get(i).get( + TABLE_TEXTURE_UNIT_TYPE_INDEX); + int textureId = (Integer) result.get(i).get( + TABLE_TEXTURE_OBJ_ID_INDEX); + int magFilter = (Integer) result.get(i).get( + TABLE_TEXTURE_OBJ_MAG_FUNC_INDEX); + int minFilter = (Integer) result.get(i).get( + TABLE_TEXTURE_OBJ_MIN_FUNC_INDEX); + int wrapS = (Integer) result.get(i).get( + TABLE_TEXTURE_OBJ_WRAP_S_INDEX); + int wrapT = (Integer) result.get(i).get( + TABLE_TEXTURE_OBJ_WRAP_T_INDEX); + + GLStateTextureType textureType = new GLStateTextureType(textureId, + contextID, seq); + textureType.setMagFilter(magFilter); + textureType.setMinFilter(minFilter); + textureType.setWrapS(wrapS); + textureType.setWrapT(wrapT); + textureType.setTrxtureType(unitType); + textureList.add(textureType); + } + return textureList; + } + + @Override + public boolean prepare(PreparedStatement prep, List rowData) { + boolean isPrepared = true; + + int columnsize = getColumnSize(); + if (columnsize != rowData.size()) { + isPrepared = false; + } else { + try { + prep.setLong(TABLE_CONTEXT_ID_INDEX + 1, + (Long) (rowData.get(TABLE_CONTEXT_ID_INDEX))); + prep.setInt(TABLE_CHANGE_SEQ_INDEX + 1, + (Integer) (rowData.get(TABLE_CHANGE_SEQ_INDEX))); + prep.setInt(TABLE_TEXTURE_UNIT_TYPE_INDEX + 1, + (Integer) (rowData.get(TABLE_TEXTURE_UNIT_TYPE_INDEX))); + prep.setInt(TABLE_TEXTURE_OBJ_ID_INDEX + 1, + (Integer) (rowData.get(TABLE_TEXTURE_OBJ_ID_INDEX))); + prep.setInt(TABLE_TEXTURE_OBJ_MAG_FUNC_INDEX + 1, + (Integer) (rowData + .get(TABLE_TEXTURE_OBJ_MAG_FUNC_INDEX))); + prep.setInt(TABLE_TEXTURE_OBJ_MIN_FUNC_INDEX + 1, + (Integer) (rowData + .get(TABLE_TEXTURE_OBJ_MIN_FUNC_INDEX))); + prep.setInt(TABLE_TEXTURE_OBJ_WRAP_S_INDEX + 1, + (Integer) (rowData.get(TABLE_TEXTURE_OBJ_WRAP_S_INDEX))); + prep.setInt(TABLE_TEXTURE_OBJ_WRAP_T_INDEX + 1, + (Integer) (rowData.get(TABLE_TEXTURE_OBJ_WRAP_T_INDEX))); + } catch (SQLException e) { + e.printStackTrace(); + isPrepared = false; + } + } + return isPrepared; + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/inserter/GLContextDataInserter.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/inserter/GLContextDataInserter.java deleted file mode 100644 index 673dcfc..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/inserter/GLContextDataInserter.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.data.inserter; - -import java.util.List; - -import org.tizen.dynamicanalyzer.common.AnalyzerManager; -import org.tizen.dynamicanalyzer.sql.DBTableManager; -import org.tizen.dynamicanalyzer.sql.SqlManager; - -public class GLContextDataInserter implements Runnable { - private static GLContextDataQueue contextDatasQueue = new GLContextDataQueue(); - private static volatile Thread inserterThread = null; - - public static void startinserterThread() { - if (inserterThread == null || !inserterThread.isAlive()) { - synchronized (GLContextDataInserter.class) { - if (inserterThread == null || !inserterThread.isAlive()) { - inserterThread = new Thread(null, - new GLContextDataInserter()); - inserterThread.start(); - } - } - } - } - - public static void stopinserterThread() { - if (inserterThread != null && inserterThread.isAlive()) { - try { - sendNotify(); - inserterThread.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } - - public static GLContextDataQueue getContextDataQueue() { - return contextDatasQueue; - } - - public static void clear() { - stopinserterThread(); - } - - @Override - public void run() { - while (!AnalyzerManager.isExit()) { - List> contextDatas = contextDatasQueue - .getFirstContextDatas(); - SqlManager - .getInstance() - .insertQuery( - DBTableManager - .getInstance() - .getTableInfo( - DBTableManager.TABLE_INDEX_GLES20_CONTEXT_DATA) - .insertQuery(), contextDatas); - } - } - - public static void sendNotify() { - GLContextDataQueue contextDataQueue = getContextDataQueue(); - synchronized (contextDataQueue) { - contextDataQueue.notifyAll(); - } - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/inserter/GLContextDataQueue.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/inserter/GLContextDataQueue.java deleted file mode 100644 index ba7ed7b..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/inserter/GLContextDataQueue.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.data.inserter; - -import java.util.ArrayList; -import java.util.List; - -public class GLContextDataQueue { - private static final int FULL_COUNT = 300; - private List>> contextDatasList; - - public GLContextDataQueue() { - contextDatasList = new ArrayList>>(); - } - - public synchronized List> getFirstContextDatas() { - while (isEmpty()) { - try { - wait(); - } catch (InterruptedException e) { - e.printStackTrace(); - break; - } - } - - List> contextDatas = contextDatasList.get(0); - contextDatasList.remove(0); - notifyAll(); - - return contextDatas; - } - - public synchronized void push(List> contextDatas) { - while (isFull()) { - try { - wait(); - } catch (InterruptedException e) { - e.printStackTrace(); - break; - } - } - contextDatasList.add(contextDatas); - notifyAll(); - } - - private boolean isEmpty() { - return contextDatasList.isEmpty(); - } - - private boolean isFull() { - if (size() > FULL_COUNT) { - return true; - } - return false; - } - - private int size() { - return contextDatasList.size(); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/model/GLAPIData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/model/GLAPIData.java deleted file mode 100644 index 94bb0bf..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/model/GLAPIData.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.data.model; - -import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData; -import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants; - -public class GLAPIData { - private GLES20LogData logData; - - public GLAPIData(GLES20LogData logData) { - this.logData = logData; - } - - public int getSeq() { - return logData.getSeq(); - } - - public String getName() { - return logData.getApiName(); - } - - public String getParameter() { - return logData.getArgs(); - } - - public long getTime() { - return logData.getTime(); - } - - public long getElapsedTime() { - return logData.getElapsedTime() / TimelineConstants.KILO_LONG; - } - - public long getErrorNo() { - return logData.getErrno(); - } - - public String getReturnValue() { - return logData.getReturn(); - } - - public int getPID() { - return logData.getPid(); - } - - public int getTID() { - return logData.getTid(); - } - - public GLES20LogData getLogData() { - return logData; - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/ContextValueType.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/ContextValueType.java new file mode 100644 index 0000000..e8c4d61 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/ContextValueType.java @@ -0,0 +1,197 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.data.type; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; + +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; + +public class ContextValueType { + private static final int CONTEXT_VALUE_SIZE = GLContextNameEnum.values().length; + + private long contextID = -1; + private List defaultValueList = null; + private List preValueList = null; + private List currentValueList = null; + + static int maxVertexAttribs = 0; + static int maxTextureUnits = 0; + private boolean isInitState = false; + + public List gvaV0ValueList; + public List gvaV1ValueList; + public List gvaV2ValueList; + public List gvaV3ValueList; + public List gvaEnabledValueList; + public List gvaSizeValueList; + public List gvaTypeValueList; + public List gvaNormalValueList; + public List gvaStrideValueList; + public List gvaPointerValueList; + public String vboBindingArray; + public String vboBindingElementArray; + + public LinkedHashMap vboIDMap; + public LinkedHashMap vboSizeMap; + public LinkedHashMap vboDataMap; + public LinkedHashMap vboUsageMap; + + public ContextValueType(long contextID) { + this.contextID = contextID; + gvaEnabledValueList = new ArrayList(); + gvaV0ValueList = new ArrayList(); + gvaV1ValueList = new ArrayList(); + gvaV2ValueList = new ArrayList(); + gvaV3ValueList = new ArrayList(); + gvaSizeValueList = new ArrayList(); + gvaTypeValueList = new ArrayList(); + gvaNormalValueList = new ArrayList(); + gvaStrideValueList = new ArrayList(); + gvaPointerValueList = new ArrayList(); + + vboBindingArray = CommonConstants.ZERO; + vboBindingElementArray = CommonConstants.ZERO; + vboIDMap = new LinkedHashMap(); + vboSizeMap = new LinkedHashMap(); + vboDataMap = new LinkedHashMap(); + vboUsageMap = new LinkedHashMap(); + } + + public void setVertexAttribs(int size) { + ContextValueType.maxVertexAttribs = size; + } + + public void setTextureUnits(int size) { + ContextValueType.maxTextureUnits = size; + } + + public void init() { + /* GVA */ + for (int i = 0; i < ContextValueType.maxVertexAttribs; i++) { + gvaEnabledValueList.add(CommonConstants.EMPTY); + gvaV0ValueList.add(CommonConstants.EMPTY); + gvaV1ValueList.add(CommonConstants.EMPTY); + gvaV2ValueList.add(CommonConstants.EMPTY); + gvaV3ValueList.add(CommonConstants.EMPTY); + gvaSizeValueList.add(CommonConstants.EMPTY); + gvaTypeValueList.add(CommonConstants.EMPTY); + gvaNormalValueList.add(CommonConstants.EMPTY); + gvaStrideValueList.add(CommonConstants.EMPTY); + gvaPointerValueList.add(CommonConstants.EMPTY); + } + } + + public long getContextID() { + return contextID; + } + + public void setContextID(long contextID) { + this.contextID = contextID; + } + + public List getDefaultValueList() { + if (null == defaultValueList) { + defaultValueList = initContextList(); + } + return defaultValueList; + } + + public void setDefaultValueList(List defaultValueList) { + this.defaultValueList = defaultValueList; + } + + public List getPreValueList() { + if (null == preValueList) { + preValueList = initContextList(); + } + return preValueList; + } + + public void setPreValueList(List preValueList) { + this.preValueList = preValueList; + } + + public List getCurrentValueList() { + if (null == currentValueList) { + currentValueList = initContextList(); + } + return currentValueList; + } + + public void setCurrentValueList(List currentValueList) { + this.currentValueList = currentValueList; + } + + public void addContextValue(long contextID, String seq, int featureIndex, + String value, int frameRateIndex, int frameTimeIndex) { + + if (!isInitState) { + init(); + } + + if (!getPreValueList().get(featureIndex).equals(value)) { + // System.out.println("this : " + contextID + " contextID : " + // + contextID + " seq : " + seq + " featureIndex : " + // + featureIndex + " value " + value); + getPreValueList().set(GLContextNameEnum.CONTEXT_ID.ordinal(), + Long.toString(contextID)); + getPreValueList().set(GLContextNameEnum.SEQ.ordinal(), seq); + getPreValueList().set(featureIndex, value); + + getCurrentValueList().set(GLContextNameEnum.CONTEXT_ID.ordinal(), + Long.toString(contextID)); + getCurrentValueList().set(GLContextNameEnum.SEQ.ordinal(), seq); + getCurrentValueList().set(featureIndex, value); + + GLDataManager.getInstance().getContextDBTableManage() + .insertContextData(getCurrentValueList()); + + GLDataManager + .getInstance() + .getStateHistoryDBTableManage() + .insertData(contextID, featureIndex, Integer.parseInt(seq), + frameRateIndex, frameTimeIndex); + + } + } + + private List initContextList() { + List list = new ArrayList(); + for (int i = 0; i < CONTEXT_VALUE_SIZE; i++) { + list.add(CommonConstants.EMPTY); + String stateName = GLContextNameEnum.values()[i].getcolumnName(); + String defaultValue = GLContextDefaultValueHashMap + .getDefaultValue(stateName); + list.set(i, defaultValue); + } + return list; + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/model/FrameCountInfo.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/FrameCountInfoType.java similarity index 56% rename from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/model/FrameCountInfo.java rename to org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/FrameCountInfoType.java index 8ae0be4..0dcc0d1 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/model/FrameCountInfo.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/FrameCountInfoType.java @@ -3,7 +3,8 @@ * * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * - * Contact: + * Contact: + * Hyunjong Park * Sanghyun Lee * Juyoung Kim * @@ -24,26 +25,56 @@ * */ -package org.tizen.dynamicanalyzer.ui.opengl.data.model; +package org.tizen.dynamicanalyzer.ui.opengl.data.type; -public class FrameCountInfo { - private int startFrameIndex; - private int frameCount; +public class FrameCountInfoType { + private int time = 0; + private int startFrameIndex = 0; + private int endFrameIndex = 0; + private int frameCount = 0; + private int errno = 0; - public FrameCountInfo(int startFrameIndex) { - this.startFrameIndex = startFrameIndex; - frameCount = 0; + public int getTime() { + return time; + } + + public void setTime(int time) { + this.time = time; } public int getStartFrameIndex() { return startFrameIndex; } - public void addFrameCount() { - frameCount++; + public void setStartFrameIndex(int startFrameIndex) { + this.startFrameIndex = startFrameIndex; } public int getFrameCount() { return frameCount; } + + public void setFrameCount(int frameCount) { + this.frameCount = frameCount; + } + + public int hasErrno() { + return errno; + } + + public void setErrno(int errno) { + this.errno = errno; + } + + public void addFrameCount() { + frameCount++; + } + + public int getEndFrameIndex() { + return endFrameIndex; + } + + public void setEndFrameIndex(int endFrameIndex) { + this.endFrameIndex = endFrameIndex; + } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLAPINameDefine.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLAPINameDefine.java new file mode 100644 index 0000000..05794ac --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLAPINameDefine.java @@ -0,0 +1,128 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ +package org.tizen.dynamicanalyzer.ui.opengl.data.type; + +public class GLAPINameDefine { + /* EnableCap */ + public static final String GL_TEXTURE_2D = "de1";//$NON-NLS-1$ + public static final String GL_CULL_FACE = "b44";//$NON-NLS-1$ + public static final String GL_BLEND = "be2";//$NON-NLS-1$ + public static final String GL_DITHER = "bd0";//$NON-NLS-1$ + public static final String GL_STENCIL_TEST = "b90";//$NON-NLS-1$ + public static final String GL_DEPTH_TEST = "b71";//$NON-NLS-1$ + public static final String GL_SCISSOR_TEST = "c11";//$NON-NLS-1$ + public static final String GL_POLYGON_OFFSET_FILL = "8037";//$NON-NLS-1$ + /* CullFaceMode */ + public static final String GL_FRONT = "404";//$NON-NLS-1$ + public static final String GL_BACK = "405";//$NON-NLS-1$ + public static final String GL_FRONT_AND_BACK = "408";//$NON-NLS-1$ + /* Pixel */ + public static final String GL_PACK_ALIGNMENT = "d05";//$NON-NLS-1$ + public static final String GL_UNPACK_ALIGNMENT = "cf5";//$NON-NLS-1$ + /* TextureBinding */ + public static final String GL_TEXTURE_CUBE_MAP = "8513";//$NON-NLS-1$ + /* TextureParameterName */ + public static final String GL_TEXTURE_MAG_FILTER = "10240";//$NON-NLS-1$ + public static final String GL_TEXTURE_MIN_FILTER = "10241";//$NON-NLS-1$ + public static final String GL_TEXTURE_WRAP_S = "10242";//$NON-NLS-1$ + public static final String GL_TEXTURE_WRAP_T = "10243";//$NON-NLS-1$ + + public static final String GL_TEXTURE_2D_STR = "GL_TEXTURE_2D";//$NON-NLS-1$ + public static final String GL_TEXTURE_CUBE_MAP_STR = "GL_TEXTURE_CUBE_MAP";//$NON-NLS-1$ + + /* GL APIs */ + // Vertex Info + public static final String API_GL_DISABLE_VAA = "glDisableVertexAttribArray";//$NON-NLS-1$ + public static final String API_GL_ENABLE_VAA = "glEnableVertexAttribArray";//$NON-NLS-1$ + public static final String API_GL_VERTEX_ATTRIB1F = "glVertexAttrib1f";//$NON-NLS-1$ + public static final String API_GL_VERTEX_ATTRIB2F = "glVertexAttrib2f";//$NON-NLS-1$ + public static final String API_GL_VERTEX_ATTRIB3F = "glVertexAttrib3f";//$NON-NLS-1$ + public static final String API_GL_VERTEX_ATTRIB4F = "glVertexAttrib4f";//$NON-NLS-1$ + public static final String API_GL_VERTEX_ATTRIB1FV = "glVertexAttrib1fv";//$NON-NLS-1$ + public static final String API_GL_VERTEX_ATTRIB2FV = "glVertexAttrib2fv";//$NON-NLS-1$ + public static final String API_GL_VERTEX_ATTRIB3FV = "glVertexAttrib3fv";//$NON-NLS-1$ + public static final String API_GL_VERTEX_ATTRIB4FV = "glVertexAttrib4fv";//$NON-NLS-1$ + public static final String API_GL_VERTEX_ATTRIB_POINTER = "glVertexAttribPointer";//$NON-NLS-1$ + public static final String API_GL_BUFFER_BIND = "glBindBuffer ";//$NON-NLS-1$ + + // print context table + public static final String API_GL_BUFFER_DATA = "glBufferData";//$NON-NLS-1$ + public static final String API_GL_BUFFER_DEL = "glDeleteBuffers";//$NON-NLS-1$ + public static final String API_GL_BUFFER_GEN = "glGenBuffers";//$NON-NLS-1$ + // Transformation + public static final String API_GL_VIEWPORT = "glViewport";//$NON-NLS-1$ + public static final String API_GL_DEPTH_RANGEF = "glDepthRangef";//$NON-NLS-1$ + + // Rasterization + public static final String API_GL_LINEWIDTH = "glLineWidth";//$NON-NLS-1$ + public static final String API_GL_CULLFACE = "glFrontFace";//$NON-NLS-1$ + public static final String API_GL_FRONTFACE = "glFrontFace";//$NON-NLS-1$ + public static final String API_GL_POLY_OFFSET = "glPolygonOffset";//$NON-NLS-1$ + + // Fragment Operation + public static final String API_GL_SCISSOR = "glScissor";//$NON-NLS-1$ + public static final String API_GL_STENCIL_FUNC = "glStencilFunc";//$NON-NLS-1$ + public static final String API_GL_STENCIL_FUNC_SEP = "glStencilFuncSeparate";//$NON-NLS-1$ + public static final String API_GL_STENCIL_OP = "glStencilOp";//$NON-NLS-1$ + public static final String API_GL_STENCIL_OP_SEP = "glStencilOpSeparate";//$NON-NLS-1$ + public static final String API_GL_BLEND_COLOR = "glBlendColor";//$NON-NLS-1$ + public static final String API_GL_BLEND_EQ = "glBlendEquation";//$NON-NLS-1$ + public static final String API_GL_BLEND_EQ_SEP = "glBlendEquationSeparate";//$NON-NLS-1$ + public static final String API_GL_BLEND_FUNC = "glBlendFunc";//$NON-NLS-1$ + public static final String API_GL_BLEND_FUNC_SEP = "glBlendFuncSeparate";//$NON-NLS-1$ + public static final String API_GL_DEPTH_FUNC = "glDepthFunc";//$NON-NLS-1$ + + // Pixel + public static final String API_GL_PIXEL_STOREI = "glPixelStorei";//$NON-NLS-1$ + + // Texture + public static final String API_GL_TEXTURE_GEN = "glGenTextures";//$NON-NLS-1$ + public static final String API_GL_TEXTURE_BIND = "glBindTexture";//$NON-NLS-1$ + public static final String API_GL_TEXTURE_ACTIVE = "glActiveTexture";//$NON-NLS-1$ + public static final String API_GL_TEXTURE_DEL = "glDeleteTextures";//$NON-NLS-1$ + public static final String API_GL_TEXTURE_PARAM_F = "glTexParameterf";//$NON-NLS-1$ + public static final String API_GL_TEXTURE_PARAM_FV = "glTexParameterfv";//$NON-NLS-1$ + public static final String API_GL_TEXTURE_PARAM_I = "glTexParameteri";//$NON-NLS-1$ + public static final String API_GL_TEXTURE_PARAM_IV = "glTexParameteriv";//$NON-NLS-1$ + + // program + public static final String API_GL_SHADER_CREATE = "glCreateShader";//$NON-NLS-1$ + public static final String API_GL_SHADER_SOURCE = "glShaderSource";//$NON-NLS-1$ + public static final String API_GL_PROGRAM_CREATE = "glCreateProgram";//$NON-NLS-1$ + public static final String API_GL_PROGRAM_ATTACH_SHADER = "glAttachShader";//$NON-NLS-1$ + public static final String API_GL_PROGRAM_LINK = "glLinkProgram";//$NON-NLS-1$ + public static final String API_GL_SHADER_COMPILE = "glCompileShader";//$NON-NLS-1$ + public static final String API_GL_PROGRAM_USE = "glUseProgram";//$NON-NLS-1$ + public static final String API_GL_PROGRAM_DEL = "glDeleteProgram";//$NON-NLS-1$ + public static final String API_GL_PROGRAM_DETATCH_SHADER = "glDetachShader";//$NON-NLS-1$ + public static final String API_GL_SHADER_DEL = "glDeleteShader";//$NON-NLS-1$ + + // Common + public static final String API_GL_ENABLE = "glEnable";//$NON-NLS-1$ + public static final String API_EGL_SWAPBUFFERS = "eglSwapBuffers";//$NON-NLS-1$ + public static final String API_SGL_SWAPBUFFERS = "_SglSwapBuffers";//$NON-NLS-1$ +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLAPIType.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLAPIType.java new file mode 100644 index 0000000..0f47af4 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLAPIType.java @@ -0,0 +1,234 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.data.type; + +import java.util.ArrayList; +import java.util.List; + +import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLAPIDBTableManager; +import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants; + +public class GLAPIType extends GLES20LogData { + + private GLES20LogData logData = null; + private int frameIndex = 0; + private long elapsedTime = 0; + + public GLAPIType(List data) { + setSeq((Integer) data.get(GLAPIDBTableManager.TABLE_SEQ_INDEX)); + setFrameIndex((Integer) data + .get(GLAPIDBTableManager.TABLE_FRAME_INDEX_INDEX)); + setContextID((Long) data + .get(GLAPIDBTableManager.TABLE_CONTEXT_ID_INDEX)); + setTime((Long) data.get(GLAPIDBTableManager.TABLE_TIME_INDEX)); + setApiId((Integer) data.get(GLAPIDBTableManager.TABLE_API_ID_INDEX)); + setArgs((String) data.get(GLAPIDBTableManager.TABLE_ARGUMENT_INDEX)); + setElapsedTime((Long) data + .get(GLAPIDBTableManager.TABLE_ELAPSED_TIMEQ_INDEX)); + setErrNo((Long) data.get(GLAPIDBTableManager.TABLE_ERROR_INDEX)); + setPid((Integer) data.get(GLAPIDBTableManager.TABLE_PID_INDEX)); + setTid((Integer) data.get(GLAPIDBTableManager.TABLE_TID_INDEX)); + setCallerAddress((Long) data + .get(GLAPIDBTableManager.TABLE_CALLER_PC_ADDRESS_INDEX)); + setLibName((String) data.get(GLAPIDBTableManager.TABLE_LIB_NAME_INDEX)); + } + + public GLAPIType(GLES20LogData logData) { + setSeq(logData.getSeq()); + setContextID(logData.getCurrentContextName()); + setApiId(logData.getApiId()); + setArgs(logData.getArgs()); + setTime(logData.getTime()); + setErrNo(logData.getErrno()); + setPid(logData.getPid()); + setTid(logData.getTid()); + setCallerAddress(logData.getCallerPcAddr()); + setLibName(logData.getLibName()); + this.logData = logData; + } + + public int getSeq() { + if (null != this.logData) { + return logData.getSeq(); + } else { + return seq; + } + } + + public void setSeq(int sequenceNumber) { + this.seq = sequenceNumber; + } + + public void setContextID(long id) { + glCurrentContextName = id; + } + + public long getContextID() { + return glCurrentContextName; + } + + public int getApiId() { + if (null != this.logData) { + return logData.getApiId(); + } else { + return this.apiId; + } + } + + public void setApiId(int apiId) { + this.apiId = apiId; + } + + public int getFrameIndex() { + return frameIndex; + } + + public void setFrameIndex(int frameIndex) { + this.frameIndex = frameIndex; + } + + public String getArgs() { + if (null != this.logData) { + return logData.getArgs(); + } else { + return this.args; + } + } + + public void setArgs(String argument) { + this.args = argument; + } + + public long getTime() { + if (null != this.logData) { + return logData.getTime(); + } else { + return this.time; + } + } + + public void setTime(long apiTime) { + this.time = apiTime; + } + + public long getElapsedTime() { + if (null != this.logData) { + return logData.getElapsedTime() / TimelineConstants.KILO_LONG; + } else { + return this.elapsedTime; + } + } + + public void setElapsedTime(long elapsedTime) { + this.elapsedTime = elapsedTime; + } + + public long getErrno() { + if (null != this.logData) { + return logData.getErrno(); + } else { + return this.errno; + } + } + + public void setErrNo(long errno) { + this.errno = errno; + } + + public String getReturn() { + if (null != this.logData) { + return logData.getReturn(); + } else { + return this.ret; + } + } + + public void setReturn(String ret) { + this.ret = ret; + } + + public int getPid() { + if (null != this.logData) { + return logData.getPid(); + } else { + return this.pid; + } + } + + public void setPid(int pid) { + this.pid = pid; + } + + public int getTid() { + if (null != this.logData) { + return logData.getTid(); + } else { + return this.tid; + } + } + + public void setTid(int tid) { + this.tid = tid; + } + + public GLES20LogData getLogData() { + if (null != this.logData) { + return logData; + } else { + GLES20LogData glLogData = new GLES20LogData(); + glLogData.setSeq(getSeq()); + glLogData.setApiId(getApiId()); + glLogData.setArgs(getArgs()); + glLogData.setTime(getTime()); + glLogData.setElapsedTime(getElapsedTime()); + glLogData.setErrNo(getErrno()); + glLogData.setPid(getPid()); + glLogData.setTid(getTid()); + return glLogData; + } + } + + public List getDBInsertData() { + List data = new ArrayList(); + data.add(getSeq()); + data.add(getContextID()); + data.add(getFrameIndex()); + data.add(getTime()); + data.add(getApiId()); + data.add(getArgs()); + data.add(getElapsedTime()); + data.add(getErrno()); + data.add(getPid()); + data.add(getTid()); + data.add(getCallerPcAddr()); + data.add(getLibName()); + return data; + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLConstantDefine.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLConstantDefine.java new file mode 100644 index 0000000..f85a9dc --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLConstantDefine.java @@ -0,0 +1,196 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.data.type; + +import java.util.HashMap; + +public class GLConstantDefine { + private static HashMap constantMap = null; + + private static void initialize() { + constantMap = new HashMap(); + + constantMap.put("5120", "GL_BYTE");//$NON-NLS-1$//$NON-NLS-2$ + /* DataType */ + constantMap.put("5120", "GL_BYTE");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("5121", "GL_UNSIGNED_BYTE");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("5122", "GL_SHORT");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("5123", "GL_UNSIGNED_SHORT");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("5124", "GL_INT");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("5125", "GL_UNSIGNED_INT");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("5126", "GL_FLOAT");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("5132", "GL_FIXED");//$NON-NLS-1$//$NON-NLS-2$ + /* BlendingFactorDest */ + constantMap.put("0", "GL_ZERO");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("1", "GL_ONE");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("768", "GL_SRC_COLOR");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("769", "GL_ONE_MINUS_SRC_COLOR");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("770", "GL_SRC_ALPHA");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("771", "GL_ONE_MINUS_SRC_ALPHA");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("772", "GL_DST_ALPHA");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("773", "GL_ONE_MINUS_DST_ALPHA");//$NON-NLS-1$//$NON-NLS-2$ + /* BlendingFactorSrc */ + constantMap.put("774", "GL_DST_COLOR");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("775", "GL_ONE_MINUS_DST_COLOR");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("776", "GL_SRC_ALPHA_SATURATE");//$NON-NLS-1$//$NON-NLS-2$ + /* BlendEquationSeparate */ + constantMap.put("32774", "GL_FUNC_ADD");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("32777", "GL_BLEND_EQUATION");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("32777", "GL_BLEND_EQUATION_RGB");///$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34877", "GL_BLEND_EQUATION_ALPHA");//$NON-NLS-1$//$NON-NLS-2$ + /* BlendSubtract */ + constantMap.put("32778", "GL_FUNC_SUBTRACT");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("32779", "GL_FUNC_REVERSE_SUBTRACT");//$NON-NLS-1$//$NON-NLS-2$ + /* Separate Blend Functions */ + constantMap.put("32968", "GL_BLEND_DST_RGB");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("32969", "GL_BLEND_SRC_RGB");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("32970", "GL_BLEND_DST_ALPHA");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("32971", "GL_BLEND_SRC_ALPHA");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("32769", "GL_CONSTANT_COLOR");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("32770", "GL_ONE_MINUS_CONSTANT_COLOR");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("32771", "GL_CONSTANT_ALPHA");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("32772", "GL_ONE_MINUS_CONSTANT_ALPHA");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("32773", "GL_BLEND_COLOR");//$NON-NLS-1$//$NON-NLS-2$ + /* FrontFaceDirection */ + constantMap.put("2304", "GL_CW");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("2305", "GL_CCW");//$NON-NLS-1$//$NON-NLS-2$ + /* CullFaceMode */ + constantMap.put("1028", "GL_FRONT");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("1029", "GL_BACK");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("1030", "GL_FRONT_AND_BACK");//$NON-NLS-1$//$NON-NLS-2$ + /* StencilFunction */ + constantMap.put("512", "GL_NEVER");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("513", "GL_LESS");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("514", "GL_EQUAL");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("515", "GL_LEQUAL");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("516", "GL_GREATER");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("517", "GL_NOTEQUAL");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("518", "GL_GEQUAL");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("519", "GL_ALWAYS");//$NON-NLS-1$//$NON-NLS-2$ + /* StencilOp */ + constantMap.put("7680", "GL_KEEP");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("7681", "GL_REPLACE");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("7682", "GL_INCR");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("7683", "GL_DECR");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("7690", "GL_INVERT");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("7687", "GL_INCR_WRAP");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("7688", "GL_DECR_WRAP");//$NON-NLS-1$//$NON-NLS-2$ + /* TextureUnit */ + constantMap.put("33984", "GL_TEXTURE0");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33985", "GL_TEXTURE1");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33986", "GL_TEXTURE2");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33987", "GL_TEXTURE3");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33988", "GL_TEXTURE4");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33989", "GL_TEXTURE5");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33990", "GL_TEXTURE6");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33991", "GL_TEXTURE7");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33992", "GL_TEXTURE8");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33993", "GL_TEXTURE9");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33994", "GL_TEXTURE10");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33995", "GL_TEXTURE11");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33996", "GL_TEXTURE12");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33997", "GL_TEXTURE13");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33998", "GL_TEXTURE14");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33999", "GL_TEXTURE15");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34000", "GL_TEXTURE16");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34001", "GL_TEXTURE17");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34002", "GL_TEXTURE18");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34003", "GL_TEXTURE19");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34004", "GL_TEXTURE20");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34005", "GL_TEXTURE21");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34006", "GL_TEXTURE22");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34007", "GL_TEXTURE23");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34008", "GL_TEXTURE24");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34009", "GL_TEXTURE25");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34010", "GL_TEXTURE26");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34011", "GL_TEXTURE27");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34012", "GL_TEXTURE28");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34013", "GL_TEXTURE29");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34014", "GL_TEXTURE30");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34015", "GL_TEXTURE31");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34016", "GL_ACTIVE_TEXTURE");//$NON-NLS-1$//$NON-NLS-2$ + /* Shaders */ + constantMap.put("35632", "GL_FRAGMENT_SHADER");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35633", "GL_VERTEX_SHADER");//$NON-NLS-1$//$NON-NLS-2$ + /* Uniform Types */ + constantMap.put("35664", "GL_FLOAT_VEC2");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35665", "GL_FLOAT_VEC3");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35666", "GL_FLOAT_VEC4");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35667", "GL_INT_VEC2");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35668", "GL_INT_VEC3");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35669", "GL_INT_VEC4");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35670", "GL_BOOL");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35671", "GL_BOOL_VEC2");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35672", "GL_BOOL_VEC3");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35673", "GL_BOOL_VEC4");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35674", "GL_FLOAT_MAT2");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35675", "GL_FLOAT_MAT3");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35676", "GL_FLOAT_MAT4");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35678", "GL_SAMPLER_2D");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35680", "GL_SAMPLER_CUBE");//$NON-NLS-1$//$NON-NLS-2$ + /* TextureParameterName */ + constantMap.put("10240", "GL_TEXTURE_MAG_FILTER");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("10241", "GL_TEXTURE_MIN_FILTER");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("10242", "GL_TEXTURE_WRAP_S");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("10243", "GL_TEXTURE_WRAP_T");//$NON-NLS-1$//$NON-NLS-2$ + /* TextureTarget */ + constantMap.put("3553", "GL_TEXTURE_2D");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34067", "GL_TEXTURE_CUBE_MAP");//$NON-NLS-1$//$NON-NLS-2$ + /* TextureMagFilter */ + constantMap.put("9728", "GL_NEAREST");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("9729", "GL_LINEAR");//$NON-NLS-1$//$NON-NLS-2$ + /* TextureMinFilter */ + /* GL_NEAREST */ + /* GL_LINEAR */ + constantMap.put("9984", "GL_NEAREST_MIPMAP_NEAREST");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("9985", "GL_LINEAR_MIPMAP_NEAREST");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("9986", "GL_NEAREST_MIPMAP_LINEAR");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("9987", "GL_LINEAR_MIPMAP_LINEAR");//$NON-NLS-1$//$NON-NLS-2$ + /* TextureWrapMode */ + constantMap.put("10497", "GL_REPEAT");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33071", "GL_CLAMP_TO_EDGE");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("33648", "GL_MIRRORED_REPEAT");//$NON-NLS-1$//$NON-NLS-2$ + /* Buffer Objects */ + constantMap.put("34962", "GL_ARRAY_BUFFER");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34963", "GL_ELEMENT_ARRAY_BUFFER");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34964", "GL_ARRAY_BUFFER_BINDING");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("34965", "GL_ELEMENT_ARRAY_BUFFER_BINDING");//$NON-NLS-1$//$NON-NLS-2$ + + constantMap.put("35040", "GL_STREAM_DRAW");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35044", "GL_STATIC_DRAW");//$NON-NLS-1$//$NON-NLS-2$ + constantMap.put("35048", "GL_DYNAMIC_DRAW");//$NON-NLS-1$//$NON-NLS-2$ + } + + public static String getConstantString(String key) { + if (constantMap == null) { + initialize(); + } + + return constantMap.get(key); + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLContextDefaultValueHashMap.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLContextDefaultValueHashMap.java new file mode 100644 index 0000000..c6457d7 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLContextDefaultValueHashMap.java @@ -0,0 +1,120 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.data.type; + +import java.util.HashMap; + +import org.tizen.dynamicanalyzer.constant.CommonConstants; + +public class GLContextDefaultValueHashMap { + private static HashMap defaultContextHashMap = null; + + private static final String NOT_APPLICABLE = "N/A"; + + private static void initialize() { + defaultContextHashMap = new HashMap(); + + defaultContextHashMap.put("SEQ", "0");//$NON-NLS-1$ + defaultContextHashMap.put("CONTEXT_ID", "0");//$NON-NLS-1$ + + defaultContextHashMap.put("VIEWPORT", "0,0,0,0"); + + defaultContextHashMap.put("BLEND_ENABLED", CommonConstants.DISABLE); //$NON-NLS-1$ + defaultContextHashMap.put("BLEND_COLOR", "0,0,0,0"); //$NON-NLS-1$ + defaultContextHashMap.put("BLEND_DEST_RGB", "0"); //$NON-NLS-1$ + defaultContextHashMap.put("BLEND_DEST_ALPHA", "0"); //$NON-NLS-1$ + defaultContextHashMap.put("BLEND_EQUATION_RGB", "32774"); //$NON-NLS-1$ + defaultContextHashMap.put("BLEND_EQUATION_ALPHA", "32774"); //$NON-NLS-1$ + defaultContextHashMap.put("BLEND_SRC_RGB", "1"); //$NON-NLS-1$ + defaultContextHashMap.put("BLEND_SRC_ALPHA", "1"); //$NON-NLS-1$ + + defaultContextHashMap.put("CULLING_ENABLED", CommonConstants.DISABLE); //$NON-NLS-1$ + defaultContextHashMap.put("CULLING_ORIENTATION", "2305"); //$NON-NLS-1$ + defaultContextHashMap.put("CULLING_MODE", "1029"); //$NON-NLS-1$ + + defaultContextHashMap.put("DEPTH_ENABLED", CommonConstants.DISABLE); //$NON-NLS-1$ + defaultContextHashMap.put("DEPTH_FUNC", "513"); //$NON-NLS-1$ + defaultContextHashMap.put("DEPTH_RANGE_N", "0"); //$NON-NLS-1$ + defaultContextHashMap.put("DEPTH_RANGE_F", "1"); //$NON-NLS-1$ + + defaultContextHashMap.put("DITHER_ENABLED", CommonConstants.DISABLE); //$NON-NLS-1$ + + defaultContextHashMap.put("FRAME_BUFFER_BINDING", "0"); //$NON-NLS-1$ + + defaultContextHashMap.put("LINE_WIDTH", "1"); //$NON-NLS-1$ + + defaultContextHashMap.put("POLY_ENABLED", CommonConstants.DISABLE); //$NON-NLS-1$ + defaultContextHashMap.put("POLY_FACTOR", "0"); //$NON-NLS-1$ + defaultContextHashMap.put("POLY_UNITS", "0"); //$NON-NLS-1$ + + defaultContextHashMap.put("SCISSOR_ENABLED", CommonConstants.DISABLE); //$NON-NLS-1$ + defaultContextHashMap.put("SCISSOR", "0,0,0,0"); //$NON-NLS-1$ + + defaultContextHashMap.put("STENCIL_ENABLED", CommonConstants.DISABLE); //$NON-NLS-1$ + defaultContextHashMap.put("STENCIL_FRONT_FUNC", "519"); //$NON-NLS-1$ + defaultContextHashMap.put("STENCIL_FRONT_REF", "1"); //$NON-NLS-1$ + defaultContextHashMap.put("STENCIL_FRONT_MASK", "0"); //$NON-NLS-1$ + defaultContextHashMap.put("STENCIL_FRONT_S_FAIL", "7680"); //$NON-NLS-1$ + defaultContextHashMap.put("STENCIL_FRONT_D_FAIL", "7680"); //$NON-NLS-1$ + defaultContextHashMap.put("STENCIL_FRONT_D_PASS", "7680"); //$NON-NLS-1$ + defaultContextHashMap.put("STENCIL_BACK_FUNC", "519"); //$NON-NLS-1$ + defaultContextHashMap.put("STENCIL_BACK_REF", "1"); //$NON-NLS-1$ + defaultContextHashMap.put("STENCIL_BACK_MASK", "0"); //$NON-NLS-1$ + defaultContextHashMap.put("STENCIL_BACK_S_FAIL", "7680"); //$NON-NLS-1$ + defaultContextHashMap.put("STENCIL_BACK_D_FAIL", "7680"); //$NON-NLS-1$ + defaultContextHashMap.put("STENCIL_BACK_D_PASS", "7680"); //$NON-NLS-1$ + + defaultContextHashMap.put("TEXTURE_ACTIVE", "0"); //$NON-NLS-1$ + + defaultContextHashMap.put("PACK_ALIGN", "4"); //$NON-NLS-1$ + defaultContextHashMap.put("UNPACK_ALIGN", "4"); //$NON-NLS-1$ + + defaultContextHashMap.put("GVA_ENABLED", NOT_APPLICABLE); //$NON-NLS-1$ + defaultContextHashMap.put("GVA_V0", NOT_APPLICABLE); //$NON-NLS-1$ + defaultContextHashMap.put("GVA_V1", NOT_APPLICABLE); //$NON-NLS-1$ + defaultContextHashMap.put("GVA_V2", NOT_APPLICABLE); //$NON-NLS-1$ + defaultContextHashMap.put("GVA_V3", NOT_APPLICABLE); //$NON-NLS-1$ + defaultContextHashMap.put("GVA_SIZE", NOT_APPLICABLE); //$NON-NLS-1$ + defaultContextHashMap.put("GVA_TYPE", NOT_APPLICABLE); //$NON-NLS-1$ + defaultContextHashMap.put("GVA_NORMAL", NOT_APPLICABLE); //$NON-NLS-1$ + defaultContextHashMap.put("GVA_STRIDE", NOT_APPLICABLE); //$NON-NLS-1$ + defaultContextHashMap.put("GVA_POINTER", NOT_APPLICABLE); //$NON-NLS-1$ + defaultContextHashMap.put("VBO_BINDING", NOT_APPLICABLE); //$NON-NLS-1$ + defaultContextHashMap.put("VBO_ID", NOT_APPLICABLE); //$NON-NLS-1$ + defaultContextHashMap.put("VBO_SIZE", NOT_APPLICABLE); //$NON-NLS-1$ + defaultContextHashMap.put("VBO_Data", NOT_APPLICABLE); //$NON-NLS-1$ + defaultContextHashMap.put("VBO_USAGE", NOT_APPLICABLE); //$NON-NLS-1$ + } + + public static String getDefaultValue(String key) { + if (defaultContextHashMap == null) { + initialize(); + } + return defaultContextHashMap.get(key.trim()); + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLContextNameEnum.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLContextNameEnum.java new file mode 100644 index 0000000..3f0d2d7 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLContextNameEnum.java @@ -0,0 +1,113 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.data.type; + +public enum GLContextNameEnum { + + RID("RID"), //$NON-NLS-1$ + SEQ("SEQ"), //$NON-NLS-1$ + CONTEXT_ID("CONTEXT_ID"), //$NON-NLS-1$ + + VIEWPORT("VIEWPORT"), //$NON-NLS-1$ + + BLEND_ENABLED("BLEND_ENABLED"), //$NON-NLS-1$ + BLEND_COLOR("BLEND_COLOR"), //$NON-NLS-1$ + BLEND_DEST_RGB("BLEND_DEST_RGB"), //$NON-NLS-1$ + BLEND_DEST_ALPHA("BLEND_DEST_ALPHA"), //$NON-NLS-1$ + BLEND_EQUATION_RGB("BLEND_EQUATION_RGB"), //$NON-NLS-1$ + BLEND_EQUATION_ALPHA("BLEND_EQUATION_ALPHA"), //$NON-NLS-1$ + BLEND_SRC_RGB("BLEND_SRC_RGB"), //$NON-NLS-1$ + BLEND_SRC_ALPHA("BLEND_SRC_ALPHA"), //$NON-NLS-1$ + + CULLING_ENABLED("CULLING_ENABLED"), //$NON-NLS-1$ + CULLING_ORIENTATION("CULLING_ORIENTATION"), //$NON-NLS-1$ + CULLING_MODE("CULLING_MODE"), //$NON-NLS-1$ + + DEPTH_ENABLED("DEPTH_ENABLED"), //$NON-NLS-1$ + DEPTH_FUNC("DEPTH_FUNC"), //$NON-NLS-1$ + DEPTH_RANGE_N("DEPTH_RANGE_N"), //$NON-NLS-1$ + DEPTH_RANGE_F("DEPTH_RANGE_F"), //$NON-NLS-1$ + + DITHER_ENABLED("DITHER_ENABLED"), //$NON-NLS-1$ + + FRAME_BUFFER_BINDING("FRAME_BUFFER_BINDING"), //$NON-NLS-1$ + + LINE_WIDTH("LINE_WIDTH"), //$NON-NLS-1$ + + POLY_ENABLED("POLY_ENABLED"), //$NON-NLS-1$ + POLY_FACTOR("POLY_FACTOR"), //$NON-NLS-1$ + POLY_UNITS("POLY_UNITS"), //$NON-NLS-1$ + + SCISSOR_ENABLED("SCISSOR_ENABLED"), //$NON-NLS-1$ + SCISSOR("SCISSOR"), //$NON-NLS-1$ + + STENCIL_ENABLED("STENCIL_ENABLED"), //$NON-NLS-1$ + STENCIL_FRONT_FUNC("STENCIL_FRONT_FUNC"), //$NON-NLS-1$ + STENCIL_FRONT_REF("STENCIL_FRONT_REF"), //$NON-NLS-1$ + STENCIL_FRONT_MASK("STENCIL_FRONT_MASK"), //$NON-NLS-1$ + STENCIL_FRONT_S_FAIL("STENCIL_FRONT_S_FAIL"), //$NON-NLS-1$ + STENCIL_FRONT_D_FAIL("STENCIL_FRONT_D_FAIL"), //$NON-NLS-1$ + STENCIL_FRONT_D_PASS("STENCIL_FRONT_D_PASS"), //$NON-NLS-1$ + STENCIL_BACK_FUNC("STENCIL_BACK_FUNC"), //$NON-NLS-1$ + STENCIL_BACK_REF("STENCIL_BACK_REF"), //$NON-NLS-1$ + STENCIL_BACK_MASK("STENCIL_BACK_MASK"), //$NON-NLS-1$ + STENCIL_BACK_S_FAIL("STENCIL_BACK_S_FAIL"), //$NON-NLS-1$ + STENCIL_BACK_D_FAIL("STENCIL_BACK_D_FAIL"), //$NON-NLS-1$ + STENCIL_BACK_D_PASS("STENCIL_BACK_D_PASS"), //$NON-NLS-1$ + + PACK_ALIGN("PACK_ALIGN"), //$NON-NLS-1$ + UNPACK_ALIGN("UNPACK_ALIGN"), //$NON-NLS-1$ + + GVA_ENABLED("GVA_ENABLED"), //$NON-NLS-1$ + GVA_SIZE("GVA_SIZE"), //$NON-NLS-1$ + GVA_TYPE("GVA_TYPE"), //$NON-NLS-1$ + GVA_NORMAL("GVA_NORMAL"), //$NON-NLS-1$ + GVA_STRIDE("GVA_STRIDE"), //$NON-NLS-1$ + GVA_POINTER("GVA_POINTER"), //$NON-NLS-1$ + GVA_V0("GVA_V0"), //$NON-NLS-1$ + GVA_V1("GVA_V1"), //$NON-NLS-1$ + GVA_V2("GVA_V2"), //$NON-NLS-1$ + GVA_V3("GVA_V3"), //$NON-NLS-1$ + + VBO_BINDING("VBO_BINDING"), //$NON-NLS-1$ + VBO_ID("VBO_ID"), //$NON-NLS-1$ + VBO_SIZE("VBO_SIZE"), //$NON-NLS-1$ + VBO_Data("VBO_Data"), //$NON-NLS-1$ + VBO_USAGE("VBO_USAGE"), //$NON-NLS-1$ + + TEXTURE_ACTIVE("TEXTURE_ACTIVE"); //$NON-NLS-1$ + + private String columnName; + + private GLContextNameEnum(String columnName) { + this.columnName = columnName; + } + + public String getcolumnName() { + return columnName; + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLES20ErrorDefine.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLES20ErrorDefine.java new file mode 100644 index 0000000..a83ada4 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLES20ErrorDefine.java @@ -0,0 +1,541 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.data.type; + +import java.util.HashMap; + +public class GLES20ErrorDefine { + private static HashMap gles20ErrorMap = null; + private static HashMap gles20ErrorDescriptionMap = null; + static public long GL_SUCCESS = 0; + static public long EGL_SUCCESS = 12288; + + private static void initialize() { + gles20ErrorMap = new HashMap(); + gles20ErrorMap.put(new Long(GL_SUCCESS), "GL_SUCCESS");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(1280), "GL_INVALID_ENUM");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(1281), "GL_INVALID_VALUE");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(1282), "GL_INVALID_OPERATION");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(1285), "GL_OUT_OF_MEMORY");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(1286), "GL_INVALID_FRAMEBUFFER_OPERATION");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(EGL_SUCCESS), "EGL_SUCCESS");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(12289), "EGL_NOT_INITIALIZED");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(12290), "EGL_BAD_ACCESS");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(12291), "EGL_BAD_ALLOC");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(12292), "EGL_BAD_ATTRIBUTE");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(12293), "EGL_BAD_CONFIG");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(12294), "EGL_BAD_CONTEXT.");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(12295), "EGL_BAD_CURRENT_SURFACE");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(12296), "EGL_BAD_DISPLAY");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(12297), "EGL_BAD_MATCH");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(12298), "EGL_BAD_NATIVE_PIXMAP");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(12299), "EGL_BAD_NATIVE_WINDOW");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(12300), "EGL_BAD_PARAMETER");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(12301), "EGL_BAD_SURFACE");//$NON-NLS-1$ + gles20ErrorMap.put(new Long(12302), "EGL_CONTEXT_LOST");//$NON-NLS-1$ + + gles20ErrorDescriptionMap = new HashMap(); + gles20ErrorDescriptionMap.put("0", "No error");//$NON-NLS-1$//$NON-NLS-2$ + gles20ErrorDescriptionMap + .put("500",//$NON-NLS-1$ + "An unacceptable value is specified for an enumerated argument. The offending command is ignored and has no other side effect than to set the error flag.");//$NON-NLS-1$//$NON-NLS-2$ + gles20ErrorDescriptionMap + .put("501",//$NON-NLS-1$ + "A numeric argument is out of range. The offending command is ignored and has no other side effect than to set the error flag.");//$NON-NLS-1$//$NON-NLS-2$ + gles20ErrorDescriptionMap + .put("502",//$NON-NLS-1$ + "The specified operation is not allowed in the current state. The offending command is ignored and has no other side effect than to set the error flag.");//$NON-NLS-1$//$NON-NLS-2$ + gles20ErrorDescriptionMap + .put("505",//$NON-NLS-1$ + "There is not enough memory left to execute the command. The state of the GL is undefined, except for the state of the error flags, after this error is recorded.");//$NON-NLS-1$//$NON-NLS-2$ + gles20ErrorDescriptionMap + .put("506",//$NON-NLS-1$ + "The command is trying to render to or read from the framebuffer while the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE). The offending command is ignored and has no other side effect than to set the error flag.");//$NON-NLS-1$//$NON-NLS-2$ + + gles20ErrorDescriptionMap + .put("glActiveTextureGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if texture is not one of GL_TEXTUREi, where i ranges from 0 to (GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1).");//$NON-NLS-1$//$NON-NLS-2$ + gles20ErrorDescriptionMap + .put("glAttachShaderGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if either program or shader is not a value generated by OpenGL.");//$NON-NLS-1$//$NON-NLS-2$ + gles20ErrorDescriptionMap + .put("glAttachShaderGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if program is not a program object.\n2. if shader is not a shader object.\n3. if shader is already attached to program, or if another shader object of the same type as shader is already attached to program.");//$NON-NLS-1$//$NON-NLS-2$ + gles20ErrorDescriptionMap + .put("glBindAttribLocationGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.\n2. if program is not a value");//$NON-NLS-1$//$NON-NLS-2$ + gles20ErrorDescriptionMap + .put("glBindAttribLocationGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if name starts with the reserved prefix \"gl_\".\n2. if program is not a program object.");//$NON-NLS-1$//$NON-NLS-2$ + gles20ErrorDescriptionMap + .put("glBindBufferGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if target is not one of the allowable values.");//$NON-NLS-1$//$NON-NLS-2$ + gles20ErrorDescriptionMap + .put("glBindFramebufferGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if target is not GL_FRAMEBUFFER.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glBindRenderbufferGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glBindTextureGL_INVALID_ENUM", + "GL_INVALID_ENUM is generated if target is not one of the allowable values.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glBindTextureGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if texture was previously created with a target that doesn't match that of target.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glBlendEquationGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if mode is not one of GL_FUNC_ADD, GL_FUNC_SUBTRACT, or GL_FUNC_REVERSE_SUBTRACT.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glBlendEquationSeparateGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if either modeRGB or modeAlpha is not one of GL_FUNC_ADD, GL_FUNC_SUBTRACT, or GL_FUNC_REVERSE_SUBTRACT.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glBlendFuncGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glBlendFuncSeparateGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if srcRGB, dstRGB, srcAlpha, or dstAlpha is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap.put("glBufferDataGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if size is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glBufferDataGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if target is not GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER.\n2. if usage is not GL_STREAM_DRAW, GL_STATIC_DRAW, or GL_DYNAMIC_DRAW.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glBufferDataGL_OUT_OF_MEMORY",//$NON-NLS-1$ + "GL_OUT_OF_MEMORY is generated if the GL is unable to create a data store with the specified size.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glBufferDataGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glBufferSubDataGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if offset or size is negative, or if together they define a region of memory that extends beyond the buffer object's allocated data store.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glBufferSubDataGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if target is not GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glBufferSubDataGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCheckFramebufferStatusGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if target is not GL_FRAMEBUFFER.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glClearGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if any bit other than the three defined bits is set in mask.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCompileShaderGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCompileShaderGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if a shader compiler is not supported.\n2. if shader is not a shader object.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCompressedTexImage2DGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if level is less than 0.\n2. if level is greater than log 2 ? max , where max is the returned value of GL_MAX_TEXTURE_SIZE when target is GL_TEXTURE_2D or GL_MAX_CUBE_MAP_TEXTURE_SIZE when target is not GL_TEXTURE_2D.\n3. if width or height is less than 0 or greater than GL_MAX_TEXTURE_SIZE when target is GL_TEXTURE_2D or GL_MAX_CUBE_MAP_TEXTURE_SIZE when target is not GL_TEXTURE_2D.\n4. if border is not 0.\n5. if imageSize is not consistent with the format, dimensions, and contents of the specified compressed image data.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCompressedTexImage2DGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if target is not GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.\n2. if internalformat is not a supported format returned in GL_COMPRESSED_TEXTURE_FORMATS.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCompressedTexImage2DGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if parameter combinations are not supported by the specific compressed internal format as specified in the specific texture compression extension.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCompressedTexSubImage2DGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if level is less than 0.\n2. if level is greater than log 2 ? max , where max is the returned value of GL_MAX_TEXTURE_SIZE when target is GL_TEXTURE_2D or GL_MAX_CUBE_MAP_TEXTURE_SIZE when target is not GL_TEXTURE_2D.\n3. if xoffset < 0 , xoffset + width > w , yoffset < 0 , or yoffset + height > h , where w is the width and h is the height of the texture image being modified.\n4. if width or height is less than 0.\n5. if imageSize is not consistent with the format, dimensions, and contents of the specified compressed image data.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCompressedTexSubImage2DGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if target is not GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.\n2. if format is not a supported format returned in GL_COMPRESSED_TEXTURE_FORMATS.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCompressedTexSubImage2DGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if the texture array has not been defined by a previous glCompressedTexImage2D operation whose internalformat matches the format of glCompressedTexSubImage2D.\n2. if parameter combinations are not supported by the specific compressed internal format as specified in the specific texture compression extension.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCopyTexImage2DGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if target is one of the six cube map 2D image targets and the width and height parameters are not equal.\n2. if level is less than 0.\n3. if level is greater than log 2 ? max , where max is the returned value of GL_MAX_TEXTURE_SIZE when target is GL_TEXTURE_2D or GL_MAX_CUBE_MAP_TEXTURE_SIZE when target is not GL_TEXTURE_2D.\n4. if width or height is less than 0 or greater than GL_MAX_TEXTURE_SIZE when target is GL_TEXTURE_2D or GL_MAX_CUBE_MAP_TEXTURE_SIZE when target is not GL_TEXTURE_2D.\n5. if border is not 0.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCopyTexImage2DGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if target is not GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.\n2. if internalformat is not an accepted format.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCopyTexImage2DGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if the currently bound framebuffer's format does not contain a superset of the components required by the base format of internalformat.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCopyTexImage2DGL_INVALID_FRAMEBUFFER_OPERATION",//$NON-NLS-1$ + "GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE).");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCopyTexSubImage2DGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if level is less than 0.\n2. if level > log 2 ? max , where max is the returned value of GL_MAX_TEXTURE_SIZE.\n3. if xoffset < 0 , xoffset + width > w , yoffset < 0 , or yoffset + height > h , where w is the width and h is the height of the texture image being modified.\n4. if width or height is less than 0.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCopyTexSubImage2DGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if target is not GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCopyTexSubImage2DGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if the texture array has not been defined by a previous glTexImage2D or glCopyTexImage2D operation.\n2. if the currently bound framebuffer's format does not contain a superset of the components required by the texture's base internal format.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCopyTexSubImage2DGL_INVALID_FRAMEBUFFER_OPERATION",//$NON-NLS-1$ + "GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE).");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCreateShaderGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if shaderType is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glCullFaceGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if mode is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap.put("glDeleteBuffersGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if n is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap.put("glDeleteFramebuffersGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if n is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glDeleteProgramGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");//$NON-NLS-1$ + gles20ErrorDescriptionMap.put("glDeleteRenderbuffersGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if n is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glDeleteShaderGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL.");//$NON-NLS-1$ + gles20ErrorDescriptionMap.put("glDeleteTexturesGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if n is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glDepthFuncGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if func is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glDetachShaderGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if either program or shader is a value that was not generated by OpenGL.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glDetachShaderGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if program is not a program object.\n2. if shader is not a shader object.\n3. if shader is not attached to program.");//$NON-NLS-1$ + gles20ErrorDescriptionMap.put("glDrawArraysGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if count is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glDrawArraysGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if mode is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glDrawArraysGL_INVALID_FRAMEBUFFER_OPERATION",//$NON-NLS-1$ + "GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE).");//$NON-NLS-1$ + gles20ErrorDescriptionMap.put("glDrawElementsGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if count is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glDrawElementsGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if mode is not an accepted value.\n2. if type is not GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glDrawElementsGL_INVALID_FRAMEBUFFER_OPERATION",//$NON-NLS-1$ + "GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE).");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glEnableGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if cap is not one of the values listed previously.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glEnableVertexAttribArrayGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glFramebufferRenderbufferGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if target is not GL_FRAMEBUFFER.\n2. if renderbuffertarget is not GL_RENDERBUFFER and renderbuffer is not 0.\n3. if attachment is not an accepted attachment point.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glFramebufferRenderbufferGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if the default framebuffer object name 0 is bound.\n2. if renderbuffer is neither 0 nor the name of an existing renderbuffer object.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glFramebufferTexture2DGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if level is not 0 and texture is not 0.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glFramebufferTexture2DGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if target is not GL_FRAMEBUFFER.\n2. if textarget is not an accepted texture target and texture is not 0.\n3. if attachment is not an accepted attachment point.");//$NON-NLS-1$//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glFramebufferTexture2DGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if the default framebuffer object name 0 is bound.\n2. if texture is neither 0 nor the name of an existing texture object.\n3. if texture is the name of an existing two-dimensional texture object but textarget is not GL_TEXTURE_2D or if texture is the name of an existing cube map texture object but textarget is GL_TEXTURE_2D.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glFrontFaceGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if mode is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap.put("glGenBuffersGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if n is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap.put("glGenFramebuffersGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if n is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap.put("glGenRenderbuffersGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if n is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap.put("glGenTexturesGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if n is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGenerateMipmapGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if target is not GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGenerateMipmapGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if the texture bound to target is a cube map, but its six faces do not share indentical widths, heights, formats, and types.\n2. if either the width or height of the zero level array is not a power of two.\n3. if the zero level array is stored in a compressed internal format.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if pname is not one of the values listed previously.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetActiveAttribGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if program is not a value\n2. if index is greater than or equal to the number of active attribute variables in program.\n3. if bufSize is less than 0.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetActiveAttribGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if program is not a program object.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetActiveUniformGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if program is not a value\n2. if index is greater than or equal to the number of active uniform variables in program.\n3. if bufSize is less than 0.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetActiveUniformGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if program is not a program object.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetAttachedShadersGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if program is not a value\n2. if maxCount is less than 0.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetAttachedShadersGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if program is not a program object.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetAttribLocationGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if program is not a value\n2. if program is not a program object.\n3. if program has not been successfully linked.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetBufferParameterivGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if target or value is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetBufferParameterivGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetFramebufferAttachmentParameterivGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if target is not GL_FRAMEBUFFER.\n2. if attachment is not GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, or GL_STENCIL_ATTACHMENT.\n3. if the attached object at the named attachment point is GL_RENDERBUFFER and pname is not GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE or GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.\n4. if the attached object at the named attachment point is GL_TEXTURE and pname is not GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, or GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.\n5. if there is no attached object at the named attachment point and pname is not GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetFramebufferAttachmentParameterivGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if the default framebuffer object name 0 is bound.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetProgramInfoLogGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if program is not a value\n2. if maxLength is less than 0.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetProgramInfoLogGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if program is not a program object.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetProgramivGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetProgramivGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if pname is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetProgramivGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if program does not refer to a program object.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetRenderbufferParameterivGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if target is not GL_RENDERBUFFER.\n2. if pname is not GL_RENDERBUFFER_WIDTH, GL_RENDERBUFFER_HEIGHT, GL_RENDERBUFFER_INTERNAL_FORMAT, GL_RENDERBUFFER_RED_SIZE, GL_RENDERBUFFER_GREEN_SIZE, GL_RENDERBUFFER_BLUE_SIZE, GL_RENDERBUFFER_ALPHA_SIZE, GL_RENDERBUFFER_DEPTH_SIZE, or GL_RENDERBUFFER_STENCIL_SIZE.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetRenderbufferParameterivGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if the reserved renderbuffer object name 0 is bound.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetShaderInfoLogGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if shader is not a value\n2. if maxLength is less than 0.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetShaderInfoLogGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if shader is not a shader object.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetShaderPrecisionFormatGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if shaderType or precisionType is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetShaderPrecisionFormatGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if a shader compiler is not supported.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetShaderSourceGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if shader is not a value\n2. if bufSize is less than 0.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetShaderSourceGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if shader is not a shader object.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetShaderivGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetShaderivGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if pname is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetShaderivGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if pname is GL_COMPILE_STATUS, GL_INFO_LOG_LENGTH, or GL_SHADER_SOURCE_LENGTH but a shader compiler is not supported.\n2. if shader does not refer to a shader object.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetStringGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if name is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetTexParameterGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if target or pname is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetUniformGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetUniformGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if program is not a program object.\n2. if program has not been successfully linked.\n3. if location does not correspond to a valid uniform variable location for the specified program object.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetUniformLocationGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetUniformLocationGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if program is not a program object.\n2. if program has not been successfully linked.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetVertexAttribGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetVertexAttribGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if pname is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetVertexAttribPointervGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glGetVertexAttribPointervGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if pname is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glHintGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if either target or mode is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glIsEnabledGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if cap is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glLineWidthGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if width is less than or equal to 0.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glLinkProgramGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glLinkProgramGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if program is not a program object.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glPixelStoreiGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if alignment is specified as other than 1, 2, 4, or 8.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glPixelStoreiGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if pname is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glReadPixelsGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if either width or height is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glReadPixelsGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if format or type is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glReadPixelsGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if type is GL_UNSIGNED_SHORT_5_6_5 and format is not GL_RGB.\n2. if type is GL_UNSIGNED_SHORT_4_4_4_4 or GL_UNSIGNED_SHORT_5_5_5_1 and format is not GL_RGBA.\n3. if format and type are neither GL_RGBA and GL_UNSIGNED_BYTE, respectively, nor the format/type pair returned by querying GL_IMPLEMENTATION_COLOR_READ_FORMAT and GL_IMPLEMENTATION_COLOR_READ_TYPE.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glReadPixelsGL_INVALID_FRAMEBUFFER_OPERATION",//$NON-NLS-1$ + "GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE).");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glReleaseShaderCompilerGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if a shader compiler is not supported.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glRenderbufferStorageGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if width or height is less than zero or greater than GL_MAX_RENDERBUFFER_SIZE.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glRenderbufferStorageGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if target is not GL_RENDERBUFFER.\n2. if internalformat is not an accepted format.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glRenderbufferStorageGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if the reserved renderbuffer object name 0 is bound.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glRenderbufferStorageGL_OUT_OF_MEMORY",//$NON-NLS-1$ + "GL_OUT_OF_MEMORY is generated if the implementation is unable to create a data store with the requested width and height.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glScissorGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if either width or height is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glShaderBinaryGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if any value in shaders is not a vlue\n2. if the format of the data pointed to by binary does not match binaryformat.\n3. if n or length is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glShaderBinaryGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if binaryformat is not a supported format returned in GL_SHADER_BINARY_FORMATS.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glShaderBinaryGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if any value in shaders is not a shader object, or if there is more than one vertex shader object handle or more than one fragment shader object handle in shaders.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glShaderSourceGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if shader is not a value\n2. if count is less than 0.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glShaderSourceGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if a shader compiler is not supported.\n2. if shader is not a shader object.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glStencilFuncGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if func is not one of the eight accepted values.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glStencilFuncSeparateGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if face is not GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.\n2. if func is not one of the eight accepted values.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glStencilMaskSeparateGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if face is not GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glStencilOpGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if sfail, dpfail, or dppass is any value other than the eight defined symbolic constant values.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glStencilOpSeparateGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if face is any value other than GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.\n2. if sfail, dpfail, or dppass is any value other than the eight defined symbolic constant values.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glTexImage2DGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if target is one of the six cube map 2D image targets and the width and height parameters are not equal.\n2. if level is less than 0.\n3. if level is greater than log 2 ? max , where max is the returned value of GL_MAX_TEXTURE_SIZE when target is GL_TEXTURE_2D or GL_MAX_CUBE_MAP_TEXTURE_SIZE when target is not GL_TEXTURE_2D.\n4. if internalformat is not an accepted format.\n5. if width or height is less than 0 or greater than GL_MAX_TEXTURE_SIZE when target is GL_TEXTURE_2D or GL_MAX_CUBE_MAP_TEXTURE_SIZE when target is not GL_TEXTURE_2D.\n6. if border is not 0.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glTexImage2DGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if target is not GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.\n2. if format or type is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glTexImage2DGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if format does not match internalformat.\n2. if type is GL_UNSIGNED_SHORT_5_6_5 and format is not GL_RGB.\n3. if type is GL_UNSIGNED_SHORT_4_4_4_4 or GL_UNSIGNED_SHORT_5_5_5_1 and format is not GL_RGBA.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glTexParameterGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if target or pname is not one of the accepted defined values.\n2. if params should have a defined symbolic constant value (based on the value of pname) and does not.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glTexSubImage2DGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if level is less than 0.\n2. if level is greater than log 2 max, where max is the returned value of GL_MAX_TEXTURE_SIZE.\n3. if xoffset < 0 , xoffset + width > w , yoffset < 0 , or yoffset + height > h , where w is the width and h is the height of the texture image being modified.\n4. if width or height is less than 0.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glTexSubImage2DGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated \n1. if target is not GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.\n2. if format or type is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glTexSubImage2DGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if the texture array has not been defined by a previous glTexImage2D or glCopyTexImage2D operation whose internalformat matches the format of glTexSubImage2D.\n2. if type is GL_UNSIGNED_SHORT_5_6_5 and format is not GL_RGB.\n3. if type is GL_UNSIGNED_SHORT_4_4_4_4 or GL_UNSIGNED_SHORT_5_5_5_1 and format is not GL_RGBA.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glUniformGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if count is less than 0.\n2. if transpose is not GL_FALSE.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glUniformGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if there is no current program object.\n2. if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.\n3. if one of the integer variants of this function is used to load a uniform variable of type float, vec2, vec3, vec4, or an array of these, or if one of the floating-point variants of this function is used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.\n4. if location is an invalid uniform location for the current program object and location is not equal to -1.\n5. if count is greater than 1 and the indicated uniform variable is not an array variable.\n6. if a sampler is loaded using a command other than glUniform1i and glUniform1iv.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glUseProgramGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if program is neither 0 nor a value generated by OpenGL.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glUseProgramGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated \n1. if program is not a program object.\n2. if program could not be made part of current state.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glValidateProgramGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glValidateProgramGL_INVALID_OPERATION",//$NON-NLS-1$ + "GL_INVALID_OPERATION is generated if program is not a program object.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glVertexAttribGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glVertexAttribPointerGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated \n1. if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.\n2. if size is not 1, 2, 3, or 4.\n3. if stride is negative.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glVertexAttribPointerGL_INVALID_ENUM",//$NON-NLS-1$ + "GL_INVALID_ENUM is generated if type is not an accepted value.");//$NON-NLS-1$ + gles20ErrorDescriptionMap + .put("glViewportGL_INVALID_VALUE",//$NON-NLS-1$ + "GL_INVALID_VALUE is generated if either width or height is negative.");//$NON-NLS-1$ + + } + + public static String getError(Long key) { + if (gles20ErrorMap == null) { + initialize(); + } + return gles20ErrorMap.get(key); + } + + public static String getErrorDescription(String key) { + if (gles20ErrorDescriptionMap == null) { + initialize(); + } + return gles20ErrorDescriptionMap.get(key); + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/model/GLFrameData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLFrameType.java similarity index 59% rename from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/model/GLFrameData.java rename to org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLFrameType.java index de7e0ff..4db3724 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/model/GLFrameData.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLFrameType.java @@ -4,6 +4,7 @@ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: + * Hyunjong Park * Sanghyun Lee * Juyoung Kim * @@ -24,18 +25,22 @@ * */ -package org.tizen.dynamicanalyzer.ui.opengl.data.model; +package org.tizen.dynamicanalyzer.ui.opengl.data.type; import java.util.ArrayList; import java.util.List; -public class GLFrameData { - private int frameNumber; - private List glAPIDataList; - private int errorCount; +public class GLFrameType { + private int frameNumber = 1; + private List glAPIDataList = null; + private int errorCount = 0; - public GLFrameData(int frameNumber) { - glAPIDataList = new ArrayList(); + public GLFrameType(int frameNumber) { + initFrameIndex(frameNumber); + } + + public void initFrameIndex(int frameNumber) { + glAPIDataList = new ArrayList(); this.frameNumber = frameNumber; errorCount = 0; } @@ -44,22 +49,23 @@ public class GLFrameData { return frameNumber; } - public void addGLAPIData(GLAPIData glAPIData) { + public void addGLAPIData(GLAPIType glAPIData) { glAPIDataList.add(glAPIData); - if (glAPIData.getErrorNo() != 0) { + if (glAPIData.getErrno() != GLES20ErrorDefine.EGL_SUCCESS + && glAPIData.getErrno() != GLES20ErrorDefine.GL_SUCCESS) { errorCount++; } } - public List getGLApiDataList() { + public List getGLApiDataList() { return glAPIDataList; } public long getFrametime() { long frametime = 0; - for (GLAPIData glAPIData : glAPIDataList) { + for (GLAPIType glAPIData : glAPIDataList) { frametime += glAPIData.getElapsedTime(); } @@ -70,11 +76,19 @@ public class GLFrameData { return errorCount; } - public boolean hasError() { + public int hasError() { if (errorCount != 0) { - return true; + return 1; } else { - return false; + return 0; } } + + public int getStartSeq() { + return glAPIDataList.get(0).getSeq(); + } + + public int getEndSeq() { + return glAPIDataList.get(glAPIDataList.size() - 1).getSeq(); + } } \ No newline at end of file diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLSelectionData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLSelectionData.java new file mode 100644 index 0000000..fc96142 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLSelectionData.java @@ -0,0 +1,101 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.data.type; + +import org.eclipse.swt.widgets.Control; +import org.tizen.dynamicanalyzer.common.DASelectionData; +import org.tizen.dynamicanalyzer.constant.CommonConstants; + +public class GLSelectionData extends DASelectionData { + private int frameTimeIndex = -1; + private int frameRateIndex = -1; + private long contextId = -1; + private int secondFrameIndex = -1; + private String seq = CommonConstants.EMPTY; + private String apiName = CommonConstants.EMPTY; + private long error = -1; + + public GLSelectionData(String id, int frameIndex, int secondFrameIndex, + String seq) { + super(id, null); + this.frameTimeIndex = frameIndex; + this.seq = seq; + this.secondFrameIndex = secondFrameIndex; + } + + public GLSelectionData(String id, long start, long end, Object data, + Control control, int frameIndex, long contextId) { + super(id, data); + this.frameTimeIndex = frameIndex; + this.contextId = contextId; + this.isLogData = false; + this.startTime = start; + this.endTime = end; + this.control = control; + } + + public GLSelectionData(String id, Object data, int frameTimeIndex, + int frameRateIndex, long seq) { + super(id, data); + this.frameTimeIndex = frameTimeIndex; + this.frameRateIndex = frameRateIndex; + this.seq = Long.toString(seq); + } + + public int getFrameTimeIndex() { + return frameTimeIndex; + } + + public int getFrameRateIndex() { + return frameRateIndex; + } + + public int getSecondFrameIndex() { + return secondFrameIndex; + } + + public String getSeq() { + return seq; + } + + public String getApiName() { + return this.apiName; + } + + public long getErrno() { + return this.error; + } + + public long getContextId() { + return contextId; + } + + public void setContextId(long contextId) { + this.contextId = contextId; + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLStateProgramType.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLStateProgramType.java new file mode 100644 index 0000000..15f3236 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLStateProgramType.java @@ -0,0 +1,92 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.data.type; + +public class GLStateProgramType { + public static int GL_FRAGMENT_SHADER = 1; + public static int GL_VERTEX_SHADER = 2; + + private int id = -1; + private int linkStatus = -1; + private int deleteStatus = -1; + private int fragmentShaderId = -1; + private int vertexShaderId = -1; + private int contextName = -1; + + public GLStateProgramType(int id) { + setId(id); + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getLinkStatus() { + return linkStatus; + } + + public void setLinkStatus(int linkStatus) { + this.linkStatus = linkStatus; + } + + public int getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(int deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public int getFragmentShaderId() { + return fragmentShaderId; + } + + public void setFragmentShaderId(int fragmentShaderId) { + this.fragmentShaderId = fragmentShaderId; + } + + public int getVertexShaderId() { + return vertexShaderId; + } + + public void setVertexShaderId(int vertexShaderId) { + this.vertexShaderId = vertexShaderId; + } + + public int getContextName() { + return contextName; + } + + public void setContextName(int contextName) { + this.contextName = contextName; + } + +} \ No newline at end of file diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLStateShaderType.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLStateShaderType.java new file mode 100644 index 0000000..ffb7dff --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLStateShaderType.java @@ -0,0 +1,93 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.data.type; + +import org.tizen.dynamicanalyzer.constant.CommonConstants; + +public class GLStateShaderType { + public static int GL_FRAGMENT_SHADER = 1; + public static int GL_VERTEX_SHADER = 2; + + private int id = -1; + private int shaderType = -1; + private String shaderSrc = CommonConstants.EMPTY; + private int deleteStatus = -1; + private int compileStatus = -1; + + public GLStateShaderType(int id) { + setId(id); + } + + public boolean isFragementShader() { + if (getShaderType() == 35632) { + return true; + } else { + return false; + } + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getShaderType() { + return shaderType; + } + + public void setShaderType(int shaderType) { + this.shaderType = shaderType; + } + + public String getShaderSrc() { + return shaderSrc; + } + + public void setShaderSrc(String shaderSrc) { + this.shaderSrc = shaderSrc; + } + + public int getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(int deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public int getCompileStatus() { + return compileStatus; + } + + public void setCompileStatus(int compileStatus) { + this.compileStatus = compileStatus; + } + +} \ No newline at end of file diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLStateTextureType.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLStateTextureType.java new file mode 100644 index 0000000..1f607ed --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLStateTextureType.java @@ -0,0 +1,130 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.data.type; + +public class GLStateTextureType { + public static int GL_TEXTURE_2D = 1; + public static int GL_TEXTURE_CUBE_MAP = 2; + + private int seq = -1; + private long contextID = -1; + private int trxtureType = -1; + private int objID = -1; + private int magFilter = -1; + private int minFilter = -1; + private int wrapS = -1; + private int wrapT = -1; + private boolean isDelete = false; + + public GLStateTextureType(int id, long contextID, int seq) { + this.objID = id; + this.contextID = contextID; + this.seq = seq; + } + + public int getSeq() { + return seq; + } + + public void setSeq(int seq) { + this.seq = seq; + } + + public long getContextID() { + return contextID; + } + + public void setContextID(long contextID) { + this.contextID = contextID; + } + + public int getTrxtureType() { + return trxtureType; + } + + public void setTrxtureType(int trxtureType) { + this.trxtureType = trxtureType; + } + + public int getObjID() { + return objID; + } + + public void setObjID(int objID) { + this.objID = objID; + } + + public int getMagFilter() { + return magFilter; + } + + public void setMagFilter(int magFilter) { + this.magFilter = magFilter; + } + + public int getMinFilter() { + return minFilter; + } + + public void setMinFilter(int minFilter) { + this.minFilter = minFilter; + } + + public int getWrapS() { + return wrapS; + } + + public void setWrapS(int wrapS) { + this.wrapS = wrapS; + } + + public int getWrapT() { + return wrapT; + } + + public void setWrapT(int wrapT) { + this.wrapT = wrapT; + } + + public boolean isDelete() { + return isDelete; + } + + public void setDelete(boolean isDelete) { + this.isDelete = isDelete; + } + + public boolean validInsertState() { + if (seq != -1 && contextID != -1 && trxtureType != -1 && objID != -1 + && magFilter != -1 && minFilter != -1 && wrapS != -1 + && wrapT != -1) { + return true; + } else { + return false; + } + } +} \ No newline at end of file diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/api/GLAPIListView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/api/GLAPIListView.java new file mode 100644 index 0000000..e8eaa42 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/api/GLAPIListView.java @@ -0,0 +1,174 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Sanghyun Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.table.api; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.nl.GLPageLabels; +import org.tizen.dynamicanalyzer.resources.ColorResources; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.FrameCountInfoType; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData; +import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite; +import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData; + +public class GLAPIListView extends DAViewComposite { + GLAPITable glAPIListTable; + + private String[] columnNames = { + GLPageLabels.GL_API_LIST_VIEW_SEQ, + GLPageLabels.GL_API_LIST_VIEW_FRAME, + GLPageLabels.GL_API_LIST_VIEW_TIME, + GLPageLabels.GL_API_LIST_VIEW_NAME, + GLPageLabels.GL_API_LIST_VIEW_PARAMETER, + GLPageLabels.GL_API_LIST_VIEW_ELAPSED_TIME + "(μs)", //$NON-NLS-1$ + GLPageLabels.GL_API_LIST_VIEW_ERROR, + GLPageLabels.GL_API_LIST_VIEW_PID, + GLPageLabels.GL_API_LIST_VIEW_TID }; + + private int[] columnSizes = { 40, 0, 70, 120, 250, 105, 95, 60, 60 }; + private int[] columnAlignment = { SWT.RIGHT, SWT.LEFT, SWT.LEFT, SWT.LEFT, + SWT.LEFT, SWT.RIGHT, SWT.LEFT, SWT.RIGHT, SWT.RIGHT }; + + private int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM, + AnalyzerConstants.SORT_TYPE_STRING, + AnalyzerConstants.SORT_TYPE_STRING, + AnalyzerConstants.SORT_TYPE_STRING, + AnalyzerConstants.SORT_TYPE_STRING, + AnalyzerConstants.SORT_TYPE_NUM, + AnalyzerConstants.SORT_TYPE_STRING, + AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM, }; + + public GLAPIListView(Composite parent, int style) { + super(parent, style, true); + setLayout(new FillLayout()); + + setTitle(GLPageLabels.GL_API_LIST_VIEW_TITLE); + + Composite contents = getContentArea(); + contents.setBackground(ColorResources.WINDOW_BG_COLOR); + contents.setLayout(new FillLayout()); + + glAPIListTable = new GLAPITable(contents, SWT.NONE, SWT.SINGLE + | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); + + glAPIListTable.setTableName(GLPageLabels.GL_API_LIST_VIEW_TITLE); + glAPIListTable.setSortTypes(sortTypes); + glAPIListTable.setColumnAlignment(columnAlignment); + glAPIListTable.setColumns(columnNames); + glAPIListTable.setColumnSize(columnSizes); + } + + @Override + public void updateView() { + } + + @Override + public void updateView(DAViewData vdata) { + + if (vdata instanceof GLSelectionData) { + GLSelectionData data = (GLSelectionData) vdata; + String id = data.getViewID(); + if (id.equals(GLPage.chartViewID)) { + int endFrameIndex = data.getSecondFrameIndex(); + int frameIndex = data.getFrameTimeIndex(); + if (GLDataManager.getInstance().isShowFrameRateChart()) { + title = GLPageLabels.GL_API_LIST_VIEW_TITLE + + CommonConstants.OPEN_BRACKET + frameIndex + + CommonConstants.DASH + endFrameIndex + + GLPageLabels.GL_FRAME + + CommonConstants.CLOSE_BRACKET; + + } else { + title = GLPageLabels.GL_API_LIST_VIEW_TITLE + + CommonConstants.OPEN_BRACKET + frameIndex + + GLPageLabels.GL_FRAME + + CommonConstants.CLOSE_BRACKET; + } + setTitle(title); + glAPIListTable.updateTableFromChart(frameIndex, endFrameIndex); + } else if (id.equals(GLPage.contextHistoryID)) { + if (GLDataManager.getInstance().isShowFrameRateChart()) { + + int frameRateIndex = data.getFrameRateIndex(); + if (frameRateIndex == 1) { + frameRateIndex = GLDataManager.getInstance() + .getStartFrameRateTime(); + } + + FrameCountInfoType selectionFrameCountInfo = GLDataManager + .getInstance().getFrameRateStartIndex( + frameRateIndex, frameRateIndex); + if (null == selectionFrameCountInfo) { + return; + } + int startFrameIndex = selectionFrameCountInfo + .getStartFrameIndex(); + + int endFrameIdnex = selectionFrameCountInfo + .getEndFrameIndex(); + title = GLPageLabels.GL_API_LIST_VIEW_TITLE + + CommonConstants.OPEN_BRACKET + startFrameIndex + + CommonConstants.DASH + endFrameIdnex + + GLPageLabels.GL_FRAME + + CommonConstants.CLOSE_BRACKET; + + setTitle(title); + glAPIListTable.updateTableFromContext(startFrameIndex, + endFrameIdnex, data.getSeq()); + } else { + int frameIndex = data.getFrameTimeIndex(); + title = GLPageLabels.GL_API_LIST_VIEW_TITLE + + CommonConstants.OPEN_BRACKET + + data.getFrameTimeIndex() + GLPageLabels.GL_FRAME + + CommonConstants.CLOSE_BRACKET; + setTitle(title); + glAPIListTable.updateTableFromContext(frameIndex, + frameIndex, data.getSeq()); + } + } + } + + } + + @Override + public Control getControl() { + return glAPIListTable; + } + + @Override + public void clear() { + setTitle(GLPageLabels.GL_API_LIST_VIEW_TITLE); + glAPIListTable.clear(); + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/api/GLAPITable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/api/GLAPITable.java new file mode 100644 index 0000000..11b5232 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/api/GLAPITable.java @@ -0,0 +1,199 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.table.api; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.nebula.widgets.grid.Grid; +import org.eclipse.nebula.widgets.grid.GridItem; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Composite; +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.AnalyzerManager; +import org.tizen.dynamicanalyzer.model.TableInput; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPIType; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLES20ErrorDefine; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData; +import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite; +import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; +import org.tizen.dynamicanalyzer.utils.Formatter; + +public class GLAPITable extends DATableComposite { + + private int startFrameIndex = -1; + private int endFrameIndex = -1; + + public GLAPITable(Composite parent, int style, int tableStyle) { + super(parent, style, tableStyle); + setContextMenu(AnalyzerConstants.CONTEXT_TABLE_RANGE); + table.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + GridItem[] items = table.getSelection(); + if (items == null || items.length == 0) { + return; + } + DATableDataFormat dataFormat = (DATableDataFormat) items[0] + .getData(); + if (dataFormat.getLogData() instanceof GLAPIType) { + GLAPIType glAPIType = (GLAPIType) dataFormat.getLogData(); + long time = glAPIType.getTime(); + int frameIndex = glAPIType.getFrameIndex(); + long contextId = glAPIType.getContextID(); + + GLSelectionData selData = new GLSelectionData( + GLPage.apiListViewID, time, time, items, table, + frameIndex, contextId); + AnalyzerManager.getCurrentPage().updateView(selData); + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + } + + protected List makeTableInput() { + + List input = new ArrayList(); + + List> apiList = GLDataManager.getInstance() + .getAPIDataMagerInstance() + .selectOpenGLAPIData(startFrameIndex, endFrameIndex); + if (null == apiList) { + return null; + } + + int size = apiList.size(); + + for (int i = 0; i < size; i++) { + + List text = new ArrayList(); + + GLAPIType glApiType = new GLAPIType(apiList.get(i)); + + String seq = Integer.toString(glApiType.getSeq()); + DATableDataFormat tableData = new DATableDataFormat( + Long.parseLong(seq)); + tableData.setLogData(glApiType); + text.add(seq); + text.add(Integer.toString(glApiType.getFrameIndex())); + text.add(String.valueOf(Formatter.toTimeFormat(glApiType.getTime()))); + text.add(glApiType.getApiName()); + text.add(glApiType.getArgs()); + text.add(String.valueOf(glApiType.getElapsedTime())); + text.add(GLES20ErrorDefine.getError(glApiType.getErrno())); + text.add(String.valueOf(glApiType.getPid())); + text.add(String.valueOf(glApiType.getTid())); + + TableInput tableInput = new TableInput(); + tableInput.setText(text); + tableInput.setData(glApiType); + tableInput.setData(tableData); + input.add(tableInput); + + } + return input; + } + + public void removeSelection() { + table.removeAll(); + updateTable(); + } + + public void updateTableFromChart(int startFrameIndex, int endFrameIndex) { + if (startFrameIndex >= 0) { + this.startFrameIndex = startFrameIndex; + } + this.endFrameIndex = endFrameIndex; + + updateTable(); + table.setSelection(0); + + GridItem[] items = table.getSelection(); + if (items == null || items.length == 0) { + return; + } + DATableDataFormat dataFormat = (DATableDataFormat) items[0].getData(); + if (dataFormat.getLogData() instanceof GLAPIType) { + GLAPIType glAPIType = (GLAPIType) dataFormat.getLogData(); + long time = glAPIType.getTime(); + int frameIndex = glAPIType.getFrameIndex(); + long contextId = glAPIType.getContextID(); + + GLSelectionData selData = new GLSelectionData(GLPage.apiListViewID, + time, time, items, table, frameIndex, contextId); + AnalyzerManager.getCurrentPage().updateView(selData); + } + } + + public void updateTableFromContext(int startFrameIndex, int endFrameIndex, + String seq) { + if (startFrameIndex >= 0) { + this.startFrameIndex = startFrameIndex; + } + this.endFrameIndex = endFrameIndex; + updateTable(); + int nSize = table.getItemCount(); + for (int ii = 0; ii < nSize; ii++) { + if (table.getItem(ii).getText(0).equals(seq)) { + table.setSelection(ii); + table.getVerticalBar().setSelection( + getScrollSelectionIndex(table, ii)); + updateTable(); + } + } + + GridItem[] items = table.getSelection(); + if (items == null || items.length == 0) { + return; + } + DATableDataFormat dataFormat = (DATableDataFormat) items[0].getData(); + if (dataFormat.getLogData() instanceof GLAPIType) { + GLAPIType glAPIType = (GLAPIType) dataFormat.getLogData(); + long time = glAPIType.getTime(); + int frameIndex = glAPIType.getFrameIndex(); + long contextId = glAPIType.getContextID(); + + GLSelectionData selData = new GLSelectionData(GLPage.apiListViewID, + time, time, items, table, frameIndex, contextId); + AnalyzerManager.getCurrentPage().updateView(selData); + } + } + + private int getScrollSelectionIndex(Grid table, int selection) { + int size = table.getVerticalBar().getThumb() / 2; + int output = selection - size; + output = (output < 0) ? 0 : output; + return output; + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLContextTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLContextTable.java new file mode 100644 index 0000000..887dfd7 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLContextTable.java @@ -0,0 +1,369 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * yeongtaik byeon + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.table.state; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.nebula.widgets.grid.GridEditor; +import org.eclipse.nebula.widgets.grid.GridItem; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseMoveListener; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; +import org.eclipse.swt.layout.FormLayout; +import org.eclipse.swt.widgets.Composite; +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.AnalyzerManager; +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.model.TableInput; +import org.tizen.dynamicanalyzer.resources.ColorResources; +import org.tizen.dynamicanalyzer.resources.ImageResources; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLStateDBTableManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLStateHistoryDBTableManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLConstantDefine; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLContextDefaultValueHashMap; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLContextNameEnum; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData; +import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite; +import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; +import org.tizen.dynamicanalyzer.widgets.button.DACustomButton; +import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener; + +public class GLContextTable extends DATableComposite { + + private final String STATE_CHANDE = "STATE_CHANDE";//$NON-NLS-1$ + private boolean isCheckedBox = true; + private String selectedSeq = CommonConstants.EMPTY; + private List stateValueList = null; + + private String selectedStateName = CommonConstants.EMPTY; + + private Composite naviButtonLeftComposite; + private Composite naviButtonRightComposite; + private DACustomButton buttonLeftLeft; + private DACustomButton buttonRightRight; + + public GLContextTable(Composite parent, int style, int tableStyle) { + super(parent, style, tableStyle); + setContextMenu(AnalyzerConstants.CONTEXT_TABLE_RANGE); + table.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + GridItem[] items = table.getSelection(); + if (items.length <= 0) { + return; + } + GLSelectionData selData = new GLSelectionData( + GLPage.contextViewID, -1, -1, items, table, -1, -1); + + AnalyzerManager.getCurrentPage().updateView(selData); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + table.addMouseMoveListener(new MouseMoveListener() { + @Override + public void mouseMove(MouseEvent e) { + + GridItem gridItem = table.getItem(new Point(e.x, e.y)); + if (gridItem == null) { + disposeNaviButtons(); + return; + } + + int secondeColumnStartX = table.getColumn(0).getWidth(); + int secondeColumnEndX = secondeColumnStartX + + table.getColumn(1).getWidth(); + + if (secondeColumnStartX <= e.x && e.x <= secondeColumnEndX + && gridItem.getText(3).equals(STATE_CHANDE)) { + String stateName = gridItem.getText(0); + createNaviButtons(gridItem, stateName); + } else { + disposeNaviButtons(); + } + + } + }); + + } + + public void setSelectedSeq(boolean isCheckedBox, String selectedSeq, + List stateValueList) { + this.isCheckedBox = isCheckedBox; + this.selectedSeq = selectedSeq; + this.stateValueList = stateValueList; + } + + protected List makeTableInput() { + if (null == stateValueList) { + return null; + } + List input = new ArrayList(); + + GLStateDBTableManager dbManager = GLDataManager.getInstance() + .getContextDBTableManage(); + int size = dbManager.getColumnSize(); + + for (int i = 0; i < size; i++) { + if (i == GLContextNameEnum.RID.ordinal() + || i == GLContextNameEnum.SEQ.ordinal() + || i == GLContextNameEnum.CONTEXT_ID.ordinal()) { + continue; + } + + List text = new ArrayList(); + DATableDataFormat tableData = new DATableDataFormat( + Long.parseLong(selectedSeq)); + + String stateName = dbManager.getColumnName()[i]; + String defaultValue = GLContextDefaultValueHashMap + .getDefaultValue(stateName); + + String currentValue = stateValueList.get(i); + if (isCheckedBox && !isChangeStateValue(defaultValue, currentValue)) { + continue; + } + + if (isInteger(currentValue)) { + if (i != GLContextNameEnum.TEXTURE_ACTIVE.ordinal()) { + String glConstantDefine = GLConstantDefine + .getConstantString(currentValue); + if (null != glConstantDefine) { + defaultValue = glConstantDefine; + currentValue = glConstantDefine; + } + } + } + text.add(stateName); + text.add(defaultValue); + text.add(currentValue); + if (isChangeStateValue(defaultValue, currentValue)) { + text.add(STATE_CHANDE); + } else { + text.add(CommonConstants.EMPTY); + } + + TableInput tableInput = new TableInput(); + tableInput.setText(text); + tableInput.setData(tableData); + input.add(tableInput); + + if (isChangeStateValue(defaultValue, currentValue)) { + tableInput.setInRange(true); + } + + } + return input; + } + + private boolean isInteger(String str) { + try { + Integer.parseInt(str); + return true; + } catch (NumberFormatException e) { + return false; + } + } + + private boolean isChangeStateValue(String defaultValue, String currentValue) { + String removeOpenBracket = currentValue.replace( + CommonConstants.OPEN_SQUARE_BRACKET, CommonConstants.EMPTY); + String removeCloseBracket = removeOpenBracket.replace( + CommonConstants.CLOSE_SQUARE_BRACKET, CommonConstants.EMPTY); + + if (defaultValue.equals(removeCloseBracket.trim())) { + return false; + } else { + return true; + } + } + + private void disposeNaviButtons() { + if (naviButtonLeftComposite != null) { + naviButtonLeftComposite.dispose(); + } + + if (naviButtonRightComposite != null) { + naviButtonRightComposite.dispose(); + } + + if (buttonLeftLeft != null) { + buttonLeftLeft.dispose(); + } + if (buttonRightRight != null) { + buttonRightRight.dispose(); + } + } + + private void createNaviButtons(GridItem gridItem, String stateName) { + disposeNaviButtons(); + Color bgColor; + if (table.isSelected(gridItem)) { + bgColor = ColorResources.TABLE_CONTENTS_SELECTED_END; + } else { + bgColor = gridItem.getBackground(); + } + + FormLayout formLayout = new FormLayout(); + formLayout.marginHeight = -1; + formLayout.marginWidth = -1; + + naviButtonLeftComposite = new Composite(table, SWT.NONE); + naviButtonLeftComposite.setLayout(formLayout); + naviButtonLeftComposite.setBackground(bgColor); + + buttonLeftLeft = new DACustomButton(naviButtonLeftComposite, + ImageResources.OPEN_GL_PRE_NAVI_NORMAL, + ImageResources.OPEN_GL_PRE_NAVI_PUSH, + ImageResources.OPEN_GL_PRE_NAVI_HOVER, + ImageResources.OPEN_GL_PRE_NAVI_NORMAL); + + FormData formData = new FormData(); + formData.top = new FormAttachment(0, 2); + formData.left = new FormAttachment(0, 2); + formData.right = new FormAttachment(100, -1); + formData.width = ImageResources.OPEN_GL_PRE_NAVI_NORMAL.getBounds().width; + formData.height = ImageResources.OPEN_GL_PRE_NAVI_NORMAL.getBounds().height; + + buttonLeftLeft.setLayoutData(formData); + naviButtonLeftComposite.pack(); + + GridEditor editor = new GridEditor(table); + editor.minimumWidth = naviButtonLeftComposite.getSize().x; + editor.horizontalAlignment = SWT.LEFT; + editor.setEditor(naviButtonLeftComposite, gridItem, 1); + + naviButtonRightComposite = new Composite(table, SWT.NONE); + naviButtonRightComposite.setLayout(formLayout); + naviButtonRightComposite.setBackground(bgColor); + + buttonRightRight = new DACustomButton(naviButtonRightComposite, + ImageResources.OPEN_GL_NEXT_NAVI_NORMAL, + ImageResources.OPEN_GL_NEXT_NAVI_PUSH, + ImageResources.OPEN_GL_NEXT_NAVI_HOVER, + ImageResources.OPEN_GL_NEXT_NAVI_NORMAL); + formData = new FormData(); + formData.top = new FormAttachment(0, 2); + formData.left = new FormAttachment(0, 1); + formData.right = new FormAttachment(100, -2); + formData.width = ImageResources.OPEN_GL_PRE_NAVI_NORMAL.getBounds().width; + formData.height = ImageResources.OPEN_GL_PRE_NAVI_NORMAL.getBounds().height; + buttonRightRight.setLayoutData(formData); + naviButtonRightComposite.pack(); + + editor = new GridEditor(table); + editor.minimumWidth = naviButtonRightComposite.getSize().x; + editor.horizontalAlignment = SWT.RIGHT; + editor.setEditor(naviButtonRightComposite, gridItem, 1); + + selectedStateName = stateName; + buttonLeftLeft.addClickListener(NavigationPreSelectionListener); + buttonRightRight.addClickListener(NavigationNextSelectionListener); + } + + private DACustomButtonClickEventListener NavigationPreSelectionListener = new DACustomButtonClickEventListener() { + + @Override + public void handleClickEvent(DACustomButton button) { + int contextDBIndex = getSelectedStateIndex(); + if (contextDBIndex < 0) { + return; + } + List searchInfo = GLDataManager + .getInstance() + .getStateHistoryDBTableManage() + .selectLastChangedSeq( + GLDataManager.getInstance().getSelectedContextID(), + contextDBIndex, Long.parseLong(selectedSeq)); + updateCurrentPage(searchInfo); + + } + }; + private DACustomButtonClickEventListener NavigationNextSelectionListener = new DACustomButtonClickEventListener() { + + @Override + public void handleClickEvent(DACustomButton button) { + int contextDBIndex = getSelectedStateIndex(); + if (contextDBIndex < 0) { + return; + } + List searchInfo = GLDataManager + .getInstance() + .getStateHistoryDBTableManage() + .selectNextChangedSeq( + GLDataManager.getInstance().getSelectedContextID(), + contextDBIndex, Long.parseLong(selectedSeq)); + updateCurrentPage(searchInfo); + } + }; + + private int getSelectedStateIndex() { + if (selectedSeq == null) { + return -1; + } + int contextDBIndex = -1; + GLContextNameEnum[] glContextDBEnum = GLContextNameEnum.values(); + for (int i = 0; i < glContextDBEnum.length; i++) { + if (glContextDBEnum[i].getcolumnName().equals(selectedStateName)) { + contextDBIndex = i; + return contextDBIndex; + } + } + return -1; + } + + private void updateCurrentPage(List searchInfo) { + if (null == searchInfo) { + return; + } + + long seq = (Long) searchInfo + .get(GLStateHistoryDBTableManager.TABLE_CHANGE_SEQ_INDEX); + int frameRateIndex = (Integer) searchInfo + .get(GLStateHistoryDBTableManager.TABLE_FRAME_RATE_INDEX_INDEX); + int frameTimeIndex = (Integer) searchInfo + .get(GLStateHistoryDBTableManager.TABLE_FRAME_TIME_INDEX_INDEX); + + GLSelectionData selData = new GLSelectionData(GLPage.contextHistoryID, + null, frameTimeIndex, frameRateIndex, seq); + AnalyzerManager.getCurrentPage().updateView(selData); + disposeNaviButtons(); + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLContextTableView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLContextTableView.java new file mode 100644 index 0000000..5ee4f17 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLContextTableView.java @@ -0,0 +1,195 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.table.state; + +import java.util.List; + +import org.eclipse.nebula.widgets.grid.GridItem; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Canvas; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Listener; +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.DASelectionData; +import org.tizen.dynamicanalyzer.constant.CommonConstants; +import org.tizen.dynamicanalyzer.nl.GLPageLabels; +import org.tizen.dynamicanalyzer.nl.UserInterfacePageLabels; +import org.tizen.dynamicanalyzer.resources.ColorResources; +import org.tizen.dynamicanalyzer.resources.ImageResources; +import org.tizen.dynamicanalyzer.swap.model.data.LogData; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLContextNameEnum; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData; +import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; +import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener; +import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite; +import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData; + +public class GLContextTableView extends DAViewComposite { + GLContextTable tableComp = null; + private Canvas titleBar = null; + private int[] columnSizes = { 150, 100, 400 }; + private boolean[] columnVisibility = { true, true, true }; + private int[] columnAlignment = { SWT.LEFT, SWT.LEFT, SWT.LEFT }; + + private int checkBoxOffSet = 20; + private List selectedStateValueList = null; + private String selectedSeq = CommonConstants.EMPTY; + private boolean isCheckedBox = true; + private Image checkImg = ImageResources.CHECKBOX_SELECTED; + + private String[] columnNames = { GLPageLabels.GL_CONTEXT_VIEW_NAME, + GLPageLabels.GL_CONTEXT_VIEW_DEFAULT_VALUE, + GLPageLabels.GL_CONTEXT_VIEW_CURRENT_VALUE }; + + int[] sortTypes = { AnalyzerConstants.SORT_TYPE_STRING, + AnalyzerConstants.SORT_TYPE_STRING, + AnalyzerConstants.SORT_TYPE_STRING }; + + public GLContextTableView(Composite parent, int style) { + super(parent, style, true); + this.setLayout(new FillLayout()); + + setTitle(GLPageLabels.GL_CONTEXT_VIEW_TITLE); + titleBar = getTitleArea(); + titleBar.addPaintListener(checkBoxPaintListener); + titleBar.addListener(SWT.MouseUp, checkBoxMouseUpListener); + + Composite contents = getContentArea(); + contents.setBackground(ColorResources.WINDOW_BG_COLOR); + contents.setLayout(new FillLayout()); + tableComp = new GLContextTable(contents, SWT.NONE, SWT.MULTI + | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); + tableComp + .setTableName(UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_NAME); + tableComp.setSortTypes(sortTypes); + tableComp.setColumnAlignment(columnAlignment); + tableComp.setColumns(columnNames); + tableComp.setColumnSize(columnSizes); + tableComp.setColumnVisibility(columnVisibility); + tableComp.setTableToolTipEnable(false); + + contents.addControlListener(new TableColumnSizePackListener(tableComp, + columnSizes)); + + } + + @Override + public void updateView() { + } + + @Override + public void updateView(DAViewData vdata) { + if (vdata instanceof DASelectionData) { + DASelectionData data = (DASelectionData) vdata; + String id = data.getViewID(); + if ((id.equals(GLPage.apiListViewID) && data instanceof GLSelectionData)) { + GridItem[] gridItems = (GridItem[]) data.getData(); + DATableDataFormat tableDataFormat = (DATableDataFormat) gridItems[0] + .getData(); + LogData logData = tableDataFormat.getLogData(); + + int frameIndex = ((GLSelectionData) data).getFrameTimeIndex(); + long contextId = ((GLSelectionData) data).getContextId(); + selectedSeq = Integer.toString(logData.getSeq()); + + selectedStateValueList = GLDataManager.getInstance() + .getContextDBTableManage() + .getContextData(selectedSeq, contextId); + if (null == selectedStateValueList) { + return; + } + + tableComp.setSelectedSeq(isCheckedBox, selectedSeq, + selectedStateValueList); + tableComp.updateTable(); + tableComp.setSelectedSeq(isCheckedBox, selectedSeq, null); + + int contextID = Integer.parseInt(selectedStateValueList + .get(GLContextNameEnum.CONTEXT_ID.ordinal())); + String curretnContextNember = "Context_" + contextID;//$NON-NLS-1$ + setTitle(curretnContextNember + " ( #" + selectedSeq + " of "//$NON-NLS-1$ //$NON-NLS-2$ + + frameIndex + " frame )");//$NON-NLS-1$ + GLDataManager.getInstance().setSelectedContextID(contextID); + } + } + } + + @Override + public void clear() { + tableComp.clear(); + } + + @Override + public Control getControl() { + return tableComp; + } + + private PaintListener checkBoxPaintListener = new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + GC gc = e.gc; + + Rectangle bounds = titleBar.getBounds(); + int width = bounds.width; + gc.drawImage(checkImg, width - checkBoxOffSet, 2); + } + }; + + private Listener checkBoxMouseUpListener = new Listener() { + @Override + public void handleEvent(Event event) { + Rectangle bounds = titleBar.getBounds(); + int width = bounds.width; + + if (width - checkBoxOffSet <= event.x && event.x <= width) { + if (isCheckedBox) { + isCheckedBox = false; + checkImg = ImageResources.CHECKBOX_UNSELECTED; + } else { + isCheckedBox = true; + checkImg = ImageResources.CHECKBOX_SELECTED; + } + titleBar.redraw(); + tableComp.setSelectedSeq(isCheckedBox, selectedSeq, + selectedStateValueList); + tableComp.updateTable(); + tableComp.setSelectedSeq(isCheckedBox, selectedSeq, null); + } + } + }; +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLProgramTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLProgramTable.java new file mode 100644 index 0000000..25d29c5 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLProgramTable.java @@ -0,0 +1,118 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.table.state; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.nebula.widgets.grid.GridItem; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Composite; +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.AnalyzerManager; +import org.tizen.dynamicanalyzer.model.TableInput; +import org.tizen.dynamicanalyzer.nl.GLPageLabels; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateProgramType; +import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite; +import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; + +public class GLProgramTable extends DATableComposite { + + public GLProgramTable(Composite parent, int style, int tableStyle) { + super(parent, style, tableStyle); + setContextMenu(AnalyzerConstants.CONTEXT_TABLE_RANGE); + table.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + GridItem[] items = table.getSelection(); + if (null == items) { + return; + } + GLSelectionData selData = new GLSelectionData( + GLPage.programViewID, -1, -1, items, table, -1, -1); + + AnalyzerManager.getCurrentPage().updateView(selData); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + } + + protected List makeTableInput() { + + List input = new ArrayList(); + + List programList = GLDataManager.getInstance() + .getStateDataMagerInstance().getProgramList(); + + int size = programList.size(); + + for (int i = 0; i < size; i++) { + List text = new ArrayList(); + String programId = Integer.toString(programList.get(i).getId()); + DATableDataFormat tableData = new DATableDataFormat( + Long.parseLong(programId)); + + String contextName = GLPageLabels.GL_CONTEXT + + programList.get(i).getContextName(); + String programID = GLPageLabels.GL_PROGRAM + programId; + String vertexShaderID = GLPageLabels.GL_SHADER + + programList.get(i).getVertexShaderId(); + String vertexFragmentID = GLPageLabels.GL_SHADER + + programList.get(i).getFragmentShaderId(); + + text.add(contextName); + text.add(programID); + text.add(vertexShaderID); + text.add(vertexFragmentID); + + TableInput tableInput = new TableInput(); + tableInput.setText(text); + tableInput.setData(tableData); + input.add(tableInput); + + int contextID = programList.get(i).getContextName(); + + if (GLDataManager.getInstance().getSelectedContextID() == contextID) { + tableInput.setInRange(true); + } + + } + return input; + } + + public void removeSelection() { + table.removeAll(); + updateTable(); + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLProgramTableView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLProgramTableView.java new file mode 100644 index 0000000..2a233b7 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLProgramTableView.java @@ -0,0 +1,116 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.table.state; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.DASelectionData; +import org.tizen.dynamicanalyzer.nl.GLPageLabels; +import org.tizen.dynamicanalyzer.nl.UserInterfacePageLabels; +import org.tizen.dynamicanalyzer.resources.ColorResources; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData; +import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener; +import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite; +import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData; + +public class GLProgramTableView extends DAViewComposite { + GLProgramTable tableComp = null; + private int[] columnSizes = { 90, 90, 110, 110 }; + private boolean[] columnVisibility = { true, true, true, true }; + private int[] columnAlignment = { SWT.CENTER, SWT.CENTER, SWT.CENTER, + SWT.CENTER }; + + private String[] columnNames = { + GLPageLabels.GL_STATE_PROGRAM_VIEW_CONTEXT_NAME, + GLPageLabels.GL_STATE_PROGRAM_VIEW_ID, + GLPageLabels.GL_STATE_PROGRAM_VIEW_VERTEX_SHADER, + GLPageLabels.GL_STATE_PROGRAM_VIEW_FRAGMENT_SHADER }; + + int[] sortTypes = { AnalyzerConstants.SORT_TYPE_STRING, + AnalyzerConstants.SORT_TYPE_STRING, + AnalyzerConstants.SORT_TYPE_STRING }; + + public GLProgramTableView(Composite parent, int style) { + super(parent, style, true); + this.setLayout(new FillLayout()); + + setTitle(GLPageLabels.GL_PROGRAMS_VIEW_TITLE); + + Composite contents = getContentArea(); + contents.setBackground(ColorResources.WINDOW_BG_COLOR); + contents.setLayout(new FillLayout()); + tableComp = new GLProgramTable(contents, SWT.NONE, SWT.MULTI + | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); + tableComp + .setTableName(UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_NAME); + tableComp.setSortTypes(sortTypes); + tableComp.setColumnAlignment(columnAlignment); + tableComp.setColumns(columnNames); + tableComp.setColumnSize(columnSizes); + tableComp.setColumnVisibility(columnVisibility); + tableComp.setTableToolTipEnable(false); + + contents.addControlListener(new TableColumnSizePackListener(tableComp, + columnSizes)); + + } + + @Override + public void updateView() { + } + + @Override + public void updateView(DAViewData vdata) { + + if (vdata instanceof DASelectionData) { + DASelectionData data = (DASelectionData) vdata; + String id = data.getViewID(); + if (!id.equals(GLPage.programViewID)) { + tableComp.removeSelection(); + } + + if ((id.equals(GLPage.apiListViewID) && data instanceof GLSelectionData)) { + tableComp.updateTable(); + } + } + } + + @Override + public void clear() { + tableComp.clear(); + } + + @Override + public Control getControl() { + return tableComp; + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLTextureTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLTextureTable.java new file mode 100644 index 0000000..92c0f77 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLTextureTable.java @@ -0,0 +1,115 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.table.state; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.nebula.widgets.grid.GridItem; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Composite; +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.model.TableInput; +import org.tizen.dynamicanalyzer.nl.GLPageLabels; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLConstantDefine; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateTextureType; +import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite; +import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; + +public class GLTextureTable extends DATableComposite { + + public GLTextureTable(Composite parent, int style, int tableStyle) { + super(parent, style, tableStyle); + setContextMenu(AnalyzerConstants.CONTEXT_TABLE_RANGE); + table.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + GridItem[] items = table.getSelection(); + if (null == items) { + return; + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + } + + protected List makeTableInput() { + + List input = new ArrayList(); + + List textureList = GLDataManager.getInstance() + .getStateTextureDBTableManage().select(); + + int size = textureList.size(); + for (int i = 0; i < size; i++) { + List text = new ArrayList(); + + String textureId = Integer.toString(textureList.get(i).getObjID()); + + DATableDataFormat tableData = new DATableDataFormat( + Long.parseLong(textureId)); + + text.add(GLPageLabels.GL_CONTEXT + + Long.toString(textureList.get(i).getContextID())); + text.add(GLPageLabels.GL_TEXTURE + textureId); + + text.add(GLConstantDefine.getConstantString(Integer + .toString(textureList.get(i).getTrxtureType()))); + text.add(GLConstantDefine.getConstantString(Integer + .toString(textureList.get(i).getWrapS()))); + text.add(GLConstantDefine.getConstantString(Integer + .toString(textureList.get(i).getWrapT()))); + text.add(GLConstantDefine.getConstantString(Integer + .toString(textureList.get(i).getMinFilter()))); + text.add(GLConstantDefine.getConstantString(Integer + .toString(textureList.get(i).getMagFilter()))); + + TableInput tableInput = new TableInput(); + tableInput.setText(text); + tableInput.setData(tableData); + input.add(tableInput); + + long contextID = textureList.get(i).getContextID(); + + if (GLDataManager.getInstance().getSelectedContextID() == contextID) { + tableInput.setInRange(true); + } + + } + return input; + } + + public void removeSelection() { + table.removeAll(); + updateTable(); + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLTextureTableView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLTextureTableView.java new file mode 100644 index 0000000..9ba1606 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLTextureTableView.java @@ -0,0 +1,119 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalyzer.ui.opengl.table.state; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.DASelectionData; +import org.tizen.dynamicanalyzer.nl.GLPageLabels; +import org.tizen.dynamicanalyzer.nl.UserInterfacePageLabels; +import org.tizen.dynamicanalyzer.resources.ColorResources; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; +import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData; +import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener; +import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite; +import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData; + +public class GLTextureTableView extends DAViewComposite { + GLTextureTable tableComp = null; + private int[] columnSizes = { 80, 80, 110, 120, 120, 100, 100 }; + private boolean[] columnVisibility = { true, true, true, true, true, true, + true }; + private int[] columnAlignment = { SWT.CENTER, SWT.CENTER, SWT.CENTER, + SWT.CENTER, SWT.CENTER, SWT.CENTER, SWT.CENTER }; + + private String[] columnNames = { GLPageLabels.GL_TEXTURE_VIEW_CONTEXT_NAME, + GLPageLabels.GL_TEXTURE_VIEW_CONTEXT_ID, + GLPageLabels.GL_TEXTURE_VIEW_CONTEXT_TYPE, + GLPageLabels.GL_TEXTURE_VIEW_CONTEXT_WRAP_S, + GLPageLabels.GL_TEXTURE_VIEW_CONTEXT_WRAP_T, + GLPageLabels.GL_TEXTURE_VIEW_CONTEXT_MIN_FILTER, + GLPageLabels.GL_TEXTURE_VIEW_CONTEXT_MAG_FILTER }; + + int[] sortTypes = { AnalyzerConstants.SORT_TYPE_STRING, + AnalyzerConstants.SORT_TYPE_STRING, + AnalyzerConstants.SORT_TYPE_STRING }; + + public GLTextureTableView(Composite parent, int style) { + super(parent, style, true); + this.setLayout(new FillLayout()); + + setTitle(GLPageLabels.GL_TEXTURE_VIEW_TITLE); + + Composite contents = getContentArea(); + contents.setBackground(ColorResources.WINDOW_BG_COLOR); + contents.setLayout(new FillLayout()); + tableComp = new GLTextureTable(contents, SWT.NONE, SWT.MULTI + | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); + tableComp + .setTableName(UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_NAME); + tableComp.setSortTypes(sortTypes); + tableComp.setColumnAlignment(columnAlignment); + tableComp.setColumns(columnNames); + tableComp.setColumnSize(columnSizes); + tableComp.setColumnVisibility(columnVisibility); + tableComp.setTableToolTipEnable(false); + + contents.addControlListener(new TableColumnSizePackListener(tableComp, + columnSizes)); + + } + + @Override + public void updateView() { + } + + @Override + public void updateView(DAViewData vdata) { + + if (vdata instanceof DASelectionData) { + DASelectionData data = (DASelectionData) vdata; + String id = data.getViewID(); + if (!id.equals(GLPage.textureViewID)) { + tableComp.removeSelection(); + } + + if ((id.equals(GLPage.apiListViewID) && data instanceof GLSelectionData)) { + tableComp.updateTable(); + } + } + } + + @Override + public void clear() { + tableComp.clear(); + } + + @Override + public Control getControl() { + return tableComp; + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/GLDetailsView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/GLDetailsView.java deleted file mode 100644 index 7e8cc22..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/GLDetailsView.java +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.ui; - -import org.eclipse.nebula.widgets.grid.GridItem; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Canvas; -import org.eclipse.swt.widgets.Composite; -import org.tizen.dynamicanalyzer.common.DASelectionData; -import org.tizen.dynamicanalyzer.nl.GLPageLabels; -import org.tizen.dynamicanalyzer.resources.ColorResources; -import org.tizen.dynamicanalyzer.resources.FontResources; -import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData; -import org.tizen.dynamicanalyzer.ui.opengl.GLES20ErrorInformation; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataMaker; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLSelectionData; -import org.tizen.dynamicanalyzer.ui.opengl.data.model.GLFrameData; -import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; -import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite; -import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData; - -public class GLDetailsView extends DAViewComposite { - public static final int LEFT_MARGIN = 10; - public static final int HEIGHT_MARGIN = 20; - - private static final int DETAIL_FRAME = 0; - private static final int DETAIL_API = 1; - private static final int DETAIL_CONTEXT = 2; - - private Canvas canvas = null; - private int detail = -1; - - private String frameNumber; - private String elapsedTime; - private String apiCount; - private String errorCount; - - private String api; - private String state; - - private String m_txt; - private int m_length; - private int m_width; - private int m_position; - private int m_start; - private GC m_gc; - - public GLDetailsView(Composite parent, int style) { - super(parent, style, true); - this.setLayout(new FillLayout()); - - setTitle(GLPageLabels.GL_DETAILS_VIEW_TITLE); - - Composite contents = getContentArea(); - contents.setBackground(ColorResources.VIEW_BG_COLOR); - contents.setLayout(new FillLayout()); - canvas = new Canvas(contents, SWT.TRANSPARENT); - canvas.addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - Rectangle rect = canvas.getBounds(); - e.gc.setBackground(ColorResources.VIEW_BG_COLOR); - e.gc.fillRectangle(rect.x, rect.y, rect.width, rect.height); - e.gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR); - e.gc.setFont(FontResources.DETAIL_INFO_FONT); - - if (detail == DETAIL_FRAME) { - int y = HEIGHT_MARGIN; - Point p = e.gc.textExtent(frameNumber, SWT.DRAW_MNEMONIC); - e.gc.drawText(frameNumber, LEFT_MARGIN, y); - y += (p.y + HEIGHT_MARGIN); - - e.gc.drawText(elapsedTime, LEFT_MARGIN, y); - y += (p.y + HEIGHT_MARGIN); - - e.gc.drawText(apiCount, LEFT_MARGIN, y); - y += (p.y + HEIGHT_MARGIN); - - e.gc.drawText(errorCount, LEFT_MARGIN, y); - } else if (detail == DETAIL_API) { - int y = HEIGHT_MARGIN; - Point p = e.gc.textExtent(api, SWT.DRAW_MNEMONIC); - e.gc.drawText(api, LEFT_MARGIN, y); - y += (p.y + HEIGHT_MARGIN); - - if (state != null) { - writeWithWrap(e.gc, state, LEFT_MARGIN, y, rect.width - - LEFT_MARGIN * 2); - } - } else if (detail == DETAIL_CONTEXT) { - // TODO - } - } - }); - } - - @Override - public void updateView(DAViewData vdata) { - if (vdata instanceof DASelectionData) { - DASelectionData data = (DASelectionData) vdata; - - String id = data.getViewID(); - if (id.equals(GLPage.chartViewID) - && data instanceof GLSelectionData) { - detail = DETAIL_FRAME; - - int frameIndex = ((GLSelectionData) data).getFrameIndex(); - GLFrameData glFrameData = GLDataMaker.getInstance() - .getFrameData(frameIndex); - - frameNumber = "Frame# : " + String.valueOf(frameIndex + 1); - elapsedTime = "Elapsed time : " + glFrameData.getFrametime() - + "(μs)"; - apiCount = glFrameData.getGLApiDataList().size() + " API(s)"; - errorCount = glFrameData.getErrorCount() + " error(s)"; - - } else if (id.equals(GLPage.listViewID)) { - GLSelectionData gdata = (GLSelectionData) data; - if (!gdata.getSubID().equals(GLPage.listViewSubID)) { - detail = DETAIL_API; - - GridItem[] gridItems = (GridItem[]) data.getData(); - DATableDataFormat tableDataFormat = (DATableDataFormat) gridItems[0] - .getData(); - GLES20LogData logData = (GLES20LogData) tableDataFormat - .getLogData(); - - api = logData.getApiName(); - long error = logData.getErrno(); - if (error == 0) { - state = GLES20ErrorInformation - .getErrorDescription(String.valueOf(error)); - } else { - state = getErrorDescription(api, - GLES20ErrorInformation.getError(error)); - } - } - } else if (id.equals(GLPage.contextViewID)) { - if (data.getData() != null) - detail = DETAIL_CONTEXT; - // TODO - } - - canvas.redraw(); - } - } - - private String getErrorDescription(String apiName, String errorName) { - if (apiName.equals("glDisable")) { - apiName.equals("glEnable"); - } else if (apiName.equals(GLDataMaker.API_GL_DISABLE_VAA)) { - apiName = GLDataMaker.API_GL_ENABLE_VAA; - } else if (apiName.equals("glGetBooleanv") - || apiName.equals("glGetFloatv") - || apiName.equals("glGetIntegerv")) { - apiName = "glGet"; - } else if (apiName.startsWith("glGetTexParameter")) { - apiName = "glGetTexParameter"; - } else if (apiName.startsWith("glGetUniform") && !apiName.endsWith("n")) { - apiName = "glGetUniform"; - } else if (apiName.startsWith("glGetVertexAttrib") - && !apiName.endsWith("rv")) { - apiName = "glGetVertexAttrib"; - } else if (apiName.startsWith("glTexParameter")) { - apiName = "glTexParameter"; - } else if (apiName.startsWith("glUniform")) { - apiName = "glUniform"; - } else if (apiName.startsWith("glVertexAttrib") - && (apiName.endsWith("f") || apiName.endsWith("v"))) { - apiName = "glVertexAttrib"; - } - - String errorDescription = GLES20ErrorInformation - .getErrorDescription(apiName + errorName); - - if (errorDescription == null) { - return errorName; - } else { - return errorDescription; - } - } - - private int writeWithWrap(GC gc, String txt, int x, int y, int width) { - m_txt = txt; - m_length = txt.length(); - m_width = width; - m_position = 0; - m_start = 0; - m_gc = gc; - - int fontHight = gc.textExtent(m_txt.split("\n")[0]).y; - String s; - while (hasMoreLines()) { - s = nextLine().trim(); - gc.drawString(s, x, y); - y += fontHight; - } - return y; - } - - private boolean hasMoreLines() { - return (m_position < (m_length - 1)); - } - - private String nextLine() { - int maxLength = m_txt.length(); - int next = next(); - if (m_start >= maxLength || next > maxLength) { - return ""; - } - - String s = m_txt.substring(m_start, next); - m_start = next; - if ((m_txt.length() - 1 > m_start) - && ((m_txt.charAt(m_start) == '\n') || (m_txt.charAt(m_start) == ' '))) { - m_position++; - m_start++; - } - return s; - } - - private int next() { - int i = getNextWord(m_position); - int lastBreak = -1; - String line; - line = m_txt.substring(m_position, i); - int lineWidth = m_gc.textExtent(line, SWT.DRAW_MNEMONIC).x; - while (i < m_length && lineWidth <= m_width) { - if (m_txt.charAt(i) == ' ') - lastBreak = i; - else if (m_txt.charAt(i) == '\n') { - lastBreak = i; - break; - } - if (++i < m_length) { - i = getNextWord(i); - line = m_txt.substring(m_position, i); - lineWidth = m_gc.textExtent(line, SWT.DRAW_MNEMONIC).x; - } - } - if (i == m_length && lineWidth <= m_width) - m_position = i; - else if (lastBreak == m_position) - m_position++; - else if (lastBreak < m_position) - m_position = i; - else - m_position = lastBreak; - return m_position; - } - - private int getNextWord(int startIndex) { - int space = m_txt.indexOf(' ', startIndex); - int newLine = m_txt.indexOf('\n', startIndex); - if (space == -1) - space = m_length; - if (newLine == -1) - newLine = m_length; - if (space < newLine) - return space; - else - return newLine; - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListTable.java deleted file mode 100644 index 46c73b6..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListTable.java +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.ui.apiList; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.nebula.widgets.grid.GridItem; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.tizen.dynamicanalyzer.common.AnalyzerConstants; -import org.tizen.dynamicanalyzer.common.AnalyzerManager; -import org.tizen.dynamicanalyzer.model.TableInput; -import org.tizen.dynamicanalyzer.nl.GLPageLabels; -import org.tizen.dynamicanalyzer.resources.ColorResources; -import org.tizen.dynamicanalyzer.resources.ImageResources; -import org.tizen.dynamicanalyzer.sql.DBTableInfo; -import org.tizen.dynamicanalyzer.sql.DBTableManager; -import org.tizen.dynamicanalyzer.sql.SqlManager; -import org.tizen.dynamicanalyzer.swap.model.data.LogData; -import org.tizen.dynamicanalyzer.ui.opengl.GLES20ErrorInformation; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLContextDBEnum; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataMaker; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLSelectionData; -import org.tizen.dynamicanalyzer.ui.opengl.data.model.GLAPIData; -import org.tizen.dynamicanalyzer.ui.opengl.data.model.GLFrameData; -import org.tizen.dynamicanalyzer.ui.opengl.ui.GLPage; -import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea; -import org.tizen.dynamicanalyzer.ui.widgets.table.DAApiListTableComposite; -import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; -import org.tizen.dynamicanalyzer.util.DALogger; -import org.tizen.dynamicanalyzer.utils.Formatter; -import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite; - -public class GLAPIListTable extends DAApiListTableComposite { - private static final DALogger DA_LOG = DALogger.getInstance(); - - private static final String EMPTY = ""; - private String[] columnNames = { - GLPageLabels.GL_API_LIST_VIEW_SEQ, - EMPTY, - GLPageLabels.GL_API_LIST_VIEW_TIME, - GLPageLabels.GL_API_LIST_VIEW_NAME, - GLPageLabels.GL_API_LIST_VIEW_PARAMETER, - GLPageLabels.GL_API_LIST_VIEW_ELAPSED_TIME + "(μs)", //$NON-NLS-1$ - GLPageLabels.GL_API_LIST_VIEW_ERROR, - GLPageLabels.GL_API_LIST_VIEW_PID, - GLPageLabels.GL_API_LIST_VIEW_TID }; - - private int[] columnSizes = { 40, 0, 70, 120, 250, 105, 95, 60, 60 }; - private int[] columnAlignment = { SWT.RIGHT, SWT.LEFT, SWT.LEFT, SWT.LEFT, - SWT.LEFT, SWT.RIGHT, SWT.LEFT, SWT.RIGHT, SWT.RIGHT }; - - private int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM, - AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM, - AnalyzerConstants.SORT_TYPE_STRING, - AnalyzerConstants.SORT_TYPE_STRING, - AnalyzerConstants.SORT_TYPE_NUM, - AnalyzerConstants.SORT_TYPE_STRING, - AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM, }; - - private int startFrameIndex = 0; - private int endFrameIndex = -1; - private List selectedTreeInvolvedOrdinalList = null; - private int selectedTreeInvolvedInsideColumnIndex = -1; - private List secondSelectedItemsList = new ArrayList(); - - public GLAPIListTable(Composite parent, int compStyle, int tableStyle) { - super(parent, compStyle, tableStyle); - - setTableName(GLPageLabels.GL_API_LIST_VIEW_TITLE); - setSortTypes(sortTypes); - setColumnAlignment(columnAlignment); - setColumns(columnNames); - setColumnSize(columnSizes); - - table.addSelectionListener(new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent e) { - GridItem[] items = table.getSelection(); - if (items == null) { - return; - } - - DATableDataFormat dataFormat = (DATableDataFormat) items[0] - .getData(); - long time = dataFormat.getLogData().getTime(); - - GLSelectionData selData = new GLSelectionData( - GLPage.listViewID, GLPage.listViewID, time, time, - items, table, startFrameIndex, -1); - AnalyzerManager.getCurrentPage().updateView(selData); - - for (GridItem gridItem : secondSelectedItemsList) { - gridItem.setBackground(ColorResources.TABLE_CONTENTS_NORMAL); - } - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - } - - public void updateTableFromFrameMode(int startFrameIndex) { - if (startFrameIndex >= 0) { - this.startFrameIndex = startFrameIndex; - } - endFrameIndex = -1; - - selectedTreeInvolvedOrdinalList = null; - updateTable(); - table.setSelection(0); - - GridItem[] items = table.getSelection(); - if (items == null) { - return; - } - - DATableDataFormat dataFormat = (DATableDataFormat) items[0].getData(); - long time = dataFormat.getLogData().getTime(); - - GLSelectionData selData = new GLSelectionData(GLPage.listViewID, - GLPage.listViewSubID, time, time, items, table, - startFrameIndex, -1); - AnalyzerManager.getCurrentPage().updateView(selData); - } - - public void updateTableFromTimeMode(int startFrameIndex, int endFrameIndex) { - if (startFrameIndex >= 0) { - this.startFrameIndex = startFrameIndex; - } - this.endFrameIndex = endFrameIndex; - - selectedTreeInvolvedOrdinalList = null; - updateTable(); - table.setSelection(0); - - GridItem[] items = table.getSelection(); - if (items == null || items.length == 0) { - return; - } - - DATableDataFormat dataFormat = (DATableDataFormat) items[0].getData(); - long time = dataFormat.getLogData().getTime(); - - GLSelectionData selData = new GLSelectionData(GLPage.listViewID, - GLPage.listViewSubID, time, time, items, table, - startFrameIndex, -1); - AnalyzerManager.getCurrentPage().updateView(selData); - } - - public void updateTableFromNavi(int frameIndex, String seq, - DAViewComposite view) { - if (endFrameIndex == -1 - || (frameIndex < startFrameIndex || frameIndex > endFrameIndex)) { - startFrameIndex = frameIndex; - endFrameIndex = -1; - - view.setTitle(GLPageLabels.GL_API_LIST_VIEW_TITLE + "(" - + frameIndex + "frame)"); - } - - selectedTreeInvolvedOrdinalList = null; - updateTable(); - - GridItem[] gridItems = table.getItems(); - int selectedItemIndex = -1; - for (int i = 0; i < gridItems.length; i++) { - GridItem gridItem = gridItems[i]; - if (gridItem.getText(0).equals(seq)) { - DATableDataFormat dataFormat = (DATableDataFormat) gridItem - .getData(); - long time = dataFormat.getLogData().getTime(); - - GLSelectionData selData = new GLSelectionData( - GLPage.listViewID, GLPage.listViewID, time, time, - new GridItem[] { gridItem }, table, frameIndex, -1); - AnalyzerManager.getCurrentPage().updateView(selData); - table.getVerticalBar().setSelection(i); - selectedItemIndex = i; - - break; - } - } - - updateTable(); - if (selectedItemIndex != -1) { - table.setSelection(new GridItem[] { table - .getItem(selectedItemIndex) }); - } - } - - public void updateTableFromContextView(List treeOrdinalList, - int insideColumnIndex) { - this.selectedTreeInvolvedOrdinalList = treeOrdinalList; - this.selectedTreeInvolvedInsideColumnIndex = insideColumnIndex; - updateTable(); - } - - @Override - protected List makeTableInput() { - if (startFrameIndex < 0) { - return null; - } - - Map involvedMap = null; - Map insideColumnMap = null; - List> involvedInfoList = null; - if (selectedTreeInvolvedOrdinalList != null) { - DBTableManager dbManager = DBTableManager.getInstance(); - DBTableInfo tableInfo = dbManager - .getTableInfo(DBTableManager.TABLE_INDEX_GLES20_CONTEXT_DATA); - String[] colmunNames = { "Seq", - GLContextDBEnum.INVOLVED_ORDINAL.getcolumnName(), - GLContextDBEnum.INVOLVED_INDEX1.getcolumnName(), - GLContextDBEnum.FRAME_INDEX.getcolumnName() }; - String whereQuery; - if (endFrameIndex == -1) { - whereQuery = "where " - + GLContextDBEnum.FRAME_INDEX.getcolumnName() + " = " - + startFrameIndex; - } else { - whereQuery = "where " - + GLContextDBEnum.FRAME_INDEX.getcolumnName() - + " between " + startFrameIndex + " and " - + (endFrameIndex - 1); - } - involvedInfoList = SqlManager.getInstance().selectQuery(null, - colmunNames, tableInfo.getTableName(), whereQuery); - } - - if (involvedInfoList != null) { - involvedMap = makeInvolveMap(involvedInfoList); - insideColumnMap = makeInsideColumnIndexMap(involvedInfoList); - } - - List inputList = new ArrayList(); - if (endFrameIndex == -1) { - // TODO - table.getColumn(1).setWidth(0); - table.getColumn(1).setText(EMPTY); - makeInputList(inputList, involvedMap, insideColumnMap, - startFrameIndex); - } else { - table.getColumn(1).setWidth(45); - table.getColumn(1).setText(GLPageLabels.GL_API_LIST_VIEW_FRAME); - for (int index = startFrameIndex; index < endFrameIndex; index++) { - makeInputList(inputList, involvedMap, insideColumnMap, index); - } - } - - return inputList; - } - - private void makeInputList(List inputList, - Map involvedMap, - Map insideColumnMap, int frameIndex) { - GLFrameData glFrameData = GLDataMaker.getInstance().getFrameData( - frameIndex); - List glAPIDataList = glFrameData.getGLApiDataList(); - for (int i = 0; i < glAPIDataList.size(); i++) { - GLAPIData glAPIData = glAPIDataList.get(i); - int selectedPid = ToolbarArea.getInstance().getSelectedPid(); - if (selectedPid != 0 && selectedPid != glAPIData.getPID()) { - continue; - } - - List texts = new ArrayList(); - DATableDataFormat tableData = new DATableDataFormat( - glAPIData.getTime()); - tableData.setLogData(glAPIData.getLogData()); - - String seq = String.valueOf(glAPIData.getSeq()); - texts.add(seq); - texts.add(Integer.toString(frameIndex)); - texts.add(String.valueOf(Formatter.toTimeFormat(glAPIData.getTime()))); - texts.add(glAPIData.getName()); - texts.add(glAPIData.getParameter()); - texts.add(String.valueOf(glAPIData.getElapsedTime())); - texts.add(GLES20ErrorInformation.getError(glAPIData.getErrorNo())); - texts.add(String.valueOf(glAPIData.getPID())); - texts.add(String.valueOf(glAPIData.getTID())); - texts.add(glAPIData.getParameter()); - - tableData.getData().addAll(texts); - - TableInput tableInput = new TableInput(); - tableInput.setText(texts); - tableInput.setData(tableData); - if (glAPIData.getErrorNo() != 0) { - tableInput.setFailed(true); - } - - inputList.add(tableInput); - - if (involvedMap != null) { - Boolean isInvolved = involvedMap.get(seq); - if (isInvolved != null) { - if (isInvolved) { - int insideColumnIndex = insideColumnMap.get(seq); - if (selectedTreeInvolvedInsideColumnIndex == -1) { - tableInput.setSecondSelection(true); - } else if (selectedTreeInvolvedInsideColumnIndex == insideColumnIndex) { - tableInput.setSecondSelection(true); - } else { - tableInput.setSecondSelection(false); - } - } else { - tableInput.setSecondSelection(false); - } - } else { - tableInput.setSecondSelection(false); - } - } else { - tableInput.setSecondSelection(false); - } - } - } - - private Map makeInvolveMap( - List> involvedInfoList) { - Map map = new HashMap(); - - for (List involvedInfo : involvedInfoList) { - List involvedOrdinalList = Arrays.asList(involvedInfo - .get(1).split(GLDataMaker.DELIMITER)); - - for (int selectedTreeOrdinal : selectedTreeInvolvedOrdinalList) { - map.put(involvedInfo.get(0), false); - if (involvedOrdinalList.contains(String - .valueOf(selectedTreeOrdinal))) { - map.put(involvedInfo.get(0), true); - break; - } - } - } - - return map; - } - - private Map makeInsideColumnIndexMap( - List> involvedInfoList) { - Map map = new HashMap(); - - for (List involvedInfo : involvedInfoList) { - String seq = involvedInfo.get(0); - try { - int insideColumnIndex = Integer.parseInt(involvedInfo.get(2)); - map.put(seq, insideColumnIndex); - } catch (NumberFormatException e) { - DA_LOG.debug("init log"); - } - } - - return map; - } - - @Override - public void updateTable() { - secondSelectedItemsList.clear(); - - GridItem[] selections = table.getSelection(); - List selSeqs = new ArrayList(); - for (int i = 0; i < selections.length; i++) { - DATableDataFormat tableData = (DATableDataFormat) selections[i] - .getData(); - LogData logData = tableData.getLogData(); - selSeqs.add(Integer.toString(logData.getSeq())); - } - table.removeAll(); - - List input = makeTableInput(); - if (null == input) { - return; - } - if (null != comparator) { - Collections.sort(input, comparator); - } - int[] sels = new int[selSeqs.size()]; - int iii = 0; - int focusIndex = -1; - int size = input.size(); - for (int i = 0; i < size; i++) { - GridItem gridItem = new GridItem(table, SWT.NONE); - DATableDataFormat gridData = (DATableDataFormat) input.get(i) - .getData(); - gridItem.setData(gridData); - - List text = input.get(i).getText(); - List images = input.get(i).getImages(); - int columnCount = text.size(); - for (int index = 0; index < columnCount; index++) { - if (text.get(index) == null) { - continue; - } - - gridItem.setText(index, text.get(index)); - - if (null != images && !images.isEmpty()) { - gridItem.setImage(index, images.get(index)); - } - } - - if (input.get(i).isInRange() && input.get(i).isSecondSelection()) { - gridItem.setBackground(intersectColor); - } else if (input.get(i).isSecondSelection()) { - gridItem.setBackground(secondSelectionColor); - secondSelectedItemsList.add(gridItem); - } else if (input.get(i).isInRange()) { - gridItem.setBackground(rangeColor); - } - - if (input.get(i).isFailed()) { - gridItem.setBackground(ColorResources.TABLE_CONTENTS_FAILED_BACGOUND_COLOR); - gridItem.setForeground(ColorResources.TABLE_CONTENTS_FAILED_FONT_COLOR); - gridItem.setImage(0, ImageResources.FAILED_API_ICON_TABLE); - } - - if (gridData != null) { - long seqNum = gridData.getSelectionKey(); - for (int ii = 0; ii < selSeqs.size(); ii++) { - if (seqNum == Long.parseLong(selSeqs.get(ii))) { - sels[iii++] = i; - selSeqs.remove(ii); - } - } - if (seqNum == focusSeq) { - focusIndex = i; - } - } - } - - if (table.isFocusControl() && focusIndex > 0) { - table.setFocusItem(table.getItem(focusIndex)); - } - table.update(); - } - - @Override - public void clear() { - super.clear(); - startFrameIndex = 0; - endFrameIndex = -1; - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListView.java deleted file mode 100644 index 46ac143..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListView.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.ui.apiList; - -import org.eclipse.nebula.widgets.grid.GridItem; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.tizen.dynamicanalyzer.common.DASelectionData; -import org.tizen.dynamicanalyzer.nl.GLPageLabels; -import org.tizen.dynamicanalyzer.resources.ColorResources; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLContextTreeNodeData; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLSelectionData; -import org.tizen.dynamicanalyzer.ui.opengl.ui.GLPage; -import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite; -import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData; - -public class GLAPIListView extends DAViewComposite { - private boolean updateTable = true; - - GLAPIListTable glAPIListTable; - - public GLAPIListView(Composite parent, int style) { - super(parent, style, true); - setLayout(new FillLayout()); - - setTitle(GLPageLabels.GL_API_LIST_VIEW_TITLE); - - Composite contents = getContentArea(); - contents.setBackground(ColorResources.WINDOW_BG_COLOR); - contents.setLayout(new FillLayout()); - - glAPIListTable = new GLAPIListTable(contents, SWT.NONE, SWT.SINGLE - | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); - } - - @Override - public void updateView() { - if (updateTable) { - glAPIListTable.updateTable(); - - updateTable = false; - } - } - - @Override - public void updateView(DAViewData vdata) { - if (vdata instanceof DASelectionData) { - DASelectionData data = (DASelectionData) vdata; - - String id = data.getViewID(); - if (id.equals(GLPage.chartViewID)) { - if (data instanceof GLSelectionData) { - int endFrameIndex = ((GLSelectionData) data) - .getSecondFrameIndex(); - int frameIndex = ((GLSelectionData) data).getFrameIndex(); - if (endFrameIndex == -1) { // frame mode - String title = GLPageLabels.GL_API_LIST_VIEW_TITLE - + "(" + frameIndex + "frame)"; - setTitle(title); - glAPIListTable.updateTableFromFrameMode(frameIndex); - } else { // time mode - String title = GLPageLabels.GL_API_LIST_VIEW_TITLE - + "(" + frameIndex + "-" + (endFrameIndex - 1) - + "frame)"; - setTitle(title); - glAPIListTable.updateTableFromTimeMode(frameIndex, - endFrameIndex); - } - } - } else if (id.equals(GLPage.contextViewID)) { - Object odata = data.getData(); - if (odata == null) { - int frameIndex = ((GLSelectionData) data).getFrameIndex(); - String seq = ((GLSelectionData) data).getSeq(); - - glAPIListTable.updateTableFromNavi(frameIndex, seq, this); - } else { - GridItem gridItem = (GridItem) odata; - GLContextTreeNodeData nodeData = (GLContextTreeNodeData) gridItem - .getData(); - glAPIListTable.updateTableFromContextView( - nodeData.getInvolvedDBColumnIndexList(), - nodeData.getInsideColumnIndex1()); - } - } - } - - // other view selection occurred - glAPIListTable.deselectAll(); - } - - @Override - public void clear() { - setTitle(GLPageLabels.GL_API_LIST_VIEW_TITLE); - glAPIListTable.clear(); - updateTable = true; - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLChartView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLChartView.java deleted file mode 100644 index 391b3a0..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLChartView.java +++ /dev/null @@ -1,382 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.ui.chart; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.StackLayout; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.tizen.dynamicanalyzer.common.DASelectionData; -import org.tizen.dynamicanalyzer.nl.GLPageLabels; -import org.tizen.dynamicanalyzer.nl.ThreadPageLabels; -import org.tizen.dynamicanalyzer.resources.ColorResources; -import org.tizen.dynamicanalyzer.resources.FontResources; -import org.tizen.dynamicanalyzer.resources.ImageResources; -import org.tizen.dynamicanalyzer.ui.common.SetRangeMarkerMouseMoveListener; -import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter; -import org.tizen.dynamicanalyzer.ui.common.UICommonConstants; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataMaker; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLSelectionData; -import org.tizen.dynamicanalyzer.ui.opengl.eventListner.BoundLineEventListener; -import org.tizen.dynamicanalyzer.ui.opengl.eventListner.GLFrameChartMouseEventListener; -import org.tizen.dynamicanalyzer.ui.opengl.eventListner.GLTimeChartMouseEventListener; -import org.tizen.dynamicanalyzer.ui.opengl.ui.GLPage; -import org.tizen.dynamicanalyzer.ui.range.RangeDataManager; -import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants; -import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser; -import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea; -import org.tizen.dynamicanalyzer.ui.widgets.TitleComboPopupRenderer; -import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer; -import org.tizen.dynamicanalyzer.widgets.chart.DAChart; -import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot; -import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker; -import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard; -import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem; -import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo; -import org.tizen.dynamicanalyzer.widgets.combo.DACustomComboSelectionListener; -import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite; -import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData; -import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline; - -public class GLChartView extends DAViewComposite { - private static final int COMBO_HEIGHT = 24; - - private final RangeDataManager rangeDataManager = RangeDataManager - .getInstance(); - private final Composite contents; - private DAChartBoard frameChartBoard; - private DAChartBoard timeChartBoard; - private DACustomCombo frameCombo; - private DACustomCombo timeCombo; - private final StackLayout stackLayout; - private GLDataMaker glDataMaker = GLDataMaker.getInstance(); - - public GLChartView(Composite parent, int style) { - super(parent, style, false); - setLayout(new FillLayout()); - - setTitle(ThreadPageLabels.THREAD_CHART_TITLE); - - contents = getContentArea(); - contents.setBackground(ColorResources.WINDOW_BG_COLOR); - - stackLayout = new StackLayout(); - contents.setLayout(stackLayout); - - frameChartBoard = new DAChartBoard(contents, - GLPageLabels.GL_CHART_TITLE_FRAME_TIME, - DAChartBoard.BOARD_STYLE_FRAME); - frameChartBoard.setNameFont(FontResources.CHART_NAME_FONT); - - timeChartBoard = new DAChartBoard(contents, - GLPageLabels.GL_CHART_TITLE_FRAME_RATE, - DAChartBoard.BOARD_STYLE_TIME); - timeChartBoard.setNameFont(FontResources.CHART_NAME_FONT); - - stackLayout.topControl = frameChartBoard; - - frameCombo = new DACustomCombo(frameChartBoard.getTitleComp(), SWT.NONE); - frameCombo.setImages(ImageResources.TIMELINE_DROPDOWN_NORMAL, - ImageResources.TIMELINE_DROPDOWN_HOVER, - ImageResources.TIMELINE_DROPDOWN_PUSH, - ImageResources.TIMELINE_DROPDOWN_NORMAL); - frameCombo.add(GLPageLabels.GL_CHART_TITLE_FRAME_TIME); - frameCombo.add(GLPageLabels.GL_CHART_TITLE_FRAME_RATE); - frameCombo.setTextAlign(DACustomCombo.TEXT_ALIGN_CENTER); - frameCombo.select(0); - frameCombo.setComboButtonGradation( - ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_START, - ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_END, - ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_START, - ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_END, - ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_START, - ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_END, - ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_START, - ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_END); - frameCombo.setButtonImages(ImageResources.COMBO_DROPDOWN_UP, - ImageResources.COMBO_DROPDOWN_DOWN); - frameCombo.setEnabled(true); - frameCombo.setItemHeight(COMBO_HEIGHT); - frameCombo.setComboRender(new GLTitleComboRenderer()); - frameCombo.setComboPopupRender(new TitleComboPopupRenderer()); - frameCombo.setButtonRenderer(new DACustomButtonRenderer()); - frameCombo.addSelectionListener(new DACustomComboSelectionListener() { - @Override - public void selectionEvent(DACustomCombo combo) { - String selected = combo.getText(); - if (null == selected || selected.isEmpty()) { - return; - } - if (selected.equals(GLPageLabels.GL_CHART_TITLE_FRAME_RATE)) { - changeComboFrameToTime(); - } else { - return; - } - } - }); - - timeCombo = new DACustomCombo(timeChartBoard.getTitleComp(), SWT.NONE); - - timeCombo.setImages(ImageResources.TIMELINE_DROPDOWN_NORMAL, - ImageResources.TIMELINE_DROPDOWN_HOVER, - ImageResources.TIMELINE_DROPDOWN_PUSH, - ImageResources.TIMELINE_DROPDOWN_NORMAL); - timeCombo.add(GLPageLabels.GL_CHART_TITLE_FRAME_TIME); - timeCombo.add(GLPageLabels.GL_CHART_TITLE_FRAME_RATE); - timeCombo.setTextAlign(DACustomCombo.TEXT_ALIGN_CENTER); - timeCombo.select(1); - timeCombo.setComboButtonGradation( - ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_START, - ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_END, - ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_START, - ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_END, - ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_START, - ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_END, - ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_START, - ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_END); - timeCombo.setButtonImages(ImageResources.COMBO_DROPDOWN_UP, - ImageResources.COMBO_DROPDOWN_DOWN); - timeCombo.setEnabled(true); - timeCombo.setItemHeight(COMBO_HEIGHT); - timeCombo.setComboRender(new GLTitleComboRenderer()); - timeCombo.setComboPopupRender(new TitleComboPopupRenderer()); - timeCombo.setButtonRenderer(new DACustomButtonRenderer()); - timeCombo.addSelectionListener(new DACustomComboSelectionListener() { - @Override - public void selectionEvent(DACustomCombo combo) { - String selected = combo.getText(); - if (null == selected || selected.isEmpty()) { - return; - } - if (selected.equals(GLPageLabels.GL_CHART_TITLE_FRAME_TIME)) { - changeComboTimeToFrame(); - } else { - return; - } - } - }); - - frameChartBoard.setSelectable(false); - timeChartBoard.setSelectable(false); - - initializeCharts(); - - DATimeline frameTimeline = frameChartBoard.getTimeline(); - DATimeline timeTimeline = timeChartBoard.getTimeline(); - - frameTimeline.setTimeTickFont(FontResources.TIMELINE_TICK_FONT); - frameTimeline.setTimeBalloonFont(FontResources.TIMELINE_BALLOON_FONT); - frameTimeline.addMouseMoveListener(new SetRangeMarkerMouseMoveListener( - rangeDataManager, frameChartBoard, frameTimeline)); - timeTimeline.setTimeTickFont(FontResources.TIMELINE_TICK_FONT); - timeTimeline.setTimeBalloonFont(FontResources.TIMELINE_BALLOON_FONT); - - LifecycleLogParser.getInstance().registerLifecycleBar( - timeChartBoard.getLifecycleBar()); - LifecycleLogParser.getInstance().registerTimeline(timeTimeline); - - frameTimeline.addMouseMoveListener(new SetRangeMarkerMouseMoveListener( - rangeDataManager, frameChartBoard, frameTimeline)); - timeTimeline.addMouseMoveListener(new SetRangeMarkerMouseMoveListener( - rangeDataManager, timeChartBoard, timeTimeline)); - } - - private void changeComboFrameToTime() { - stackLayout.topControl = timeChartBoard; - contents.layout(); - timeCombo.setText(GLPageLabels.GL_CHART_TITLE_FRAME_RATE); - timeChartBoard.setScaleVal(frameChartBoard.getScaleVal()); - timeChartBoard.setVisibleStart(frameChartBoard.getVisibleStart()); - timeChartBoard.setItemsHeightMode(frameChartBoard.isItemMinimized()); - updateView(); - } - - private void changeComboTimeToFrame() { - stackLayout.topControl = frameChartBoard; - contents.layout(); - frameCombo.setText(GLPageLabels.GL_CHART_TITLE_FRAME_TIME); - frameChartBoard.setScaleVal(timeChartBoard.getScaleVal()); - frameChartBoard.setVisibleStart(timeChartBoard.getVisibleStart()); - frameChartBoard.setItemsHeightMode(timeChartBoard.isItemMinimized()); - updateView(); - } - - @Override - public void updateView() { - frameChartBoard.setTotalEndTime(glDataMaker.getFrameSize() - * TimelineConstants.MEGA_LONG); - timeChartBoard.setTotalEndTime(ToolbarArea.getInstance().getTime()); - - frameChartBoard.setTimelineMarkerStartTime(rangeDataManager - .getMarkerStartTime() / TimelineConstants.MEGA_DOUBLE); - frameChartBoard.setTimelineMarkerEndTime(rangeDataManager - .getMarkerEndTime() / TimelineConstants.MEGA_DOUBLE); - timeChartBoard.setTimelineMarkerStartTime(rangeDataManager - .getMarkerStartTime() / TimelineConstants.MEGA_DOUBLE); - timeChartBoard.setTimelineMarkerEndTime(rangeDataManager - .getMarkerEndTime() / TimelineConstants.MEGA_DOUBLE); - - if (RangeDataManager.getInstance().isBeingAnalyzed()) { - ((DAChartPlotIntervalMarker) frameChartBoard.getMarkers().get( - UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX)) - .setInterval(rangeDataManager.getAnalysisStartTime() - / TimelineConstants.MEGA_DOUBLE, - rangeDataManager.getAnalysisEndTime() - / TimelineConstants.MEGA_DOUBLE); - - ((DAChartPlotIntervalMarker) timeChartBoard.getMarkers().get( - UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX)) - .setInterval(rangeDataManager.getAnalysisStartTime() - / TimelineConstants.MEGA_DOUBLE, - rangeDataManager.getAnalysisEndTime() - / TimelineConstants.MEGA_DOUBLE); - } else { - ((DAChartPlotIntervalMarker) frameChartBoard.getMarkers().get( - UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX)) - .setInterval(-1, -1); - } - - ((DAChartPlotIntervalMarker) frameChartBoard.getMarkers().get( - UICommonConstants.RANGE_MARKER_INDEX)).setInterval( - rangeDataManager.getMarkerStartTime() - / TimelineConstants.MEGA_DOUBLE, - rangeDataManager.getMarkerEndTime() - / TimelineConstants.MEGA_DOUBLE); - } - - @Override - public void updateView(DAViewData vdata) { - if (vdata instanceof DASelectionData) { - DASelectionData data = (DASelectionData) vdata; - - String id = data.getViewID(); - if (id.equals(GLPage.listViewID)) { - String subID = ((GLSelectionData) data).getSubID(); - if (!subID.equals(GLPage.listViewSubID)) { - int frameIndex = ((GLSelectionData) data).getFrameIndex(); - - frameChartBoard.setVisibleMiddleTime(frameIndex); - DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) frameChartBoard - .getMarkers().get( - UICommonConstants.SELECTION_MARKER_INDEX); - intervalMarker.setInterval(frameIndex, frameIndex); - - long start = data.getStartTime(); - long end = data.getEndTime(); - Double startTime = start / TimelineConstants.MEGA_DOUBLE; - Double endTime = end / TimelineConstants.MEGA_DOUBLE; - double middleTime = (startTime + endTime) / 2.0; - if (startTime.equals(endTime)) { - middleTime = startTime; - } - - timeChartBoard.setVisibleMiddleTime(middleTime); - intervalMarker = (DAChartPlotIntervalMarker) timeChartBoard - .getMarkers().get( - UICommonConstants.SELECTION_MARKER_INDEX); - intervalMarker.setInterval(startTime, endTime); - } - } - } - } - - @Override - public void clear() { - frameChartBoard.contentsClear(); - frameChartBoard.clear(); - timeChartBoard.contentsClear(); - timeChartBoard.clear(); - initializeCharts(); - } - - private void initializeCharts() { - initIntervalMarkers(frameChartBoard); - - GLFrameTimeChart frameTimeChart = GLFrameTimeChart.getInstance(); - DAChartBoardItem frameTimeChartItem = frameTimeChart - .createBoardItem(frameChartBoard); - DAChart frameTimeChartWidget = frameTimeChartItem.getChart(); - - GLFrameChartMouseEventListener glFrameChartMouseEventListener = new GLFrameChartMouseEventListener( - frameTimeChart.getPopupMenu(), frameChartBoard.getTimeline()); - - frameTimeChartWidget.getPlot().setMarkers(frameChartBoard.getMarkers()); - frameTimeChartWidget.addMouseListener(glFrameChartMouseEventListener); - frameTimeChartWidget - .addMouseMoveListener(glFrameChartMouseEventListener); - frameTimeChartWidget - .addMouseTrackListener(new TimelineChartMouseTrackAdapter( - frameChartBoard.getTimeline())); - - BoundLineEventListener upperBoundLineEventListener = new BoundLineEventListener( - frameTimeChartWidget, DAChartPlot.BoundType.UPPER); - frameTimeChartWidget.addMouseListener(upperBoundLineEventListener); - frameTimeChartWidget.addMouseMoveListener(upperBoundLineEventListener); - frameTimeChartWidget.addMouseTrackListener(upperBoundLineEventListener); - - initIntervalMarkers(timeChartBoard); - - GLFrameRateChart frameRateChart = GLFrameRateChart.getInstance(); - DAChartBoardItem frameRateChartItem = frameRateChart - .createBoardItem(timeChartBoard); - DAChart frameRateChartWidget = frameRateChartItem.getChart(); - - GLTimeChartMouseEventListener glTimeChartMouseEventListener = new GLTimeChartMouseEventListener( - frameRateChart.getPopupMenu(), timeChartBoard.getTimeline()); - - frameRateChartWidget.getPlot().setMarkers(timeChartBoard.getMarkers()); - frameRateChartWidget.addMouseListener(glTimeChartMouseEventListener); - frameRateChartWidget - .addMouseMoveListener(glTimeChartMouseEventListener); - frameRateChartWidget - .addMouseTrackListener(new TimelineChartMouseTrackAdapter( - timeChartBoard.getTimeline())); - } - - private void initIntervalMarkers(DAChartBoard board) { - // selection marker - DAChartPlotIntervalMarker selectionMarker = new DAChartPlotIntervalMarker( - -1, -1, DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_AREA); - selectionMarker.setBackgroundColor(ColorResources.SELECTION_RANGE); - selectionMarker.setAlpha((int) (255 * 0.25)); - board.addIntervalMarker(selectionMarker); - - // range analysis marker - DAChartPlotIntervalMarker rangeAnalyzeMarker = new DAChartPlotIntervalMarker( - -1, -1, DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_AREA); - rangeAnalyzeMarker.setBackgroundColor(ColorResources.YELLOW); - rangeAnalyzeMarker.setAlpha((int) (255 * 0.25)); - board.addIntervalMarker(rangeAnalyzeMarker); - - // range marker - DAChartPlotIntervalMarker rangeMarker = new DAChartPlotIntervalMarker( - -1, -1, DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_LINE); - rangeMarker.setForegroundColor(ColorResources.RED); - rangeMarker.setAlpha((int) (255 * 0.25)); - board.addIntervalMarker(rangeMarker); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLFPSChart.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLFPSChart.java deleted file mode 100644 index 18483bd..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLFPSChart.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.ui.chart; - -import org.tizen.dynamicanalyzer.resources.ColorResources; -import org.tizen.dynamicanalyzer.resources.ImageResources; -import org.tizen.dynamicanalyzer.swap.logparser.LogPackage; -import org.tizen.dynamicanalyzer.ui.timeline.chart.TimelineChart; -import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot; -import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType; -import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries; -import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem; -import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard; -import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem; -import org.tizen.dynamicanalyzer.widgets.helper.Formatter; - -public class GLFPSChart extends TimelineChart { - private static GLFPSChart instance = null; - private static final String FPS = "fps"; - - private DAChartSeries fpsSeries; - - public static GLFPSChart getInstance() { - if (instance == null) { - instance = new GLFPSChart(); - } - - return instance; - } - - private GLFPSChart() { - chartName = "FPS"; - chartIcon = ImageResources.CHART_FPS; - fpsSeries = new DAChartSeries(chartName, - DAChartSeries.SERIES_STYLE_BAR, - ColorResources.SERIES_COLOR_CPU_APP); - } - - @Override - public DAChartBoardItem createBoardItem(DAChartBoard chartBoard) { - DAChartBoardItem item = super.createBoardItem(chartBoard); - - chart.addSeries(fpsSeries); - - chart.getPlot().setSeriesHeightRange(true); - chart.getPlot().setAutoHeightRange(AutoRangeType.AUTO); - chart.getPlot().setAxisUnit(FPS); - chart.getPlot().setAxisUnitType(DAChartPlot.UnitType.GL_FPS); - chart.getPlot().setShowAxis(true); - - return item; - } - - public void addData(final int frameNumber, long elapsedTime, - boolean drawError) { - double fps = Math.round(1000.0 / elapsedTime); - if (drawError) { - fpsSeries.addSeriesItem(new DAChartSeriesItem( - frameNumber, fps, ColorResources.RED, - fps + FPS + "(" - + Formatter - .convertDecimalPrefix(elapsedTime) - + "ms)")); - } else { - fpsSeries.addSeriesItem(new DAChartSeriesItem(frameNumber, fps, fps - + FPS + "(" - + Formatter.convertDecimalPrefix(elapsedTime) - + "ms)")); - } - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLFrameRateChart.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLFrameRateChart.java deleted file mode 100644 index ffa3c8f..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLFrameRateChart.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.ui.chart; - -import java.util.List; - -import org.tizen.dynamicanalyzer.resources.ColorResources; -import org.tizen.dynamicanalyzer.resources.ImageResources; -import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants; -import org.tizen.dynamicanalyzer.swap.logparser.LogPackage; -import org.tizen.dynamicanalyzer.swap.logparser.Logs; -import org.tizen.dynamicanalyzer.swap.model.data.LogData; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataMaker; -import org.tizen.dynamicanalyzer.ui.timeline.chart.TimelineChart; -import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants; -import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot; -import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType; -import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries; -import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem; -import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard; -import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem; - -public class GLFrameRateChart extends TimelineChart { - private static GLFrameRateChart instance = null; - private static final String FRAMES = "frames"; - - private DAChartSeries framerateSeries; - private GLDataMaker glDataMaker; - - public static GLFrameRateChart getInstance() { - if (instance == null) { - instance = new GLFrameRateChart(); - } - - return instance; - } - - private GLFrameRateChart() { - chartName = "Frame rate"; - chartIcon = ImageResources.CHART_FRAME_RATE; - framerateSeries = new DAChartSeries(chartName, - DAChartSeries.SERIES_STYLE_BAR, - ColorResources.SERIES_COLOR_CPU_APP); - glDataMaker = GLDataMaker.getInstance(); - } - - @Override - public DAChartBoardItem createBoardItem(DAChartBoard chartBoard) { - DAChartBoardItem item = super.createBoardItem(chartBoard); - - chart.addSeries(framerateSeries); - - chart.getPlot().setSeriesHeightRange(true); - chart.getPlot().setAutoHeightRange(AutoRangeType.AUTO); - chart.getPlot().setAxisUnit(FRAMES); - chart.getPlot().setAxisUnitType(DAChartPlot.UnitType.DECIMAL); - chart.getPlot().setShowAxis(true); - - return item; - } - - public void parseLogPackage(LogPackage logPack) { - Logs logs = logPack.getLogs(DataChannelConstants.MSG_DATA_SYSTEM); - if (logs == null) { - return; - } - - List logDataList = logs.getRawLogs(); - for (LogData logData : logDataList) { - int index = (int) (logData.getTime() / TimelineConstants.MEGA_LONG); - int size = glDataMaker.getFrameCountInfoListSize(); - if (index != 0 && size > index - 1) { - int frameCount = glDataMaker.getFrameCountInfo(index - 1) - .getFrameCount(); - framerateSeries.addSeriesItem(new DAChartSeriesItem(index - 1, - frameCount, frameCount + FRAMES)); - } - } - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/context/GLContextTreeTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/context/GLContextTreeTable.java deleted file mode 100644 index 353e565..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/context/GLContextTreeTable.java +++ /dev/null @@ -1,1526 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.ui.context; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.nebula.widgets.grid.GridEditor; -import org.eclipse.nebula.widgets.grid.GridItem; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.MouseMoveListener; -import org.eclipse.swt.events.MouseTrackListener; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.FormAttachment; -import org.eclipse.swt.layout.FormData; -import org.eclipse.swt.layout.FormLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; -import org.tizen.dynamicanalyzer.common.AnalyzerConstants; -import org.tizen.dynamicanalyzer.common.AnalyzerManager; -import org.tizen.dynamicanalyzer.common.DASelectionData; -import org.tizen.dynamicanalyzer.listeners.TableTooltipListener; -import org.tizen.dynamicanalyzer.model.TreeInput; -import org.tizen.dynamicanalyzer.nl.GLPageLabels; -import org.tizen.dynamicanalyzer.resources.ColorResources; -import org.tizen.dynamicanalyzer.sql.DBTableInfo; -import org.tizen.dynamicanalyzer.sql.DBTableManager; -import org.tizen.dynamicanalyzer.sql.SqlManager; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLContextDBEnum; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLContextTreeNodeData; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataMaker; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLSelectionData; -import org.tizen.dynamicanalyzer.ui.opengl.ui.GLPage; -import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; -import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite; - -public class GLContextTreeTable extends DATreeComposite { - private enum ButtonType { - LEFTLEFT, LEFT, RIGHT, RIGHTRIGHT - } - - private static final int BASE_TREE_SELECTION_SEQ = 0; - private static final int GVA_TREE_SELECTION_SEQ = 100; - private static final int TEXTURE_UNIT_TREE_SELECTION_SEQ = 500; - private static final int TEXTURE_OBJ_TREE_SELECTION_SEQ = 600; - private static final int SHADER_OBJ_TREE_SELECTION_SEQ = 1000; - private static final int PROGRMA_OBJ_TREE_SELECTION_SEQ = 2000; - private static GLContextTreeTable instance = null; - - private static final int COLUMN_SIZE_NAME = 200; - private static final int COLUMN_SIZE_VALUE = 200; - private static final int COLUMN_SIZE_DIFF = 100; - - private String[] columnNames = { GLPageLabels.GL_CONTEXT_VIEW_NAME, - GLPageLabels.GL_CONTEXT_VIEW_VALUE, - GLPageLabels.GL_CONTEXT_VIEW_NAVI }; - private int[] columnSizes = { COLUMN_SIZE_NAME, COLUMN_SIZE_VALUE, - COLUMN_SIZE_DIFF }; - private int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NONE, - AnalyzerConstants.SORT_TYPE_NONE, AnalyzerConstants.SORT_TYPE_NONE }; - - private String seq; - private boolean makeTreeInput; - private List contextValueList; - private List contextTree; - private TreeInput nodeGVAs; - private TreeInput nodeGVAArrays; - private TreeInput nodeTextureUnits; - private TreeInput nodeTextureObject; - private TreeInput nodeProgramObject; - private TreeInput nodeShaderObject; - - private GridItem gridItem2; - private Composite naviButtonLeftComposite; - private Composite naviButtonRightComposite; - private Button buttonLeftLeft; - private Button buttonLeft; - private Button buttonRight; - private Button buttonRightRight; - - private GLDataMaker glDataMaker = GLDataMaker.getInstance(); - - public static GLContextTreeTable getInstance(Composite parent, - int compStyle, int tableStyle) { - if (instance == null) { - instance = new GLContextTreeTable(parent, compStyle, tableStyle); - } - - return instance; - } - - public static GLContextTreeTable getInstance() { - return instance; - } - - private GLContextTreeTable(Composite parent, int compStyle, int tableStyle) { - super(parent, compStyle, tableStyle); - setTree(true); - setSortTypes(sortTypes); - setColumns(columnNames); - setColumnSize(columnSizes); - - - table.addListener(SWT.Expand, new Listener() { - @Override - public void handleEvent(Event event) { - GridItem item = (GridItem) event.item; - setExpand(item, true); - } - }); - - table.addListener(SWT.Collapse, new Listener() { - @Override - public void handleEvent(Event event) { - GridItem item = (GridItem) event.item; - setExpand(item, false); - } - }); - - table.addSelectionListener(new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent e) { - int selectionIndex = table.getSelectionIndex(); - - GridItem[] items = table.getSelection(); - if (items == null || items.length <= 0) { - return; - } - DASelectionData selData = new DASelectionData(GLPage.contextViewID, - 0, 0, items[0], table); - AnalyzerManager.getCurrentPage().updateView(selData); - - for (TreeInput treeInput : contextTree) { - clearSecondSelection(treeInput); - } - makeTreeInput = false; - updateTree(); - table.setSelection(selectionIndex); - - if (naviButtonLeftComposite != null - && !naviButtonLeftComposite.isDisposed()) { - naviButtonLeftComposite - .setBackground(ColorResources.TABLE_CONTENTS_SELECTED_END); - } - - if (naviButtonRightComposite != null - && !naviButtonRightComposite.isDisposed()) { - naviButtonRightComposite - .setBackground(ColorResources.TABLE_CONTENTS_SELECTED_END); - } - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - - table.addMouseListener(new MouseListener() { - @Override - public void mouseUp(MouseEvent e) { - } - - @Override - public void mouseDown(MouseEvent e) { - } - - @Override - public void mouseDoubleClick(MouseEvent e) { - GridItem[] items = (GridItem[]) table.getSelection(); - if (null == items || items.length == 0) { - return; - } - GridItem item = items[0]; - if (item.isExpanded()) { - setExpand(item, false); - } else { - setExpand(item, true); - } - updateTree(); - } - }); - - table.addMouseTrackListener(new MouseTrackListener() { - @Override - public void mouseHover(MouseEvent e) { - } - - @Override - public void mouseExit(MouseEvent e) { - // TODO dispose -// disposeButtons(); - } - - @Override - public void mouseEnter(MouseEvent e) { - } - }); - - table.addMouseMoveListener(new MouseMoveListener() { - @Override - public void mouseMove(MouseEvent e) { - GridItem gridItem = table.getItem(new Point(e.x, e.y)); - if(gridItem == null) { - return; - } - - if(gridItem2 == gridItem) { - return; - } else { - disposeNaviButtons(); - gridItem2 = gridItem; - } - - final GLContextTreeNodeData treeNodeData = (GLContextTreeNodeData)gridItem.getData(); - if(treeNodeData.getDBColumnIndex() == -1) { - return; - } - - createNaviButtons(gridItem, treeNodeData); - } - }); - - table.addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - - } - }); - - contextTree = new ArrayList(); - - initContextTree(); - } - - private void disposeNaviButtons() { - if(naviButtonLeftComposite != null) { - naviButtonLeftComposite.dispose(); - } - - if(naviButtonRightComposite != null) { - naviButtonRightComposite.dispose(); - } - - if(buttonLeftLeft != null) { - buttonLeftLeft.dispose(); - } - - if(buttonLeft != null) { - buttonLeft.dispose(); - } - - if(buttonRight != null) { - buttonRight.dispose(); - } - - if(buttonRightRight != null) { - buttonRightRight.dispose(); - } - } - - private void createNaviButtons(GridItem gridItem, - GLContextTreeNodeData treeNodeData) { - - Color bgColor; - if (table.isSelected(gridItem)) { - bgColor = ColorResources.TABLE_CONTENTS_SELECTED_END; - } else { - bgColor = gridItem.getBackground(); - } - - FormLayout formLayout = new FormLayout(); - formLayout.marginHeight = -1; - formLayout.marginWidth = -1; - - naviButtonLeftComposite = new Composite(table, SWT.NONE); - naviButtonLeftComposite.setLayout(formLayout); - naviButtonLeftComposite.setBackground(bgColor); - - buttonLeftLeft = new Button(naviButtonLeftComposite, SWT.NONE); - buttonLeftLeft.setText("<<"); - FormData formData = new FormData(); - formData.top = new FormAttachment(0, 0); - formData.bottom = new FormAttachment(100, 0); - formData.left = new FormAttachment(0, 0); - formData.right = new FormAttachment(0, 27); - buttonLeftLeft.setLayoutData(formData); - - buttonLeft = new Button(naviButtonLeftComposite, SWT.NONE); - buttonLeft.setText("<"); - formData = new FormData(); - formData.top = new FormAttachment(0, 0); - formData.bottom = new FormAttachment(100, 0); - formData.left = new FormAttachment(0, 27); - formData.right = new FormAttachment(0, 54); - buttonLeft.setLayoutData(formData); - naviButtonLeftComposite.pack(); - - GridEditor editor = new GridEditor(table); - editor.minimumWidth = naviButtonLeftComposite.getSize().x; - editor.horizontalAlignment = SWT.LEFT; - editor.setEditor(naviButtonLeftComposite, gridItem, 1); - - naviButtonRightComposite = new Composite(table, SWT.NONE); - naviButtonRightComposite.setLayout(formLayout); - naviButtonRightComposite.setBackground(bgColor); - - buttonRight = new Button(naviButtonRightComposite, SWT.NONE); - buttonRight.setText(">"); - formData = new FormData(); - formData.top = new FormAttachment(0, 0); - formData.bottom = new FormAttachment(100, 0); - formData.left = new FormAttachment(100, -54); - formData.right = new FormAttachment(100, -27); - buttonRight.setLayoutData(formData); - - buttonRightRight = new Button(naviButtonRightComposite, SWT.NONE); - buttonRightRight.setText(">>"); - formData = new FormData(); - formData.top = new FormAttachment(0, 0); - formData.bottom = new FormAttachment(100, 0); - formData.left = new FormAttachment(100, -27); - formData.right = new FormAttachment(100, 0); - buttonRightRight.setLayoutData(formData); - naviButtonRightComposite.pack(); - - editor = new GridEditor(table); - editor.minimumWidth = naviButtonRightComposite.getSize().x; - editor.horizontalAlignment = SWT.RIGHT; - editor.setEditor(naviButtonRightComposite, gridItem, 1); - - buttonLeftLeft.addSelectionListener(new NavigationSelectionListener( - ButtonType.LEFTLEFT, treeNodeData)); - buttonLeft.addSelectionListener(new NavigationSelectionListener( - ButtonType.LEFT, treeNodeData)); - buttonRight.addSelectionListener(new NavigationSelectionListener( - ButtonType.RIGHT, treeNodeData)); - buttonRightRight.addSelectionListener(new NavigationSelectionListener( - ButtonType.RIGHTRIGHT, treeNodeData)); - } - - private void setNodeProperty(TreeInput treeInput) { - List textList = new ArrayList(); - GLContextTreeNodeData nodeData = (GLContextTreeNodeData) treeInput - .getData(); - textList.add(nodeData.getNodeName()); - int columnIndex = nodeData.getDBColumnIndex(); - if (columnIndex == -1) { - textList.add(GLDataMaker.EMPTY); - treeInput.setSecondSelection(false); - } else { - int insideColmunIndex1 = nodeData.getInsideColumnIndex1(); - if (insideColmunIndex1 >= 0) { - int insideColmunIndex2 = nodeData.getInsideColumnIndex2(); - if (insideColmunIndex2 >= 0) { - textList.add(contextValueList.get(columnIndex).split( - GLDataMaker.DELIMITER)[insideColmunIndex1] - .split(GLDataMaker.COMMA)[insideColmunIndex2]); - } else { - textList.add(contextValueList.get(columnIndex).split( - GLDataMaker.DELIMITER)[insideColmunIndex1]); - } - } else { - textList.add(contextValueList.get(columnIndex)); - } - - List involvedOrdinalList = new ArrayList( - Arrays.asList(contextValueList.get( - GLContextDBEnum.INVOLVED_ORDINAL.ordinal()).split( - GLDataMaker.DELIMITER))); - if (involvedOrdinalList.contains(String.valueOf(columnIndex))) { - int involvedIndex1 = Integer.parseInt(contextValueList - .get(GLContextDBEnum.INVOLVED_INDEX1.ordinal())); - if (involvedIndex1 == -1 - || involvedIndex1 == insideColmunIndex1) { - treeInput.setSecondSelection(true); - setAncestorSecondSelection(treeInput); - } else { - treeInput.setSecondSelection(false); - } - } else { - treeInput.setSecondSelection(false); - } - } - treeInput.setText(textList); - - for (TreeInput child : treeInput.getChildren()) { - setNodeProperty(child); - } - } - - private void clearSecondSelection(TreeInput treeInput) { - treeInput.setSecondSelection(false); - for (TreeInput child : treeInput.getChildren()) { - clearSecondSelection(child); - } - } - - private void setAncestorSecondSelection(TreeInput child) { - TreeInput parent = child.getParentInput(); - if (parent != null) { - parent.setSecondSelection(true); - setAncestorSecondSelection(parent); - } - } - - public void initGVA(int maxVertexAttrib) { - int treeSelectionSeq = GVA_TREE_SELECTION_SEQ; - - for (int i = 0; i < maxVertexAttrib; i++) { - TreeInput nodeGVAIndex = new TreeInput(); - nodeGVAIndex.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, i, String - .valueOf(i), - GLContextDBEnum.GVA_V0.ordinal(), - GLContextDBEnum.GVA_V1.ordinal(), - GLContextDBEnum.GVA_V2.ordinal(), - GLContextDBEnum.GVA_V3.ordinal())); - nodeGVAs.addChild(nodeGVAIndex); - { - TreeInput nodeV0 = new TreeInput(); - nodeV0.setData(new GLContextTreeNodeData(++treeSelectionSeq, GLContextDBEnum.GVA_V0 - .ordinal(), i, GLPageLabels.GL_CONTEXT_V0)); - nodeGVAIndex.addChild(nodeV0); - - TreeInput nodeV1 = new TreeInput(); - nodeV1.setData(new GLContextTreeNodeData(++treeSelectionSeq, GLContextDBEnum.GVA_V1 - .ordinal(), i, GLPageLabels.GL_CONTEXT_V1)); - nodeGVAIndex.addChild(nodeV1); - - TreeInput nodeV2 = new TreeInput(); - nodeV2.setData(new GLContextTreeNodeData(++treeSelectionSeq, GLContextDBEnum.GVA_V2 - .ordinal(), i, GLPageLabels.GL_CONTEXT_V2)); - nodeGVAIndex.addChild(nodeV2); - - TreeInput nodeV3 = new TreeInput(); - nodeV3.setData(new GLContextTreeNodeData(++treeSelectionSeq, GLContextDBEnum.GVA_V3 - .ordinal(), i, GLPageLabels.GL_CONTEXT_V3)); - nodeGVAIndex.addChild(nodeV3); - } - - TreeInput nodeGVAArrayIndex = new TreeInput(); - nodeGVAArrayIndex.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.GVA_ENABLED.ordinal(), i, - String.valueOf(i), - GLContextDBEnum.GVA_SIZE.ordinal(), - GLContextDBEnum.GVA_TYPE.ordinal(), - GLContextDBEnum.GVA_NORMAL.ordinal(), - GLContextDBEnum.GVA_STRIDE.ordinal(), - GLContextDBEnum.GVA_POINTER.ordinal())); - nodeGVAArrays.addChild(nodeGVAArrayIndex); - { - TreeInput nodeSize = new TreeInput(); - nodeSize.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.GVA_SIZE.ordinal(), i, - GLPageLabels.GL_CONTEXT_SIZE)); - nodeGVAArrayIndex.addChild(nodeSize); - - TreeInput nodeType = new TreeInput(); - nodeType.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.GVA_TYPE.ordinal(), i, - GLPageLabels.GL_CONTEXT_TYPE)); - nodeGVAArrayIndex.addChild(nodeType); - - TreeInput nodeNormal = new TreeInput(); - nodeNormal.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.GVA_NORMAL.ordinal(), i, - GLPageLabels.GL_CONTEXT_NORMALIZED)); - nodeGVAArrayIndex.addChild(nodeNormal); - - TreeInput nodeStride = new TreeInput(); - nodeStride.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.GVA_STRIDE.ordinal(), i, - GLPageLabels.GL_CONTEXT_STRIDE)); - nodeGVAArrayIndex.addChild(nodeStride); - - TreeInput nodePointer = new TreeInput(); - nodePointer.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.GVA_POINTER.ordinal(), i, - GLPageLabels.GL_CONTEXT_POINTER)); - nodeGVAArrayIndex.addChild(nodePointer); - } - } - } - - public void initTextureUnit(int maxTextureUnit) { - int treeSelectionSeq = TEXTURE_UNIT_TREE_SELECTION_SEQ; - - for (int i = 0; i < maxTextureUnit; i++) { - TreeInput nodeTextureUnitIndex = new TreeInput(); - nodeTextureUnitIndex.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, i, - String.valueOf(i), - GLContextDBEnum.TEXTURE_UNIT_2D.ordinal(), - GLContextDBEnum.TEXTURE_UNIT_CUBE.ordinal())); - nodeTextureUnits.addChild(nodeTextureUnitIndex); - { - TreeInput node2D = new TreeInput(); - node2D.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.TEXTURE_UNIT_2D.ordinal(), i, - GLPageLabels.GL_CONTEXT_2D_BINDING)); - nodeTextureUnitIndex.addChild(node2D); - - TreeInput nodeCube = new TreeInput(); - nodeCube.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.TEXTURE_UNIT_CUBE.ordinal(), i, - GLPageLabels.GL_CONTEXT_CUBEMAP_BINDING)); - nodeTextureUnitIndex.addChild(nodeCube); - } - } - } - - private void makeTextureObejctTree() { - int treeSelectionSeq = TEXTURE_OBJ_TREE_SELECTION_SEQ; - nodeTextureObject.getChildren().clear(); - String[] textureIDs = contextValueList.get( - GLContextDBEnum.TEXTURE_OBJ_ID.ordinal()).split( - GLDataMaker.DELIMITER); - - if (textureIDs.length == 1 && textureIDs[0].equals(GLDataMaker.EMPTY)) { - return; - } - - for (int i = 0; i < textureIDs.length; i++) { - TreeInput nodeTextureObjID = new TreeInput(); - nodeTextureObjID.setData(new GLContextTreeNodeData( - ++treeSelectionSeq, -1, i, textureIDs[i], - GLContextDBEnum.TEXTURE_OBJ_MAG_FUNC.ordinal(), - GLContextDBEnum.TEXTURE_OBJ_MIN_FUNC.ordinal(), - GLContextDBEnum.TEXTURE_OBJ_WRAP_S.ordinal(), - GLContextDBEnum.TEXTURE_OBJ_WRAP_T.ordinal())); - nodeTextureObject.addChild(nodeTextureObjID); - { - TreeInput nodeTextureMagFunc = new TreeInput(); - nodeTextureMagFunc.setData(new GLContextTreeNodeData( - ++treeSelectionSeq, - GLContextDBEnum.TEXTURE_OBJ_MAG_FUNC.ordinal(), i, - GLPageLabels.GL_CONTEXT_MAG_FUNCTION)); - nodeTextureObjID.addChild(nodeTextureMagFunc); - - TreeInput nodeTextureMinFunc = new TreeInput(); - nodeTextureMinFunc.setData(new GLContextTreeNodeData( - ++treeSelectionSeq, - GLContextDBEnum.TEXTURE_OBJ_MIN_FUNC.ordinal(), i, - GLPageLabels.GL_CONTEXT_MIN_FUNCTION)); - nodeTextureObjID.addChild(nodeTextureMinFunc); - - TreeInput nodeTextureWrapS = new TreeInput(); - nodeTextureWrapS.setData(new GLContextTreeNodeData( - ++treeSelectionSeq, - GLContextDBEnum.TEXTURE_OBJ_WRAP_S.ordinal(), i, - GLPageLabels.GL_CONTEXT_WRAP_MODE_S)); - nodeTextureObjID.addChild(nodeTextureWrapS); - - TreeInput nodeTextureWrapT = new TreeInput(); - nodeTextureWrapT.setData(new GLContextTreeNodeData( - ++treeSelectionSeq, - GLContextDBEnum.TEXTURE_OBJ_WRAP_T.ordinal(), i, - GLPageLabels.GL_CONTEXT_WRAP_MODE_T)); - nodeTextureObjID.addChild(nodeTextureWrapT); - } - } - } - - private void makeProgramObjectTree() { - int treeSelectionSeq = PROGRMA_OBJ_TREE_SELECTION_SEQ; - nodeProgramObject.getChildren().clear(); - - String[] programIDs = contextValueList.get( - GLContextDBEnum.PROGRAM_OBJ_ID.ordinal()).split( - GLDataMaker.DELIMITER); - String[] allAttribIndices = contextValueList.get( - GLContextDBEnum.PROGRAM_ATTRIB_INDEX.ordinal()).split( - GLDataMaker.DELIMITER); - String[] allUniformIndices = contextValueList.get( - GLContextDBEnum.PROGRAM_UNIFORM_INDEX.ordinal()).split( - GLDataMaker.DELIMITER); - - if (programIDs.length == 1 && programIDs[0].equals(GLDataMaker.EMPTY)) { - return; - } - - for (int i = 0; i < programIDs.length; i++) { - TreeInput nodeProgramObjID = new TreeInput(); - nodeProgramObjID.setData(new GLContextTreeNodeData( - ++treeSelectionSeq, -1, i, programIDs[i], - GLContextDBEnum.PROGRAM_OBJ_V_SHADER.ordinal(), - GLContextDBEnum.PROGRAM_OBJ_F_SHADER.ordinal(), - GLContextDBEnum.PROGRAM_ATTRIB_INDEX.ordinal(), - GLContextDBEnum.PROGRAM_ATTRIB_NAME.ordinal(), - GLContextDBEnum.PROGRAM_ATTRIB_SIZE.ordinal(), - GLContextDBEnum.PROGRAM_ATTRIB_TYPE.ordinal(), - GLContextDBEnum.PROGRAM_UNIFORM_INDEX.ordinal(), - GLContextDBEnum.PROGRAM_UNIFORM_NAME.ordinal(), - GLContextDBEnum.PROGRAM_UNIFORM_SIZE.ordinal(), - GLContextDBEnum.PROGRAM_UNIFORM_TYPE.ordinal())); - nodeProgramObject.addChild(nodeProgramObjID); - { - TreeInput nodeVertexShader = new TreeInput(); - nodeVertexShader.setData(new GLContextTreeNodeData( - ++treeSelectionSeq, - GLContextDBEnum.PROGRAM_OBJ_V_SHADER.ordinal(), i, - GLPageLabels.GL_CONTEXT_VERTEX_SHADER)); - nodeProgramObjID.addChild(nodeVertexShader); - - TreeInput nodeFragmentShader = new TreeInput(); - nodeFragmentShader.setData(new GLContextTreeNodeData( - ++treeSelectionSeq, - GLContextDBEnum.PROGRAM_OBJ_F_SHADER.ordinal(), i, - GLPageLabels.GL_CONTEXT_FRAGMENT_SHADER)); - nodeProgramObjID.addChild(nodeFragmentShader); - - TreeInput nodeAttribute = new TreeInput(); - nodeAttribute.setData(new GLContextTreeNodeData( - ++treeSelectionSeq, -1, i, - GLPageLabels.GL_CONTEXT_ATTRIBUTE, - GLContextDBEnum.PROGRAM_ATTRIB_INDEX.ordinal(), - GLContextDBEnum.PROGRAM_ATTRIB_NAME.ordinal(), - GLContextDBEnum.PROGRAM_ATTRIB_SIZE.ordinal(), - GLContextDBEnum.PROGRAM_ATTRIB_TYPE.ordinal())); - nodeProgramObjID.addChild(nodeAttribute); - { - if(!allAttribIndices[i].equals(GLDataMaker.EMPTY)) { - String[] attribIndices = allAttribIndices[i].split(GLDataMaker.COMMA); - for(int j = 0; j < attribIndices.length; j++) { - TreeInput nodeAttribIndex = new TreeInput(); - nodeAttribIndex.setData(new GLContextTreeNodeData( - ++treeSelectionSeq, -1, i, j, - attribIndices[j], - GLContextDBEnum.PROGRAM_ATTRIB_INDEX.ordinal(), - GLContextDBEnum.PROGRAM_ATTRIB_NAME.ordinal(), - GLContextDBEnum.PROGRAM_ATTRIB_SIZE.ordinal(), - GLContextDBEnum.PROGRAM_ATTRIB_TYPE.ordinal())); - nodeAttribute.addChild(nodeAttribIndex); - { - TreeInput nodeAttribName = new TreeInput(); - nodeAttribName - .setData(new GLContextTreeNodeData( - ++treeSelectionSeq, - GLContextDBEnum.PROGRAM_ATTRIB_NAME.ordinal(), - i, j, - GLPageLabels.GL_CONTEXT_NAME)); - nodeAttribIndex.addChild(nodeAttribName); - - TreeInput nodeAttribSize = new TreeInput(); - nodeAttribSize - .setData(new GLContextTreeNodeData( - ++treeSelectionSeq, - GLContextDBEnum.PROGRAM_ATTRIB_SIZE.ordinal(), - i, j, - GLPageLabels.GL_CONTEXT_SIZE)); - nodeAttribIndex.addChild(nodeAttribSize); - - TreeInput nodeAttribType= new TreeInput(); - nodeAttribType - .setData(new GLContextTreeNodeData( - ++treeSelectionSeq, - GLContextDBEnum.PROGRAM_ATTRIB_TYPE.ordinal(), - i, j, - GLPageLabels.GL_CONTEXT_TYPE)); - nodeAttribIndex.addChild(nodeAttribType); - } - } - } - } - - //TODO uniforms - TreeInput nodeUniform = new TreeInput(); - nodeUniform.setData(new GLContextTreeNodeData( - ++treeSelectionSeq, -1, i, - GLPageLabels.GL_CONTEXT_UNIFORM, - GLContextDBEnum.PROGRAM_UNIFORM_INDEX.ordinal(), - GLContextDBEnum.PROGRAM_UNIFORM_NAME.ordinal(), - GLContextDBEnum.PROGRAM_UNIFORM_SIZE.ordinal(), - GLContextDBEnum.PROGRAM_UNIFORM_TYPE.ordinal())); - nodeProgramObjID.addChild(nodeUniform); - { - if(!allUniformIndices[i].equals(GLDataMaker.EMPTY)) { - String[] uniformIndices = allUniformIndices[i].split(GLDataMaker.COMMA); - for(int j = 0; j < uniformIndices.length; j++) { - TreeInput nodeUniformIndex = new TreeInput(); - nodeUniformIndex.setData(new GLContextTreeNodeData( - ++treeSelectionSeq, -1, i, j, - uniformIndices[j], - GLContextDBEnum.PROGRAM_UNIFORM_INDEX.ordinal(), - GLContextDBEnum.PROGRAM_UNIFORM_NAME.ordinal(), - GLContextDBEnum.PROGRAM_UNIFORM_SIZE.ordinal(), - GLContextDBEnum.PROGRAM_UNIFORM_TYPE.ordinal())); - nodeUniform.addChild(nodeUniformIndex); - { - TreeInput nodeUniformName = new TreeInput(); - nodeUniformName - .setData(new GLContextTreeNodeData( - ++treeSelectionSeq, - GLContextDBEnum.PROGRAM_UNIFORM_NAME.ordinal(), - i, j, - GLPageLabels.GL_CONTEXT_NAME)); - nodeUniformIndex.addChild(nodeUniformName); - - TreeInput nodeUniformSize = new TreeInput(); - nodeUniformSize - .setData(new GLContextTreeNodeData( - ++treeSelectionSeq, - GLContextDBEnum.PROGRAM_UNIFORM_SIZE.ordinal(), - i, j, - GLPageLabels.GL_CONTEXT_SIZE)); - nodeUniformIndex.addChild(nodeUniformSize); - - TreeInput nodeUniformType= new TreeInput(); - nodeUniformType - .setData(new GLContextTreeNodeData( - ++treeSelectionSeq, - GLContextDBEnum.PROGRAM_UNIFORM_TYPE.ordinal(), - i, j, - GLPageLabels.GL_CONTEXT_TYPE)); - nodeUniformIndex.addChild(nodeUniformType); - } - } - } - } - } - } - } - - private void makeShaderObjectTree() { - int treeSelectionSeq = SHADER_OBJ_TREE_SELECTION_SEQ; - nodeShaderObject.getChildren().clear(); - - String[] shaderIDs = contextValueList.get( - GLContextDBEnum.SHADER_OBJ_ID.ordinal()).split( - GLDataMaker.DELIMITER); - if (shaderIDs.length == 1 && shaderIDs[0].equals(GLDataMaker.EMPTY)) { - return; - } - - for (int i = 0; i < shaderIDs.length; i++) { - TreeInput nodeShaderObjID = new TreeInput(); - nodeShaderObjID.setData(new GLContextTreeNodeData( - ++treeSelectionSeq, -1, i, shaderIDs[i], - GLContextDBEnum.SHADER_TYPE.ordinal(), - GLContextDBEnum.SHADER_SRC.ordinal())); - nodeShaderObject.addChild(nodeShaderObjID); - { - TreeInput nodeShaderType = new TreeInput(); - nodeShaderType.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.SHADER_TYPE.ordinal(), i, - GLPageLabels.GL_CONTEXT_TYPE)); - nodeShaderObjID.addChild(nodeShaderType); - - TreeInput nodeShaderSource = new TreeInput(); - nodeShaderSource.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.SHADER_SRC.ordinal(), i, - GLPageLabels.GL_CONTEXT_SOURCE)); - nodeShaderObjID.addChild(nodeShaderSource); - } - } - } - - @Override - public List makeTreeInput() { - if (makeTreeInput) { - DBTableManager dbManager = DBTableManager.getInstance(); - DBTableInfo tableInfo = dbManager - .getTableInfo(DBTableManager.TABLE_INDEX_GLES20_CONTEXT_DATA); - contextValueList = SqlManager - .getInstance() - .selectQuery(null, tableInfo.getColumnNames(), - tableInfo.getTableName(), "where Seq = " + seq) - .get(0); - - makeTextureObejctTree(); - makeProgramObjectTree(); - makeShaderObjectTree(); - - for (TreeInput treeInput : contextTree) { - setNodeProperty(treeInput); - } - - makeTreeInput = false; - } - - return contextTree; - } - - private void initContextTree() { - contextTree.clear(); - int treeSelectionSeq = BASE_TREE_SELECTION_SEQ; - // vertex info - TreeInput nodeVertexInfo = new TreeInput(); - nodeVertexInfo.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_VERTEX_INFO, - GLContextDBEnum.GVA_V0.ordinal(), - GLContextDBEnum.GVA_V1.ordinal(), - GLContextDBEnum.GVA_V2.ordinal(), - GLContextDBEnum.GVA_V3.ordinal(), - GLContextDBEnum.GVA_ENABLED.ordinal(), - GLContextDBEnum.GVA_SIZE.ordinal(), - GLContextDBEnum.GVA_TYPE.ordinal(), - GLContextDBEnum.GVA_NORMAL.ordinal(), - GLContextDBEnum.GVA_STRIDE.ordinal(), - GLContextDBEnum.GVA_POINTER.ordinal())); - { - TreeInput nodeGenericVertexAttib = new TreeInput(); - nodeGenericVertexAttib.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_GENERIC_VERTEX_ATTRIBUTE, - GLContextDBEnum.GVA_V0.ordinal(), - GLContextDBEnum.GVA_V1.ordinal(), - GLContextDBEnum.GVA_V2.ordinal(), - GLContextDBEnum.GVA_V3.ordinal(), - GLContextDBEnum.GVA_ENABLED.ordinal(), - GLContextDBEnum.GVA_SIZE.ordinal(), - GLContextDBEnum.GVA_TYPE.ordinal(), - GLContextDBEnum.GVA_NORMAL.ordinal(), - GLContextDBEnum.GVA_STRIDE.ordinal(), - GLContextDBEnum.GVA_POINTER.ordinal())); - nodeVertexInfo.addChild(nodeGenericVertexAttib); - { - nodeGVAs = new TreeInput(); - nodeGVAs.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_ATTRIBUTES, - GLContextDBEnum.GVA_V0.ordinal(), - GLContextDBEnum.GVA_V1.ordinal(), - GLContextDBEnum.GVA_V2.ordinal(), - GLContextDBEnum.GVA_V3.ordinal())); - nodeGenericVertexAttib.addChild(nodeGVAs); - - nodeGVAArrays = new TreeInput(); - nodeGVAArrays.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_ATTRIBUTE_ARRAYS, - GLContextDBEnum.GVA_ENABLED.ordinal(), - GLContextDBEnum.GVA_SIZE.ordinal(), - GLContextDBEnum.GVA_TYPE.ordinal(), - GLContextDBEnum.GVA_NORMAL.ordinal(), - GLContextDBEnum.GVA_STRIDE.ordinal(), - GLContextDBEnum.GVA_POINTER.ordinal())); - nodeGenericVertexAttib.addChild(nodeGVAArrays); - } - TreeInput nodeVertexBufferObj = new TreeInput(); - nodeVertexBufferObj.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.VBO_BINDING.ordinal(), - GLPageLabels.GL_CONTEXT_VERTEX_BUFFER_OBJECT)); - nodeVertexInfo.addChild(nodeVertexBufferObj); - } - contextTree.add(nodeVertexInfo); - - // transformation - TreeInput nodeTransformation = new TreeInput(); - nodeTransformation.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_TRANSFORMATION, - GLContextDBEnum.VIEWPORT_X.ordinal(), - GLContextDBEnum.VIEWPORT_Y.ordinal(), - GLContextDBEnum.VIEWPORT_W.ordinal(), - GLContextDBEnum.VIEWPORT_H.ordinal(), - GLContextDBEnum.DEPTH_RANGE_N.ordinal(), - GLContextDBEnum.DEPTH_RANGE_F.ordinal())); - { - TreeInput nodeViewport = new TreeInput(); - nodeViewport.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_VIEWPORT, - GLContextDBEnum.VIEWPORT_X.ordinal(), - GLContextDBEnum.VIEWPORT_Y.ordinal(), - GLContextDBEnum.VIEWPORT_W.ordinal(), - GLContextDBEnum.VIEWPORT_H.ordinal())); - nodeTransformation.addChild(nodeViewport); - { - TreeInput nodeViewportX = new TreeInput(); - nodeViewportX.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.VIEWPORT_X.ordinal(), - GLPageLabels.GL_CONTEXT_X)); - nodeViewport.addChild(nodeViewportX); - - TreeInput nodeViewportY = new TreeInput(); - nodeViewportY.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.VIEWPORT_Y.ordinal(), - GLPageLabels.GL_CONTEXT_Y)); - nodeViewport.addChild(nodeViewportY); - - TreeInput nodeViewportW = new TreeInput(); - nodeViewportW.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.VIEWPORT_W.ordinal(), - GLPageLabels.GL_CONTEXT_WIDTH)); - nodeViewport.addChild(nodeViewportW); - - TreeInput nodeViewportH = new TreeInput(); - nodeViewportH.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.VIEWPORT_H.ordinal(), - GLPageLabels.GL_CONTEXT_HEIGHT)); - nodeViewport.addChild(nodeViewportH); - } - TreeInput nodeDepthRange = new TreeInput(); - nodeDepthRange.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_DEPTH_RANGE, - GLContextDBEnum.DEPTH_RANGE_N.ordinal(), - GLContextDBEnum.DEPTH_RANGE_F.ordinal())); - nodeTransformation.addChild(nodeDepthRange); - { - TreeInput nodeDepthNear = new TreeInput(); - nodeDepthNear.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.DEPTH_RANGE_N.ordinal(), - GLPageLabels.GL_CONTEXT_NEAR)); - nodeDepthRange.addChild(nodeDepthNear); - - TreeInput nodeDepthFar = new TreeInput(); - nodeDepthFar.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.DEPTH_RANGE_F.ordinal(), - GLPageLabels.GL_CONTEXT_FAR)); - nodeDepthRange.addChild(nodeDepthFar); - } - } - contextTree.add(nodeTransformation); - - // rasterization - TreeInput nodeRasterization = new TreeInput(); - nodeRasterization.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_RASTERIZATION, - GLContextDBEnum.LINE_W.ordinal(), - GLContextDBEnum.CULLING_ENABLED.ordinal(), - GLContextDBEnum.CULLING_ORI.ordinal(), - GLContextDBEnum.CULLING_MODE.ordinal(), - GLContextDBEnum.POLY_ENABLED.ordinal(), - GLContextDBEnum.POLY_FACTOR.ordinal(), - GLContextDBEnum.POLY_UNITS.ordinal())); - { - TreeInput nodeLineWidth = new TreeInput(); - nodeLineWidth.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.LINE_W.ordinal(), - GLPageLabels.GL_CONTEXT_LINE_WIDTH)); - nodeRasterization.addChild(nodeLineWidth); - - TreeInput nodeCulling = new TreeInput(); - nodeCulling.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.CULLING_ENABLED.ordinal(), - GLPageLabels.GL_CONTEXT_CULLING, - GLContextDBEnum.CULLING_ORI.ordinal(), - GLContextDBEnum.CULLING_MODE.ordinal())); - nodeRasterization.addChild(nodeCulling); - { - TreeInput nodeOrientation = new TreeInput(); - nodeOrientation.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.CULLING_ORI.ordinal(), - GLPageLabels.GL_CONTEXT_ORIENTATION)); - nodeCulling.addChild(nodeOrientation); - - TreeInput nodeMode = new TreeInput(); - nodeMode.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.CULLING_MODE.ordinal(), - GLPageLabels.GL_CONTEXT_MODE)); - nodeCulling.addChild(nodeMode); - } - - TreeInput nodePoly = new TreeInput(); - nodePoly.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.POLY_ENABLED.ordinal(), - GLPageLabels.GL_CONTEXT_POLYGON_OFFSET, - GLContextDBEnum.POLY_FACTOR.ordinal(), - GLContextDBEnum.POLY_UNITS.ordinal())); - nodeRasterization.addChild(nodePoly); - { - TreeInput nodePolyFactor = new TreeInput(); - nodePolyFactor.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.POLY_FACTOR.ordinal(), - GLPageLabels.GL_CONTEXT_FACTOR)); - nodePoly.addChild(nodePolyFactor); - - TreeInput nodePolyUnits = new TreeInput(); - nodePolyUnits.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.POLY_UNITS.ordinal(), - GLPageLabels.GL_CONTEXT_UNITS)); - nodePoly.addChild(nodePolyUnits); - } - } - contextTree.add(nodeRasterization); - - // fragment operation - TreeInput nodeFragmentOperation = new TreeInput(); - nodeFragmentOperation.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_FRAGMENT_OPERATION, - GLContextDBEnum.SCISSOR_ENABLED.ordinal(), - GLContextDBEnum.SCISSOR_X.ordinal(), - GLContextDBEnum.SCISSOR_Y.ordinal(), - GLContextDBEnum.SCISSOR_W.ordinal(), - GLContextDBEnum.SCISSOR_H.ordinal(), - GLContextDBEnum.STENCIL_ENABLED.ordinal(), - GLContextDBEnum.STENCIL_FRONT_FUNC.ordinal(), - GLContextDBEnum.STENCIL_FRONT_REF.ordinal(), - GLContextDBEnum.STENCIL_FRONT_MASK.ordinal(), - GLContextDBEnum.STENCIL_FRONT_S_FAIL.ordinal(), - GLContextDBEnum.STENCIL_FRONT_D_FAIL.ordinal(), - GLContextDBEnum.STENCIL_FRONT_D_PASS.ordinal(), - GLContextDBEnum.STENCIL_BACK_FUNC.ordinal(), - GLContextDBEnum.STENCIL_BACK_REF.ordinal(), - GLContextDBEnum.STENCIL_BACK_MASK.ordinal(), - GLContextDBEnum.STENCIL_BACK_S_FAIL.ordinal(), - GLContextDBEnum.STENCIL_BACK_D_FAIL.ordinal(), - GLContextDBEnum.STENCIL_BACK_D_PASS.ordinal(), - GLContextDBEnum.DEPTH_ENABLED.ordinal(), - GLContextDBEnum.DEPTH_FUNC.ordinal(), - GLContextDBEnum.BLEND_ENABLED.ordinal(), - GLContextDBEnum.BLEND_SRC_RGB.ordinal(), - GLContextDBEnum.BLEND_SRC_A.ordinal(), - GLContextDBEnum.BLEND_DEST_RGB.ordinal(), - GLContextDBEnum.BLEND_DEST_A.ordinal(), - GLContextDBEnum.BLEND_RGB_EQ.ordinal(), - GLContextDBEnum.BLEND_A_EQ.ordinal(), - GLContextDBEnum.BLEND_COLOR.ordinal(), - GLContextDBEnum.DITHER_ENABLED.ordinal())); - { - TreeInput nodeScissor = new TreeInput(); - nodeScissor.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.SCISSOR_ENABLED.ordinal(), - GLPageLabels.GL_CONTEXT_SCISSOR, - GLContextDBEnum.SCISSOR_ENABLED.ordinal(), - GLContextDBEnum.SCISSOR_X.ordinal(), - GLContextDBEnum.SCISSOR_Y.ordinal(), - GLContextDBEnum.SCISSOR_W.ordinal(), - GLContextDBEnum.SCISSOR_H.ordinal())); - nodeFragmentOperation.addChild(nodeScissor); - { - TreeInput nodeScissorX = new TreeInput(); - nodeScissorX.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.SCISSOR_X.ordinal(), - GLPageLabels.GL_CONTEXT_X)); - nodeScissor.addChild(nodeScissorX); - - TreeInput nodeScissorY = new TreeInput(); - nodeScissorY.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.SCISSOR_Y.ordinal(), - GLPageLabels.GL_CONTEXT_Y)); - nodeScissor.addChild(nodeScissorY); - - TreeInput nodeScissorW = new TreeInput(); - nodeScissorW.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.SCISSOR_W.ordinal(), - GLPageLabels.GL_CONTEXT_WIDTH)); - nodeScissor.addChild(nodeScissorW); - - TreeInput nodeScissorH = new TreeInput(); - nodeScissorH.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.SCISSOR_H.ordinal(), - GLPageLabels.GL_CONTEXT_HEIGHT)); - nodeScissor.addChild(nodeScissorH); - } - TreeInput nodeStencil = new TreeInput(); - nodeStencil.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.STENCIL_ENABLED.ordinal(), - GLPageLabels.GL_CONTEXT_STENCIL, - GLContextDBEnum.STENCIL_ENABLED.ordinal(), - GLContextDBEnum.STENCIL_FRONT_FUNC.ordinal(), - GLContextDBEnum.STENCIL_FRONT_REF.ordinal(), - GLContextDBEnum.STENCIL_FRONT_MASK.ordinal(), - GLContextDBEnum.STENCIL_FRONT_S_FAIL.ordinal(), - GLContextDBEnum.STENCIL_FRONT_D_FAIL.ordinal(), - GLContextDBEnum.STENCIL_FRONT_D_PASS.ordinal(), - GLContextDBEnum.STENCIL_BACK_FUNC.ordinal(), - GLContextDBEnum.STENCIL_BACK_REF.ordinal(), - GLContextDBEnum.STENCIL_BACK_MASK.ordinal(), - GLContextDBEnum.STENCIL_BACK_S_FAIL.ordinal(), - GLContextDBEnum.STENCIL_BACK_D_FAIL.ordinal(), - GLContextDBEnum.STENCIL_BACK_D_PASS.ordinal())); - nodeFragmentOperation.addChild(nodeStencil); - { - TreeInput nodeFront = new TreeInput(); - nodeFront.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_FRONT, - GLContextDBEnum.STENCIL_FRONT_FUNC.ordinal(), - GLContextDBEnum.STENCIL_FRONT_REF.ordinal(), - GLContextDBEnum.STENCIL_FRONT_MASK.ordinal(), - GLContextDBEnum.STENCIL_FRONT_S_FAIL.ordinal(), - GLContextDBEnum.STENCIL_FRONT_D_FAIL.ordinal(), - GLContextDBEnum.STENCIL_FRONT_D_PASS.ordinal())); - nodeStencil.addChild(nodeFront); - { - TreeInput nodeFrontFunction = new TreeInput(); - nodeFrontFunction.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.STENCIL_FRONT_FUNC.ordinal(), - GLPageLabels.GL_CONTEXT_FUNCTION)); - nodeFront.addChild(nodeFrontFunction); - - TreeInput nodeFrontRef = new TreeInput(); - nodeFrontRef.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.STENCIL_FRONT_REF.ordinal(), - GLPageLabels.GL_CONTEXT_REFERENCE)); - nodeFront.addChild(nodeFrontRef); - - TreeInput nodeFrontMask = new TreeInput(); - nodeFrontMask.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.STENCIL_FRONT_MASK.ordinal(), - GLPageLabels.GL_CONTEXT_MASK)); - nodeFront.addChild(nodeFrontMask); - - TreeInput nodeFrontSFail = new TreeInput(); - nodeFrontSFail.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.STENCIL_FRONT_S_FAIL.ordinal(), - GLPageLabels.GL_CONTEXT_STENCIL_TEST_FAIL_ACTION)); - nodeFront.addChild(nodeFrontSFail); - - TreeInput nodeFrontDFail = new TreeInput(); - nodeFrontDFail.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.STENCIL_FRONT_D_FAIL.ordinal(), - GLPageLabels.GL_CONTEXT_DEPTH_TEST_FAIL_ACTION)); - nodeFront.addChild(nodeFrontDFail); - - TreeInput nodeFrontDPass = new TreeInput(); - nodeFrontDPass.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.STENCIL_FRONT_D_PASS.ordinal(), - GLPageLabels.GL_CONTEXT_DEPTH_TEST_PASS_ACTION)); - nodeFront.addChild(nodeFrontDPass); - } - TreeInput nodeBack = new TreeInput(); - nodeBack.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_BACK, - GLContextDBEnum.STENCIL_BACK_FUNC.ordinal(), - GLContextDBEnum.STENCIL_BACK_REF.ordinal(), - GLContextDBEnum.STENCIL_BACK_MASK.ordinal(), - GLContextDBEnum.STENCIL_BACK_S_FAIL.ordinal(), - GLContextDBEnum.STENCIL_BACK_D_FAIL.ordinal(), - GLContextDBEnum.STENCIL_BACK_D_PASS.ordinal())); - nodeStencil.addChild(nodeBack); - { - TreeInput nodeBackFunction = new TreeInput(); - nodeBackFunction.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.STENCIL_BACK_FUNC.ordinal(), - GLPageLabels.GL_CONTEXT_FUNCTION)); - nodeBack.addChild(nodeBackFunction); - - TreeInput nodeBackRef = new TreeInput(); - nodeBackRef.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.STENCIL_BACK_REF.ordinal(), - GLPageLabels.GL_CONTEXT_REFERENCE)); - nodeBack.addChild(nodeBackRef); - - TreeInput nodeBackMask = new TreeInput(); - nodeBackMask.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.STENCIL_BACK_MASK.ordinal(), - GLPageLabels.GL_CONTEXT_MASK)); - nodeBack.addChild(nodeBackMask); - - TreeInput nodeBackSFail = new TreeInput(); - nodeBackSFail.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.STENCIL_BACK_S_FAIL.ordinal(), - GLPageLabels.GL_CONTEXT_STENCIL_TEST_FAIL_ACTION)); - nodeBack.addChild(nodeBackSFail); - - TreeInput nodeBackDFail = new TreeInput(); - nodeBackDFail.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.STENCIL_BACK_D_FAIL.ordinal(), - GLPageLabels.GL_CONTEXT_DEPTH_TEST_FAIL_ACTION)); - nodeBack.addChild(nodeBackDFail); - - TreeInput nodeBackDPass = new TreeInput(); - nodeBackDPass.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.STENCIL_BACK_D_PASS.ordinal(), - GLPageLabels.GL_CONTEXT_DEPTH_TEST_PASS_ACTION)); - nodeBack.addChild(nodeBackDPass); - } - } - TreeInput nodeDepth = new TreeInput(); - nodeDepth.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.DEPTH_ENABLED.ordinal(), - GLPageLabels.GL_CONTEXT_DEPTH, - GLContextDBEnum.DEPTH_FUNC.ordinal())); - nodeFragmentOperation.addChild(nodeDepth); - { - TreeInput nodeDepthFunc = new TreeInput(); - nodeDepthFunc.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.DEPTH_FUNC.ordinal(), - GLPageLabels.GL_CONTEXT_FUNCTION)); - nodeDepth.addChild(nodeDepthFunc); - } - TreeInput nodeBlending = new TreeInput(); - nodeBlending.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.BLEND_ENABLED.ordinal(), - GLPageLabels.GL_CONTEXT_BLENDING, - GLContextDBEnum.BLEND_SRC_RGB.ordinal(), - GLContextDBEnum.BLEND_SRC_A.ordinal(), - GLContextDBEnum.BLEND_DEST_RGB.ordinal(), - GLContextDBEnum.BLEND_DEST_A.ordinal(), - GLContextDBEnum.BLEND_RGB_EQ.ordinal(), - GLContextDBEnum.BLEND_A_EQ.ordinal(), - GLContextDBEnum.BLEND_COLOR.ordinal())); - nodeFragmentOperation.addChild(nodeBlending); - { - TreeInput nodeBlendingSrc = new TreeInput(); - nodeBlendingSrc.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_SOURCE, - GLContextDBEnum.BLEND_SRC_RGB.ordinal(), - GLContextDBEnum.BLEND_SRC_A.ordinal())); - nodeBlending.addChild(nodeBlendingSrc); - { - TreeInput nodeBlendingSrcRGB = new TreeInput(); - nodeBlendingSrcRGB.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.BLEND_SRC_RGB.ordinal(), - GLPageLabels.GL_CONTEXT_RGB_FACTOR)); - nodeBlendingSrc.addChild(nodeBlendingSrcRGB); - - TreeInput nodeBlendingSrcAlpha = new TreeInput(); - nodeBlendingSrcAlpha.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.BLEND_SRC_A.ordinal(), - GLPageLabels.GL_CONTEXT_ALPHA_FACTOR)); - nodeBlendingSrc.addChild(nodeBlendingSrcAlpha); - } - - TreeInput nodeBlendingDest = new TreeInput(); - nodeBlendingDest.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_DESTINATION, - GLContextDBEnum.BLEND_DEST_RGB.ordinal(), - GLContextDBEnum.BLEND_DEST_A.ordinal())); - nodeBlending.addChild(nodeBlendingDest); - { - TreeInput nodeBlendingDestRGB = new TreeInput(); - nodeBlendingDestRGB.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.BLEND_DEST_RGB.ordinal(), - GLPageLabels.GL_CONTEXT_RGB_FACTOR)); - nodeBlendingDest.addChild(nodeBlendingDestRGB); - - TreeInput nodeBlendingDestAlpha = new TreeInput(); - nodeBlendingDestAlpha.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.BLEND_DEST_A.ordinal(), - GLPageLabels.GL_CONTEXT_ALPHA_FACTOR)); - nodeBlendingDest.addChild(nodeBlendingDestAlpha); - } - TreeInput nodeBlendingRGB = new TreeInput(); - nodeBlendingRGB.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.BLEND_RGB_EQ.ordinal(), - GLPageLabels.GL_CONTEXT_RGB_EQUATION)); - nodeBlending.addChild(nodeBlendingRGB); - - TreeInput nodeBlendingAlpha = new TreeInput(); - nodeBlendingAlpha.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.BLEND_A_EQ.ordinal(), - GLPageLabels.GL_CONTEXT_ALPHA_EQUATION)); - nodeBlending.addChild(nodeBlendingAlpha); - - TreeInput nodeBlendingColor = new TreeInput(); - nodeBlendingColor.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.BLEND_COLOR.ordinal(), - GLPageLabels.GL_CONTEXT_BLEND_COLOR)); - nodeBlending.addChild(nodeBlendingColor); - } - TreeInput nodeDither = new TreeInput(); - nodeDither.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.DITHER_ENABLED.ordinal(), - GLPageLabels.GL_CONTEXT_DITHER)); - nodeFragmentOperation.addChild(nodeDither); - } - contextTree.add(nodeFragmentOperation); - - // pixcel - TreeInput nodePixcel = new TreeInput(); - nodePixcel.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_PIXEL, - GLContextDBEnum.PACK_ALIGN.ordinal(), - GLContextDBEnum.UNPACK_ALIGN.ordinal())); - { - TreeInput nodePackAlignment = new TreeInput(); - nodePackAlignment.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.PACK_ALIGN.ordinal(), - GLPageLabels.GL_CONTEXT_PACK_ALIGNMENT)); - nodePixcel.addChild(nodePackAlignment); - - TreeInput nodeUnpackAlignment = new TreeInput(); - nodeUnpackAlignment.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.UNPACK_ALIGN.ordinal(), - GLPageLabels.GL_CONTEXT_UNPACK_ALIGNMENT)); - nodePixcel.addChild(nodeUnpackAlignment); - } - contextTree.add(nodePixcel); - - // texture - TreeInput nodeTexture = new TreeInput(); - nodeTexture.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_TEXTURE, - GLContextDBEnum.TEXTURE_ACTIVE.ordinal(), - GLContextDBEnum.TEXTURE_UNIT_2D.ordinal(), - GLContextDBEnum.TEXTURE_UNIT_CUBE.ordinal(), - GLContextDBEnum.TEXTURE_OBJ_ID.ordinal(), - GLContextDBEnum.TEXTURE_OBJ_MAG_FUNC.ordinal(), - GLContextDBEnum.TEXTURE_OBJ_MIN_FUNC.ordinal(), - GLContextDBEnum.TEXTURE_OBJ_WRAP_S.ordinal(), - GLContextDBEnum.TEXTURE_OBJ_WRAP_T.ordinal())); - { - nodeTextureUnits = new TreeInput(); - nodeTextureUnits.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.TEXTURE_ACTIVE.ordinal(), - GLPageLabels.GL_CONTEXT_TEXTURE_UNITS, - GLContextDBEnum.TEXTURE_UNIT_2D.ordinal(), - GLContextDBEnum.TEXTURE_UNIT_CUBE.ordinal())); - nodeTexture.addChild(nodeTextureUnits); - - nodeTextureObject = new TreeInput(); - nodeTextureObject.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_TEXTURE_OBJECT, - GLContextDBEnum.TEXTURE_OBJ_ID.ordinal(), - GLContextDBEnum.TEXTURE_OBJ_MAG_FUNC.ordinal(), - GLContextDBEnum.TEXTURE_OBJ_MIN_FUNC.ordinal(), - GLContextDBEnum.TEXTURE_OBJ_WRAP_S.ordinal(), - GLContextDBEnum.TEXTURE_OBJ_WRAP_T.ordinal())); - nodeTexture.addChild(nodeTextureObject); - } - contextTree.add(nodeTexture); - - // program object - nodeProgramObject = new TreeInput(); - nodeProgramObject.setData(new GLContextTreeNodeData(++treeSelectionSeq, - GLContextDBEnum.PROGRAM_OBJ_CURRENT.ordinal(), - GLPageLabels.GL_CONTEXT_PROGRAM_OBJ, - GLContextDBEnum.PROGRAM_OBJ_ID.ordinal(), - GLContextDBEnum.PROGRAM_OBJ_V_SHADER.ordinal(), - GLContextDBEnum.PROGRAM_OBJ_F_SHADER.ordinal(), - GLContextDBEnum.PROGRAM_ATTRIB_INDEX.ordinal(), - GLContextDBEnum.PROGRAM_ATTRIB_NAME.ordinal(), - GLContextDBEnum.PROGRAM_ATTRIB_SIZE.ordinal(), - GLContextDBEnum.PROGRAM_ATTRIB_TYPE.ordinal(), - GLContextDBEnum.PROGRAM_UNIFORM_INDEX.ordinal(), - GLContextDBEnum.PROGRAM_UNIFORM_NAME.ordinal(), - GLContextDBEnum.PROGRAM_UNIFORM_SIZE.ordinal(), - GLContextDBEnum.PROGRAM_UNIFORM_TYPE.ordinal())); - contextTree.add(nodeProgramObject); - - // shader object - nodeShaderObject = new TreeInput(); - nodeShaderObject.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_SHADER_OBJECT, - GLContextDBEnum.SHADER_TYPE.ordinal(), - GLContextDBEnum.SHADER_SRC.ordinal())); - contextTree.add(nodeShaderObject); - - // framebuffer state - TreeInput nodeFramebuffer = new TreeInput(); - nodeFramebuffer.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_FRAMEBUFFER_STATE)); - { - TreeInput nodeFramebufferBinding = new TreeInput(); - nodeFramebufferBinding.setData(new GLContextTreeNodeData(++treeSelectionSeq, -1, - GLPageLabels.GL_CONTEXT_FRAMEBUFER_BINDING)); - nodeFramebuffer.addChild(nodeFramebufferBinding); - } - contextTree.add(nodeFramebuffer); - } - - public void clear() { - makeTreeInput = false; - initContextTree(); - getTable().getColumn(2).setText(GLPageLabels.GL_CONTEXT_VIEW_NAVI); - } - - public void updateTree(String seq) { - if (seq != null) { - this.seq = seq; - makeTreeInput = true; - } - - updateTree(); - } - - @Override - protected GridItem checkExpand(GridItem gridItem, DATableDataFormat gridData) { - long seq = gridData.getSelectionKey(); - Object expand = getExpandMap().get(seq); - if (null == expand) { - expandMap.put(seq, false); - } else { - gridItem.setExpanded((Boolean) expand); - } - return gridItem; - } - - @Override - public void setTableToolTipListener(TableTooltipListener tableListener) { - } - - private class NavigationSelectionListener implements - SelectionListener { - private ButtonType type; - private GLContextTreeNodeData treeNodeData; - - private NavigationSelectionListener(ButtonType type, - GLContextTreeNodeData treeNodeData) { - this.type = type; - this.treeNodeData = treeNodeData; - } - - @Override - public void widgetSelected(SelectionEvent e) { - if (seq == null) { - return; - } - ArrayList list; - int bSearchedIndex; - - if (type == ButtonType.LEFTLEFT || type == ButtonType.RIGHTRIGHT) { - list = glDataMaker.getContextValueChangeList(treeNodeData - .getDBColumnIndex()); - } else { - list = glDataMaker.getContextValueSetList(treeNodeData - .getDBColumnIndex()); - } - - if (type == ButtonType.LEFTLEFT || type == ButtonType.LEFT) { - bSearchedIndex = bSearchPrev(list, Integer.parseInt(seq)); - if (bSearchedIndex < 0) { - return; - } - } else { - bSearchedIndex = bSearchNext(list, Integer.parseInt(seq)); - if (bSearchedIndex < 0 || bSearchedIndex >= list.size()) { - return; - } - } - - naviButtonLeftComposite - .setBackground(ColorResources.TABLE_RANGE_COLOR_SECOND_SELECTION); - naviButtonRightComposite - .setBackground(ColorResources.TABLE_RANGE_COLOR_SECOND_SELECTION); - - String[] prevChangeInfo = list.get(bSearchedIndex).split( - GLDataMaker.DELIMITER); - AnalyzerManager.getCurrentPage().updateView( - new GLSelectionData(GLPage.contextViewID, - Integer.parseInt(prevChangeInfo[0]), -1, - prevChangeInfo[1])); - - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - - private int bSearchPrev(List list, int target) { - int first = 0; - int last = list.size() - 1; - int mid; - - while (first <= last) { - mid = (first + last) / 2; - int seq = Integer.parseInt(list.get(mid).split( - GLDataMaker.DELIMITER)[1]); - - if (seq == target) { - return mid - 1; - } else if (seq < target) { - if (mid + 1 >= list.size() - 1) { - return mid; - } - - int nextSeq = Integer.parseInt(list.get(mid + 1).split( - GLDataMaker.DELIMITER)[1]); - - if (nextSeq >= target) { - return mid; - } else { - first = mid + 1; - } - } else if (seq > target) { - last = mid - 1; - } - } - - return -1; - } - - private int bSearchNext(List list, int target) { - int first = 0; - int last = list.size() - 1; - int mid; - - while (first <= last) { - mid = (first + last) / 2; - int seq = Integer.parseInt(list.get(mid).split( - GLDataMaker.DELIMITER)[1]); - - if (seq == target) { - return mid + 1; - } else if (seq > target) { - if (mid == 0) { - return mid; - } - - int prevSeq = Integer.parseInt(list.get(mid - 1).split( - GLDataMaker.DELIMITER)[1]); - - if (prevSeq <= target) { - return mid; - } else { - last = mid - 1; - } - } else if (seq < target) { - first = mid + 1; - } - } - - return -1; - } - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/context/GLContextView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/context/GLContextView.java deleted file mode 100644 index df84970..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/context/GLContextView.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Sanghyun Lee - * Juyoung Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.dynamicanalyzer.ui.opengl.ui.context; - -import org.eclipse.nebula.widgets.grid.GridItem; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.tizen.dynamicanalyzer.common.DASelectionData; -import org.tizen.dynamicanalyzer.nl.GLPageLabels; -import org.tizen.dynamicanalyzer.resources.ColorResources; -import org.tizen.dynamicanalyzer.swap.model.data.LogData; -import org.tizen.dynamicanalyzer.ui.opengl.data.GLSelectionData; -import org.tizen.dynamicanalyzer.ui.opengl.ui.GLPage; -import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; -import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite; -import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData; - -public class GLContextView extends DAViewComposite { - private GLContextTreeTable glContextTreeTable; - - public GLContextView(Composite parent, int style) { - super(parent, style, true); - setLayout(new FillLayout()); - - setTitle(GLPageLabels.GL_CONTEXT_VIEW_TITLE); - - Composite contents = getContentArea(); - contents.setBackground(ColorResources.VIEW_BG_COLOR); - contents.setLayout(new FillLayout()); - glContextTreeTable = GLContextTreeTable.getInstance(contents, SWT.NONE, - SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); - } - - @Override - public void updateView() { - glContextTreeTable.updateTree(); - } - - @Override - public void updateView(DAViewData vdata) { - if (vdata instanceof DASelectionData) { - DASelectionData data = (DASelectionData) vdata; - - String id = data.getViewID(); - if ((id.equals(GLPage.listViewID) && data instanceof GLSelectionData)) { - GridItem[] gridItems = (GridItem[]) data.getData(); - DATableDataFormat tableDataFormat = (DATableDataFormat) gridItems[0] - .getData(); - LogData logData = tableDataFormat.getLogData(); - - int frameIndex = ((GLSelectionData) data).getFrameIndex(); - String seq = Integer.toString(logData.getSeq()); - glContextTreeTable.updateTree(seq); - - setTitle(GLPageLabels.GL_CONTEXT_VIEW_TITLE + "(" - + frameIndex + "frame #" + seq + ")"); - } - } - - // other view selection occurred - glContextTreeTable.deselectAll(); - } - - @Override - public void clear() { - glContextTreeTable.clear(); - setTitle(GLPageLabels.GL_CONTEXT_VIEW_TITLE); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java index 18f06c4..bc7f47c 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java @@ -33,7 +33,7 @@ import org.eclipse.ui.part.ViewPart; import org.tizen.dynamicanalyzer.ui.file.FilePage; import org.tizen.dynamicanalyzer.ui.kernel.KernelPage; import org.tizen.dynamicanalyzer.ui.network.NetworkPage; -import org.tizen.dynamicanalyzer.ui.opengl.ui.GLPage; +import org.tizen.dynamicanalyzer.ui.opengl.GLPage; import org.tizen.dynamicanalyzer.ui.summary.SummaryPage; import org.tizen.dynamicanalyzer.ui.thread.ThreadPage; import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/ProfileDataMaker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/ProfileDataMaker.java index f8c65f2..360cc6d 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/ProfileDataMaker.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/ProfileDataMaker.java @@ -438,7 +438,7 @@ public class ProfileDataMaker { } addrs.add(0, selfAddr); } else { - DA_LOG.debug("makeFunctionUsageProfileData : cannot find seq by time"); + // DA_LOG.debug("makeFunctionUsageProfileData : cannot find seq by time"); addrs = new ArrayList(); addrs.add(selfAddr); } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineEditItemsDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineEditItemsDialog.java index c6d48df..03b192a 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineEditItemsDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineEditItemsDialog.java @@ -82,7 +82,7 @@ import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox; public class TimelineEditItemsDialog extends DAMessageBox { private TableViewer chartTableViewer; - //private boolean chartChangeSatus = true; + // private boolean chartChangeSatus = true; private TimelineChartManager chartManager = TimelineChartManager .getInstance(); @@ -115,8 +115,10 @@ public class TimelineEditItemsDialog extends DAMessageBox { List chartList = new ArrayList(); List selectedChartList = new ArrayList(); - StringBuffer strSaveChartNameList = new StringBuffer(CommonConstants.EMPTY); - StringBuffer strSaveSelectedChartNameList = new StringBuffer(CommonConstants.EMPTY); + StringBuffer strSaveChartNameList = new StringBuffer( + CommonConstants.EMPTY); + StringBuffer strSaveSelectedChartNameList = new StringBuffer( + CommonConstants.EMPTY); for (TableItem item : tableitems) { int chartType = Integer.parseInt(item.getText(0)); @@ -339,7 +341,7 @@ public class TimelineEditItemsDialog extends DAMessageBox { Transfer[] types = new Transfer[] { TextTransfer.getInstance() }; DragSource source = new DragSource(chartTableViewer.getTable(), - DND.DROP_MOVE | DND.DROP_COPY); + DND.DROP_MOVE); source.setTransfer(types); source.addDragListener(new DragSourceAdapter() { public void dragSetData(DragSourceEvent event) { @@ -352,12 +354,12 @@ public class TimelineEditItemsDialog extends DAMessageBox { } event.data = buff.toString(); - // chartChangeSatus = false; + // chartChangeSatus = false; } }); DropTarget target = new DropTarget(chartTableViewer.getTable(), - DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT); + DND.DROP_MOVE); target.setTransfer(types); target.addDropListener(new DropTargetAdapter() { public void dragEnter(DropTargetEvent event) { @@ -369,7 +371,7 @@ public class TimelineEditItemsDialog extends DAMessageBox { } if (event.detail == DND.DROP_DEFAULT) { - event.detail = (event.operations & DND.DROP_COPY) != 0 ? DND.DROP_COPY + event.detail = (event.operations & DND.DROP_MOVE) != 0 ? DND.DROP_MOVE : DND.DROP_NONE; } for (int i = 0, n = event.dataTypes.length; i < n; i++) { @@ -497,22 +499,21 @@ public class TimelineEditItemsDialog extends DAMessageBox { private MouseListener itemZoomMouseListener = new MouseAdapter() { public void mouseUp(MouseEvent event) { - // if (chartChangeSatus == true) { - Table table = chartTableViewer.getTable(); - int selectItemIndex = table.getSelectionIndex(); - TableItem[] chartTableItems = chartTableViewer.getTable() - .getItems(); - if (chartTableItems[selectItemIndex].getText(3).equals( - strEnableChart)) { - chartTableItems[selectItemIndex] - .setText(3, strDisableChart); - } else if (chartTableItems[selectItemIndex].getText(3).equals( - strDisableChart)) { - chartTableItems[selectItemIndex].setText(3, strEnableChart); - } - chartTableViewer.getTable().redraw(); - // } - // chartChangeSatus = true; + // if (chartChangeSatus == true) { + Table table = chartTableViewer.getTable(); + int selectItemIndex = table.getSelectionIndex(); + TableItem[] chartTableItems = chartTableViewer.getTable() + .getItems(); + if (chartTableItems[selectItemIndex].getText(3).equals( + strEnableChart)) { + chartTableItems[selectItemIndex].setText(3, strDisableChart); + } else if (chartTableItems[selectItemIndex].getText(3).equals( + strDisableChart)) { + chartTableItems[selectItemIndex].setText(3, strEnableChart); + } + chartTableViewer.getTable().redraw(); + // } + // chartChangeSatus = true; } }; } \ No newline at end of file diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/logparser/DeviceLogParser.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/logparser/DeviceLogParser.java deleted file mode 100644 index d1a4b03..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/logparser/DeviceLogParser.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.tizen.dynamicanalyzer.ui.timeline.logparser; - -import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants; -import org.tizen.dynamicanalyzer.swap.logparser.LogPackage; -import org.tizen.dynamicanalyzer.swap.logparser.Logs; -import org.tizen.dynamicanalyzer.ui.opengl.ui.chart.GLFrameRateChart; - -public class DeviceLogParser { - private GLFrameRateChart frameRateChart = GLFrameRateChart.getInstance(); - - public void parseLogPackage(LogPackage logPack) { - Logs deviceLogs = logPack.getLogs(DataChannelConstants.MSG_DATA_SYSTEM); - if (deviceLogs != null && deviceLogs.getRawLogs() != null - && deviceLogs.getRawLogs().size() > 0) { - frameRateChart.parseLogPackage(logPack); - } - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java index 1713795..d11fb89 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java @@ -56,6 +56,7 @@ import org.tizen.dynamicanalyzer.resources.FontResources; import org.tizen.dynamicanalyzer.resources.ImageResources; import org.tizen.dynamicanalyzer.shortcut.ShortCutManager; import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage; +import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager; import org.tizen.dynamicanalyzer.ui.page.BaseView; import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage; import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialog; @@ -501,6 +502,7 @@ public class ToolbarArea { AnalyzerManager.setRunningState(false); AnalyzerManager.stopScreenshotTimer(); TraceStartStopThread.runStartStopThread(); + GLDataManager.getInstance().stopProcess(); } private void createToolbar(Composite parent) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableComposite.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableComposite.java index ebdff18..a7af4a7 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableComposite.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableComposite.java @@ -372,7 +372,9 @@ public abstract class DATableComposite extends Composite { DATableDataFormat tableData = (DATableDataFormat) selections[i] .getData(); LogData data = tableData.getLogData(); - selSeqs.add((long) data.getSeq()); + if(null != data){ + selSeqs.add((long) data.getSeq()); + } } table.removeAll();