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

Side by Side Diff: gpu/command_buffer/tests/texture_image_factory.h

Issue 2945673002: Allow creating GLImage-backed textures with glTexStorage2D. (Closed)
Patch Set: rebase Created 3 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "gpu/command_buffer/service/image_factory.h" 5 #include "gpu/command_buffer/service/image_factory.h"
6 6
7 namespace gpu { 7 namespace gpu {
8 8
9 // The images created by this factory have no inherent storage. When the image 9 // The images created by this factory have no inherent storage. When the image
10 // is bound to a texture, storage is allocated for the texture via glTexImage2D. 10 // is bound to a texture, storage is allocated for the texture via glTexImage2D.
11 class TextureImageFactory : public gpu::ImageFactory { 11 class TextureImageFactory : public gpu::ImageFactory {
12 public: 12 public:
13 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( 13 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer(
14 const gfx::GpuMemoryBufferHandle& handle, 14 const gfx::GpuMemoryBufferHandle& handle,
15 const gfx::Size& size, 15 const gfx::Size& size,
16 gfx::BufferFormat format, 16 gfx::BufferFormat format,
17 unsigned internalformat, 17 unsigned internalformat,
18 int client_id, 18 int client_id,
19 SurfaceHandle surface_handle) override; 19 SurfaceHandle surface_handle) override;
20 scoped_refptr<gl::GLImage> CreateAnonymousImage( 20 scoped_refptr<gl::GLImage> CreateAnonymousImage(
21 const gfx::Size& size, 21 const gfx::Size& size,
22 gfx::BufferFormat format, 22 gfx::BufferFormat format,
23 gfx::BufferUsage usage,
23 unsigned internalformat) override; 24 unsigned internalformat) override;
24 unsigned RequiredTextureType() override; 25 unsigned RequiredTextureType() override;
25 bool SupportsFormatRGB() override; 26 bool SupportsFormatRGB() override;
26 27
27 void SetRequiredTextureType(unsigned type); 28 void SetRequiredTextureType(unsigned type);
28 29
29 private: 30 private:
30 unsigned required_texture_type_ = 0; 31 unsigned required_texture_type_ = 0;
31 }; 32 };
32 33
33 } // namespace gpu 34 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/gl_texture_storage_unittest.cc ('k') | gpu/command_buffer/tests/texture_image_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698