aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorMateusz Zalega <mateusz@appliedsourcery.com>2018-08-16 21:44:37 +0200
committerMateusz Zalega <mateusz@appliedsourcery.com>2018-10-23 15:43:51 +0200
commitd03291eeb1efbb1005eba5a8a4b2c92ef66d2fd5 (patch)
tree997b4a31291efaca2d1f60c54e95b81785a9ddcc /common
parentb5faa7ad102b8308eeb0c73a3849909bf4b1b635 (diff)
downloadnextpnr-d03291eeb1efbb1005eba5a8a4b2c92ef66d2fd5.tar.gz
nextpnr-d03291eeb1efbb1005eba5a8a4b2c92ef66d2fd5.tar.bz2
nextpnr-d03291eeb1efbb1005eba5a8a4b2c92ef66d2fd5.zip
gui: improved FPGAViewWidget::paintGL() performance
Profiling revealed that memcpy() in QOpenGLBuffer::allocate() had been taking the most time during paintGL() calls. I've been able to take the CPU usage down to about 1/4 of its previous values by caching elements in VBOs and updating them only after subsequent calls to renderGraphicElement(). Signed-off-by: Mateusz Zalega <mateusz@appliedsourcery.com>
Diffstat (limited to 'common')
-rw-r--r--common/nextpnr.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h
index 29a85a10..59ae0323 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -157,11 +157,25 @@ struct GraphicElement
enum style_t
{
+ STYLE_GRID,
STYLE_FRAME, // Static "frame". Contrast between STYLE_INACTIVE and STYLE_ACTIVE
STYLE_HIDDEN, // Only display when object is selected or highlighted
STYLE_INACTIVE, // Render using low-contrast color
STYLE_ACTIVE, // Render using high-contast color
+ // UI highlight groups
+ STYLE_HIGHLIGHTED0,
+ STYLE_HIGHLIGHTED1,
+ STYLE_HIGHLIGHTED2,
+ STYLE_HIGHLIGHTED3,
+ STYLE_HIGHLIGHTED4,
+ STYLE_HIGHLIGHTED5,
+ STYLE_HIGHLIGHTED6,
+ STYLE_HIGHLIGHTED7,
+
+ STYLE_SELECTED,
+ STYLE_HOVER,
+
STYLE_MAX
} style = STYLE_FRAME;