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

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

Issue 2732213008: Revert of android: Add draw completion for CompositorView (Closed)
Patch Set: Created 3 years, 9 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
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 da2cc35e8b36755073c4f714c0a48dd853374bd6..96dcc517578cc152c9298e9a5e90f67da7d741c5 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -186,11 +186,9 @@
class AndroidOutputSurface : public cc::OutputSurface {
public:
- AndroidOutputSurface(
- scoped_refptr<ui::ContextProviderCommandBuffer> context_provider,
- base::Closure swap_buffers_callback)
+ explicit AndroidOutputSurface(
+ scoped_refptr<ui::ContextProviderCommandBuffer> context_provider)
: cc::OutputSurface(std::move(context_provider)),
- swap_buffers_callback_(std::move(swap_buffers_callback)),
overlay_candidate_validator_(
new display_compositor::
CompositorOverlayCandidateValidatorAndroid()),
@@ -270,12 +268,10 @@
const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) {
RenderWidgetHostImpl::CompositorFrameDrawn(latency_info);
client_->DidReceiveSwapBuffersAck();
- swap_buffers_callback_.Run();
}
private:
cc::OutputSurfaceClient* client_ = nullptr;
- base::Closure swap_buffers_callback_;
std::unique_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator_;
base::WeakPtrFactory<AndroidOutputSurface> weak_ptr_factory_;
};
@@ -686,12 +682,10 @@
HandlePendingCompositorFrameSinkRequest();
}
- // Unretained is safe this owns cc::Display which owns OutputSurface.
- InitializeDisplay(
- base::MakeUnique<AndroidOutputSurface>(
- context_provider,
- base::Bind(&CompositorImpl::DidSwapBuffers, base::Unretained(this))),
- nullptr, std::move(context_provider));
+ auto display_output_surface =
+ base::MakeUnique<AndroidOutputSurface>(context_provider);
+ InitializeDisplay(std::move(display_output_surface), nullptr,
+ std::move(context_provider));
}
void CompositorImpl::InitializeDisplay(
@@ -737,10 +731,6 @@
host_->SetCompositorFrameSink(std::move(compositor_frame_sink));
}
-void CompositorImpl::DidSwapBuffers() {
- client_->DidSwapBuffers();
-}
-
cc::UIResourceId CompositorImpl::CreateUIResource(
cc::UIResourceClient* client) {
TRACE_EVENT0("compositor", "CompositorImpl::CreateUIResource");
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.h ('k') | content/public/browser/android/compositor_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698