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

Unified Diff: components/mus/surfaces/direct_output_surface_ozone.h

Issue 1881793002: SurfacelessSurfaces for Mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build Created 4 years, 8 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 | « components/mus/surfaces/buffer_queue.cc ('k') | components/mus/surfaces/direct_output_surface_ozone.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/surfaces/direct_output_surface_ozone.h
diff --git a/components/mus/surfaces/direct_output_surface_ozone.h b/components/mus/surfaces/direct_output_surface_ozone.h
new file mode 100644
index 0000000000000000000000000000000000000000..b3ed3ea5c2a9eecfaf2b472f89c00402565c7043
--- /dev/null
+++ b/components/mus/surfaces/direct_output_surface_ozone.h
@@ -0,0 +1,70 @@
+// Copyright 2016 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.
+
+#ifndef COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_
+#define COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_
+
+#include <memory>
+
+#include "base/memory/weak_ptr.h"
+#include "cc/output/context_provider.h"
+#include "cc/output/output_surface.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/native_widget_types.h"
+#include "ui/gfx/swap_result.h"
+#include "ui/gl/gl_surface.h"
+
+namespace ui {
+class LatencyInfo;
+} // namespace ui
+
+namespace cc {
+class CompositorFrame;
+} // namespace cc
+
+namespace mus {
+
+class BufferQueue;
+class SurfacesContextProvider;
+
+// An OutputSurface implementation that directly draws and swap to a GL
+// "surfaceless" surface (aka one backed by a buffer managed explicitly in
+// mus/ozone. This class is adapted from
+// GpuSurfacelessBrowserCompositorOutputSurface.
+class DirectOutputSurfaceOzone : public cc::OutputSurface {
+ public:
+ DirectOutputSurfaceOzone(
+ const scoped_refptr<SurfacesContextProvider>& context_provider,
+ gfx::AcceleratedWidget widget,
+ uint32_t target,
+ uint32_t internalformat);
+
+ ~DirectOutputSurfaceOzone() override;
+
+ // TODO(rjkroege): Implement the equivalent of Reflector.
+
+ private:
+ // cc::OutputSurface implementation.
+ void SwapBuffers(cc::CompositorFrame* frame) override;
+ void BindFramebuffer() override;
+ void Reshape(const gfx::Size& size, float scale_factor, bool alpha) override;
+ bool IsDisplayedAsOverlayPlane() const override;
+ unsigned GetOverlayTextureId() const override;
+ bool BindToClient(cc::OutputSurfaceClient* client) override;
+
+ // Taken from BrowserCompositor specific API.
+ void OnUpdateVSyncParametersFromGpu(base::TimeTicks timebase,
+ base::TimeDelta interval);
+
+ // Called when a swap completion is sent from the GPU process.
+ void OnGpuSwapBuffersCompleted(gfx::SwapResult result);
+
+ std::unique_ptr<BufferQueue> output_surface_;
+
+ base::WeakPtrFactory<DirectOutputSurfaceOzone> weak_ptr_factory_;
+};
+
+} // namespace mus
+
+#endif // COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_
« no previous file with comments | « components/mus/surfaces/buffer_queue.cc ('k') | components/mus/surfaces/direct_output_surface_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698