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

Unified Diff: ui/gl/gl_image_ref_counted_memory.cc

Issue 331723003: gpu: Remove Create/DeleteImage IPC by adding an X11_PIXMAP_BUFFER GpuMemoryBuffer type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 | « ui/gl/gl_image_ref_counted_memory.h ('k') | ui/gl/gl_image_shared_memory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_ref_counted_memory.cc
diff --git a/ui/gl/gl_image_ref_counted_memory.cc b/ui/gl/gl_image_ref_counted_memory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5ca65d0abc062fff7b9c714c8f8397da0fedecc3
--- /dev/null
+++ b/ui/gl/gl_image_ref_counted_memory.cc
@@ -0,0 +1,37 @@
+// Copyright 2014 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 "ui/gl/gl_image_ref_counted_memory.h"
+
+#include "base/logging.h"
+#include "base/memory/ref_counted_memory.h"
+
+namespace gfx {
+
+GLImageRefCountedMemory::GLImageRefCountedMemory(const gfx::Size& size,
+ unsigned internalformat)
+ : GLImageMemory(size, internalformat) {
+}
+
+GLImageRefCountedMemory::~GLImageRefCountedMemory() {
+ Destroy();
+}
+
+bool GLImageRefCountedMemory::Initialize(
+ base::RefCountedMemory* ref_counted_memory) {
+ if (!HasValidFormat())
+ return false;
+
+ DCHECK(!ref_counted_memory_);
+ ref_counted_memory_ = ref_counted_memory;
+ GLImageMemory::Initialize(ref_counted_memory_->front());
+ return true;
+}
+
+void GLImageRefCountedMemory::Destroy() {
+ GLImageMemory::Destroy();
+ ref_counted_memory_ = NULL;
+}
+
+} // namespace gfx
« no previous file with comments | « ui/gl/gl_image_ref_counted_memory.h ('k') | ui/gl/gl_image_shared_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698