Update knockout plotter to use new API

This commit is contained in:
Vincent Sanders 2017-02-11 13:47:39 +00:00
parent 18abdadac8
commit 7d660561cc
5 changed files with 475 additions and 292 deletions

View File

@ -628,7 +628,7 @@ bool content_scaled_redraw(struct hlcache_handle *h,
plot_ok &= c->handler->redraw(c, &data, &clip, &new_ctx); plot_ok &= c->handler->redraw(c, &data, &clip, &new_ctx);
if (ctx->plot->option_knockout) { if (ctx->plot->option_knockout) {
knockout_plot_end(); knockout_plot_end(ctx);
} }
return plot_ok; return plot_ok;

View File

@ -238,7 +238,7 @@ bool browser_window_redraw(struct browser_window *bw, int x, int y,
*/ */
if (bw->window != NULL && ctx->plot->option_knockout) { if (bw->window != NULL && ctx->plot->option_knockout) {
/* Root browser window: knockout end */ /* Root browser window: knockout end */
knockout_plot_end(); knockout_plot_end(ctx);
} }
return plot_ok; return plot_ok;
@ -314,7 +314,7 @@ bool browser_window_redraw(struct browser_window *bw, int x, int y,
if (bw->window != NULL && ctx->plot->option_knockout) { if (bw->window != NULL && ctx->plot->option_knockout) {
/* Root browser window: end knockout */ /* Root browser window: end knockout */
knockout_plot_end(); knockout_plot_end(ctx);
} }
return plot_ok; return plot_ok;

File diff suppressed because it is too large Load Diff

View File

@ -26,9 +26,21 @@
#include "netsurf/plotters.h" #include "netsurf/plotters.h"
/**
* Start a knockout plotting session
*
* \param ctx the redraw context with real plotter table
* \param knk_ctx updated to copy of ctx, with plotter table replaced
* \return true on success, false otherwise
*/
bool knockout_plot_start(const struct redraw_context *ctx, bool knockout_plot_start(const struct redraw_context *ctx,
struct redraw_context *knk_ctx); struct redraw_context *knk_ctx);
bool knockout_plot_end(void); /**
* End a knockout plotting session
*
* \return true on success, false otherwise
*/
bool knockout_plot_end(const struct redraw_context *ctx);
extern const struct plotter_table knockout_plotters; extern const struct plotter_table knockout_plotters;

View File

@ -2042,7 +2042,7 @@ void treeview_redraw(treeview *tree, const int x, const int y,
/* Rendering complete */ /* Rendering complete */
if (ctx->plot->option_knockout) { if (ctx->plot->option_knockout) {
knockout_plot_end(); knockout_plot_end(ctx);
} }
} }