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 17 matching lines...) Expand all Loading... |
41 const Capabilities& capabilities); | 41 const Capabilities& capabilities); |
42 | 42 |
43 // Returns true if |size| is valid for |format|. | 43 // Returns true if |size| is valid for |format|. |
44 static bool IsImageSizeValidForGpuMemoryBufferFormat( | 44 static bool IsImageSizeValidForGpuMemoryBufferFormat( |
45 const gfx::Size& size, | 45 const gfx::Size& size, |
46 gfx::BufferFormat format); | 46 gfx::BufferFormat format); |
47 | 47 |
48 // Creates a GLImage instance for GPU memory buffer identified by |handle|. | 48 // Creates a GLImage instance for GPU memory buffer identified by |handle|. |
49 // |client_id| should be set to the client requesting the creation of instance | 49 // |client_id| should be set to the client requesting the creation of instance |
50 // and can be used by factory implementation to verify access rights. | 50 // and can be used by factory implementation to verify access rights. |
51 virtual scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( | 51 virtual scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( |
52 const gfx::GpuMemoryBufferHandle& handle, | 52 const gfx::GpuMemoryBufferHandle& handle, |
53 const gfx::Size& size, | 53 const gfx::Size& size, |
54 gfx::BufferFormat format, | 54 gfx::BufferFormat format, |
55 unsigned internalformat, | 55 unsigned internalformat, |
56 int client_id) = 0; | 56 int client_id) = 0; |
57 | 57 |
58 protected: | 58 protected: |
59 virtual ~ImageFactory(); | 59 virtual ~ImageFactory(); |
60 }; | 60 }; |
61 | 61 |
62 } // namespace gpu | 62 } // namespace gpu |
63 | 63 |
64 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_FACTORY_H_ | 64 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_FACTORY_H_ |
OLD | NEW |