| 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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // Creates a GLImage instance for GPU memory buffer identified by |handle|. | 23 // Creates a GLImage instance for GPU memory buffer identified by |handle|. |
| 24 // |client_id| should be set to the client requesting the creation of instance | 24 // |client_id| should be set to the client requesting the creation of instance |
| 25 // and can be used by factory implementation to verify access rights. | 25 // and can be used by factory implementation to verify access rights. |
| 26 virtual scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( | 26 virtual scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( |
| 27 const gfx::GpuMemoryBufferHandle& handle, | 27 const gfx::GpuMemoryBufferHandle& handle, |
| 28 const gfx::Size& size, | 28 const gfx::Size& size, |
| 29 gfx::BufferFormat format, | 29 gfx::BufferFormat format, |
| 30 unsigned internalformat, | 30 unsigned internalformat, |
| 31 int client_id) = 0; | 31 int client_id) = 0; |
| 32 | 32 |
| 33 // Create an anonymous GLImage backed by a GpuMemoryBuffer that doesn't have a |
| 34 // client_id. It can't be passed to other processes. |
| 35 virtual scoped_refptr<gl::GLImage> CreateAnonymousImage( |
| 36 const gfx::Size& size, |
| 37 gfx::BufferFormat format, |
| 38 unsigned internalformat); |
| 39 |
| 40 // An image can only be bound to a texture with the appropriate type. |
| 41 virtual unsigned RequiredTextureType(); |
| 42 |
| 43 // Whether a created image can have format GL_RGB. |
| 44 virtual bool SupportsFormatRGB(); |
| 45 |
| 33 protected: | 46 protected: |
| 34 virtual ~ImageFactory(); | 47 virtual ~ImageFactory(); |
| 35 }; | 48 }; |
| 36 | 49 |
| 37 } // namespace gpu | 50 } // namespace gpu |
| 38 | 51 |
| 39 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_FACTORY_H_ | 52 #endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_FACTORY_H_ |
| OLD | NEW |