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

Side by Side Diff: services/ui/common/mojo_buffer_backing.cc

Issue 2184943002: services/ui: Move some files into the client lib. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chrome-gpu-in-mus-windows
Patch Set: . Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « services/ui/common/mojo_buffer_backing.h ('k') | services/ui/common/mojo_gpu_memory_buffer.h » ('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 2014 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 #include "services/ui/common/mojo_buffer_backing.h"
6
7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h"
9
10 namespace ui {
11
12 MojoBufferBacking::MojoBufferBacking(mojo::ScopedSharedBufferMapping mapping,
13 size_t size)
14 : mapping_(std::move(mapping)), size_(size) {}
15
16 MojoBufferBacking::~MojoBufferBacking() = default;
17
18 // static
19 std::unique_ptr<gpu::BufferBacking> MojoBufferBacking::Create(
20 mojo::ScopedSharedBufferHandle handle,
21 size_t size) {
22 mojo::ScopedSharedBufferMapping mapping = handle->Map(size);
23 if (!mapping)
24 return nullptr;
25 return base::MakeUnique<MojoBufferBacking>(std::move(mapping), size);
26 }
27 void* MojoBufferBacking::GetMemory() const {
28 return mapping_.get();
29 }
30 size_t MojoBufferBacking::GetSize() const {
31 return size_;
32 }
33
34 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/common/mojo_buffer_backing.h ('k') | services/ui/common/mojo_gpu_memory_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698