Fix initial transparency delay for OSR + gpu-disabled (see issue #2938)
This commit is contained in:
parent
11f37bc6eb
commit
87c8a72831
|
@ -53,6 +53,12 @@ void CefBrowserPlatformDelegateOsr::WebContentsCreated(
|
|||
view_osr_->WebContentsCreated(web_contents);
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateOsr::RenderViewCreated(
|
||||
content::RenderViewHost* render_view_host) {
|
||||
if (view_osr_)
|
||||
view_osr_->RenderViewCreated();
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateOsr::BrowserCreated(
|
||||
CefBrowserHostImpl* browser) {
|
||||
CefBrowserPlatformDelegateAlloy::BrowserCreated(browser);
|
||||
|
|
|
@ -26,6 +26,7 @@ class CefBrowserPlatformDelegateOsr
|
|||
content::RenderViewHostDelegateView** delegate_view) override;
|
||||
void WebContentsCreated(content::WebContents* web_contents,
|
||||
bool owned) override;
|
||||
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
|
||||
void BrowserCreated(CefBrowserHostImpl* browser) override;
|
||||
void NotifyBrowserDestroyed() override;
|
||||
void BrowserDestroyed(CefBrowserHostImpl* browser) override;
|
||||
|
|
|
@ -29,7 +29,17 @@ void CefWebContentsViewOSR::WebContentsCreated(
|
|||
DCHECK(!web_contents_);
|
||||
web_contents_ = web_contents;
|
||||
|
||||
RenderViewReady();
|
||||
RenderViewCreated();
|
||||
}
|
||||
|
||||
void CefWebContentsViewOSR::RenderViewCreated() {
|
||||
if (web_contents_) {
|
||||
auto host = web_contents_->GetRenderViewHost();
|
||||
CefRenderWidgetHostViewOSR* view =
|
||||
static_cast<CefRenderWidgetHostViewOSR*>(host->GetWidget()->GetView());
|
||||
if (view)
|
||||
view->InstallTransparency();
|
||||
}
|
||||
}
|
||||
|
||||
gfx::NativeView CefWebContentsViewOSR::GetNativeView() const {
|
||||
|
@ -120,15 +130,7 @@ CefWebContentsViewOSR::CreateViewForChildWidget(
|
|||
|
||||
void CefWebContentsViewOSR::SetPageTitle(const base::string16& title) {}
|
||||
|
||||
void CefWebContentsViewOSR::RenderViewReady() {
|
||||
if (web_contents_) {
|
||||
auto host = web_contents_->GetRenderViewHost();
|
||||
CefRenderWidgetHostViewOSR* view =
|
||||
static_cast<CefRenderWidgetHostViewOSR*>(host->GetWidget()->GetView());
|
||||
if (view)
|
||||
view->InstallTransparency();
|
||||
}
|
||||
}
|
||||
void CefWebContentsViewOSR::RenderViewReady() {}
|
||||
|
||||
void CefWebContentsViewOSR::RenderViewHostChanged(
|
||||
content::RenderViewHost* old_host,
|
||||
|
|
|
@ -31,6 +31,8 @@ class CefWebContentsViewOSR : public content::WebContentsView,
|
|||
void WebContentsCreated(content::WebContents* web_contents);
|
||||
content::WebContents* web_contents() const { return web_contents_; }
|
||||
|
||||
void RenderViewCreated();
|
||||
|
||||
// WebContentsView methods.
|
||||
gfx::NativeView GetNativeView() const override;
|
||||
gfx::NativeView GetContentNativeView() const override;
|
||||
|
|
Loading…
Reference in New Issue