mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-03-27 09:23:01 +03:00
Fix the white flickering and bad redraws (text too dark due to being drawn twice), by setting the ViewColor to transparent (avoiding app_server to draw it), and doing it ourselves in plot_clg() just before drawing the rest.
svn path=/trunk/netsurf/; revision=5486
This commit is contained in:
parent
ae7290a2e2
commit
022616ce99
@ -143,6 +143,20 @@ void nsbeos_current_gc_set(BView *view)
|
||||
bool nsbeos_plot_clg(colour c)
|
||||
{
|
||||
#warning BView::Invalidate() ?
|
||||
|
||||
BView *view;
|
||||
|
||||
view = nsbeos_current_gc/*_lock*/();
|
||||
if (view == NULL) {
|
||||
warn_user("No GC", 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
nsbeos_set_colour(c);
|
||||
view->FillRect(view->Bounds());
|
||||
|
||||
//nsbeos_current_gc_unlock();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -596,10 +610,12 @@ bool nsbeos_plot_bitmap_tile(int x, int y, int width, int height,
|
||||
pretiled = nsbeos_bitmap_get_pretile_y(bitmap);
|
||||
primary = nsbeos_bitmap_get_primary(bitmap);
|
||||
/* use the primary and pretiled widths to scale the w/h provided */
|
||||
printf("plot_tile: -> %dx%d\n", width, height);
|
||||
width *= pretiled->Bounds().Width() + 1;
|
||||
width /= primary->Bounds().Width() + 1;
|
||||
height *= pretiled->Bounds().Height() + 1;
|
||||
height /= primary->Bounds().Height() + 1;
|
||||
printf("plot_tile: -> %dx%d\n", width, height);
|
||||
|
||||
BView *view;
|
||||
|
||||
|
@ -367,8 +367,12 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
|
||||
BRect frame(0,0,-1,-1); // will be resized later
|
||||
g->view = new NSBrowserFrameView(frame, g);
|
||||
/* set the default background colour of the drawing area to white. */
|
||||
//g->view->SetViewColor(B_TRANSPARENT_COLOR);
|
||||
g->view->SetViewColor(kWhiteColor);
|
||||
//g->view->SetViewColor(kWhiteColor);
|
||||
/* NOOO! Since we defer drawing (DetachCurrent()), the white flickers,
|
||||
* besides sometimes text was drawn twice, making it ugly.
|
||||
* Instead we set to transparent here, and implement plot_clg() to
|
||||
* do it just before the rest. This almost removes the flicker. */
|
||||
g->view->SetViewColor(B_TRANSPARENT_COLOR);
|
||||
g->view->SetLowColor(kWhiteColor);
|
||||
|
||||
#ifdef B_BEOS_VERSION_DANO
|
||||
|
Loading…
x
Reference in New Issue
Block a user