anmar7889 / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
0 stars 1 forks source link

OnPaint not called for off-screen popup windows #1437

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an off-screen rendered popup by calling windowInfo.SetAsWindowless in 
OnBeforePopup

What is the expected output? What do you see instead?
CefRenderHandler::OnPaint should be called for the new popup window. Instead, 
it is never called.

Please use labels and text to provide additional information.
The problem is that CefRenderWidgetHostViewOSR never calls 
Compositor::SetScaleAndSize for popup windows. This results in LayerTreeHost 
always having an empty |device_viewport_size_| value and consequently 
SingleThreadProxy::DoComposite fails with DRAW_ABORTED_CANT_DRAW.

Related call stack from Chromium revision 40af916:

    libcef.dll!cc::SingleThreadProxy::DoComposite(base::TimeTicks frame_begin_time, cc::LayerTreeHostImpl::FrameData * frame) Line 580  C++
    libcef.dll!cc::SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) Line 518   C++
    libcef.dll!cc::LayerTreeHost::Composite(base::TimeTicks frame_begin_time) Line 735  C++
    libcef.dll!ui::Compositor::Draw() Line 242  C++

For comparison, a successful async result looks like this:

#1: DoCommit:

>   libcef.dll!cc::Layer::PushPropertiesTo(cc::LayerImpl * layer) Line 987  C++
    libcef.dll!cc::DelegatedRendererLayer::PushPropertiesTo(cc::LayerImpl * impl) Line 65   C++
    libcef.dll!cc::TreeSynchronizer::PushPropertiesInternal<cc::Layer>(cc::Layer * layer, cc::LayerImpl * layer_impl, unsigned int * num_dependents_need_push_properties_for_parent) Line 203   C++
    libcef.dll!cc::TreeSynchronizer::PushPropertiesInternal<cc::Layer>(cc::Layer * layer, cc::LayerImpl * layer_impl, unsigned int * num_dependents_need_push_properties_for_parent) Line 222   C++
    libcef.dll!cc::TreeSynchronizer::PushProperties(cc::Layer * layer, cc::LayerImpl * layer_impl) Line 299 C++
    libcef.dll!cc::LayerTreeHost::FinishCommitOnImplThread(cc::LayerTreeHostImpl * host_impl) Line 319  C++
    libcef.dll!cc::SingleThreadProxy::DoCommit() Line 220   C++
    libcef.dll!cc::SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) Line 497   C++
    libcef.dll!cc::LayerTreeHost::Composite(base::TimeTicks frame_begin_time) Line 735  C++
    libcef.dll!ui::Compositor::Draw() Line 242  C++

#2: DoComposite:

>   libcef.dll!cc::PostCopyCallbackToMainThread(scoped_refptr<base::SingleThreadTa
skRunner> main_thread_task_runner, 
scoped_ptr<cc::CopyOutputRequest,base::DefaultDeleter<cc::CopyOutputRequest> > 
request, 
scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> > 
result) Line 851    C++
    libcef.dll!base::internal::RunnableAdapter<void (__cdecl*)(scoped_refptr<base::SingleThreadTaskRunner>,scoped_ptr<cc::CopyOutputRequest,base::DefaultDeleter<cc::CopyOutputRequest> >,scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >)>::Run(const scoped_refptr<base::SingleThreadTaskRunner> & a1, scoped_ptr<cc::CopyOutputRequest,base::DefaultDeleter<cc::CopyOutputRequest> > a2, scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> > a3) Line 289  C++
    libcef.dll!base::internal::InvokeHelper<0,void,base::internal::RunnableAdapter<void (__cdecl*)(scoped_refptr<base::SingleThreadTaskRunner>,scoped_ptr<cc::CopyOutputRequest,base::DefaultDeleter<cc::CopyOutputRequest> >,scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >)>,void __cdecl(base::SingleThreadTaskRunner *,scoped_ptr<cc::CopyOutputRequest,base::DefaultDeleter<cc::CopyOutputRequest> >,scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >)>::MakeItSo(base::internal::RunnableAdapter<void (__cdecl*)(scoped_refptr<base::SingleThreadTaskRunner>,scoped_ptr<cc::CopyOutputRequest,base::DefaultDeleter<cc::CopyOutputRequest> >,scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >)> runnable, base::SingleThreadTaskRunner * a1, scoped_ptr<cc::CopyOutputRequest,base::DefaultDeleter<cc::CopyOutputRequest> > a2, scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> > a3) Line 927    C++
    libcef.dll!base::internal::Invoker<2,base::internal::BindState<base::internal::RunnableAdapter<void (__cdecl*)(scoped_refptr<base::SingleThreadTaskRunner>,scoped_ptr<cc::CopyOutputRequest,base::DefaultDeleter<cc::CopyOutputRequest> >,scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >)>,void __cdecl(scoped_refptr<base::SingleThreadTaskRunner>,scoped_ptr<cc::CopyOutputRequest,base::DefaultDeleter<cc::CopyOutputRequest> >,scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >),void __cdecl(scoped_refptr<base::SingleThreadTaskRunner>,base::internal::PassedWrapper<scoped_ptr<cc::CopyOutputRequest,base::DefaultDeleter<cc::CopyOutputRequest> > >)>,void __cdecl(scoped_refptr<base::SingleThreadTaskRunner>,scoped_ptr<cc::CopyOutputRequest,base::DefaultDeleter<cc::CopyOutputRequest> >,scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >)>::Run(base::internal::BindStateBase * base, scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> > x3) Line 1349   C++
    libcef.dll!base::Callback<void __cdecl(scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >)>::Run(scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> > a1) Line 441    C++
    libcef.dll!cc::CopyOutputRequest::SendResult(scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> > result) Line 50   C++
    libcef.dll!cc::CopyOutputRequest::SendTextureResult(const gfx::Size & size, const cc::TextureMailbox & texture_mailbox, scoped_ptr<cc::SingleReleaseCallback,base::DefaultDeleter<cc::SingleReleaseCallback> > release_callback) Line 69    C++
    libcef.dll!cc::GLRenderer::GetFramebufferPixelsAsync(const cc::DirectRenderer::DrawingFrame * frame, const gfx::Rect & rect, scoped_ptr<cc::CopyOutputRequest,base::DefaultDeleter<cc::CopyOutputRequest> > request) Line 2482  C++
    libcef.dll!cc::GLRenderer::CopyCurrentRenderPassToBitmap(cc::DirectRenderer::DrawingFrame * frame, scoped_ptr<cc::CopyOutputRequest,base::DefaultDeleter<cc::CopyOutputRequest> > request) Line 2272    C++
    libcef.dll!cc::DirectRenderer::DrawFrame(cc::ScopedPtrVector<cc::RenderPass> * render_passes_in_draw_order, float device_scale_factor, const gfx::Rect & device_viewport_rect, const gfx::Rect & device_clip_rect, bool disable_picture_quad_image_filtering) Line 243  C++
    libcef.dll!cc::LayerTreeHostImpl::DrawLayers(cc::LayerTreeHostImpl::FrameData * frame, base::TimeTicks frame_begin_time) Line 1508  C++
    libcef.dll!cc::SingleThreadProxy::DoComposite(base::TimeTicks frame_begin_time, cc::LayerTreeHostImpl::FrameData * frame) Line 588  C++
    libcef.dll!cc::SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) Line 518   C++
    libcef.dll!cc::LayerTreeHost::Composite(base::TimeTicks frame_begin_time) Line 735  C++
    libcef.dll!ui::Compositor::Draw() Line 242  C++

#3: Execute CopyFromCompositingSurfaceHasResult:

>   libcef.dll!CefRenderWidgetHostViewOSR::CopyFromCompositingSurfaceHasResult(sco
ped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> > 
result) Line 866    C++
    libcef.dll!base::internal::RunnableAdapter<void (__thiscall CefRenderWidgetHostViewOSR::*)(scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >)>::Run(CefRenderWidgetHostViewOSR * object, scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> > a1) Line 190   C++
    libcef.dll!base::internal::InvokeHelper<1,void,base::internal::RunnableAdapter<void (__thiscall CefRenderWidgetHostViewOSR::*)(scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >)>,void __cdecl(base::WeakPtr<CefRenderWidgetHostViewOSR> const &,scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >)>::MakeItSo(base::internal::RunnableAdapter<void (__thiscall CefRenderWidgetHostViewOSR::*)(scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >)> runnable, const base::WeakPtr<CefRenderWidgetHostViewOSR> & weak_ptr, scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> > a2) Line 910    C++
    libcef.dll!base::internal::Invoker<1,base::internal::BindState<base::internal::RunnableAdapter<void (__thiscall CefRenderWidgetHostViewOSR::*)(scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >)>,void __cdecl(CefRenderWidgetHostViewOSR *,scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >),void __cdecl(base::WeakPtr<CefRenderWidgetHostViewOSR>)>,void __cdecl(CefRenderWidgetHostViewOSR *,scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >)>::Run(base::internal::BindStateBase * base, scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> > x2) Line 1224   C++
    libcef.dll!base::Callback<void __cdecl(scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> >)>::Run(scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> > a1) Line 441    C++
    libcef.dll!cc::CopyOutputRequest::SendResult(scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> > result) Line 50   C++
    libcef.dll!cc::RunCopyCallbackOnMainThread(scoped_ptr<cc::CopyOutputRequest,base::DefaultDeleter<cc::CopyOutputRequest> > request, scoped_ptr<cc::CopyOutputResult,base::DefaultDeleter<cc::CopyOutputResult> > result) Line 842    C++

Original issue reported on code.google.com by magreenb...@gmail.com on 18 Nov 2014 at 7:26

GoogleCodeExporter commented 9 years ago
Fixed in trunk revision 1910, 2171 branch revision 1911 and 2062 branch 
revision 1914. Note that it's necessary to call CefBrowserHost::WasResized() at 
least one time after the off-screen CefBrowser is created.

Original comment by magreenb...@gmail.com on 18 Nov 2014 at 7:37

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 18 Nov 2014 at 8:12