summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Dumais2012-12-10 06:40:52 (EST)
committerWilliam Swanson2012-12-10 15:03:37 (EST)
commitc916dfe4e71389790a361876c4b19a1599b6db10 (patch)
treea49a592e3ba99c6923aacc401fac8c85ce4d3bd4
parent880ac74b2675055c328285c15a2b8879707e6949 (diff)
downloadorg.eclipse.cdt-c916dfe4e71389790a361876c4b19a1599b6db10.zip
org.eclipse.cdt-c916dfe4e71389790a361876c4b19a1599b6db10.tar.gz
org.eclipse.cdt-c916dfe4e71389790a361876c4b19a1599b6db10.tar.bz2
Bug 396076 - [Visualizer] Cores displayed non-optimally when there arerefs/changes/10/9110/3
multiple CPUs Change-Id: Ib043630b29ba1c25bd5fd8ee08c68e3ca388bb68 Reviewed-on: https://git.eclipse.org/r/9110 Reviewed-by: William Swanson <traveler@tilera.com> IP-Clean: William Swanson <traveler@tilera.com> Tested-by: William Swanson <traveler@tilera.com>
-rwxr-xr-xdsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java
index 993e227..80adea4 100755
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java
@@ -7,6 +7,7 @@
*
* Contributors:
* William R. Swanson (Tilera Corporation) - initial API and implementation
+ * Marc Dumais (Ericsson) - Bug 396076
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
@@ -396,6 +397,11 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
}
if (m_recacheSizes) {
+ // avoid doing resize calculations if the model is not ready
+ if (m_model == null ) {
+ m_recacheSizes = false;
+ return;
+ }
// update cached size information
// General margin/spacing constants.
@@ -418,7 +424,7 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
if (cpu_size < 0) cpu_size = 0;
// Calculate area on each CPU for placing cores.
- int ncores = m_cores.size();
+ int ncores = m_cores.size() / ((ncpus == 0) ? 1 : ncpus);
int cpu_width = cpu_size - core_margin * 2 + core_separation;
int cpu_height = cpu_size - core_margin * 2 + core_separation;
int core_edge = fitSquareItems(ncores, cpu_width, cpu_height);