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

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

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/gpu_memory_buffer_impl.h ('k') | components/mus/gles2/mojo_gpu_memory_buffer.h » ('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.cc
diff --git a/components/mus/gles2/gpu_memory_buffer_impl.cc b/components/mus/gles2/gpu_memory_buffer_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d2592dc650c06d82f8ce83f1578724c0a419ccbc
--- /dev/null
+++ b/components/mus/gles2/gpu_memory_buffer_impl.cc
@@ -0,0 +1,46 @@
+// Copyright 2013 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.
+
+#include "components/mus/gles2/gpu_memory_buffer_impl.h"
+
+namespace mus {
+
+GpuMemoryBufferImpl::GpuMemoryBufferImpl(gfx::GpuMemoryBufferId id,
+ const gfx::Size& size,
+ gfx::BufferFormat format)
+ : id_(id), size_(size), format_(format), mapped_(false) {}
+
+GpuMemoryBufferImpl::~GpuMemoryBufferImpl() {
+ DCHECK(!mapped_);
+}
+
+// static
+GpuMemoryBufferImpl* GpuMemoryBufferImpl::FromClientBuffer(
+ ClientBuffer buffer) {
+ return reinterpret_cast<GpuMemoryBufferImpl*>(buffer);
+}
+
+gfx::Size GpuMemoryBufferImpl::GetSize() const {
+ return size_;
+}
+
+gfx::BufferFormat GpuMemoryBufferImpl::GetFormat() const {
+ return format_;
+}
+
+gfx::GpuMemoryBufferId GpuMemoryBufferImpl::GetId() const {
+ return id_;
+}
+
+ClientBuffer GpuMemoryBufferImpl::AsClientBuffer() {
+ return reinterpret_cast<ClientBuffer>(this);
+}
+
+#if defined(USE_OZONE)
+scoped_refptr<ui::NativePixmap> GpuMemoryBufferImpl::GetNativePixmap() {
+ return scoped_refptr<ui::NativePixmap>();
+}
+#endif
+
+} // namespace mus
« no previous file with comments | « components/mus/gles2/gpu_memory_buffer_impl.h ('k') | components/mus/gles2/mojo_gpu_memory_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698