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

Side by Side Diff: components/exo/shared_memory.h

Issue 1412093006: components: Add Exosphere component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove some ifdefs Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « components/exo/display_unittest.cc ('k') | components/exo/shared_memory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_EXO_SHARED_MEMORY_H_
6 #define COMPONENTS_EXO_SHARED_MEMORY_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/shared_memory.h"
11 #include "ui/gfx/buffer_types.h"
12 #include "ui/gfx/geometry/size.h"
13
14 namespace exo {
15 class Buffer;
16
17 // Shared memory abstraction. Provides a wrapper around base::SharedMemory
18 // with functionality to create buffers from the memory to use for display.
19 class SharedMemory {
20 public:
21 explicit SharedMemory(const base::SharedMemoryHandle& handle);
22 ~SharedMemory();
23
24 // Creates a buffer from the shared memory. The buffer is created offset bytes
25 // into the memory and has width and height as specified. The stride
26 // arguments specifies the number of bytes from beginning of one row to the
27 // beginning of the next. The format is the pixel format of the buffer and
28 // must be one of RGBX_8888, RGBA_8888, BGRX_8888, BGRA_8888.
29 scoped_ptr<Buffer> CreateBuffer(const gfx::Size& size,
30 gfx::BufferFormat format,
31 unsigned offset,
32 int stride);
33
34 private:
35 base::SharedMemory shared_memory_;
36
37 DISALLOW_COPY_AND_ASSIGN(SharedMemory);
38 };
39
40 } // namespace exo
41
42 #endif // COMPONENTS_EXO_SHARED_MEMORY_H_
OLDNEW
« no previous file with comments | « components/exo/display_unittest.cc ('k') | components/exo/shared_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698