Skip to content

Commit

Permalink
Layer calls for pm3d queue flush
Browse files Browse the repository at this point in the history
  • Loading branch information
markisch committed Nov 19, 2016
1 parent 7420760 commit 0390141
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/pm3d.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static char *RCSid() { return RCSid("$Id: pm3d.c,v 1.114 2016-11-05 21:21:07 sfeam Exp $"); }
static char *RCSid() { return RCSid("$Id: pm3d.c,v 1.115 2016-11-19 06:43:49 markisch Exp $"); }
#endif

/* GNUPLOT - pm3d.c */
Expand Down Expand Up @@ -384,6 +384,8 @@ void pm3d_depth_queue_flush(void)
if (pm3d.direction != PM3D_DEPTH && !track_pm3d_quadrangles)
return;

term->layer(TERM_LAYER_BEGIN_PM3D_FLUSH);

if (current_quadrangle > 0 && quadrangles) {

quadrangle* qp;
Expand Down Expand Up @@ -442,6 +444,8 @@ void pm3d_depth_queue_flush(void)
}

pm3d_depth_queue_clear();

term->layer(TERM_LAYER_END_PM3D_FLUSH);
}

/*
Expand Down
4 changes: 3 additions & 1 deletion src/term_api.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: term_api.h,v 1.149 2016-10-08 20:13:17 markisch Exp $
* $Id: term_api.h,v 1.150 2016-11-19 06:43:49 markisch Exp $
*/

/* GNUPLOT - term_api.h */
Expand Down Expand Up @@ -202,6 +202,8 @@ typedef enum termlayer {
TERM_LAYER_BEFORE_ZOOM,
TERM_LAYER_BEGIN_PM3D_MAP,
TERM_LAYER_END_PM3D_MAP,
TERM_LAYER_BEGIN_PM3D_FLUSH,
TERM_LAYER_END_PM3D_FLUSH,
TERM_LAYER_BEGIN_IMAGE,
TERM_LAYER_END_IMAGE,
TERM_LAYER_BEGIN_COLORBOX,
Expand Down
6 changes: 4 additions & 2 deletions src/win/wgdiplus.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: wgdiplus.cpp,v 1.45 2016-11-19 06:31:07 markisch Exp $
* $Id: wgdiplus.cpp,v 1.46 2016-11-19 06:43:49 markisch Exp $
*/

/*
Expand Down Expand Up @@ -742,7 +742,8 @@ do_draw_gdiplus(LPGW lpgw, Graphics &graphics, LPRECT rect, enum draw_target tar
plotno = 0;
break;
case TERM_LAYER_BEGIN_PM3D_MAP:
// Antialiasing of pm3d polygons is obtained by drawing to
case TERM_LAYER_BEGIN_PM3D_FLUSH:
// Antialiasing of pm3d polygons is obtained by drawing to a
// bitmap four times as large and copying it back with interpolation
if (lpgw->antialiasing && lpgw->polyaa) {
float scale = 2.f;
Expand All @@ -754,6 +755,7 @@ do_draw_gdiplus(LPGW lpgw, Graphics &graphics, LPRECT rect, enum draw_target tar
}
break;
case TERM_LAYER_END_PM3D_MAP:
case TERM_LAYER_END_PM3D_FLUSH:
if (poly_graphics != NULL) {
delete poly_graphics;
poly_graphics = NULL;
Expand Down

0 comments on commit 0390141

Please sign in to comment.