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

Side by Side Diff: content/test/test_client_native_pixmap_manager_ozone.cc

Issue 1248713002: ozone: ClientPixmapManager passes VGEM fd from browser to renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to latest crrev.com/1128113011 Created 5 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
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 #include "content/test/test_client_native_pixmap_manager_ozone.h"
6
7 #include "base/file_descriptor_posix.h"
8 #include "base/memory/singleton.h"
9 #include "ui/ozone/public/ozone_platform.h"
10
11 namespace content {
12
13 struct TestClientNativePixmapManagerTrait
14 : public DefaultSingletonTraits<TestClientNativePixmapManager> {
15 static TestClientNativePixmapManager* New() {
16 TestClientNativePixmapManager* manager =
17 new TestClientNativePixmapManager();
18 manager->Initialize(ui::OzonePlatform::GetInstance()->GetVirtualDeviceFd());
19 return manager;
20 }
21 };
22
23 // static
24 TestClientNativePixmapManager* TestClientNativePixmapManager::GetInstance() {
25 return Singleton<TestClientNativePixmapManager,
26 TestClientNativePixmapManagerTrait>::get();
27 }
28
29 TestClientNativePixmapManager::TestClientNativePixmapManager() {}
30
31 TestClientNativePixmapManager::~TestClientNativePixmapManager() {}
32
33 void TestClientNativePixmapManager::Initialize(
34 const base::FileDescriptor& virtual_device) {
35 pixmap_manager_ = ui::ClientNativePixmapManager::Create(virtual_device);
36 }
37
38 std::vector<ui::ClientNativePixmapManager::Configuration>
39 TestClientNativePixmapManager::GetSupportedConfigurations() const {
40 return pixmap_manager_->GetSupportedConfigurations();
41 }
42
43 scoped_ptr<ui::ClientNativePixmap>
44 TestClientNativePixmapManager::ImportClientNativePixmap(
45 base::FileDescriptor handle,
46 gfx::Size size,
47 ui::NativePixmapFormat format,
48 ui::NativePixmapUsage usage) {
49 return pixmap_manager_->ImportClientNativePixmap(handle, size, format, usage);
50 }
51
52 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698