Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(765)

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 2317753002: cc: Abstract the LayerTreeHost. (Closed)
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/swap_promise_monitor.cc ('k') | content/renderer/gpu/render_widget_compositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index 15aa7e0d6f8234af09e907b07e178929189f6541..c5b90203eba3c2cbdc8452ef3d80a134cac4b4c0 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -503,9 +503,9 @@ void CompositorImpl::CreateLayerTreeHost() {
params.settings = &settings;
params.animation_host = cc::AnimationHost::CreateMainInstance();
host_ = cc::LayerTreeHost::CreateSingleThreaded(this, &params);
- DCHECK(!host_->visible());
+ DCHECK(!host_->IsVisible());
host_->GetLayerTree()->SetRootLayer(root_window_->GetLayer());
- host_->set_surface_client_id(surface_id_allocator_->client_id());
+ host_->SetSurfaceClientId(surface_id_allocator_->client_id());
host_->GetLayerTree()->SetViewportSize(size_);
host_->GetLayerTree()->set_has_transparent_background(
has_transparent_background_);
@@ -518,7 +518,7 @@ void CompositorImpl::CreateLayerTreeHost() {
void CompositorImpl::SetVisible(bool visible) {
TRACE_EVENT1("cc", "CompositorImpl::SetVisible", "visible", visible);
if (!visible) {
- DCHECK(host_->visible());
+ DCHECK(host_->IsVisible());
// Make a best effort to try to complete pending readbacks.
// TODO(crbug.com/637035): Consider doing this in a better way,
@@ -562,7 +562,7 @@ void CompositorImpl::SetHasTransparentBackground(bool flag) {
}
void CompositorImpl::SetNeedsComposite() {
- if (!host_->visible())
+ if (!host_->IsVisible())
return;
TRACE_EVENT0("compositor", "Compositor::SetNeedsComposite");
host_->SetNeedsAnimate();
@@ -600,7 +600,7 @@ void CompositorImpl::HandlePendingOutputSurfaceRequest() {
DCHECK(output_surface_request_pending_);
// We might have been made invisible now.
- if (!host_->visible())
+ if (!host_->IsVisible())
return;
#if defined(ENABLE_VULKAN)
@@ -664,7 +664,7 @@ void CompositorImpl::OnGpuChannelEstablished(
break;
case ui::ContextProviderFactory::GpuChannelHostResult::SUCCESS:
// We don't need the context anymore if we are invisible.
- if (!host_->visible())
+ if (!host_->IsVisible())
return;
DCHECK(window_);
@@ -712,7 +712,7 @@ void CompositorImpl::InitializeDisplay(
display_.reset(new cc::Display(
HostSharedBitmapManager::current(),
BrowserGpuMemoryBufferManager::current(),
- host_->settings().renderer_settings, std::move(begin_frame_source),
+ host_->GetSettings().renderer_settings, std::move(begin_frame_source),
std::move(display_output_surface), std::move(scheduler),
base::MakeUnique<cc::TextureMailboxDeleter>(task_runner)));
@@ -774,7 +774,7 @@ void CompositorImpl::DidAbortSwapBuffers() {
// This really gets called only once from
// SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() when the
// context was lost.
- if (host_->visible())
+ if (host_->IsVisible())
host_->SetNeedsCommit();
client_->OnSwapBuffersCompleted(0);
}
@@ -811,7 +811,7 @@ void CompositorImpl::OnNeedsBeginFramesChange(bool needs_begin_frames) {
void CompositorImpl::SetNeedsAnimate() {
needs_animate_ = true;
- if (!host_->visible())
+ if (!host_->IsVisible())
return;
TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate");
« no previous file with comments | « cc/trees/swap_promise_monitor.cc ('k') | content/renderer/gpu/render_widget_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698