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

Unified Diff: components/mus/gles2/gpu_memory_buffer_impl.h

Issue 1857243005: Scan-out capable buffers (aka ui::NativePixmap) for Mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fix for windows 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/gles2/command_buffer_local.cc ('k') | components/mus/gles2/gpu_memory_buffer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/gles2/gpu_memory_buffer_impl.h
diff --git a/components/mus/gles2/gpu_memory_buffer_impl.h b/components/mus/gles2/gpu_memory_buffer_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..8d831b71bbe2d6ddf2d29f6c7ff91abaea5b6d3d
--- /dev/null
+++ b/components/mus/gles2/gpu_memory_buffer_impl.h
@@ -0,0 +1,59 @@
+// 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_GLES2_GPU_MEMORY_BUFFER_IMPL_H_
+#define COMPONENTS_MUS_GLES2_GPU_MEMORY_BUFFER_IMPL_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "gpu/command_buffer/common/sync_token.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/gpu_memory_buffer.h"
+
+#if defined(USE_OZONE)
+#include "ui/ozone/public/native_pixmap.h"
+#endif
+
+namespace mus {
+
+// Provides common implementation of a GPU memory buffer.
+class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
+ public:
+ ~GpuMemoryBufferImpl() override;
+
+ // Type-checking upcast routine. Returns an NULL on failure.
+ static GpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer);
+
+ // Overridden from gfx::GpuMemoryBuffer:
+ gfx::Size GetSize() const override;
+ gfx::BufferFormat GetFormat() const override;
+ gfx::GpuMemoryBufferId GetId() const override;
+ ClientBuffer AsClientBuffer() override;
+
+ // Returns the type of this GpuMemoryBufferImpl.
+ virtual gfx::GpuMemoryBufferType GetBufferType() const = 0;
+
+#if defined(USE_OZONE)
+ // Returns a ui::NativePixmap when one is available.
+ virtual scoped_refptr<ui::NativePixmap> GetNativePixmap();
+#endif
+
+ protected:
+ GpuMemoryBufferImpl(gfx::GpuMemoryBufferId id,
+ const gfx::Size& size,
+ gfx::BufferFormat format);
+
+ const gfx::GpuMemoryBufferId id_;
+ const gfx::Size size_;
+ const gfx::BufferFormat format_;
+ bool mapped_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl);
+};
+
+} // namespace mus
+
+#endif // COMPONENTS_MUS_GLES2_GPU_MEMORY_BUFFER_IMPL_H_
« no previous file with comments | « components/mus/gles2/command_buffer_local.cc ('k') | components/mus/gles2/gpu_memory_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698