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

Side by Side Diff: ui/aura/mus/mojo_gpu_memory_buffer.cc

Issue 2464123003: Enabling Aura-Mus clients to submit frames to Mus. (Closed)
Patch Set: Rebase, addressing feedback, removing some unneded imports/deps. Created 4 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 | « ui/aura/mus/mojo_gpu_memory_buffer.h ('k') | ui/aura/mus/mojo_gpu_memory_buffer_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/public/cpp/mojo_gpu_memory_buffer.h" 5 #include "ui/aura/mus/mojo_gpu_memory_buffer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "base/memory/shared_memory.h" 11 #include "base/memory/shared_memory.h"
12 #include "base/numerics/safe_conversions.h" 12 #include "base/numerics/safe_conversions.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "mojo/public/cpp/system/buffer.h" 14 #include "mojo/public/cpp/system/buffer.h"
15 #include "mojo/public/cpp/system/platform_handle.h" 15 #include "mojo/public/cpp/system/platform_handle.h"
16 #include "ui/gfx/buffer_format_util.h" 16 #include "ui/gfx/buffer_format_util.h"
17 17
18 namespace ui { 18 namespace aura {
19 19
20 // TODO(rjkroege): Support running a destructor callback as necessary. 20 // TODO(rjkroege): Support running a destructor callback as necessary.
21 MojoGpuMemoryBufferImpl::~MojoGpuMemoryBufferImpl() {} 21 MojoGpuMemoryBufferImpl::~MojoGpuMemoryBufferImpl() {}
22 22
23 // static 23 // static
24 std::unique_ptr<gfx::GpuMemoryBuffer> MojoGpuMemoryBufferImpl::Create( 24 std::unique_ptr<gfx::GpuMemoryBuffer> MojoGpuMemoryBufferImpl::Create(
25 const gfx::Size& size, 25 const gfx::Size& size,
26 gfx::BufferFormat format, 26 gfx::BufferFormat format,
27 gfx::BufferUsage usage) { 27 gfx::BufferUsage usage) {
28 size_t bytes = gfx::BufferSizeForBufferFormat(size, format); 28 size_t bytes = gfx::BufferSizeForBufferFormat(size, format);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 gfx::BufferFormat format, 123 gfx::BufferFormat format,
124 std::unique_ptr<base::SharedMemory> shared_memory, 124 std::unique_ptr<base::SharedMemory> shared_memory,
125 uint32_t offset, 125 uint32_t offset,
126 int32_t stride) 126 int32_t stride)
127 : GpuMemoryBufferImpl(gfx::GenericSharedMemoryId(0), size, format), 127 : GpuMemoryBufferImpl(gfx::GenericSharedMemoryId(0), size, format),
128 shared_memory_(std::move(shared_memory)), 128 shared_memory_(std::move(shared_memory)),
129 offset_(offset), 129 offset_(offset),
130 stride_(stride) {} 130 stride_(stride) {}
131 131
132 } // namespace ui 132 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/mus/mojo_gpu_memory_buffer.h ('k') | ui/aura/mus/mojo_gpu_memory_buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698