Fix drawing of dirty block overlays

pull/451/head
Jonathan G Rennison 2 years ago
parent 8c2dd8d7fb
commit 449ed7aa51

@ -1753,7 +1753,6 @@ void DrawDirtyBlocks()
DrawOverlappedWindowFlags flags = DOWF_MARK_DIRTY;
if (unlikely(HasBit(_gfx_debug_flags, GDF_SHOW_WINDOW_DIRTY))) {
flags |= DOWF_SHOW_DEBUG;
_dirty_block_colour.fetch_add(1, std::memory_order_relaxed);
}
DrawOverlappedWindowWithClipping(w, w->left, w->top, w->left + w->width, w->top + w->height, flags);
w->flags &= ~(WF_DIRTY | WF_WIDGETS_DIRTY);
@ -1765,7 +1764,6 @@ void DrawDirtyBlocks()
DrawOverlappedWindowFlags flags = DOWF_MARK_DIRTY;
if (unlikely(HasBit(_gfx_debug_flags, GDF_SHOW_WIDGET_DIRTY))) {
flags |= DOWF_SHOW_DEBUG;
_dirty_block_colour.fetch_add(1, std::memory_order_relaxed);
}
DrawOverlappedWindowWithClipping(w, w->left + widget->pos_x, w->top + widget->pos_y, w->left + widget->pos_x + widget->current_x, w->top + widget->pos_y + widget->current_y, flags);
}

@ -2215,7 +2215,7 @@ void ViewportDrawDirtyBlocks(const DrawPixelInfo *dpi, bool increment_colour)
int bottom = UnScaleByZoom(dpi->height, dpi->zoom);
const uint dirty_block_colour = increment_colour ? _dirty_block_colour.fetch_add(1, std::memory_order_relaxed) : _dirty_block_colour.load(std::memory_order_relaxed);
int colour = _string_colourmap[dirty_block_colour];
int colour = _string_colourmap[dirty_block_colour & 0xF];
dst = dpi->dst_ptr;

@ -948,8 +948,9 @@ void DrawOverlappedWindow(Window *w, int left, int top, int right, int bottom, D
dp->zoom = ZOOM_LVL_NORMAL;
w->OnPaint();
if (unlikely(flags & DOWF_SHOW_DEBUG)) {
if (w->viewport != nullptr) ViewportDoDrawProcessAllPending();
extern void ViewportDrawDirtyBlocks(const DrawPixelInfo *dpi, bool increment_colour);
ViewportDrawDirtyBlocks(_cur_dpi, false);
ViewportDrawDirtyBlocks(_cur_dpi, true);
}
if (flags & DOWF_MARK_DIRTY) {
VideoDriver::GetInstance()->MakeDirty(left, top, right - left, bottom - top);

Loading…
Cancel
Save