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

Unified Diff: services/ui/public/cpp/compositor_frame_sink.cc

Issue 2430653002: Mus+Ash: Towards Unifying CompositorFrameSink terminology (Closed)
Patch Set: Updated Created 4 years, 2 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: services/ui/public/cpp/compositor_frame_sink.cc
diff --git a/services/ui/public/cpp/compositor_frame_sink.cc b/services/ui/public/cpp/compositor_frame_sink.cc
index d132f8062546b164ad398965739287df04275ce1..ac0aed38a89b7bd3071a06f08ded7cd21d2142a6 100644
--- a/services/ui/public/cpp/compositor_frame_sink.cc
+++ b/services/ui/public/cpp/compositor_frame_sink.cc
@@ -8,20 +8,16 @@
#include "cc/output/compositor_frame.h"
#include "cc/output/compositor_frame_sink_client.h"
#include "gpu/ipc/client/gpu_channel_host.h"
-#include "services/ui/public/cpp/context_provider.h"
#include "services/ui/public/cpp/gpu_service.h"
#include "services/ui/public/cpp/window_surface.h"
namespace ui {
CompositorFrameSink::CompositorFrameSink(
- scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
+ scoped_refptr<cc::ContextProvider> context_provider,
std::unique_ptr<ui::WindowSurface> surface)
- : cc::CompositorFrameSink(
- make_scoped_refptr(new ContextProvider(std::move(gpu_channel_host))),
- nullptr),
- surface_(std::move(surface)) {
-}
+ : cc::CompositorFrameSink(std::move(context_provider), nullptr),
+ surface_(std::move(surface)) {}
CompositorFrameSink::~CompositorFrameSink() {}
@@ -49,18 +45,14 @@ void CompositorFrameSink::DetachFromClient() {
}
void CompositorFrameSink::SubmitCompositorFrame(cc::CompositorFrame frame) {
- // CompositorFrameSink owns WindowSurface, and so if CompositorFrameSink is
- // destroyed then SubmitCompositorFrame's callback will never get called.
- // Thus, base::Unretained is safe here as |client_| is valid as long as |this|
- // is.
- surface_->SubmitCompositorFrame(
- std::move(frame),
- base::Bind(&cc::CompositorFrameSinkClient::DidReceiveCompositorFrameAck,
- base::Unretained(client_)));
+ surface_->SubmitCompositorFrame(std::move(frame));
+}
+
+void CompositorFrameSink::DidReceiveCompositorFrameAck() {
+ client_->DidReceiveCompositorFrameAck();
}
-void CompositorFrameSink::OnResourcesReturned(
- ui::WindowSurface* surface,
+void CompositorFrameSink::ReclaimResources(
const cc::ReturnedResourceArray& resources) {
client_->ReclaimResources(resources);
}

Powered by Google App Engine
This is Rietveld 408576698