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

Unified Diff: components/view_manager/gles2/mojo_gpu_memory_buffer.h

Issue 1181013010: Support impl-side painting in Mandoline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit warning Created 5 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: components/view_manager/gles2/mojo_gpu_memory_buffer.h
diff --git a/components/view_manager/gles2/mojo_gpu_memory_buffer.h b/components/view_manager/gles2/mojo_gpu_memory_buffer.h
new file mode 100644
index 0000000000000000000000000000000000000000..f6511c71147ea6b3b77fc18c617af64de610b194
--- /dev/null
+++ b/components/view_manager/gles2/mojo_gpu_memory_buffer.h
@@ -0,0 +1,48 @@
+// 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 COMPONENTS_VIEW_MANAGER_GLES2_MOJO_GPU_MEMORY_BUFFER_H_
+#define COMPONENTS_VIEW_MANAGER_GLES2_MOJO_GPU_MEMORY_BUFFER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/gpu_memory_buffer.h"
+
+namespace gles2 {
+
+class MojoGpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
+ public:
+ MojoGpuMemoryBufferImpl(const gfx::Size& size,
+ Format format,
+ scoped_ptr<base::SharedMemory> shared_memory);
+ ~MojoGpuMemoryBufferImpl() override;
+
+
+ static scoped_ptr<gfx::GpuMemoryBuffer> Create(const gfx::Size& size,
+ Format format,
+ Usage usage);
+
+ static MojoGpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer);
+
+ // Overridden from gfx::GpuMemoryBuffer:
+ bool Map(void** data) override;
+ void Unmap() override;
+ bool IsMapped() const override;
+ Format GetFormat() const override;
+ void GetStride(int* stride) const override;
+ gfx::GpuMemoryBufferHandle GetHandle() const override;
+ ClientBuffer AsClientBuffer() override;
+
+ private:
+ const gfx::Size size_;
+ gfx::GpuMemoryBuffer::Format format_;
+ scoped_ptr<base::SharedMemory> shared_memory_;
+ bool mapped_;
+
+ DISALLOW_COPY_AND_ASSIGN(MojoGpuMemoryBufferImpl);
+};
+
+} // gles2
+
+#endif // COMPONENTS_VIEW_MANAGER_GLES2_MOJO_GPU_MEMORY_BUFFER_H_

Powered by Google App Engine
This is Rietveld 408576698