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

Unified Diff: gpu/ipc/client/gpu_memory_buffer_impl_direct_composition.h

Issue 2930143004: Add DIRECT_COMPOSITION GpuMemoryBuffer type.
Patch Set: fix build Created 3 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: gpu/ipc/client/gpu_memory_buffer_impl_direct_composition.h
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_direct_composition.h b/gpu/ipc/client/gpu_memory_buffer_impl_direct_composition.h
new file mode 100644
index 0000000000000000000000000000000000000000..ec846c6379193a7dcb493ce07efb31f833b97c7c
--- /dev/null
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_direct_composition.h
@@ -0,0 +1,38 @@
+// Copyright 2017 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 GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_DIRECT_COMPOSITION_H_
+#define GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_DIRECT_COMPOSITION_H_
+
+#include "gpu/gpu_export.h"
+#include "gpu/ipc/client/gpu_memory_buffer_impl.h"
+
+namespace gpu {
+
+// DirectComposition GpuMemoryBuffers can't be mapped from the client, so this
+// class just holds on to the handle so the GPU process can refer to it.
+class GPU_EXPORT GpuMemoryBufferImplDirectComposition
+ : public GpuMemoryBufferImpl {
+ public:
+ GpuMemoryBufferImplDirectComposition(const gfx::Size& size,
+ gfx::GpuMemoryBufferHandle handle,
+ gfx::BufferFormat format,
+ const DestructionCallback& callback);
+
+ ~GpuMemoryBufferImplDirectComposition() override;
+
+ bool Map() override;
+ void* memory(size_t plane) override;
+ void Unmap() override;
+ int stride(size_t plane) const override;
+ void SetColorSpaceForScanout(const gfx::ColorSpace& color_space) override;
+ gfx::GpuMemoryBufferHandle GetHandle() const override;
+
+ private:
+ gfx::GpuMemoryBufferHandle handle_;
+};
+
+} // namespace gpu
+
+#endif // GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_DIRECT_COMPOSITION_H_

Powered by Google App Engine
This is Rietveld 408576698