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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_copy_tex_image.h

Issue 2027703003: Support glCopyTex[Sub]Image to LUMA formats on the core profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Support glCopyTex[Sub]Image to LUMA formats on the core profile. Created 4 years, 6 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
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEX_IMAGE_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEX_IMAGE_H_
7
8 #include <array>
9
10 #include "base/containers/hash_tables.h"
11 #include "base/macros.h"
12 #include "gpu/command_buffer/service/feature_info.h"
13 #include "gpu/command_buffer/service/gl_utils.h"
14 #include "gpu/gpu_export.h"
15
16 namespace gpu {
17 namespace gles2 {
18
19 class GLES2Decoder;
20
21 } // namespace gles2.
22
23 // This class encapsulates the resources required to implement the
24 // glCopyTexImage and glCopyTexSubImage commands. These commands somtimes
25 // require a blit.
26 class GPU_EXPORT CopyTexImageResourceManager {
27 public:
28 explicit CopyTexImageResourceManager(const gles2::FeatureInfo* feature_info);
29 ~CopyTexImageResourceManager();
30
31 void Initialize(const gles2::GLES2Decoder* decoder);
32 void Destroy();
33
34 void DoCopyTexImage2DToLUMAComatabilityTexture(
35 const gles2::GLES2Decoder* decoder,
36 GLuint dest_texture,
37 GLenum dest_texture_target,
38 GLenum dest_target,
39 GLenum luma_format,
40 GLenum luma_type,
41 GLint level,
42 GLenum internal_format,
43 GLint x,
44 GLint y,
45 GLsizei width,
46 GLsizei height,
47 GLuint source_framebuffer,
48 GLenum source_framebuffer_internal_format);
49
50 void DoCopyTexSubImage2DToLUMAComatabilityTexture(
51 const gles2::GLES2Decoder* decoder,
52 GLuint dest_texture,
53 GLenum dest_texture_target,
54 GLenum dest_target,
55 GLenum luma_format,
56 GLenum luma_type,
57 GLint level,
58 GLint xoffset,
59 GLint yoffset,
60 GLint x,
61 GLint y,
62 GLsizei width,
63 GLsizei height,
64 GLuint source_framebuffer,
65 GLenum source_framebuffer_internal_format);
66
67 static bool CopyTexImageRequiresBlit(const gles2::FeatureInfo* feature_info,
68 GLenum dest_texture_format);
69
70 private:
71 scoped_refptr<const gles2::FeatureInfo> feature_info_;
72
73 bool initialized_ = false;
74
75 GLuint blit_program_ = 0;
76
77 std::array<GLuint, 2> scratch_textures_ = {{0, 0}};
78 GLuint scratch_fbo_ = 0;
79
80 GLuint vao_ = 0;
81
82 DISALLOW_COPY_AND_ASSIGN(CopyTexImageResourceManager);
83 };
84
85 } // namespace gpu.
86
87 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEX_IMAGE_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/BUILD.gn ('k') | gpu/command_buffer/service/gles2_cmd_copy_tex_image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698