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

Unified Diff: components/mus/public/cpp/lib/output_surface.cc

Issue 2119963002: Move mus to //services/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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: components/mus/public/cpp/lib/output_surface.cc
diff --git a/components/mus/public/cpp/lib/output_surface.cc b/components/mus/public/cpp/lib/output_surface.cc
deleted file mode 100644
index 86462ec95f49fc3513a9ef900672557595a5c054..0000000000000000000000000000000000000000
--- a/components/mus/public/cpp/lib/output_surface.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/mus/public/cpp/output_surface.h"
-
-#include "base/bind.h"
-#include "cc/output/compositor_frame.h"
-#include "cc/output/compositor_frame_ack.h"
-#include "cc/output/output_surface_client.h"
-#include "components/mus/public/cpp/window_surface.h"
-
-namespace mus {
-
-OutputSurface::OutputSurface(
- const scoped_refptr<cc::ContextProvider>& context_provider,
- std::unique_ptr<mus::WindowSurface> surface)
- : cc::OutputSurface(context_provider, nullptr, nullptr),
- surface_(std::move(surface)) {
- capabilities_.delegated_rendering = true;
-}
-
-OutputSurface::~OutputSurface() {}
-
-bool OutputSurface::BindToClient(cc::OutputSurfaceClient* client) {
- surface_->BindToThread();
- surface_->set_client(this);
- return cc::OutputSurface::BindToClient(client);
-}
-
-void OutputSurface::DetachFromClient() {
- surface_.reset();
- cc::OutputSurface::DetachFromClient();
-}
-
-void OutputSurface::BindFramebuffer() {
- // This is a delegating output surface, no framebuffer/direct drawing support.
- NOTREACHED();
-}
-
-uint32_t OutputSurface::GetFramebufferCopyTextureFormat() {
- // This is a delegating output surface, no framebuffer/direct drawing support.
- NOTREACHED();
- return 0;
-}
-
-void OutputSurface::SwapBuffers(cc::CompositorFrame frame) {
- // TODO(fsamuel, rjkroege): We should probably throttle compositor frames.
- client_->DidSwapBuffers();
- // OutputSurface owns WindowSurface, and so if OutputSurface 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)));
-}
-
-void OutputSurface::OnResourcesReturned(
- mus::WindowSurface* surface,
- mojo::Array<cc::ReturnedResource> resources) {
- cc::CompositorFrameAck cfa;
- cfa.resources = resources.To<cc::ReturnedResourceArray>();
- ReclaimResources(&cfa);
-}
-
-void OutputSurface::SwapBuffersComplete() {
- client_->DidSwapBuffersComplete();
-}
-
-} // namespace mus
« no previous file with comments | « components/mus/public/cpp/lib/in_flight_change.cc ('k') | components/mus/public/cpp/lib/property_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698