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

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: 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
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..25940522ff1bd2ae7edefb04343f9b422bc9ee55
--- /dev/null
+++ b/components/mus/gles2/gpu_memory_buffer_impl.cc
@@ -0,0 +1,44 @@
+// 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);
+}
+
+scoped_refptr<ui::NativePixmap> GpuMemoryBufferImpl::GetNativePixmap() {
+ return scoped_refptr<ui::NativePixmap>();
+}
+
+} // namespace mus

Powered by Google App Engine
This is Rietveld 408576698