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

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

Issue 2337913003: Fork cc::OutputSurface into cc::CompositorFrameSink. (Closed)
Patch Set: cfsfork: android-vulkan 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 | « services/ui/public/cpp/compositor_frame_sink.h ('k') | services/ui/public/cpp/output_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/public/cpp/compositor_frame_sink.cc
diff --git a/services/ui/public/cpp/output_surface.cc b/services/ui/public/cpp/compositor_frame_sink.cc
similarity index 65%
rename from services/ui/public/cpp/output_surface.cc
rename to services/ui/public/cpp/compositor_frame_sink.cc
index 82802cfdcdc34982ae0cd51cbd381678551e80fc..25c4e066ad7ecece6c45fe86f2a24c6abcd98750 100644
--- a/services/ui/public/cpp/output_surface.cc
+++ b/services/ui/public/cpp/compositor_frame_sink.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "services/ui/public/cpp/output_surface.h"
+#include "services/ui/public/cpp/compositor_frame_sink.h"
#include "base/bind.h"
#include "cc/output/compositor_frame.h"
-#include "cc/output/output_surface_client.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"
@@ -14,10 +14,10 @@
namespace ui {
-OutputSurface::OutputSurface(
+CompositorFrameSink::CompositorFrameSink(
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
std::unique_ptr<ui::WindowSurface> surface)
- : cc::OutputSurface(
+ : cc::CompositorFrameSink(
make_scoped_refptr(new ContextProvider(std::move(gpu_channel_host))),
nullptr,
nullptr),
@@ -25,9 +25,9 @@ OutputSurface::OutputSurface(
capabilities_.delegated_rendering = true;
}
-OutputSurface::~OutputSurface() {}
+CompositorFrameSink::~CompositorFrameSink() {}
-bool OutputSurface::BindToClient(cc::OutputSurfaceClient* client) {
+bool CompositorFrameSink::BindToClient(cc::CompositorFrameSinkClient* client) {
surface_->BindToThread();
surface_->set_client(this);
@@ -37,43 +37,43 @@ bool OutputSurface::BindToClient(cc::OutputSurfaceClient* client) {
base::ThreadTaskRunnerHandle::Get().get())));
client->SetBeginFrameSource(begin_frame_source_.get());
- return cc::OutputSurface::BindToClient(client);
+ return cc::CompositorFrameSink::BindToClient(client);
}
-void OutputSurface::DetachFromClient() {
+void CompositorFrameSink::DetachFromClient() {
client_->SetBeginFrameSource(nullptr);
begin_frame_source_.reset();
surface_.reset();
- cc::OutputSurface::DetachFromClient();
+ cc::CompositorFrameSink::DetachFromClient();
}
-void OutputSurface::BindFramebuffer() {
+void CompositorFrameSink::BindFramebuffer() {
// This is a delegating output surface, no framebuffer/direct drawing support.
NOTREACHED();
}
-uint32_t OutputSurface::GetFramebufferCopyTextureFormat() {
+uint32_t CompositorFrameSink::GetFramebufferCopyTextureFormat() {
// This is a delegating output surface, no framebuffer/direct drawing support.
NOTREACHED();
return 0;
}
-void OutputSurface::SwapBuffers(cc::CompositorFrame frame) {
- // OutputSurface owns WindowSurface, and so if OutputSurface is
+void CompositorFrameSink::SwapBuffers(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.
surface_->SubmitCompositorFrame(
- std::move(frame),
- base::Bind(&OutputSurface::SwapBuffersComplete, base::Unretained(this)));
+ std::move(frame), base::Bind(&CompositorFrameSink::SwapBuffersComplete,
+ base::Unretained(this)));
}
-void OutputSurface::OnResourcesReturned(
+void CompositorFrameSink::OnResourcesReturned(
ui::WindowSurface* surface,
mojo::Array<cc::ReturnedResource> resources) {
client_->ReclaimResources(resources.To<cc::ReturnedResourceArray>());
}
-void OutputSurface::SwapBuffersComplete() {
+void CompositorFrameSink::SwapBuffersComplete() {
client_->DidSwapBuffersComplete();
}
« no previous file with comments | « services/ui/public/cpp/compositor_frame_sink.h ('k') | services/ui/public/cpp/output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698