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

Unified Diff: ash/surfaces/surface_controller.h

Issue 1394573003: chromeos: Add SurfaceServiceProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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: ash/surfaces/surface_controller.h
diff --git a/ash/surfaces/surface_controller.h b/ash/surfaces/surface_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..53f90858e08d43471eec9510bdd092e315c424ee
--- /dev/null
+++ b/ash/surfaces/surface_controller.h
@@ -0,0 +1,69 @@
+// Copyright 2015 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 ASH_SURFACES_SURFACE_CONTROLLER_H_
+#define ASH_SURFACES_SURFACE_CONTROLLER_H_
+
+#include "base/basictypes.h"
+#include "base/callback.h"
+#include "base/containers/scoped_ptr_hash_map.h"
+#include "base/files/scoped_file.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/gpu_memory_buffer.h"
+
+namespace cc {
+class ContextProvider;
+}
+
+namespace ui {
+class Layer;
+}
+
+namespace ash {
+
+class SurfaceController {
+ public:
+ using GraphicsBufferCreatedCallback = base::Callback<void(bool)>;
+
+ SurfaceController();
+ ~SurfaceController();
+
+ void CreateGraphicsBufferFromGpuMemoryBufferHandle(
+ uint32 id,
+ const gfx::GpuMemoryBufferHandle& handle,
+ const gfx::Size& size,
+ gfx::BufferFormat format,
+ const GraphicsBufferCreatedCallback& callback);
+ void DestroyGraphicsBuffer(uint32 id);
+ void AttachGraphicsBufferToTestShellSurface(
+ uint32 buffer_id,
+ const base::Closure& released_callback);
+
+ ui::Layer* test_shell_surface_layer() {
+ return test_shell_surface_layer_.get();
+ }
+
+ private:
+ void TextureReleased(scoped_refptr<cc::ContextProvider> context_provider,
+ unsigned texture_id,
+ unsigned image_id,
+ const base::Closure& released_callback,
+ uint32 sync_point,
+ bool is_lost);
+
+ base::ScopedPtrHashMap<int32, scoped_ptr<gfx::GpuMemoryBuffer>>
+ gpu_memory_buffers_;
+ scoped_ptr<ui::Layer> test_shell_surface_layer_;
+ base::WeakPtrFactory<SurfaceController> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(SurfaceController);
+};
+
+} // namespace ash
+
+#endif // ASH_SURFACES_SURFACE_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698