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

Side by Side Diff: gpu/ipc/service/gpu_memory_buffer_factory_win.h

Issue 2930143004: Add DIRECT_COMPOSITION GpuMemoryBuffer type.
Patch Set: fix build Created 3 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
OLDNEW
(Empty)
1 // Copyright 2017 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 GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_WIN_H_
6 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_WIN_H_
7
8 #include <unordered_map>
9
10 #include "base/hash.h"
11 #include "gpu/command_buffer/service/image_factory.h"
12 #include "gpu/ipc/service/gpu_memory_buffer_factory.h"
13 #include "ui/gl/gl_image.h"
14
15 namespace gpu {
16
17 class GPU_EXPORT GpuMemoryBufferFactoryWin : public GpuMemoryBufferFactory,
18 public ImageFactory {
19 public:
20 GpuMemoryBufferFactoryWin();
21 ~GpuMemoryBufferFactoryWin() override;
22
23 // Overridden from GpuMemoryBufferFactory:
24 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(
25 gfx::GpuMemoryBufferId id,
26 const gfx::Size& size,
27 gfx::BufferFormat format,
28 gfx::BufferUsage usage,
29 int client_id,
30 SurfaceHandle surface_handle) override;
31 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
32 int client_id) override;
33 ImageFactory* AsImageFactory() override;
34
35 // Overridden from ImageFactory:
36 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer(
37 const gfx::GpuMemoryBufferHandle& handle,
38 const gfx::Size& size,
39 gfx::BufferFormat format,
40 unsigned internalformat,
41 int client_id,
42 SurfaceHandle surface_handle) override;
43 scoped_refptr<gl::GLImage> CreateAnonymousImage(
44 const gfx::Size& size,
45 gfx::BufferFormat format,
46 unsigned internalformat) override;
47 unsigned RequiredTextureType() override;
48 bool SupportsFormatRGB() override;
49
50 private:
51 using UsageMapKey = std::pair<gfx::GpuMemoryBufferId, int>;
52
53 base::Lock lock_;
54 std::
55 unordered_map<UsageMapKey, gfx::BufferUsage, base_hash::hash<UsageMapKey>>
56 usage_map_;
reveman 2017/06/14 21:35:58 The factory needs to be stateless to handle GPU pr
jbauman 2017/06/14 22:18:16 I could put the buffer usage in the handle so it c
57
58 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryWin);
59 };
60
61 } // namespace gpu
62
63 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698