Skip to content
This repository was archived by the owner on Apr 3, 2020. It is now read-only.

Commit 320e32b

Browse files
Merge to M46 for BUG=510252
Add CHROMIUM_ycbcr_422_image extension. Add an extension that provides a method for GL to process images that are defined in '2vuy' video format. GL_YCRCR_422_CHROMIUM <internalformat> as been added and it is an accepted value when creating an image if the extension is supported. This extension maps to GL_APPLE_ycbcr_422 and will allow us to determine if we can use IOSurfaces with that format. BUG=524582 Review URL: https://codereview.chromium.org/1305153005 Cr-Commit-Position: refs/heads/master@{#345693} (cherry picked from commit a93c581) Review URL: https://codereview.chromium.org/1319783009 . Cr-Commit-Position: refs/branch-heads/2490@{#200} Cr-Branched-From: 7790a35-refs/heads/master@{#344925}
1 parent 3ffaac7 commit 320e32b

13 files changed

+81
-5
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Name
2+
3+
CHROMIUM_ycbcr_422_image
4+
5+
Name Strings
6+
7+
GL_CHROMIUM_ycbcr_422_image
8+
9+
Version
10+
11+
Last Modifed Date: August 26, 2015
12+
13+
Dependencies
14+
15+
OpenGL ES 2.0 is required.
16+
17+
GL_CHROMIUM_image is required.
18+
19+
Overview
20+
21+
This extension provides a new internal image format to use when creating an
22+
image from underlying '2vuy' buffers.
23+
24+
This extension is useful in conjunction with CreateImageCHROMIUM and
25+
CreateGpuMemoryBufferImageCHROMIUM to define the format of GpuMemoryBuffer
26+
backing the image.
27+
28+
New Procedures and Functions
29+
30+
None.
31+
32+
Errors
33+
34+
None.
35+
36+
New Tokens
37+
38+
Accepted by the <internalformat> parameter of CreateImageCHROMIUM, and
39+
<internalformat> parameter of CreateGpuMemoryBufferImageCHROMIUM:
40+
GL_RGB_YCBCR_422_CHROMIUM 0x78FB
41+
42+
New State
43+
44+
None.
45+
46+
Revision History
47+
48+
8/26/2015 Documented the extension

gpu/GLES2/gl2extchromium.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ typedef void (
140140
#define GL_RGB_YUV_420_CHROMIUM 0x78FA
141141
#endif
142142

143+
#ifndef GL_RGB_YCBCR_422_CHROMIUM
144+
#define GL_RGB_YCBCR_422_CHROMIUM 0x78FB
145+
#endif
146+
143147
#ifdef GL_GLEXT_PROTOTYPES
144148
GL_APICALL GLuint GL_APIENTRY glCreateGpuMemoryBufferImageCHROMIUM(
145149
GLsizei width,

gpu/command_buffer/build_gles2_cmd_buffer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,7 @@
18621862
'valid': [
18631863
'GL_RGB',
18641864
'GL_RGB_YUV_420_CHROMIUM',
1865+
'GL_RGB_YCBCR_422_CHROMIUM',
18651866
'GL_RGBA',
18661867
],
18671868
},

gpu/command_buffer/common/capabilities.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ Capabilities::Capabilities()
7373
blend_equation_advanced(false),
7474
blend_equation_advanced_coherent(false),
7575
texture_rg(false),
76+
image_ycbcr_422(false),
7677
render_buffer_format_bgra8888(false),
7778
occlusion_query_boolean(false),
7879
surfaceless(false),
7980
major_version(2),
80-
minor_version(0) {
81-
}
81+
minor_version(0) {}
8282

8383
} // namespace gpu

gpu/command_buffer/common/capabilities.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ struct GPU_EXPORT Capabilities {
132132
bool blend_equation_advanced;
133133
bool blend_equation_advanced_coherent;
134134
bool texture_rg;
135+
bool image_ycbcr_422;
135136
bool render_buffer_format_bgra8888;
136137
bool occlusion_query_boolean;
137138
bool timer_queries;

gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ static const GLES2Util::EnumToString enum_to_string_table[] = {
252252
{
253253
0x8A53, "GL_SYNC_OBJECT_APPLE",
254254
},
255+
{
256+
0x78FB, "GL_RGB_YCBCR_422_CHROMIUM",
257+
},
255258
{
256259
0x8DF8, "GL_SHADER_BINARY_FORMATS",
257260
},
@@ -3919,6 +3922,7 @@ std::string GLES2Util::GetStringImageInternalFormat(uint32_t value) {
39193922
static const EnumToString string_table[] = {
39203923
{GL_RGB, "GL_RGB"},
39213924
{GL_RGB_YUV_420_CHROMIUM, "GL_RGB_YUV_420_CHROMIUM"},
3925+
{GL_RGB_YCBCR_422_CHROMIUM, "GL_RGB_YCBCR_422_CHROMIUM"},
39223926
{GL_RGBA, "GL_RGBA"},
39233927
};
39243928
return GLES2Util::GetQualifiedEnumString(string_table,

gpu/command_buffer/service/feature_info.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ FeatureInfo::FeatureFlags::FeatureFlags()
167167
blend_equation_advanced(false),
168168
blend_equation_advanced_coherent(false),
169169
ext_texture_rg(false),
170+
chromium_image_ycbcr_422(false),
170171
enable_subscribe_uniform(false),
171172
emulate_primitive_restart_fixed_index(false),
172-
ext_render_buffer_format_bgra8888(false) {
173-
}
173+
ext_render_buffer_format_bgra8888(false) {}
174174

175175
FeatureInfo::Workarounds::Workarounds() :
176176
#define GPU_OP(type, name) name(false),
@@ -790,6 +790,11 @@ void FeatureInfo::InitializeFeatures() {
790790
AddExtensionString("GL_CHROMIUM_iosurface");
791791
#endif
792792

793+
if (extensions.Contains("GL_APPLE_ycbcr_422")) {
794+
AddExtensionString("GL_CHROMIUM_ycbcr_422_image");
795+
feature_flags_.chromium_image_ycbcr_422 = true;
796+
}
797+
793798
// TODO(gman): Add support for these extensions.
794799
// GL_OES_depth32
795800

gpu/command_buffer/service/feature_info.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> {
7979
bool blend_equation_advanced;
8080
bool blend_equation_advanced_coherent;
8181
bool ext_texture_rg;
82+
bool chromium_image_ycbcr_422;
8283
bool enable_subscribe_uniform;
8384
bool emulate_primitive_restart_fixed_index;
8485
bool ext_render_buffer_format_bgra8888;

gpu/command_buffer/service/feature_info_unittest.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ TEST_P(FeatureInfoTest, InitializeNoExtensions) {
293293
GL_SRGB8_ALPHA8_EXT));
294294
EXPECT_FALSE(info_->validators()->frame_buffer_parameter.IsValid(
295295
GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));
296+
EXPECT_FALSE(info_->feature_flags().chromium_image_ycbcr_422);
296297
}
297298

298299
TEST_P(FeatureInfoTest, InitializeWithANGLE) {
@@ -1363,5 +1364,10 @@ TEST_P(FeatureInfoTest, InitializeARB_texture_rgNoFloat) {
13631364
EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT));
13641365
}
13651366

1367+
TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) {
1368+
SetupInitExpectations("GL_APPLE_ycbcr_422");
1369+
EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422);
1370+
}
1371+
13661372
} // namespace gles2
13671373
} // namespace gpu

gpu/command_buffer/service/gles2_cmd_decoder.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3198,6 +3198,8 @@ Capabilities GLES2DecoderImpl::GetCapabilities() {
31983198
caps.blend_equation_advanced_coherent =
31993199
feature_info_->feature_flags().blend_equation_advanced_coherent;
32003200
caps.texture_rg = feature_info_->feature_flags().ext_texture_rg;
3201+
caps.image_ycbcr_422 =
3202+
feature_info_->feature_flags().chromium_image_ycbcr_422;
32013203
caps.max_copy_texture_chromium_size =
32023204
feature_info_->workarounds().max_copy_texture_chromium_size;
32033205
caps.render_buffer_format_bgra8888 =

0 commit comments

Comments
 (0)