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

Side by Side Diff: content/common/gpu/gpu_memory_buffer_factory_surface_texture.h

Issue 1382043003: content: Add CreateGpuMemoryBufferFromHandle to GpuMemoryBufferFactory interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iosurface fix Created 5 years, 2 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_ 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_
6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_ 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_
7 7
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 23 matching lines...) Expand all
34 gfx::BufferUsage usage); 34 gfx::BufferUsage usage);
35 35
36 // Overridden from GpuMemoryBufferFactory: 36 // Overridden from GpuMemoryBufferFactory:
37 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( 37 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(
38 gfx::GpuMemoryBufferId id, 38 gfx::GpuMemoryBufferId id,
39 const gfx::Size& size, 39 const gfx::Size& size,
40 gfx::BufferFormat format, 40 gfx::BufferFormat format,
41 gfx::BufferUsage usage, 41 gfx::BufferUsage usage,
42 int client_id, 42 int client_id,
43 gfx::PluginWindowHandle surface_handle) override; 43 gfx::PluginWindowHandle surface_handle) override;
44 gfx::GpuMemoryBufferHandle CreateGpuMemoryBufferFromHandle(
45 const gfx::GpuMemoryBufferHandle& handle,
46 gfx::GpuMemoryBufferId id,
47 const gfx::Size& size,
48 gfx::BufferFormat format,
49 int client_id) override;
44 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, 50 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
45 int client_id) override; 51 int client_id) override;
46 gpu::ImageFactory* AsImageFactory() override; 52 gpu::ImageFactory* AsImageFactory() override;
47 53
48 // Overridden from gpu::ImageFactory: 54 // Overridden from gpu::ImageFactory:
49 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( 55 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer(
50 const gfx::GpuMemoryBufferHandle& handle, 56 const gfx::GpuMemoryBufferHandle& handle,
51 const gfx::Size& size, 57 const gfx::Size& size,
52 gfx::BufferFormat format, 58 gfx::BufferFormat format,
53 unsigned internalformat, 59 unsigned internalformat,
54 int client_id) override; 60 int client_id) override;
55 61
56 private: 62 private:
57 typedef std::pair<int, int> SurfaceTextureMapKey; 63 typedef std::pair<int, int> SurfaceTextureMapKey;
58 typedef base::hash_map<SurfaceTextureMapKey, 64 typedef base::hash_map<SurfaceTextureMapKey,
59 scoped_refptr<gfx::SurfaceTexture>> SurfaceTextureMap; 65 scoped_refptr<gfx::SurfaceTexture>> SurfaceTextureMap;
60 SurfaceTextureMap surface_textures_; 66 SurfaceTextureMap surface_textures_;
61 base::Lock surface_textures_lock_; 67 base::Lock surface_textures_lock_;
62 }; 68 };
63 69
64 } // namespace content 70 } // namespace content
65 71
66 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_ 72 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698