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.GLDataManager;
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateTextureType;
public class GLStateTextureDBTableManager extends DBTable {
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
+ + CONTEXT_ID + CommonConstants.COMMA + CHANGE_SEQ
+ CommonConstants.COMMA
- + TEXTURE_OBJ_ID + CommonConstants.COMMA
- + TEXTURE_OBJ_MAG_FUNC
+ + 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_S
- + CommonConstants.COMMA + TEXTURE_OBJ_WRAP_T + " from " + TABLENAME;//$NON-NLS-1$
+ + TEXTURE_OBJ_WRAP_T + " from " + TABLENAME;//$NON-NLS-1$
@Override
public String getTableName() {
}
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));
+ 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) {
insertData(insertList);
}
+ public void initTextureDataAtOpen() {
+ List<GLStateTextureType> selectedList = select();
+ for (GLStateTextureType type : selectedList) {
+ GLDataManager.getInstance().getStateDataManager().getTextureMakeObject()
+ .addTextureList(type);
+ }
+ }
+
+ public void insertTextureData() {
+ List<GLStateTextureType> insertList = GLDataManager.getInstance().getStateDataManager()
+ .getTextureMakeObject().getTextureList();
+ for (GLStateTextureType type : insertList) {
+ insertData(type);
+ }
+ }
+
public List<GLStateTextureType> select() {
- List<List<Object>> result = SqlConnectionManager
- .executeQuery(SELECT_QUERY);
+ List<List<Object>> result = SqlConnectionManager.executeQuery(SELECT_QUERY);
if (null == result || result.size() == 0 || result.get(0).size() == 0) {
return null;
}
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);
+ 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);
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)));
+ (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)));
+ (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,
package org.tizen.dynamicanalyzer.ui.opengl.data;
-import java.util.Iterator;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData;
DA_LOG.error("GL " + apiName + " undefine type : " + parameters[1]);
}
}
- insertTextureData();
} else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_PARAM_FV)
|| apiName.equals(GLAPINameDefine.API_GL_TEXTURE_PARAM_IV)) {
if (parameters.length != 3) {
DA_LOG.error("GL " + apiName + " undefine type : " + parameters[1]);
}
}
- insertTextureData();
}
}
}
+ public void addTextureList(GLStateTextureType textureType) {
+ GLContextDataManager contextValue = getStateDataManager().getGLContextDataManager(
+ textureType.getContextID());
+ if (null == contextValue) {
+ contextValue = new GLContextDataManager(textureType.getContextID());
+ getStateDataManager().getStateHashMap().put(textureType.getContextID(), contextValue);
+ }
+ contextValue.textureList.add(textureType);
+ }
+
+ public List<GLStateTextureType> getTextureList() {
+ List<GLStateTextureType> returnProgramList = new ArrayList<GLStateTextureType>();
+ for (Map.Entry<Long, GLContextDataManager> entry : getStateDataManager().getStateHashMap()
+ .entrySet()) {
+ returnProgramList.addAll(entry.getValue().textureList);
+ }
+ return returnProgramList;
+ }
+
private boolean isSameTextureType(GLStateTextureType existingTexture,
String parameterTextureObjId, long contextId) {
if (existingTexture.getObjID() == Integer.parseInt(parameterTextureObjId.trim())
return false;
}
}
-
- private void insertTextureData() {
- Iterator<Entry<Long, GLContextDataManager>> itr = getStateDataManager().getStateHashMap()
- .entrySet().iterator();
- while (itr.hasNext()) {
- GLContextDataManager contextValue = ((Map.Entry<Long, GLContextDataManager>) itr.next())
- .getValue();
- GLStateTextureType insertTextureType = returnInsertTextureType(contextValue);
- if (null != insertTextureType) {
- GLDataManager.getInstance().getStateTextureDBTableManage()
- .insertData(insertTextureType);
- }
- }
- }
-
- private GLStateTextureType returnInsertTextureType(GLContextDataManager contextValue) {
- GLStateTextureType insertTextureType = null;
- for (int i = 0; i < contextValue.textureList.size(); i++) {
- if (contextValue.textureList.get(i).validInsertState()) {
- insertTextureType = contextValue.textureList.get(i);
- contextValue.textureList.remove(i);
- break;
- }
- }
- return insertTextureType;
-
- }
}
GLDataManager.getInstance().updateSharingContextList();
- List<GLStateTextureType> textureList = GLDataManager.getInstance()
- .getStateTextureDBTableManage().select();
+ List<GLStateTextureType> textureList = GLDataManager.getInstance().getStateDataManager()
+ .getTextureMakeObject().getTextureList();
+
if (null == textureList) {
return null;
}
String textureId = Integer.toString(textureList.get(i).getObjID());
- DATableDataFormat tableData = new DATableDataFormat(
- Long.parseLong(textureId));
+ DATableDataFormat tableData = new DATableDataFormat(Long.parseLong(textureId));
- text.add(GLPageLabels.GL_CONTEXT
- + Long.toString(textureList.get(i).getContextID()));
+ text.add(GLPageLabels.GL_CONTEXT + Long.toString(textureList.get(i).getContextID()));
text.add(GLPageLabels.GL_TEXTURE + textureId);
- text.add(GLConstantDefine.getConstantString(textureList.get(i)
- .getType()));
- text.add(GLConstantDefine.getConstantString(textureList.get(i)
- .getWrapS()));
- text.add(GLConstantDefine.getConstantString(textureList.get(i)
- .getWrapT()));
- text.add(GLConstantDefine.getConstantString(textureList.get(i)
- .getMinFilter()));
- text.add(GLConstantDefine.getConstantString(textureList.get(i)
- .getMagFilter()));
+ text.add(GLConstantDefine.getConstantString(textureList.get(i).getType()));
+ text.add(GLConstantDefine.getConstantString(textureList.get(i).getWrapS()));
+ text.add(GLConstantDefine.getConstantString(textureList.get(i).getWrapT()));
+ text.add(GLConstantDefine.getConstantString(textureList.get(i).getMinFilter()));
+ text.add(GLConstantDefine.getConstantString(textureList.get(i).getMagFilter()));
TableInput tableInput = new TableInput();
tableInput.setText(text);
long contextID = textureList.get(i).getContextID();
if (GLDataManager.getInstance().getSelectedContextID() == contextID) {
- tableInput.setInRange(true);
+ tableInput.setSecondSelection(true);
}
if (GLDataManager.getInstance().isSharingData(contextID)) {
- tableInput.setInRange(true);
+ tableInput.setSecondSelection(true);
}
}
return input;
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;
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.setTableName(GLPageLabels.GL_TEXTURE_VIEW_TITLE);
tableComp.setComparator(new DefaultTableComparator());
tableComp.setSortTypes(sortTypes);
tableComp.setColumnAlignment(columnAlignment);
@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();
}