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

Unified Diff: blimp/client/core/compositor/compositor_deps_provider.h

Issue 2241623002: blimp: Move compositing, input and render widget feature to client/core. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: blimp/client/core/compositor/compositor_deps_provider.h
diff --git a/blimp/client/core/compositor/compositor_deps_provider.h b/blimp/client/core/compositor/compositor_deps_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..5afefc3f9e9046e565763645b942319f142ced39
--- /dev/null
+++ b/blimp/client/core/compositor/compositor_deps_provider.h
@@ -0,0 +1,69 @@
+// 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 BLIMP_CLIENT_CORE_COMPOSITOR_COMPOSITOR_DEPS_PROVIDER_H_
+#define BLIMP_CLIENT_CORE_COMPOSITOR_COMPOSITOR_DEPS_PROVIDER_H_
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "ui/gfx/native_widget_types.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+class Thread;
+} // namespace base
+
+namespace cc {
+class LayerTreeSettings;
+class OutputSurface;
+class TaskGraphRunner;
+} // namespace cc
+
+namespace gpu {
+class GpuMemoryBufferManager;
+} // namespace gpu
+
+namespace blimp {
+namespace client {
+class BlimpGpuMemoryBufferManager;
+
+// This class is not thread-safe and should only be used from the UI thread.
+class CompositorDepsProvider {
+ public:
+ explicit CompositorDepsProvider(bool use_direct_rendering);
+ ~CompositorDepsProvider();
+
+ bool use_direct_rendering() const { return use_direct_rendering_; }
+
+ gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager();
+
+ scoped_refptr<base::SingleThreadTaskRunner> GetCompositorTaskRunner();
+
+ cc::LayerTreeSettings* GetLayerTreeSettings();
+
+ cc::TaskGraphRunner* GetTaskGraphRunner();
+
+ std::unique_ptr<cc::OutputSurface> CreateDirectRenderingOutputSurface(
+ gfx::AcceleratedWidget widget);
+
+ private:
+ void GenerateLayerTreeSettings(cc::LayerTreeSettings* settings);
+
+ const bool use_direct_rendering_;
+
+ std::unique_ptr<cc::LayerTreeSettings> settings_;
+ std::unique_ptr<BlimpGpuMemoryBufferManager> gpu_memory_buffer_manager_;
+ std::unique_ptr<cc::TaskGraphRunner> task_graph_runner_;
+
+ // Lazily created thread that will run the compositor rendering tasks and will
+ // be shared by all compositor instances.
+ std::unique_ptr<base::Thread> compositor_thread_;
+
+ DISALLOW_COPY_AND_ASSIGN(CompositorDepsProvider);
+};
+
+} // namespace client
+} // namespace blimp
+
+#endif // BLIMP_CLIENT_CORE_COMPOSITOR_COMPOSITOR_DEPS_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698