OLD | NEW |
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 GPU_COMMAND_BUFFER_SERVICE_IMAGE_FACTORY_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_IMAGE_FACTORY_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_IMAGE_FACTORY_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_IMAGE_FACTORY_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "gpu/gpu_export.h" | 9 #include "gpu/gpu_export.h" |
10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
11 #include "ui/gfx/gpu_memory_buffer.h" | 11 #include "ui/gfx/gpu_memory_buffer.h" |
12 | 12 |
13 namespace gfx { | 13 namespace gl { |
14 class GLImage; | 14 class GLImage; |
15 } | 15 } |
16 | 16 |
17 namespace gpu { | 17 namespace gpu { |
18 struct Capabilities; | 18 struct Capabilities; |
19 | 19 |
20 class GPU_EXPORT ImageFactory { | 20 class GPU_EXPORT ImageFactory { |
21 public: | 21 public: |
22 ImageFactory(); | 22 ImageFactory(); |
23 | 23 |
(...skipping 13 matching lines...) Expand all Loading... |
37 const Capabilities& capabilities); | 37 const Capabilities& capabilities); |
38 | 38 |
39 // Returns true if |size| is valid for |format|. | 39 // Returns true if |size| is valid for |format|. |
40 static bool IsImageSizeValidForGpuMemoryBufferFormat( | 40 static bool IsImageSizeValidForGpuMemoryBufferFormat( |
41 const gfx::Size& size, | 41 const gfx::Size& size, |
42 gfx::BufferFormat format); | 42 gfx::BufferFormat format); |
43 | 43 |
44 // Creates a GLImage instance for GPU memory buffer identified by |handle|. | 44 // Creates a GLImage instance for GPU memory buffer identified by |handle|. |
45 // |client_id| should be set to the client requesting the creation of instance | 45 // |client_id| should be set to the client requesting the creation of instance |
46 // and can be used by factory implementation to verify access rights. | 46 // and can be used by factory implementation to verify access rights. |
47 virtual scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( | 47 virtual scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( |
48 const gfx::GpuMemoryBufferHandle& handle, | 48 const gfx::GpuMemoryBufferHandle& handle, |
49 const gfx::Size& size, | 49 const gfx::Size& size, |
50 gfx::BufferFormat format, | 50 gfx::BufferFormat format, |
51 unsigned internalformat, | 51 unsigned internalformat, |
52 int client_id) = 0; | 52 int client_id) = 0; |
53 | 53 |
54 protected: | 54 protected: |
55 virtual ~ImageFactory(); | 55 virtual ~ImageFactory(); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace gpu | 58 } // namespace gpu |
59 | 59 |
60 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_FACTORY_H_ | 60 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_FACTORY_H_ |
OLD | NEW |