OLD | NEW |
---|---|
(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_SRGB_CONVERTER_H_ | |
6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_SRGB_CONVERTER_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 { | |
yunchao
2016/08/29 14:33:47
I wonder that why some classes are not under the g
Zhenyao Mo
2016/08/29 23:36:50
I think they should be under gpu/gles2, including
yunchao
2016/08/31 09:18:45
Done.
| |
18 | |
19 class GLES2Decoder; | |
20 | |
21 } // namespace gles2. | |
22 | |
23 // This class encapsulates the resources required to implement the | |
24 // glBlitFramebuffer command, which somtimes requires to convert sRGB | |
25 // to linear (RGBA) color format, or vice versa. | |
26 class GPU_EXPORT SRGBConverter { | |
27 public: | |
28 explicit SRGBConverter(const gles2::FeatureInfo* feature_info); | |
29 ~SRGBConverter(); | |
30 | |
31 void InitializeSRGBDecoder(const gles2::GLES2Decoder* decoder); | |
32 void InitializeSRGBEncoder(const gles2::GLES2Decoder* decoder); | |
33 void Destroy(); | |
34 | |
35 void SRGBToLinear( | |
36 const gles2::GLES2Decoder* decoder, | |
37 GLint srcX0, | |
38 GLint srcY0, | |
39 GLint srcX1, | |
40 GLint srcY1, | |
41 GLint dstX0, | |
42 GLint dstY0, | |
43 GLint dstX1, | |
44 GLint dstY1, | |
45 GLbitfield mask, | |
46 GLenum filter, | |
47 const gfx::Size& framebuffer_size, | |
48 GLuint src_framebuffer, | |
49 GLenum src_framebuffer_internal_format, | |
50 GLuint dst_framebuffer, | |
51 GLenum dst_framebuffer_internal_format, | |
52 GLenum dst_framebuffer_format, | |
53 GLenum dst_framebuffer_type); | |
54 | |
55 void LinearToSRGB( | |
56 const gles2::GLES2Decoder* decoder, | |
57 GLint srcX0, | |
58 GLint srcY0, | |
59 GLint srcX1, | |
60 GLint srcY1, | |
61 GLint dstX0, | |
62 GLint dstY0, | |
63 GLint dstX1, | |
64 GLint dstY1, | |
65 GLbitfield mask, | |
66 GLenum filter, | |
67 const gfx::Size& framebuffer_size, | |
68 GLuint src_framebuffer, | |
69 GLenum src_framebuffer_internal_format, | |
70 GLuint dst_framebuffer, | |
71 GLenum dst_framebuffer_internal_format, | |
72 GLenum dst_framebuffer_format, | |
73 GLenum dst_framebuffer_type); | |
74 | |
75 private: | |
76 scoped_refptr<const gles2::FeatureInfo> feature_info_; | |
77 | |
78 bool srgb_decoder_initialized_ = false; | |
79 bool srgb_encoder_initialized_ = false; | |
80 | |
81 GLuint srgb_decoder_program_ = 0; | |
82 GLuint srgb_encoder_program_ = 0; | |
83 | |
84 std::array<GLuint, 2> srgb_decoder_textures_ = {{0, 0}}; | |
85 std::array<GLuint, 2> srgb_encoder_textures_ = {{0, 0}}; | |
86 GLuint srgb_decoder_fbo_ = 0; | |
87 GLuint srgb_encoder_fbo_ = 0; | |
88 | |
89 GLuint srgb_decoder_vao_ = 0; | |
90 GLuint srgb_encoder_vao_ = 0; | |
91 | |
92 DISALLOW_COPY_AND_ASSIGN(SRGBConverter); | |
93 }; | |
94 | |
95 } // namespace gpu. | |
96 | |
97 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_SRGB_CONVERTER_H_ | |
OLD | NEW |