pixheight = len;
pixwidth = dimen;
fgpattern = request_vertical_meter(pixwidth, pixheight, _clr, _stp, _styleflags);
- bgpattern = request_vertical_background (pixwidth, pixheight, _bgc);
+ bgpattern = request_vertical_background (pixwidth, pixheight, _bgc, false);
} else {
pixheight = dimen;
pixwidth = len;
fgpattern = request_horizontal_meter(pixwidth, pixheight, _clr, _stp, _styleflags);
- bgpattern = request_horizontal_background (pixwidth, pixheight, _bgc);
+ bgpattern = request_horizontal_background (pixwidth, pixheight, _bgc, false);
}
pixrect.width = pixwidth;
void
FastMeter::flush_pattern_cache ()
{
- Pattern10Map::iterator i1;
- PatternBgMap::iterator ib;
-
- for (ib = hb_pattern_cache.begin(); ib != hb_pattern_cache.end(); ++ib) {
- hb_pattern_cache.erase(ib);
- }
-
- for (i1 = hm_pattern_cache.begin(); i1 != hm_pattern_cache.end(); ++i1) {
- hm_pattern_cache.erase(i1);
- }
-
- for (ib = vb_pattern_cache.begin(); ib != vb_pattern_cache.end(); ++ib) {
- vb_pattern_cache.erase(ib);
- }
-
- for (i1 = vm_pattern_cache.begin(); i1 != vm_pattern_cache.end(); ++i1) {
- vm_pattern_cache.erase(i1);
- }
+ hb_pattern_cache.clear();
+ hm_pattern_cache.clear();
+ vb_pattern_cache.clear();
+ vm_pattern_cache.clear();
}
Cairo::RefPtr<Cairo::Pattern>
if (pixheight != h) {
fgpattern = request_vertical_meter (request_width, h, _clr, _stp, _styleflags);
- bgpattern = request_vertical_background (request_width, h, highlight ? _bgh : _bgc);
+ bgpattern = request_vertical_background (request_width, h, highlight ? _bgh : _bgc, false);
pixheight = h;
pixwidth = request_width;
}
if (pixwidth != w) {
fgpattern = request_horizontal_meter (w, request_height, _clr, _stp, _styleflags);
- bgpattern = request_horizontal_background (w, request_height, highlight ? _bgh : _bgc);
+ bgpattern = request_horizontal_background (w, request_height, highlight ? _bgh : _bgc, false);
pixwidth = w;
pixheight = request_height;
}
FastMeter::vertical_expose (cairo_t* cr, cairo_rectangle_t* area)
{
gint top_of_meter;
- GdkRectangle intersection;
- GdkRectangle background;
- GdkRectangle eventarea;
+ // GdkRectangle background;
+ // GdkRectangle eventarea;
//cairo_set_source_rgb (cr, 0, 0, 0); // black
//rounded_rectangle (cr, 0, 0, pixwidth + 2, pixheight + 2, 2);
pixrect.height = top_of_meter;
pixrect.y = pixheight - top_of_meter;
- background.x = 0;
- background.y = 0;
- background.width = pixrect.width;
- background.height = pixheight - top_of_meter;
+ // background.x = 0;
+ // background.y = 0;
+ // background.width = pixrect.width;
+ // background.height = pixheight - top_of_meter;
- eventarea.x = area->x;
- eventarea.y = area->y;
- eventarea.width = area->width;
- eventarea.height = area->height;
+ // eventarea.x = area->x;
+ // eventarea.y = area->y;
+ // eventarea.width = area->width;
+ // eventarea.height = area->height;
// Switching to CAIRO we would like to draw on the container's bkg.
// if (gdk_rectangle_intersect (&background, &eventarea, &intersection)) {
// MEMO: Normaly MATURE OS clips so called invalidated rects itself making APP free of
// heavy operations which OS does with graphic HW
- // NOTE FROM PAUL: GTK does clip already. The invalidated rect isn't the only area
+ // NOTE FROM PAUL: GTK does clip already. The invalidated rect isn't the only area
// we want to clip to however, which is why this object/class is called FastMeter.
// I have left stuff commented out as I found it when I merged from Ardour in August 2014,
// but this commenting and the previous MEMO comment represent a misunderstanding
FastMeter::horizontal_expose (cairo_t* cr, cairo_rectangle_t* area)
{
gint right_of_meter;
- GdkRectangle intersection;
- GdkRectangle background;
- GdkRectangle eventarea;
//cairo_set_source_rgb (cr, 0, 0, 0); // black
//rounded_rectangle (cr, 0, 0, pixwidth + 2, pixheight + 2, 2);
pixrect.width = right_of_meter;
- background.x = 1 + right_of_meter;
- background.y = 1;
- background.width = pixwidth - right_of_meter;
- background.height = pixheight;
-
- eventarea.x = area->x;
- eventarea.y = area->y;
- eventarea.width = area->width;
- eventarea.height = area->height;
-
- // if (gdk_rectangle_intersect (&background, &eventarea, &intersection)) {
- // cairo_set_source (cr, bgpattern->cobj());
- // cairo_rectangle (cr, intersection.x, intersection.y, intersection.width, intersection.height);
- // cairo_fill (cr);
- // }
-
- // if (gdk_rectangle_intersect (&pixrect, &eventarea, &intersection)) {
- // cairo_set_source (cr, fgpattern->cobj());
- // cairo_rectangle (cr, intersection.x, intersection.y, intersection.width, intersection.height);
- // cairo_fill (cr);
- // }
-
// draw peak bar
if (hold_state) {
}
highlight = onoff;
if (orientation == Vertical) {
- bgpattern = request_vertical_background (pixwidth + 2, pixheight + 2, highlight ? _bgh : _bgc);
+ bgpattern = request_vertical_background (pixwidth + 2, pixheight + 2, highlight ? _bgh : _bgc, false);
} else {
- bgpattern = request_horizontal_background (pixwidth + 2, pixheight + 2, highlight ? _bgh : _bgc);
+ bgpattern = request_horizontal_background (pixwidth + 2, pixheight + 2, highlight ? _bgh : _bgc, false);
}
queue_draw ();
}