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

Side by Side Diff: content/test/test_client_native_pixmap_factory_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: rename to ClientNativePixmapFactory 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_factory_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 TestClientNativePixmapFactoryTrait
14 : public DefaultSingletonTraits<TestClientNativePixmapFactory> {
15 static TestClientNativePixmapFactory* New() {
16 TestClientNativePixmapFactory* manager =
17 new TestClientNativePixmapFactory();
18 manager->Initialize(ui::OzonePlatform::GetInstance()->GetVirtualDeviceFd());
19 return manager;
20 }
21 };
22
23 // static
24 TestClientNativePixmapFactory* TestClientNativePixmapFactory::GetInstance() {
25 return Singleton<TestClientNativePixmapFactory,
26 TestClientNativePixmapFactoryTrait>::get();
27 }
28
29 TestClientNativePixmapFactory::TestClientNativePixmapFactory() {}
30
31 TestClientNativePixmapFactory::~TestClientNativePixmapFactory() {}
32
33 void TestClientNativePixmapFactory::Initialize(
34 const base::FileDescriptor& virtual_device) {
35 pixmap_factory_ = ui::ClientNativePixmapFactory::Create(virtual_device);
36 }
37
38 std::vector<ui::ClientNativePixmapFactory::Configuration>
39 TestClientNativePixmapFactory::GetSupportedConfigurations() const {
40 return pixmap_factory_->GetSupportedConfigurations();
41 }
42
43 scoped_ptr<ui::ClientNativePixmap>
44 TestClientNativePixmapFactory::ImportNativePixmap(
45 const base::FileDescriptor& handle,
46 const gfx::Size& size,
47 gfx::BufferFormat format,
48 gfx::BufferUsage usage) {
49 return pixmap_factory_->ImportNativePixmap(handle, size, format, usage);
50 }
51
52 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698