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

Side by Side Diff: ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.h

Issue 1258713002: ozone: unify GpuMemoryBufferFactoryOzoneNativePixmap in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix linux_chromium_gn_dgb build 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
« no previous file with comments | « ui/ozone/gpu/README ('k') | ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.cc » ('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 #ifndef UI_OZONE_GPU_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_PIXMAP_H_
6 #define UI_OZONE_GPU_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_PIXMAP_H_
7
8 #include <map>
9
10 #include "base/memory/ref_counted.h"
11 #include "base/synchronization/lock.h"
12 #include "ui/gfx/geometry/size.h"
13 #include "ui/gfx/gpu_memory_buffer.h"
14 #include "ui/gfx/native_widget_types.h"
15 #include "ui/ozone/gpu/ozone_gpu_export.h"
16 #include "ui/ozone/public/native_pixmap.h"
17
18 namespace gfx {
19 class GLImage;
20 }
21
22 namespace ui {
23 class NativePixmap;
24
25 class OZONE_GPU_EXPORT GpuMemoryBufferFactoryOzoneNativePixmap {
26 typedef std::map<std::pair<uint32_t, uint32_t>, scoped_refptr<NativePixmap>>
27 BufferToPixmapMap;
28
29 public:
30 GpuMemoryBufferFactoryOzoneNativePixmap();
31 virtual ~GpuMemoryBufferFactoryOzoneNativePixmap();
32
33 // Creates a GPU memory buffer identified by |id|.
34 // It can be called on any thread.
35 bool CreateGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
36 const gfx::Size& size,
37 gfx::GpuMemoryBuffer::Format format,
38 gfx::GpuMemoryBuffer::Usage usage,
39 int client_id,
40 gfx::PluginWindowHandle surface_handle);
41
42 // Destroys GPU memory buffer identified by |id|.
43 // It can be called on any thread.
44 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id);
45
46 // Creates a GLImage instance for GPU memory buffer identified by |id|.
47 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer(
48 gfx::GpuMemoryBufferId id,
49 const gfx::Size& size,
50 gfx::GpuMemoryBuffer::Format format,
51 unsigned internalformat,
52 int client_id);
53
54 static scoped_refptr<gfx::GLImage> CreateImageForPixmap(
55 scoped_refptr<NativePixmap> pixmap,
56 const gfx::Size& size,
57 gfx::GpuMemoryBuffer::Format format,
58 unsigned internalformat);
59
60 private:
61 BufferToPixmapMap native_pixmap_map_;
62 base::Lock native_pixmap_map_lock_;
63 };
64
65 } // namespace ui
66
67 #endif // UI_OZONE_GPU_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_PIXMAP_H_
OLDNEW
« no previous file with comments | « ui/ozone/gpu/README ('k') | ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698