summaryrefslogtreecommitdiffstats
path: root/ui/gl/gl_image_shm.h
diff options
context:
space:
mode:
authorreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-03 13:22:42 +0000
committerreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-03 13:22:42 +0000
commit5780f5ac5dc59b860e062cbad5992262841e05ad (patch)
treea1d040abaa18b4b4b5a6e05b41fef9b023022248 /ui/gl/gl_image_shm.h
parenta679e42fffa709c69aec93eb4e7cbcd9fd1e9f55 (diff)
downloadchromium_src-5780f5ac5dc59b860e062cbad5992262841e05ad.zip
chromium_src-5780f5ac5dc59b860e062cbad5992262841e05ad.tar.gz
chromium_src-5780f5ac5dc59b860e062cbad5992262841e05ad.tar.bz2
gpu: Add support for multiple GpuMemoryBuffer types.
This is a re-factoring of the GpuMemoryBuffer framework to support different run-time buffer implementations. This also adds a GpuMemoryBuffer type that is backed by standard shared memory. This allows us exercise more code in unit tests. TEST=gpu_unittests --gtest_filter=MockGpuMemoryBufferTest.Lifecycle BUG=261649 Review URL: https://chromiumcodereview.appspot.com/20536006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215508 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl/gl_image_shm.h')
-rw-r--r--ui/gl/gl_image_shm.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/ui/gl/gl_image_shm.h b/ui/gl/gl_image_shm.h
new file mode 100644
index 0000000..70233f9
--- /dev/null
+++ b/ui/gl/gl_image_shm.h
@@ -0,0 +1,37 @@
+// 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.
+
+#ifndef UI_GL_GL_IMAGE_SHM_H_
+#define UI_GL_GL_IMAGE_SHM_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "ui/gl/gl_image.h"
+
+namespace gfx {
+
+class GL_EXPORT GLImageShm : public GLImage {
+ public:
+ explicit GLImageShm(gfx::Size size);
+
+ bool Initialize(gfx::GpuMemoryBufferHandle buffer);
+
+ // Overridden from GLImage:
+ virtual void Destroy() OVERRIDE;
+ virtual gfx::Size GetSize() OVERRIDE;
+ virtual bool BindTexImage() OVERRIDE;
+ virtual void ReleaseTexImage() OVERRIDE;
+
+ protected:
+ virtual ~GLImageShm();
+
+ private:
+ scoped_ptr<base::SharedMemory> shared_memory_;
+ gfx::Size size_;
+
+ DISALLOW_COPY_AND_ASSIGN(GLImageShm);
+};
+
+} // namespace gfx
+
+#endif // UI_GL_GL_IMAGE_SHM_H_