hi,
When I customize the CEFClient's browser_background_color_ to CefColorSetARGB(255, 0, 0, 255), it causes a flash white after the rootWindow is created.
IN "CefBrowserViewImpl.h" it only change the resizeBackgroundColor, and in "view_view.h" the backgroundColr is set to be white and not changed after.
I wonder if there already had a way to change the browser's backgroundColor without flashing white, or could privide one, thanks for your kind help.
1. cef/libcef/browser/views/browser_view_impl.cc
void CefBrowserViewImpl::SetBackgroundColor(cef_color_t color) {
CEF_REQUIRE_VALID_RETURN_VOID();
ParentClass::SetBackgroundColor(color);
if (root_view())
root_view()->SetResizeBackgroundColor(color);
}
2. libcef "view_view.h"
virtual void Initialize() {
// Use our defaults instead of the Views framework defaults.
ParentClass::set_background(views::Background::CreateSolidBackground(
view_util::kDefaultBackgroundColor));
}
3.chromium / experimental / chromium / src / refs/wip/bajones/webvr / . / ui / views / controls / native / native_view_host.cc
void NativeViewHost::OnPaint(gfx::Canvas* canvas) {
// Paint background if there is one. NativeViewHost needs to paint
// a background when it is hosted in a TabbedPane. For Gtk implementation,
// NativeTabbedPaneGtk uses a NativeWidgetGtk as page container and because
// NativeWidgetGtk hook "expose" with its root view's paint, we need to
// fill the content. Otherwise, the tab page's background is not properly
// cleared. For Windows case, it appears okay to not paint background because
// we don't have a container window in-between. However if you want to use
// customized background, then this becomes necessary.
OnPaintBackground(canvas);
// The area behind our window is black, so during a fast resize (where our
// content doesn't draw over the full size of our native view, and the native
// view background color doesn't show up), we need to cover that blackness
// with something so that fast resizes don't result in black flash.
//
// It would be nice if this used some approximation of the page's
// current background color.
if (native_wrapper_->HasInstalledClip())
canvas->FillRect(GetLocalBounds(), resize_background_color_);
}
thx