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

Side by Side Diff: content/common/gpu/gpu_memory_buffer_factory_x11.cc

Issue 331723003: gpu: Remove Create/DeleteImage IPC by adding an X11_PIXMAP_BUFFER GpuMemoryBuffer type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add GpuMemoryBufferFactory interface Created 6 years, 6 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 | Annotate | Revision Log
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 "content/common/gpu/gpu_memory_buffer_factory.h"
6
7 #include "content/common/gpu/gpu_memory_buffer_factory_x11_pixmap.h"
8
9 namespace content {
10
11 // static
12 void GpuMemoryBufferFactory::Initialize() {
13 GpuMemoryBufferFactoryX11Pixmap::Initialize();
14 }
15
16 // static
17 bool GpuMemoryBufferFactory::CreateGpuMemoryBuffer(
18 const gfx::GpuMemoryBufferHandle& handle,
19 const gfx::Size& size,
20 unsigned internalformat,
21 unsigned usage) {
22 switch (handle.type) {
23 case gfx::X11_PIXMAP_BUFFER:
24 GpuMemoryBufferFactoryX11Pixmap::CreateGpuMemoryBuffer(handle);
25 return true;
26 default:
27 return false;
28 }
29 }
30
31 // static
32 void GpuMemoryBufferFactory::DestroyGpuMemoryBuffer(
33 const gfx::GpuMemoryBufferHandle& handle) {
34 switch (handle.type) {
35 case gfx::X11_PIXMAP_BUFFER:
36 GpuMemoryBufferFactoryX11Pixmap::DestroyGpuMemoryBuffer(handle);
37 break;
38 default:
39 break;
40 }
41 }
42
43 // static
44 bool GpuMemoryBufferFactory::RequestAccessToGpuMemoryBuffer(
45 const gfx::GpuMemoryBufferHandle& handle,
46 int client_id) {
47 switch (handle.type) {
48 case gfx::X11_PIXMAP_BUFFER:
49 return GpuMemoryBufferFactoryX11Pixmap::RequestAccessToGpuMemoryBuffer(
50 handle, client_id);
51 default:
52 return true;
53 }
54 }
55
56 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698