Delete CHROMIUM_image extension
CreateImageCHROMIUM() is no longer used. Delete the extension and all GLES2Interface functions related to it. Also delete plumbing through various layers of GPU and IPC code related to it. Remove references to the extension from other extensions as well. Bug: 1216120 Change-Id: Ia55ad5d2f85f27c9d337ac928daf5fc614dc9b75 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3582497 Reviewed-by: Derek Schuff <dschuff@chromium.org> Commit-Queue: Kyle Charbonneau <kylechar@chromium.org> Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/main@{#999958}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
b15723afd4
commit
56c239dea5
cc/raster
components/viz/test
gpu
GLES2
command_buffer
build_gles2_cmd_buffer.py
client
gles2_c_lib_autogen.hgles2_cmd_helper_autogen.hgles2_implementation.ccgles2_implementation.hgles2_implementation_autogen.hgles2_implementation_impl_autogen.hgles2_implementation_unittest.ccgles2_implementation_unittest_autogen.hgles2_interface_autogen.hgles2_interface_stub_autogen.hgles2_interface_stub_impl_autogen.hgles2_trace_implementation_autogen.hgles2_trace_implementation_impl_autogen.hgpu_control.hraster_implementation_gles_unittest.cc
common
gles2_cmd_buffer_functions.txtservice
gles2_cmd_decoder.ccgles2_cmd_decoder_autogen.hgles2_cmd_decoder_passthrough.ccgles2_cmd_decoder_passthrough.hgles2_cmd_decoder_passthrough_doer_prototypes.hgles2_cmd_decoder_passthrough_doers.ccgles2_cmd_decoder_passthrough_handlers_autogen.ccgles2_cmd_decoder_unittest_base.ccgles2_cmd_decoder_unittest_base.h
tests
gles2_conform_support
ipc
ppapi/proxy
third_party/blink/renderer/platform/graphics/gpu
@@ -40,12 +40,6 @@ namespace {
|
||||
|
||||
class PerfGLES2Interface : public gpu::gles2::GLES2InterfaceStub {
|
||||
// Overridden from gpu::gles2::GLES2Interface:
|
||||
GLuint CreateImageCHROMIUM(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat) override {
|
||||
return 1u;
|
||||
}
|
||||
void GenBuffers(GLsizei n, GLuint* buffers) override {
|
||||
for (GLsizei i = 0; i < n; ++i)
|
||||
buffers[i] = 1u;
|
||||
|
@@ -275,27 +275,6 @@ void TestGLES2Interface::PixelStorei(GLenum pname, GLint param) {
|
||||
}
|
||||
}
|
||||
|
||||
GLuint TestGLES2Interface::CreateImageCHROMIUM(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat) {
|
||||
DCHECK(internalformat == GL_RGB || internalformat == GL_RGBA ||
|
||||
(test_capabilities_.texture_format_bgra8888 &&
|
||||
internalformat == GL_BGRA_EXT));
|
||||
GLuint image_id = NextImageId();
|
||||
images_.insert(image_id);
|
||||
return image_id;
|
||||
}
|
||||
|
||||
void TestGLES2Interface::DestroyImageCHROMIUM(GLuint image_id) {
|
||||
RetireImageId(image_id);
|
||||
if (!images_.count(image_id)) {
|
||||
ADD_FAILURE() << "destroyImageCHROMIUM called on unknown image "
|
||||
<< image_id;
|
||||
}
|
||||
images_.erase(image_id);
|
||||
}
|
||||
|
||||
void* TestGLES2Interface::MapBufferCHROMIUM(GLuint target, GLenum access) {
|
||||
DCHECK_GT(bound_buffer_.count(target), 0u);
|
||||
DCHECK_GT(buffers_.count(bound_buffer_[target]), 0u);
|
||||
|
@@ -73,12 +73,6 @@ class TestGLES2Interface : public gpu::gles2::GLES2InterfaceStub {
|
||||
|
||||
void PixelStorei(GLenum pname, GLint param) override;
|
||||
|
||||
GLuint CreateImageCHROMIUM(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat) override;
|
||||
void DestroyImageCHROMIUM(GLuint image_id) override;
|
||||
|
||||
void* MapBufferCHROMIUM(GLuint target, GLenum access) override;
|
||||
GLboolean UnmapBufferCHROMIUM(GLuint target) override;
|
||||
void BufferData(GLenum target,
|
||||
@@ -242,7 +236,6 @@ class TestGLES2Interface : public gpu::gles2::GLES2InterfaceStub {
|
||||
unsigned next_texture_id_ = 1;
|
||||
unsigned next_renderbuffer_id_ = 1;
|
||||
std::unordered_map<unsigned, std::unique_ptr<Buffer>> buffers_;
|
||||
std::unordered_set<unsigned> images_;
|
||||
std::unordered_set<unsigned> textures_;
|
||||
std::unordered_set<unsigned> renderbuffer_set_;
|
||||
|
||||
|
@@ -1,132 +0,0 @@
|
||||
Name
|
||||
|
||||
CHROMIUM_image
|
||||
|
||||
Name Strings
|
||||
|
||||
GL_CHROMIUM_image
|
||||
|
||||
Version
|
||||
|
||||
Last Modifed Date: May 13, 2015
|
||||
|
||||
Dependencies
|
||||
|
||||
OpenGL ES 2.0 is required.
|
||||
|
||||
EXT_texture_format_BGRA8888 affects the definition of this extension.
|
||||
ARB_texture_rg affects the definition of this extension.
|
||||
|
||||
Overview
|
||||
|
||||
This extension defines a new resource type that is suitable for
|
||||
sharing 2D arrays of image data between client APIs.
|
||||
|
||||
Issues
|
||||
|
||||
None
|
||||
|
||||
New Tokens
|
||||
|
||||
None
|
||||
|
||||
New Procedures and Functions
|
||||
|
||||
GLuint CreateImageCHROMIUM(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat)
|
||||
|
||||
Create an image from <buffer> with width equal to <width> and
|
||||
height equal to <height> and format equal to <internalformat>.
|
||||
|
||||
Returns a unique identifier for the image that could be used in
|
||||
subsequent operations.
|
||||
|
||||
INVALID_VALUE is generated if <width> or <height> is nonpositive.
|
||||
|
||||
INVALID_VALUE is generated if <internalformat> is not one of
|
||||
RED, RGB, RGBA, BGRA_EXT, ATC_RGB_AMD, ATC_RGBA_INTERPOLATED_ALPHA_AMD,
|
||||
COMPRESSED_RGB_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT5_EXT or
|
||||
ETC1_RGB8_OES.
|
||||
|
||||
void DestroyImageCHROMIUM(GLuint image_id)
|
||||
|
||||
Frees the image previously created by a call to CreateImageCHROMIUM.
|
||||
|
||||
INVALID_OPERATION is generated if <image_id> is not a valid image id.
|
||||
|
||||
void BindTexImage2DCHROMIUM(GLenum target, GLint image_id)
|
||||
|
||||
Binds the texture object currently bound to <target> to the image
|
||||
<image_id> previously created by a call to CreateImageCHROMIUM.
|
||||
|
||||
INVALID_OPERATION is generated if no texture is bound to <target>.
|
||||
|
||||
INVALID_OPERATION is generated if <image_id> is not a valid image id.
|
||||
|
||||
void BindTexImage2DWithInternalformatCHROMIUM(GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint image_id)
|
||||
|
||||
Behaves exactly like BindTexImage2DCHROMIUM, but forces the
|
||||
texture to use the specified <internalformat> rather than the
|
||||
default one. This function is provided solely as a workaround for
|
||||
driver bugs on some platforms. BindTexImage2DCHROMIUM should be
|
||||
used by almost all users.
|
||||
|
||||
void ReleaseTexImage2DCHROMIUM(GLenum target, GLint image_id)
|
||||
|
||||
Unbinds the texture object bound to <target> from the image
|
||||
<image_id> previously created by a call to CreateImageCHROMIUM. If
|
||||
the texture is not currently bound to the image, has no effect,
|
||||
though may still generate errors.
|
||||
|
||||
INVALID_OPERATION is generated if no texture is bound to <target>.
|
||||
|
||||
INVALID_OPERATION is generated if <image_id> is not a valid image id.
|
||||
|
||||
Dependencies on EXT_texture_format_BGRA8888
|
||||
|
||||
If EXT_texture_format_BGRA8888 is not supported:
|
||||
* delete any reference to the BGRA_EXT format.
|
||||
|
||||
Dependencies on ARB_texture_rg
|
||||
|
||||
If ARB_texture_rg is not supported:
|
||||
* delete any reference to the RED format.
|
||||
|
||||
Dependencies on AMD_compressed_ATC_texture
|
||||
|
||||
If AMD_compressed_ATC_texture is not supported:
|
||||
* delete any reference to the ATC_RGB_AMD and
|
||||
ATC_RGBA_INTERPOLATED_ALPHA_AMD formats.
|
||||
|
||||
Dependencies on EXT_texture_compression_s3tc
|
||||
|
||||
If EXT_texture_compression_s3tc is not supported:
|
||||
* delete any reference to the COMPRESSED_RGB_S3TC_DXT1_EXT and
|
||||
COMPRESSED_RGBA_S3TC_DXT5_EXT formats.
|
||||
|
||||
Dependencies on OES_compressed_ETC1_RGB8_texture
|
||||
|
||||
If OES_compressed_ETC1_RGB8_texture is not supported:
|
||||
* delete any reference to the ETC1_RGB8_OES format.
|
||||
|
||||
Errors
|
||||
|
||||
None.
|
||||
|
||||
New State
|
||||
|
||||
None.
|
||||
|
||||
Revision History
|
||||
|
||||
5/9/2013 Documented the extension
|
||||
4/30/2014 Moved usage flag to creation function.
|
||||
10/7/2014 Remove map/unmap API.
|
||||
4/6/2015 Add BGRA_EXT format.
|
||||
2/7/2015 Add R8 format.
|
||||
5/13/2015 Add compressed formats.
|
||||
11/5/2015 Change R8 format to RED.
|
@@ -8,22 +8,17 @@ Name Strings
|
||||
|
||||
Version
|
||||
|
||||
Last Modifed Date: October 26, 2015
|
||||
Last Modified Date: May 3, 2022
|
||||
|
||||
Dependencies
|
||||
|
||||
OpenGL ES 2.0 is required.
|
||||
|
||||
GL_CHROMIUM_image is required.
|
||||
|
||||
Overview
|
||||
|
||||
This extension provides a new internal image format to use when creating an
|
||||
image from underlying '420v' buffers.
|
||||
|
||||
This extension is useful in conjunction with CreateImageCHROMIUM to define
|
||||
the format of GpuMemoryBuffer backing the image.
|
||||
|
||||
New Procedures and Functions
|
||||
|
||||
None.
|
||||
@@ -34,7 +29,7 @@ Errors
|
||||
|
||||
New Tokens
|
||||
|
||||
Accepted by the <internalformat> parameter of CreateImageCHROMIUM.
|
||||
GL_RGB_YCBCR_420V_CHROMIUM 0x78FC
|
||||
|
||||
New State
|
||||
|
||||
@@ -43,3 +38,4 @@ New State
|
||||
Revision History
|
||||
|
||||
10/26/2015 Documented the extension
|
||||
5/3/2022 Removed references to GL_CHROMIUM_image.
|
||||
|
@@ -8,21 +8,16 @@ Name Strings
|
||||
|
||||
Version
|
||||
|
||||
Last Modifed Date: August 26, 2015
|
||||
Last Modified Date: May 3, 2022
|
||||
|
||||
Dependencies
|
||||
|
||||
OpenGL ES 2.0 is required.
|
||||
|
||||
GL_CHROMIUM_image is required.
|
||||
|
||||
Overview
|
||||
|
||||
This extension provides a new internal image format to use when creating an
|
||||
image from underlying '2vuy' buffers.
|
||||
|
||||
This extension is useful in conjunction with CreateImageCHROMIUM to define
|
||||
the format of GpuMemoryBuffer backing the image.
|
||||
This extension provides a new internal image format to use when creating an
|
||||
image from underlying '2vuy' buffers.
|
||||
|
||||
New Procedures and Functions
|
||||
|
||||
@@ -33,8 +28,8 @@ Errors
|
||||
None.
|
||||
|
||||
New Tokens
|
||||
|
||||
Accepted by the <internalformat> parameter of CreateImageCHROMIUM.
|
||||
|
||||
GL_RGB_YCBCR_422_CHROMIUM 0x78FB
|
||||
|
||||
New State
|
||||
|
||||
@@ -43,3 +38,4 @@ New State
|
||||
Revision History
|
||||
|
||||
8/26/2015 Documented the extension
|
||||
5/3/2022 Removed references to GL_CHROMIUM_image.
|
||||
|
@@ -8,22 +8,17 @@ Name Strings
|
||||
|
||||
Version
|
||||
|
||||
Last Modified Date: June 12, 2019
|
||||
Last Modified Date: May 3, 2022
|
||||
|
||||
Dependencies
|
||||
|
||||
OpenGL ES 2.0 is required.
|
||||
|
||||
GL_CHROMIUM_image is required.
|
||||
|
||||
Overview
|
||||
|
||||
This extension provides a new internal image format to use when creating an
|
||||
image from underlying p010 buffers.
|
||||
|
||||
This extension is useful in conjunction with CreateImageCHROMIUM to define
|
||||
the format of GpuMemoryBuffer backing the image.
|
||||
|
||||
New Procedures and Functions
|
||||
|
||||
None.
|
||||
@@ -34,7 +29,7 @@ Errors
|
||||
|
||||
New Tokens
|
||||
|
||||
Accepted by the <internalformat> parameter of CreateImageCHROMIUM.
|
||||
GL_RGB_YCBCR_P010_CHROMIUM 0x78FD
|
||||
|
||||
New State
|
||||
|
||||
@@ -43,3 +38,4 @@ New State
|
||||
Revision History
|
||||
|
||||
06/12/2019 Documented the extension
|
||||
5/3/2022 Removed references to GL_CHROMIUM_image.
|
||||
|
@@ -8,21 +8,16 @@ Name Strings
|
||||
|
||||
Version
|
||||
|
||||
Last Modifed Date: April 10, 2015
|
||||
Last Modified Date: May 3, 2022
|
||||
|
||||
Dependencies
|
||||
|
||||
OpenGL ES 2.0 is required.
|
||||
|
||||
GL_CHROMIUM_image is required.
|
||||
|
||||
Overview
|
||||
|
||||
This extension provides a new internal image format to use when creating an
|
||||
image from underlying YV12 buffers with YVU components.
|
||||
|
||||
This extension is useful in conjunction with CreateImageCHROMIUM to define
|
||||
the format of GpuMemoryBuffer backing the image.
|
||||
This extension provides a new internal image format to use when creating an
|
||||
image from underlying YV12 buffers with YVU components.
|
||||
|
||||
New Procedures and Functions
|
||||
|
||||
@@ -33,8 +28,8 @@ Errors
|
||||
None.
|
||||
|
||||
New Tokens
|
||||
|
||||
Accepted by the <internalformat> parameter of CreateImageCHROMIUM.
|
||||
|
||||
GL_RGB_YCRCB_420_CHROMIUM 0x78FA
|
||||
|
||||
New State
|
||||
|
||||
@@ -43,3 +38,4 @@ New State
|
||||
Revision History
|
||||
|
||||
4/10/2015 Documented the extension
|
||||
5/3/2022 Removed references to GL_CHROMIUM_image.
|
||||
|
@@ -312,8 +312,6 @@
|
||||
#define glGetTransformFeedbackVaryingsCHROMIUM \
|
||||
GLES2_GET_FUN(GetTransformFeedbackVaryingsCHROMIUM)
|
||||
#define glGetUniformsES3CHROMIUM GLES2_GET_FUN(GetUniformsES3CHROMIUM)
|
||||
#define glCreateImageCHROMIUM GLES2_GET_FUN(CreateImageCHROMIUM)
|
||||
#define glDestroyImageCHROMIUM GLES2_GET_FUN(DestroyImageCHROMIUM)
|
||||
#define glDescheduleUntilFinishedCHROMIUM \
|
||||
GLES2_GET_FUN(DescheduleUntilFinishedCHROMIUM)
|
||||
#define glGetTranslatedShaderSourceANGLE \
|
||||
@@ -333,10 +331,6 @@
|
||||
#define glCreateAndConsumeTextureCHROMIUM \
|
||||
GLES2_GET_FUN(CreateAndConsumeTextureCHROMIUM)
|
||||
#define glBindUniformLocationCHROMIUM GLES2_GET_FUN(BindUniformLocationCHROMIUM)
|
||||
#define glBindTexImage2DCHROMIUM GLES2_GET_FUN(BindTexImage2DCHROMIUM)
|
||||
#define glBindTexImage2DWithInternalformatCHROMIUM \
|
||||
GLES2_GET_FUN(BindTexImage2DWithInternalformatCHROMIUM)
|
||||
#define glReleaseTexImage2DCHROMIUM GLES2_GET_FUN(ReleaseTexImage2DCHROMIUM)
|
||||
#define glTraceBeginCHROMIUM GLES2_GET_FUN(TraceBeginCHROMIUM)
|
||||
#define glTraceEndCHROMIUM GLES2_GET_FUN(TraceEndCHROMIUM)
|
||||
#define glDiscardFramebufferEXT GLES2_GET_FUN(DiscardFramebufferEXT)
|
||||
|
@@ -63,44 +63,6 @@ typedef GLboolean (GL_APIENTRY PFNGLUNMAPBUFFERCHROMIUM) (GLuint target);
|
||||
#endif
|
||||
#endif /* GL_CHROMIUM_pixel_transfer_buffer_object */
|
||||
|
||||
/* GL_CHROMIUM_image */
|
||||
#ifndef GL_CHROMIUM_image
|
||||
#define GL_CHROMIUM_image 1
|
||||
|
||||
typedef struct _ClientBuffer* ClientBuffer;
|
||||
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL GLuint GL_APIENTRY glCreateImageCHROMIUM(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat);
|
||||
GL_APICALL void GL_APIENTRY glDestroyImageCHROMIUM(GLuint image_id);
|
||||
GL_APICALL void GL_APIENTRY glBindTexImage2DCHROMIUM(GLenum target,
|
||||
GLint imageId);
|
||||
GL_APICALL void GL_APIENTRY
|
||||
glBindTexImage2DWithInternalformatCHROMIUM(GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint imageId);
|
||||
GL_APICALL void GL_APIENTRY glReleaseTexImage2DCHROMIUM(GLenum target,
|
||||
GLint imageId);
|
||||
#endif
|
||||
typedef GLuint(GL_APIENTRYP PFNGLCREATEIMAGECHROMIUMPROC)(
|
||||
ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat);
|
||||
typedef void (
|
||||
GL_APIENTRYP PFNGLDESTROYIMAGECHROMIUMPROC)(GLuint image_id);
|
||||
typedef void(GL_APIENTRYP PFNGLBINDTEXIMAGE2DCHROMIUMPROC)(GLenum target,
|
||||
GLint imageId);
|
||||
typedef void(GL_APIENTRYP PFNGLBINDTEXIMAGE2DWITHINTERNALFORMATCHROMIUMPROC)(
|
||||
GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint imageId);
|
||||
typedef void(GL_APIENTRYP PFNGLRELEASETEXIMAGE2DCHROMIUMPROC)(GLenum target,
|
||||
GLint imageId);
|
||||
#endif /* GL_CHROMIUM_image */
|
||||
|
||||
#ifndef GL_RGB_YCRCB_420_CHROMIUM
|
||||
#define GL_RGB_YCRCB_420_CHROMIUM 0x78FA
|
||||
#endif
|
||||
|
@@ -1952,20 +1952,6 @@ _FUNCTION_INFO = {
|
||||
'es3': True,
|
||||
'trace_level': 1,
|
||||
},
|
||||
'CreateImageCHROMIUM': {
|
||||
'type': 'NoCommand',
|
||||
'cmd_args':
|
||||
'ClientBuffer buffer, GLsizei width, GLsizei height, '
|
||||
'GLenum internalformat',
|
||||
'result': ['GLuint'],
|
||||
'extension': "CHROMIUM_image",
|
||||
'trace_level': 1,
|
||||
},
|
||||
'DestroyImageCHROMIUM': {
|
||||
'type': 'NoCommand',
|
||||
'extension': "CHROMIUM_image",
|
||||
'trace_level': 1,
|
||||
},
|
||||
'DescheduleUntilFinishedCHROMIUM': {
|
||||
'type': 'Custom',
|
||||
'decoder_func': 'DoDescheduleUntilFinishedCHROMIUM',
|
||||
@@ -3904,21 +3890,6 @@ _FUNCTION_INFO = {
|
||||
'unit_test': False,
|
||||
'pepper_interface': 'VertexArrayObject',
|
||||
},
|
||||
'BindTexImage2DCHROMIUM': {
|
||||
'decoder_func': 'DoBindTexImage2DCHROMIUM',
|
||||
'unit_test': False,
|
||||
'extension': "CHROMIUM_image",
|
||||
},
|
||||
'BindTexImage2DWithInternalformatCHROMIUM': {
|
||||
'decoder_func': 'DoBindTexImage2DWithInternalformatCHROMIUM',
|
||||
'unit_test': False,
|
||||
'extension': "CHROMIUM_image",
|
||||
},
|
||||
'ReleaseTexImage2DCHROMIUM': {
|
||||
'decoder_func': 'DoReleaseTexImage2DCHROMIUM',
|
||||
'unit_test': False,
|
||||
'extension': "CHROMIUM_image",
|
||||
},
|
||||
'ShallowFinishCHROMIUM': {
|
||||
'type': 'NoCommand',
|
||||
'extension': 'CHROMIUM_ordering_barrier',
|
||||
|
@@ -1451,16 +1451,6 @@ void GL_APIENTRY GLES2GetUniformsES3CHROMIUM(GLuint program,
|
||||
void* info) {
|
||||
gles2::GetGLContext()->GetUniformsES3CHROMIUM(program, bufsize, size, info);
|
||||
}
|
||||
GLuint GL_APIENTRY GLES2CreateImageCHROMIUM(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat) {
|
||||
return gles2::GetGLContext()->CreateImageCHROMIUM(buffer, width, height,
|
||||
internalformat);
|
||||
}
|
||||
void GL_APIENTRY GLES2DestroyImageCHROMIUM(GLuint image_id) {
|
||||
gles2::GetGLContext()->DestroyImageCHROMIUM(image_id);
|
||||
}
|
||||
void GL_APIENTRY GLES2DescheduleUntilFinishedCHROMIUM() {
|
||||
gles2::GetGLContext()->DescheduleUntilFinishedCHROMIUM();
|
||||
}
|
||||
@@ -1565,19 +1555,6 @@ void GL_APIENTRY GLES2BindUniformLocationCHROMIUM(GLuint program,
|
||||
const char* name) {
|
||||
gles2::GetGLContext()->BindUniformLocationCHROMIUM(program, location, name);
|
||||
}
|
||||
void GL_APIENTRY GLES2BindTexImage2DCHROMIUM(GLenum target, GLint imageId) {
|
||||
gles2::GetGLContext()->BindTexImage2DCHROMIUM(target, imageId);
|
||||
}
|
||||
void GL_APIENTRY
|
||||
GLES2BindTexImage2DWithInternalformatCHROMIUM(GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint imageId) {
|
||||
gles2::GetGLContext()->BindTexImage2DWithInternalformatCHROMIUM(
|
||||
target, internalformat, imageId);
|
||||
}
|
||||
void GL_APIENTRY GLES2ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) {
|
||||
gles2::GetGLContext()->ReleaseTexImage2DCHROMIUM(target, imageId);
|
||||
}
|
||||
void GL_APIENTRY GLES2TraceBeginCHROMIUM(const char* category_name,
|
||||
const char* trace_name) {
|
||||
gles2::GetGLContext()->TraceBeginCHROMIUM(category_name, trace_name);
|
||||
@@ -3005,14 +2982,6 @@ extern const NameToFunc g_gles2_function_table[] = {
|
||||
"glGetUniformsES3CHROMIUM",
|
||||
reinterpret_cast<GLES2FunctionPointer>(glGetUniformsES3CHROMIUM),
|
||||
},
|
||||
{
|
||||
"glCreateImageCHROMIUM",
|
||||
reinterpret_cast<GLES2FunctionPointer>(glCreateImageCHROMIUM),
|
||||
},
|
||||
{
|
||||
"glDestroyImageCHROMIUM",
|
||||
reinterpret_cast<GLES2FunctionPointer>(glDestroyImageCHROMIUM),
|
||||
},
|
||||
{
|
||||
"glDescheduleUntilFinishedCHROMIUM",
|
||||
reinterpret_cast<GLES2FunctionPointer>(
|
||||
@@ -3070,19 +3039,6 @@ extern const NameToFunc g_gles2_function_table[] = {
|
||||
"glBindUniformLocationCHROMIUM",
|
||||
reinterpret_cast<GLES2FunctionPointer>(glBindUniformLocationCHROMIUM),
|
||||
},
|
||||
{
|
||||
"glBindTexImage2DCHROMIUM",
|
||||
reinterpret_cast<GLES2FunctionPointer>(glBindTexImage2DCHROMIUM),
|
||||
},
|
||||
{
|
||||
"glBindTexImage2DWithInternalformatCHROMIUM",
|
||||
reinterpret_cast<GLES2FunctionPointer>(
|
||||
glBindTexImage2DWithInternalformatCHROMIUM),
|
||||
},
|
||||
{
|
||||
"glReleaseTexImage2DCHROMIUM",
|
||||
reinterpret_cast<GLES2FunctionPointer>(glReleaseTexImage2DCHROMIUM),
|
||||
},
|
||||
{
|
||||
"glTraceBeginCHROMIUM",
|
||||
reinterpret_cast<GLES2FunctionPointer>(glTraceBeginCHROMIUM),
|
||||
|
@@ -2936,32 +2936,6 @@ void BindUniformLocationCHROMIUMBucket(GLuint program,
|
||||
}
|
||||
}
|
||||
|
||||
void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) {
|
||||
gles2::cmds::BindTexImage2DCHROMIUM* c =
|
||||
GetCmdSpace<gles2::cmds::BindTexImage2DCHROMIUM>();
|
||||
if (c) {
|
||||
c->Init(target, imageId);
|
||||
}
|
||||
}
|
||||
|
||||
void BindTexImage2DWithInternalformatCHROMIUM(GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint imageId) {
|
||||
gles2::cmds::BindTexImage2DWithInternalformatCHROMIUM* c =
|
||||
GetCmdSpace<gles2::cmds::BindTexImage2DWithInternalformatCHROMIUM>();
|
||||
if (c) {
|
||||
c->Init(target, internalformat, imageId);
|
||||
}
|
||||
}
|
||||
|
||||
void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) {
|
||||
gles2::cmds::ReleaseTexImage2DCHROMIUM* c =
|
||||
GetCmdSpace<gles2::cmds::ReleaseTexImage2DCHROMIUM>();
|
||||
if (c) {
|
||||
c->Init(target, imageId);
|
||||
}
|
||||
}
|
||||
|
||||
void TraceBeginCHROMIUM(GLuint category_bucket_id, GLuint name_bucket_id) {
|
||||
gles2::cmds::TraceBeginCHROMIUM* c =
|
||||
GetCmdSpace<gles2::cmds::TraceBeginCHROMIUM>();
|
||||
|
@@ -4476,7 +4476,6 @@ const GLubyte* GLES2Implementation::GetStringHelper(GLenum name) {
|
||||
// Adds extensions implemented on client side only.
|
||||
if (name == GL_EXTENSIONS) {
|
||||
str += std::string(str.empty() ? "" : " ") +
|
||||
"GL_CHROMIUM_image "
|
||||
"GL_CHROMIUM_map_sub "
|
||||
"GL_CHROMIUM_ordering_barrier "
|
||||
"GL_CHROMIUM_sync_point "
|
||||
@@ -7190,94 +7189,6 @@ bool GLES2Implementation::CanDecodeWithHardwareAcceleration(
|
||||
return false;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
bool CreateImageValidInternalFormat(GLenum internalformat,
|
||||
const Capabilities& capabilities) {
|
||||
switch (internalformat) {
|
||||
case GL_R16_EXT:
|
||||
return capabilities.texture_norm16;
|
||||
case GL_RGB10_A2_EXT:
|
||||
return capabilities.image_ar30 || capabilities.image_ab30;
|
||||
case GL_RGB_YCBCR_P010_CHROMIUM:
|
||||
return capabilities.image_ycbcr_p010;
|
||||
case GL_RED:
|
||||
case GL_RG_EXT:
|
||||
case GL_RGB:
|
||||
case GL_RGBA:
|
||||
case GL_RGB_YCBCR_422_CHROMIUM:
|
||||
case GL_RGB_YCBCR_420V_CHROMIUM:
|
||||
case GL_RGB_YCRCB_420_CHROMIUM:
|
||||
case GL_BGRA_EXT:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
GLuint GLES2Implementation::CreateImageCHROMIUMHelper(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat) {
|
||||
if (width <= 0) {
|
||||
SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "width <= 0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (height <= 0) {
|
||||
SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "height <= 0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!CreateImageValidInternalFormat(internalformat, capabilities_)) {
|
||||
SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "invalid format");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// CreateImage creates a fence sync so we must flush first to ensure all
|
||||
// previously created fence syncs are flushed first.
|
||||
FlushHelper();
|
||||
|
||||
int32_t image_id = gpu_control_->CreateImage(buffer, width, height);
|
||||
if (image_id < 0) {
|
||||
SetGLError(GL_OUT_OF_MEMORY, "glCreateImageCHROMIUM", "image_id < 0");
|
||||
return 0;
|
||||
}
|
||||
return image_id;
|
||||
}
|
||||
|
||||
GLuint GLES2Implementation::CreateImageCHROMIUM(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat) {
|
||||
GPU_CLIENT_SINGLE_THREAD_CHECK();
|
||||
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateImageCHROMIUM(" << width
|
||||
<< ", " << height << ", "
|
||||
<< GLES2Util::GetStringImageInternalFormat(internalformat)
|
||||
<< ")");
|
||||
GLuint image_id =
|
||||
CreateImageCHROMIUMHelper(buffer, width, height, internalformat);
|
||||
CheckGLError();
|
||||
return image_id;
|
||||
}
|
||||
|
||||
void GLES2Implementation::DestroyImageCHROMIUMHelper(GLuint image_id) {
|
||||
// Flush the command stream to make sure all pending commands
|
||||
// that may refer to the image_id are executed on the service side.
|
||||
helper_->CommandBufferHelper::Flush();
|
||||
gpu_control_->DestroyImage(image_id);
|
||||
}
|
||||
|
||||
void GLES2Implementation::DestroyImageCHROMIUM(GLuint image_id) {
|
||||
GPU_CLIENT_SINGLE_THREAD_CHECK();
|
||||
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDestroyImageCHROMIUM("
|
||||
<< image_id << ")");
|
||||
DestroyImageCHROMIUMHelper(image_id);
|
||||
CheckGLError();
|
||||
}
|
||||
|
||||
bool GLES2Implementation::ValidateSize(const char* func, GLsizeiptr size) {
|
||||
if (size < 0) {
|
||||
SetGLError(GL_INVALID_VALUE, func, "size < 0");
|
||||
|
@@ -549,12 +549,6 @@ class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface,
|
||||
const GLuint* baseInstances,
|
||||
GLsizei drawcount);
|
||||
|
||||
GLuint CreateImageCHROMIUMHelper(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat);
|
||||
void DestroyImageCHROMIUMHelper(GLuint image_id);
|
||||
|
||||
// Helper for GetVertexAttrib
|
||||
bool GetVertexAttribHelper(GLuint index, GLenum pname, uint32_t* param);
|
||||
|
||||
|
@@ -1021,13 +1021,6 @@ void GetUniformsES3CHROMIUM(GLuint program,
|
||||
GLsizei* size,
|
||||
void* info) override;
|
||||
|
||||
GLuint CreateImageCHROMIUM(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat) override;
|
||||
|
||||
void DestroyImageCHROMIUM(GLuint image_id) override;
|
||||
|
||||
void DescheduleUntilFinishedCHROMIUM() override;
|
||||
|
||||
void GetTranslatedShaderSourceANGLE(GLuint shader,
|
||||
@@ -1104,14 +1097,6 @@ void BindUniformLocationCHROMIUM(GLuint program,
|
||||
GLint location,
|
||||
const char* name) override;
|
||||
|
||||
void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) override;
|
||||
|
||||
void BindTexImage2DWithInternalformatCHROMIUM(GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint imageId) override;
|
||||
|
||||
void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) override;
|
||||
|
||||
void TraceBeginCHROMIUM(const char* category_name,
|
||||
const char* trace_name) override;
|
||||
|
||||
|
@@ -3326,40 +3326,6 @@ void GLES2Implementation::CopySubTextureCHROMIUM(
|
||||
CheckGLError();
|
||||
}
|
||||
|
||||
void GLES2Implementation::BindTexImage2DCHROMIUM(GLenum target, GLint imageId) {
|
||||
GPU_CLIENT_SINGLE_THREAD_CHECK();
|
||||
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindTexImage2DCHROMIUM("
|
||||
<< GLES2Util::GetStringTextureBindTarget(target) << ", "
|
||||
<< imageId << ")");
|
||||
helper_->BindTexImage2DCHROMIUM(target, imageId);
|
||||
CheckGLError();
|
||||
}
|
||||
|
||||
void GLES2Implementation::BindTexImage2DWithInternalformatCHROMIUM(
|
||||
GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint imageId) {
|
||||
GPU_CLIENT_SINGLE_THREAD_CHECK();
|
||||
GPU_CLIENT_LOG(
|
||||
"[" << GetLogPrefix() << "] glBindTexImage2DWithInternalformatCHROMIUM("
|
||||
<< GLES2Util::GetStringTextureBindTarget(target) << ", "
|
||||
<< GLES2Util::GetStringTextureInternalFormat(internalformat) << ", "
|
||||
<< imageId << ")");
|
||||
helper_->BindTexImage2DWithInternalformatCHROMIUM(target, internalformat,
|
||||
imageId);
|
||||
CheckGLError();
|
||||
}
|
||||
|
||||
void GLES2Implementation::ReleaseTexImage2DCHROMIUM(GLenum target,
|
||||
GLint imageId) {
|
||||
GPU_CLIENT_SINGLE_THREAD_CHECK();
|
||||
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glReleaseTexImage2DCHROMIUM("
|
||||
<< GLES2Util::GetStringTextureBindTarget(target) << ", "
|
||||
<< imageId << ")");
|
||||
helper_->ReleaseTexImage2DCHROMIUM(target, imageId);
|
||||
CheckGLError();
|
||||
}
|
||||
|
||||
void GLES2Implementation::DiscardFramebufferEXT(GLenum target,
|
||||
GLsizei count,
|
||||
const GLenum* attachments) {
|
||||
|
@@ -3002,7 +3002,6 @@ TEST_F(GLES2ImplementationTest, GetString) {
|
||||
// GL_CHROMIUM_map_sub is hard coded into GLES2Implementation.
|
||||
const char* expected_str =
|
||||
"foobar "
|
||||
"GL_CHROMIUM_image "
|
||||
"GL_CHROMIUM_map_sub "
|
||||
"GL_CHROMIUM_ordering_barrier "
|
||||
"GL_CHROMIUM_sync_point "
|
||||
|
@@ -2874,39 +2874,6 @@ TEST_F(GLES2ImplementationTest, VertexAttribDivisorANGLE) {
|
||||
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, BindTexImage2DCHROMIUM) {
|
||||
struct Cmds {
|
||||
cmds::BindTexImage2DCHROMIUM cmd;
|
||||
};
|
||||
Cmds expected;
|
||||
expected.cmd.Init(GL_TEXTURE_2D, 2);
|
||||
|
||||
gl_->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, 2);
|
||||
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, BindTexImage2DWithInternalformatCHROMIUM) {
|
||||
struct Cmds {
|
||||
cmds::BindTexImage2DWithInternalformatCHROMIUM cmd;
|
||||
};
|
||||
Cmds expected;
|
||||
expected.cmd.Init(GL_TEXTURE_2D, GL_ALPHA, 3);
|
||||
|
||||
gl_->BindTexImage2DWithInternalformatCHROMIUM(GL_TEXTURE_2D, GL_ALPHA, 3);
|
||||
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, ReleaseTexImage2DCHROMIUM) {
|
||||
struct Cmds {
|
||||
cmds::ReleaseTexImage2DCHROMIUM cmd;
|
||||
};
|
||||
Cmds expected;
|
||||
expected.cmd.Init(GL_TEXTURE_2D, 2);
|
||||
|
||||
gl_->ReleaseTexImage2DCHROMIUM(GL_TEXTURE_2D, 2);
|
||||
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, DiscardFramebufferEXT) {
|
||||
GLenum data[2][1] = {{0}};
|
||||
struct Cmds {
|
||||
|
@@ -757,11 +757,6 @@ virtual void GetUniformsES3CHROMIUM(GLuint program,
|
||||
GLsizei bufsize,
|
||||
GLsizei* size,
|
||||
void* info) = 0;
|
||||
virtual GLuint CreateImageCHROMIUM(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat) = 0;
|
||||
virtual void DestroyImageCHROMIUM(GLuint image_id) = 0;
|
||||
virtual void DescheduleUntilFinishedCHROMIUM() = 0;
|
||||
virtual void GetTranslatedShaderSourceANGLE(GLuint shader,
|
||||
GLsizei bufsize,
|
||||
@@ -825,11 +820,6 @@ virtual GLuint CreateAndConsumeTextureCHROMIUM(const GLbyte* mailbox) = 0;
|
||||
virtual void BindUniformLocationCHROMIUM(GLuint program,
|
||||
GLint location,
|
||||
const char* name) = 0;
|
||||
virtual void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) = 0;
|
||||
virtual void BindTexImage2DWithInternalformatCHROMIUM(GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint imageId) = 0;
|
||||
virtual void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) = 0;
|
||||
virtual void TraceBeginCHROMIUM(const char* category_name,
|
||||
const char* trace_name) = 0;
|
||||
virtual void TraceEndCHROMIUM() = 0;
|
||||
|
@@ -733,11 +733,6 @@ void GetUniformsES3CHROMIUM(GLuint program,
|
||||
GLsizei bufsize,
|
||||
GLsizei* size,
|
||||
void* info) override;
|
||||
GLuint CreateImageCHROMIUM(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat) override;
|
||||
void DestroyImageCHROMIUM(GLuint image_id) override;
|
||||
void DescheduleUntilFinishedCHROMIUM() override;
|
||||
void GetTranslatedShaderSourceANGLE(GLuint shader,
|
||||
GLsizei bufsize,
|
||||
@@ -801,11 +796,6 @@ GLuint CreateAndConsumeTextureCHROMIUM(const GLbyte* mailbox) override;
|
||||
void BindUniformLocationCHROMIUM(GLuint program,
|
||||
GLint location,
|
||||
const char* name) override;
|
||||
void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) override;
|
||||
void BindTexImage2DWithInternalformatCHROMIUM(GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint imageId) override;
|
||||
void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) override;
|
||||
void TraceBeginCHROMIUM(const char* category_name,
|
||||
const char* trace_name) override;
|
||||
void TraceEndCHROMIUM() override;
|
||||
|
@@ -991,13 +991,6 @@ void GLES2InterfaceStub::GetUniformsES3CHROMIUM(GLuint /* program */,
|
||||
GLsizei /* bufsize */,
|
||||
GLsizei* /* size */,
|
||||
void* /* info */) {}
|
||||
GLuint GLES2InterfaceStub::CreateImageCHROMIUM(ClientBuffer /* buffer */,
|
||||
GLsizei /* width */,
|
||||
GLsizei /* height */,
|
||||
GLenum /* internalformat */) {
|
||||
return 0;
|
||||
}
|
||||
void GLES2InterfaceStub::DestroyImageCHROMIUM(GLuint /* image_id */) {}
|
||||
void GLES2InterfaceStub::DescheduleUntilFinishedCHROMIUM() {}
|
||||
void GLES2InterfaceStub::GetTranslatedShaderSourceANGLE(GLuint /* shader */,
|
||||
GLsizei /* bufsize */,
|
||||
@@ -1069,14 +1062,6 @@ GLuint GLES2InterfaceStub::CreateAndConsumeTextureCHROMIUM(
|
||||
void GLES2InterfaceStub::BindUniformLocationCHROMIUM(GLuint /* program */,
|
||||
GLint /* location */,
|
||||
const char* /* name */) {}
|
||||
void GLES2InterfaceStub::BindTexImage2DCHROMIUM(GLenum /* target */,
|
||||
GLint /* imageId */) {}
|
||||
void GLES2InterfaceStub::BindTexImage2DWithInternalformatCHROMIUM(
|
||||
GLenum /* target */,
|
||||
GLenum /* internalformat */,
|
||||
GLint /* imageId */) {}
|
||||
void GLES2InterfaceStub::ReleaseTexImage2DCHROMIUM(GLenum /* target */,
|
||||
GLint /* imageId */) {}
|
||||
void GLES2InterfaceStub::TraceBeginCHROMIUM(const char* /* category_name */,
|
||||
const char* /* trace_name */) {}
|
||||
void GLES2InterfaceStub::TraceEndCHROMIUM() {}
|
||||
|
@@ -733,11 +733,6 @@ void GetUniformsES3CHROMIUM(GLuint program,
|
||||
GLsizei bufsize,
|
||||
GLsizei* size,
|
||||
void* info) override;
|
||||
GLuint CreateImageCHROMIUM(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat) override;
|
||||
void DestroyImageCHROMIUM(GLuint image_id) override;
|
||||
void DescheduleUntilFinishedCHROMIUM() override;
|
||||
void GetTranslatedShaderSourceANGLE(GLuint shader,
|
||||
GLsizei bufsize,
|
||||
@@ -801,11 +796,6 @@ GLuint CreateAndConsumeTextureCHROMIUM(const GLbyte* mailbox) override;
|
||||
void BindUniformLocationCHROMIUM(GLuint program,
|
||||
GLint location,
|
||||
const char* name) override;
|
||||
void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) override;
|
||||
void BindTexImage2DWithInternalformatCHROMIUM(GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint imageId) override;
|
||||
void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) override;
|
||||
void TraceBeginCHROMIUM(const char* category_name,
|
||||
const char* trace_name) override;
|
||||
void TraceEndCHROMIUM() override;
|
||||
|
@@ -2091,19 +2091,6 @@ void GLES2TraceImplementation::GetUniformsES3CHROMIUM(GLuint program,
|
||||
gl_->GetUniformsES3CHROMIUM(program, bufsize, size, info);
|
||||
}
|
||||
|
||||
GLuint GLES2TraceImplementation::CreateImageCHROMIUM(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat) {
|
||||
TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::CreateImageCHROMIUM");
|
||||
return gl_->CreateImageCHROMIUM(buffer, width, height, internalformat);
|
||||
}
|
||||
|
||||
void GLES2TraceImplementation::DestroyImageCHROMIUM(GLuint image_id) {
|
||||
TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::DestroyImageCHROMIUM");
|
||||
gl_->DestroyImageCHROMIUM(image_id);
|
||||
}
|
||||
|
||||
void GLES2TraceImplementation::DescheduleUntilFinishedCHROMIUM() {
|
||||
TRACE_EVENT_BINARY_EFFICIENT0("gpu",
|
||||
"GLES2Trace::DescheduleUntilFinishedCHROMIUM");
|
||||
@@ -2240,28 +2227,6 @@ void GLES2TraceImplementation::BindUniformLocationCHROMIUM(GLuint program,
|
||||
gl_->BindUniformLocationCHROMIUM(program, location, name);
|
||||
}
|
||||
|
||||
void GLES2TraceImplementation::BindTexImage2DCHROMIUM(GLenum target,
|
||||
GLint imageId) {
|
||||
TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::BindTexImage2DCHROMIUM");
|
||||
gl_->BindTexImage2DCHROMIUM(target, imageId);
|
||||
}
|
||||
|
||||
void GLES2TraceImplementation::BindTexImage2DWithInternalformatCHROMIUM(
|
||||
GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint imageId) {
|
||||
TRACE_EVENT_BINARY_EFFICIENT0(
|
||||
"gpu", "GLES2Trace::BindTexImage2DWithInternalformatCHROMIUM");
|
||||
gl_->BindTexImage2DWithInternalformatCHROMIUM(target, internalformat,
|
||||
imageId);
|
||||
}
|
||||
|
||||
void GLES2TraceImplementation::ReleaseTexImage2DCHROMIUM(GLenum target,
|
||||
GLint imageId) {
|
||||
TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::ReleaseTexImage2DCHROMIUM");
|
||||
gl_->ReleaseTexImage2DCHROMIUM(target, imageId);
|
||||
}
|
||||
|
||||
void GLES2TraceImplementation::TraceBeginCHROMIUM(const char* category_name,
|
||||
const char* trace_name) {
|
||||
TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::TraceBeginCHROMIUM");
|
||||
|
@@ -47,15 +47,6 @@ class GPU_EXPORT GpuControl {
|
||||
|
||||
virtual const Capabilities& GetCapabilities() const = 0;
|
||||
|
||||
// Create an image for a client buffer with the given dimensions. Returns its
|
||||
// ID or -1 on error.
|
||||
virtual int32_t CreateImage(ClientBuffer buffer,
|
||||
size_t width,
|
||||
size_t height) = 0;
|
||||
|
||||
// Destroy an image. The ID must be positive.
|
||||
virtual void DestroyImage(int32_t id) = 0;
|
||||
|
||||
// Runs |callback| when a query created via glCreateQueryEXT() has cleared
|
||||
// passed the glEndQueryEXT() point.
|
||||
virtual void SignalQuery(uint32_t query, base::OnceClosure callback) = 0;
|
||||
|
@@ -92,16 +92,6 @@ class RasterMockGLES2Interface : public gles2::GLES2InterfaceStub {
|
||||
void(GLuint texture, GLenum mode));
|
||||
MOCK_METHOD1(EndSharedImageAccessDirectCHROMIUM, void(GLuint texture));
|
||||
|
||||
// Image objects.
|
||||
MOCK_METHOD4(CreateImageCHROMIUM,
|
||||
GLuint(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat));
|
||||
MOCK_METHOD2(BindTexImage2DCHROMIUM, void(GLenum target, GLint imageId));
|
||||
MOCK_METHOD2(ReleaseTexImage2DCHROMIUM, void(GLenum target, GLint imageId));
|
||||
MOCK_METHOD1(DestroyImageCHROMIUM, void(GLuint image_id));
|
||||
|
||||
// Texture allocation and copying.
|
||||
MOCK_METHOD9(TexImage2D,
|
||||
void(GLenum target,
|
||||
|
@@ -14612,126 +14612,6 @@ static_assert(
|
||||
offsetof(BindUniformLocationCHROMIUMBucket, name_bucket_id) == 12,
|
||||
"offset of BindUniformLocationCHROMIUMBucket name_bucket_id should be 12");
|
||||
|
||||
struct BindTexImage2DCHROMIUM {
|
||||
typedef BindTexImage2DCHROMIUM ValueType;
|
||||
static const CommandId kCmdId = kBindTexImage2DCHROMIUM;
|
||||
static const cmd::ArgFlags kArgFlags = cmd::kFixed;
|
||||
static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
|
||||
|
||||
static uint32_t ComputeSize() {
|
||||
return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
|
||||
}
|
||||
|
||||
void SetHeader() { header.SetCmd<ValueType>(); }
|
||||
|
||||
void Init(GLenum _target, GLint _imageId) {
|
||||
SetHeader();
|
||||
target = _target;
|
||||
imageId = _imageId;
|
||||
}
|
||||
|
||||
void* Set(void* cmd, GLenum _target, GLint _imageId) {
|
||||
static_cast<ValueType*>(cmd)->Init(_target, _imageId);
|
||||
return NextCmdAddress<ValueType>(cmd);
|
||||
}
|
||||
|
||||
gpu::CommandHeader header;
|
||||
uint32_t target;
|
||||
int32_t imageId;
|
||||
};
|
||||
|
||||
static_assert(sizeof(BindTexImage2DCHROMIUM) == 12,
|
||||
"size of BindTexImage2DCHROMIUM should be 12");
|
||||
static_assert(offsetof(BindTexImage2DCHROMIUM, header) == 0,
|
||||
"offset of BindTexImage2DCHROMIUM header should be 0");
|
||||
static_assert(offsetof(BindTexImage2DCHROMIUM, target) == 4,
|
||||
"offset of BindTexImage2DCHROMIUM target should be 4");
|
||||
static_assert(offsetof(BindTexImage2DCHROMIUM, imageId) == 8,
|
||||
"offset of BindTexImage2DCHROMIUM imageId should be 8");
|
||||
|
||||
struct BindTexImage2DWithInternalformatCHROMIUM {
|
||||
typedef BindTexImage2DWithInternalformatCHROMIUM ValueType;
|
||||
static const CommandId kCmdId = kBindTexImage2DWithInternalformatCHROMIUM;
|
||||
static const cmd::ArgFlags kArgFlags = cmd::kFixed;
|
||||
static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
|
||||
|
||||
static uint32_t ComputeSize() {
|
||||
return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
|
||||
}
|
||||
|
||||
void SetHeader() { header.SetCmd<ValueType>(); }
|
||||
|
||||
void Init(GLenum _target, GLenum _internalformat, GLint _imageId) {
|
||||
SetHeader();
|
||||
target = _target;
|
||||
internalformat = _internalformat;
|
||||
imageId = _imageId;
|
||||
}
|
||||
|
||||
void* Set(void* cmd, GLenum _target, GLenum _internalformat, GLint _imageId) {
|
||||
static_cast<ValueType*>(cmd)->Init(_target, _internalformat, _imageId);
|
||||
return NextCmdAddress<ValueType>(cmd);
|
||||
}
|
||||
|
||||
gpu::CommandHeader header;
|
||||
uint32_t target;
|
||||
uint32_t internalformat;
|
||||
int32_t imageId;
|
||||
};
|
||||
|
||||
static_assert(sizeof(BindTexImage2DWithInternalformatCHROMIUM) == 16,
|
||||
"size of BindTexImage2DWithInternalformatCHROMIUM should be 16");
|
||||
static_assert(
|
||||
offsetof(BindTexImage2DWithInternalformatCHROMIUM, header) == 0,
|
||||
"offset of BindTexImage2DWithInternalformatCHROMIUM header should be 0");
|
||||
static_assert(
|
||||
offsetof(BindTexImage2DWithInternalformatCHROMIUM, target) == 4,
|
||||
"offset of BindTexImage2DWithInternalformatCHROMIUM target should be 4");
|
||||
static_assert(offsetof(BindTexImage2DWithInternalformatCHROMIUM,
|
||||
internalformat) == 8,
|
||||
"offset of BindTexImage2DWithInternalformatCHROMIUM "
|
||||
"internalformat should be 8");
|
||||
static_assert(
|
||||
offsetof(BindTexImage2DWithInternalformatCHROMIUM, imageId) == 12,
|
||||
"offset of BindTexImage2DWithInternalformatCHROMIUM imageId should be 12");
|
||||
|
||||
struct ReleaseTexImage2DCHROMIUM {
|
||||
typedef ReleaseTexImage2DCHROMIUM ValueType;
|
||||
static const CommandId kCmdId = kReleaseTexImage2DCHROMIUM;
|
||||
static const cmd::ArgFlags kArgFlags = cmd::kFixed;
|
||||
static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
|
||||
|
||||
static uint32_t ComputeSize() {
|
||||
return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
|
||||
}
|
||||
|
||||
void SetHeader() { header.SetCmd<ValueType>(); }
|
||||
|
||||
void Init(GLenum _target, GLint _imageId) {
|
||||
SetHeader();
|
||||
target = _target;
|
||||
imageId = _imageId;
|
||||
}
|
||||
|
||||
void* Set(void* cmd, GLenum _target, GLint _imageId) {
|
||||
static_cast<ValueType*>(cmd)->Init(_target, _imageId);
|
||||
return NextCmdAddress<ValueType>(cmd);
|
||||
}
|
||||
|
||||
gpu::CommandHeader header;
|
||||
uint32_t target;
|
||||
int32_t imageId;
|
||||
};
|
||||
|
||||
static_assert(sizeof(ReleaseTexImage2DCHROMIUM) == 12,
|
||||
"size of ReleaseTexImage2DCHROMIUM should be 12");
|
||||
static_assert(offsetof(ReleaseTexImage2DCHROMIUM, header) == 0,
|
||||
"offset of ReleaseTexImage2DCHROMIUM header should be 0");
|
||||
static_assert(offsetof(ReleaseTexImage2DCHROMIUM, target) == 4,
|
||||
"offset of ReleaseTexImage2DCHROMIUM target should be 4");
|
||||
static_assert(offsetof(ReleaseTexImage2DCHROMIUM, imageId) == 8,
|
||||
"offset of ReleaseTexImage2DCHROMIUM imageId should be 8");
|
||||
|
||||
struct TraceBeginCHROMIUM {
|
||||
typedef TraceBeginCHROMIUM ValueType;
|
||||
static const CommandId kCmdId = kTraceBeginCHROMIUM;
|
||||
|
@@ -4814,47 +4814,6 @@ TEST_F(GLES2FormatTest, BindUniformLocationCHROMIUMBucket) {
|
||||
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
|
||||
}
|
||||
|
||||
TEST_F(GLES2FormatTest, BindTexImage2DCHROMIUM) {
|
||||
cmds::BindTexImage2DCHROMIUM& cmd =
|
||||
*GetBufferAs<cmds::BindTexImage2DCHROMIUM>();
|
||||
void* next_cmd =
|
||||
cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLint>(12));
|
||||
EXPECT_EQ(static_cast<uint32_t>(cmds::BindTexImage2DCHROMIUM::kCmdId),
|
||||
cmd.header.command);
|
||||
EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
|
||||
EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
|
||||
EXPECT_EQ(static_cast<GLint>(12), cmd.imageId);
|
||||
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
|
||||
}
|
||||
|
||||
TEST_F(GLES2FormatTest, BindTexImage2DWithInternalformatCHROMIUM) {
|
||||
cmds::BindTexImage2DWithInternalformatCHROMIUM& cmd =
|
||||
*GetBufferAs<cmds::BindTexImage2DWithInternalformatCHROMIUM>();
|
||||
void* next_cmd = cmd.Set(&cmd, static_cast<GLenum>(11),
|
||||
static_cast<GLenum>(12), static_cast<GLint>(13));
|
||||
EXPECT_EQ(static_cast<uint32_t>(
|
||||
cmds::BindTexImage2DWithInternalformatCHROMIUM::kCmdId),
|
||||
cmd.header.command);
|
||||
EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
|
||||
EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
|
||||
EXPECT_EQ(static_cast<GLenum>(12), cmd.internalformat);
|
||||
EXPECT_EQ(static_cast<GLint>(13), cmd.imageId);
|
||||
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
|
||||
}
|
||||
|
||||
TEST_F(GLES2FormatTest, ReleaseTexImage2DCHROMIUM) {
|
||||
cmds::ReleaseTexImage2DCHROMIUM& cmd =
|
||||
*GetBufferAs<cmds::ReleaseTexImage2DCHROMIUM>();
|
||||
void* next_cmd =
|
||||
cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLint>(12));
|
||||
EXPECT_EQ(static_cast<uint32_t>(cmds::ReleaseTexImage2DCHROMIUM::kCmdId),
|
||||
cmd.header.command);
|
||||
EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
|
||||
EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
|
||||
EXPECT_EQ(static_cast<GLint>(12), cmd.imageId);
|
||||
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
|
||||
}
|
||||
|
||||
TEST_F(GLES2FormatTest, TraceBeginCHROMIUM) {
|
||||
cmds::TraceBeginCHROMIUM& cmd = *GetBufferAs<cmds::TraceBeginCHROMIUM>();
|
||||
void* next_cmd =
|
||||
|
@@ -302,57 +302,54 @@
|
||||
OP(ProduceTextureDirectCHROMIUMImmediate) /* 543 */ \
|
||||
OP(CreateAndConsumeTextureINTERNALImmediate) /* 544 */ \
|
||||
OP(BindUniformLocationCHROMIUMBucket) /* 545 */ \
|
||||
OP(BindTexImage2DCHROMIUM) /* 546 */ \
|
||||
OP(BindTexImage2DWithInternalformatCHROMIUM) /* 547 */ \
|
||||
OP(ReleaseTexImage2DCHROMIUM) /* 548 */ \
|
||||
OP(TraceBeginCHROMIUM) /* 549 */ \
|
||||
OP(TraceEndCHROMIUM) /* 550 */ \
|
||||
OP(DiscardFramebufferEXTImmediate) /* 551 */ \
|
||||
OP(LoseContextCHROMIUM) /* 552 */ \
|
||||
OP(DrawBuffersEXTImmediate) /* 553 */ \
|
||||
OP(DiscardBackbufferCHROMIUM) /* 554 */ \
|
||||
OP(ScheduleOverlayPlaneCHROMIUM) /* 555 */ \
|
||||
OP(ScheduleCALayerSharedStateCHROMIUM) /* 556 */ \
|
||||
OP(ScheduleCALayerCHROMIUM) /* 557 */ \
|
||||
OP(ScheduleCALayerInUseQueryCHROMIUMImmediate) /* 558 */ \
|
||||
OP(CommitOverlayPlanesCHROMIUM) /* 559 */ \
|
||||
OP(FlushDriverCachesCHROMIUM) /* 560 */ \
|
||||
OP(ScheduleDCLayerCHROMIUM) /* 561 */ \
|
||||
OP(SetActiveURLCHROMIUM) /* 562 */ \
|
||||
OP(ContextVisibilityHintCHROMIUM) /* 563 */ \
|
||||
OP(CoverageModulationCHROMIUM) /* 564 */ \
|
||||
OP(BlendBarrierKHR) /* 565 */ \
|
||||
OP(BindFragDataLocationIndexedEXTBucket) /* 566 */ \
|
||||
OP(BindFragDataLocationEXTBucket) /* 567 */ \
|
||||
OP(GetFragDataIndexEXT) /* 568 */ \
|
||||
OP(SwapBuffersWithBoundsCHROMIUMImmediate) /* 569 */ \
|
||||
OP(SetDrawRectangleCHROMIUM) /* 570 */ \
|
||||
OP(SetEnableDCLayersCHROMIUM) /* 571 */ \
|
||||
OP(InitializeDiscardableTextureCHROMIUM) /* 572 */ \
|
||||
OP(UnlockDiscardableTextureCHROMIUM) /* 573 */ \
|
||||
OP(LockDiscardableTextureCHROMIUM) /* 574 */ \
|
||||
OP(TexStorage2DImageCHROMIUM) /* 575 */ \
|
||||
OP(SetColorSpaceMetadataCHROMIUM) /* 576 */ \
|
||||
OP(WindowRectanglesEXTImmediate) /* 577 */ \
|
||||
OP(CreateGpuFenceINTERNAL) /* 578 */ \
|
||||
OP(WaitGpuFenceCHROMIUM) /* 579 */ \
|
||||
OP(DestroyGpuFenceCHROMIUM) /* 580 */ \
|
||||
OP(SetReadbackBufferShadowAllocationINTERNAL) /* 581 */ \
|
||||
OP(FramebufferTextureMultiviewOVR) /* 582 */ \
|
||||
OP(MaxShaderCompilerThreadsKHR) /* 583 */ \
|
||||
OP(CreateAndTexStorage2DSharedImageINTERNALImmediate) /* 584 */ \
|
||||
OP(BeginSharedImageAccessDirectCHROMIUM) /* 585 */ \
|
||||
OP(EndSharedImageAccessDirectCHROMIUM) /* 586 */ \
|
||||
OP(BeginBatchReadAccessSharedImageCHROMIUM) /* 587 */ \
|
||||
OP(EndBatchReadAccessSharedImageCHROMIUM) /* 588 */ \
|
||||
OP(EnableiOES) /* 589 */ \
|
||||
OP(DisableiOES) /* 590 */ \
|
||||
OP(BlendEquationiOES) /* 591 */ \
|
||||
OP(BlendEquationSeparateiOES) /* 592 */ \
|
||||
OP(BlendFunciOES) /* 593 */ \
|
||||
OP(BlendFuncSeparateiOES) /* 594 */ \
|
||||
OP(ColorMaskiOES) /* 595 */ \
|
||||
OP(IsEnablediOES) /* 596 */
|
||||
OP(TraceBeginCHROMIUM) /* 546 */ \
|
||||
OP(TraceEndCHROMIUM) /* 547 */ \
|
||||
OP(DiscardFramebufferEXTImmediate) /* 548 */ \
|
||||
OP(LoseContextCHROMIUM) /* 549 */ \
|
||||
OP(DrawBuffersEXTImmediate) /* 550 */ \
|
||||
OP(DiscardBackbufferCHROMIUM) /* 551 */ \
|
||||
OP(ScheduleOverlayPlaneCHROMIUM) /* 552 */ \
|
||||
OP(ScheduleCALayerSharedStateCHROMIUM) /* 553 */ \
|
||||
OP(ScheduleCALayerCHROMIUM) /* 554 */ \
|
||||
OP(ScheduleCALayerInUseQueryCHROMIUMImmediate) /* 555 */ \
|
||||
OP(CommitOverlayPlanesCHROMIUM) /* 556 */ \
|
||||
OP(FlushDriverCachesCHROMIUM) /* 557 */ \
|
||||
OP(ScheduleDCLayerCHROMIUM) /* 558 */ \
|
||||
OP(SetActiveURLCHROMIUM) /* 559 */ \
|
||||
OP(ContextVisibilityHintCHROMIUM) /* 560 */ \
|
||||
OP(CoverageModulationCHROMIUM) /* 561 */ \
|
||||
OP(BlendBarrierKHR) /* 562 */ \
|
||||
OP(BindFragDataLocationIndexedEXTBucket) /* 563 */ \
|
||||
OP(BindFragDataLocationEXTBucket) /* 564 */ \
|
||||
OP(GetFragDataIndexEXT) /* 565 */ \
|
||||
OP(SwapBuffersWithBoundsCHROMIUMImmediate) /* 566 */ \
|
||||
OP(SetDrawRectangleCHROMIUM) /* 567 */ \
|
||||
OP(SetEnableDCLayersCHROMIUM) /* 568 */ \
|
||||
OP(InitializeDiscardableTextureCHROMIUM) /* 569 */ \
|
||||
OP(UnlockDiscardableTextureCHROMIUM) /* 570 */ \
|
||||
OP(LockDiscardableTextureCHROMIUM) /* 571 */ \
|
||||
OP(TexStorage2DImageCHROMIUM) /* 572 */ \
|
||||
OP(SetColorSpaceMetadataCHROMIUM) /* 573 */ \
|
||||
OP(WindowRectanglesEXTImmediate) /* 574 */ \
|
||||
OP(CreateGpuFenceINTERNAL) /* 575 */ \
|
||||
OP(WaitGpuFenceCHROMIUM) /* 576 */ \
|
||||
OP(DestroyGpuFenceCHROMIUM) /* 577 */ \
|
||||
OP(SetReadbackBufferShadowAllocationINTERNAL) /* 578 */ \
|
||||
OP(FramebufferTextureMultiviewOVR) /* 579 */ \
|
||||
OP(MaxShaderCompilerThreadsKHR) /* 580 */ \
|
||||
OP(CreateAndTexStorage2DSharedImageINTERNALImmediate) /* 581 */ \
|
||||
OP(BeginSharedImageAccessDirectCHROMIUM) /* 582 */ \
|
||||
OP(EndSharedImageAccessDirectCHROMIUM) /* 583 */ \
|
||||
OP(BeginBatchReadAccessSharedImageCHROMIUM) /* 584 */ \
|
||||
OP(EndBatchReadAccessSharedImageCHROMIUM) /* 585 */ \
|
||||
OP(EnableiOES) /* 586 */ \
|
||||
OP(DisableiOES) /* 587 */ \
|
||||
OP(BlendEquationiOES) /* 588 */ \
|
||||
OP(BlendEquationSeparateiOES) /* 589 */ \
|
||||
OP(BlendFunciOES) /* 590 */ \
|
||||
OP(BlendFuncSeparateiOES) /* 591 */ \
|
||||
OP(ColorMaskiOES) /* 592 */ \
|
||||
OP(IsEnablediOES) /* 593 */
|
||||
|
||||
enum CommandId {
|
||||
kOneBeforeStartPoint =
|
||||
|
@@ -310,8 +310,6 @@ GL_APICALL void GL_APIENTRY glGetProgramInfoCHROMIUM (GLidProgram progra
|
||||
GL_APICALL void GL_APIENTRY glGetUniformBlocksCHROMIUM (GLidProgram program, GLsizeiNotNegative bufsize, GLsizei* size, void* info);
|
||||
GL_APICALL void GL_APIENTRY glGetTransformFeedbackVaryingsCHROMIUM (GLidProgram program, GLsizeiNotNegative bufsize, GLsizei* size, void* info);
|
||||
GL_APICALL void GL_APIENTRY glGetUniformsES3CHROMIUM (GLidProgram program, GLsizeiNotNegative bufsize, GLsizei* size, void* info);
|
||||
GL_APICALL GLuint GL_APIENTRY glCreateImageCHROMIUM (ClientBuffer buffer, GLsizei width, GLsizei height, GLenum internalformat);
|
||||
GL_APICALL void GL_APIENTRY glDestroyImageCHROMIUM (GLuint image_id);
|
||||
GL_APICALL void GL_APIENTRY glDescheduleUntilFinishedCHROMIUM (void);
|
||||
GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLidShader shader, GLsizeiNotNegative bufsize, GLsizeiOptional* length, char* source);
|
||||
GL_APICALL void GL_APIENTRY glPostSubBufferCHROMIUM (GLuint64 swap_id, GLint x, GLint y, GLint width, GLint height, GLbitfieldSwapBuffersFlags flags = 0);
|
||||
@@ -326,9 +324,6 @@ GL_APICALL void GL_APIENTRY glProduceTextureDirectCHROMIUM (GLidBindText
|
||||
GL_APICALL GLuint GL_APIENTRY glCreateAndConsumeTextureCHROMIUM (const GLbyte* mailbox);
|
||||
GL_APICALL void GL_APIENTRY glCreateAndConsumeTextureINTERNAL (GLuint texture, const GLbyte* mailbox);
|
||||
GL_APICALL void GL_APIENTRY glBindUniformLocationCHROMIUM (GLidProgram program, GLint location, const char* name);
|
||||
GL_APICALL void GL_APIENTRY glBindTexImage2DCHROMIUM (GLenumTextureBindTarget target, GLint imageId);
|
||||
GL_APICALL void GL_APIENTRY glBindTexImage2DWithInternalformatCHROMIUM (GLenumTextureBindTarget target, GLenumTextureInternalFormat internalformat, GLint imageId);
|
||||
GL_APICALL void GL_APIENTRY glReleaseTexImage2DCHROMIUM (GLenumTextureBindTarget target, GLint imageId);
|
||||
GL_APICALL void GL_APIENTRY glTraceBeginCHROMIUM (const char* category_name, const char* trace_name);
|
||||
GL_APICALL void GL_APIENTRY glTraceEndCHROMIUM (void);
|
||||
GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenumFramebufferTarget target, GLsizei count, const GLenum* attachments);
|
||||
|
@@ -1242,20 +1242,6 @@ class GLES2DecoderImpl : public GLES2Decoder,
|
||||
uint32_t texture_target,
|
||||
gl::GLImage* image,
|
||||
bool can_bind_to_sampler) override;
|
||||
void DoBindTexImage2DCHROMIUM(
|
||||
GLenum target,
|
||||
GLint image_id);
|
||||
void DoBindTexImage2DWithInternalformatCHROMIUM(GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint image_id);
|
||||
// Common implementation of DoBindTexImage2DCHROMIUM entry points.
|
||||
void BindTexImage2DCHROMIUMImpl(const char* function_name,
|
||||
GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint image_id);
|
||||
void DoReleaseTexImage2DCHROMIUM(
|
||||
GLenum target,
|
||||
GLint image_id);
|
||||
|
||||
void DoTraceEndCHROMIUM(void);
|
||||
|
||||
@@ -19119,118 +19105,6 @@ void GLES2DecoderImpl::BindImage(uint32_t client_texture_id,
|
||||
: gpu::gles2::Texture::UNBOUND);
|
||||
}
|
||||
|
||||
void GLES2DecoderImpl::DoBindTexImage2DCHROMIUM(
|
||||
GLenum target, GLint image_id) {
|
||||
TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoBindTexImage2DCHROMIUM");
|
||||
|
||||
BindTexImage2DCHROMIUMImpl("glBindTexImage2DCHROMIUM", target, 0, image_id);
|
||||
}
|
||||
|
||||
void GLES2DecoderImpl::DoBindTexImage2DWithInternalformatCHROMIUM(
|
||||
GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint image_id) {
|
||||
TRACE_EVENT0("gpu",
|
||||
"GLES2DecoderImpl::DoBindTexImage2DWithInternalformatCHROMIUM");
|
||||
|
||||
BindTexImage2DCHROMIUMImpl("glBindTexImage2DWithInternalformatCHROMIUM",
|
||||
target, internalformat, image_id);
|
||||
}
|
||||
|
||||
void GLES2DecoderImpl::BindTexImage2DCHROMIUMImpl(const char* function_name,
|
||||
GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint image_id) {
|
||||
if (target == GL_TEXTURE_CUBE_MAP) {
|
||||
LOCAL_SET_GL_ERROR(GL_INVALID_ENUM, function_name, "invalid target");
|
||||
return;
|
||||
}
|
||||
|
||||
// Default target might be conceptually valid, but disallow it to avoid
|
||||
// accidents.
|
||||
TextureRef* texture_ref =
|
||||
texture_manager()->GetTextureInfoForTargetUnlessDefault(&state_, target);
|
||||
if (!texture_ref) {
|
||||
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, "no texture bound");
|
||||
return;
|
||||
}
|
||||
|
||||
gl::GLImage* image = image_manager()->LookupImage(image_id);
|
||||
if (!image) {
|
||||
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
|
||||
"no image found with the given ID");
|
||||
return;
|
||||
}
|
||||
|
||||
Texture::ImageState image_state = Texture::UNBOUND;
|
||||
|
||||
if (image->ShouldBindOrCopy() == gl::GLImage::BIND) {
|
||||
ScopedGLErrorSuppressor suppressor(
|
||||
"GLES2DecoderImpl::DoBindTexImage2DCHROMIUM", error_state_.get());
|
||||
|
||||
// Note: We fallback to using CopyTexImage() before the texture is used
|
||||
// when BindTexImage() fails.
|
||||
if (internalformat) {
|
||||
if (image->BindTexImageWithInternalformat(target, internalformat))
|
||||
image_state = Texture::BOUND;
|
||||
} else {
|
||||
if (image->BindTexImage(target))
|
||||
image_state = Texture::BOUND;
|
||||
}
|
||||
}
|
||||
|
||||
gfx::Size size = image->GetSize();
|
||||
GLenum texture_internalformat =
|
||||
internalformat ? internalformat : image->GetInternalFormat();
|
||||
texture_manager()->SetLevelInfo(texture_ref, target, 0,
|
||||
texture_internalformat, size.width(),
|
||||
size.height(), 1, 0, image->GetDataFormat(),
|
||||
image->GetDataType(), gfx::Rect(size));
|
||||
texture_manager()->SetLevelImage(texture_ref, target, 0, image, image_state);
|
||||
}
|
||||
|
||||
void GLES2DecoderImpl::DoReleaseTexImage2DCHROMIUM(
|
||||
GLenum target, GLint image_id) {
|
||||
TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoReleaseTexImage2DCHROMIUM");
|
||||
|
||||
// Default target might be conceptually valid, but disallow it to avoid
|
||||
// accidents.
|
||||
TextureRef* texture_ref =
|
||||
texture_manager()->GetTextureInfoForTargetUnlessDefault(&state_, target);
|
||||
if (!texture_ref) {
|
||||
LOCAL_SET_GL_ERROR(
|
||||
GL_INVALID_OPERATION,
|
||||
"glReleaseTexImage2DCHROMIUM", "no texture bound");
|
||||
return;
|
||||
}
|
||||
|
||||
gl::GLImage* image = image_manager()->LookupImage(image_id);
|
||||
if (!image) {
|
||||
LOCAL_SET_GL_ERROR(
|
||||
GL_INVALID_OPERATION,
|
||||
"glReleaseTexImage2DCHROMIUM", "no image found with the given ID");
|
||||
return;
|
||||
}
|
||||
|
||||
Texture::ImageState image_state;
|
||||
|
||||
// Do nothing when image is not currently bound.
|
||||
if (texture_ref->texture()->GetLevelImage(target, 0, &image_state) != image)
|
||||
return;
|
||||
|
||||
if (image_state == Texture::BOUND) {
|
||||
ScopedGLErrorSuppressor suppressor(
|
||||
"GLES2DecoderImpl::DoReleaseTexImage2DCHROMIUM", error_state_.get());
|
||||
|
||||
image->ReleaseTexImage(target);
|
||||
texture_manager()->SetLevelInfo(texture_ref, target, 0, GL_RGBA, 0, 0, 1, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect());
|
||||
}
|
||||
|
||||
texture_manager()->SetLevelImage(texture_ref, target, 0, nullptr,
|
||||
Texture::UNBOUND);
|
||||
}
|
||||
|
||||
error::Error GLES2DecoderImpl::HandleTraceBeginCHROMIUM(
|
||||
uint32_t immediate_data_size,
|
||||
const volatile void* cmd_data) {
|
||||
|
@@ -5026,64 +5026,6 @@ error::Error GLES2DecoderImpl::HandleCreateAndConsumeTextureINTERNALImmediate(
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
error::Error GLES2DecoderImpl::HandleBindTexImage2DCHROMIUM(
|
||||
uint32_t immediate_data_size,
|
||||
const volatile void* cmd_data) {
|
||||
const volatile gles2::cmds::BindTexImage2DCHROMIUM& c =
|
||||
*static_cast<const volatile gles2::cmds::BindTexImage2DCHROMIUM*>(
|
||||
cmd_data);
|
||||
GLenum target = static_cast<GLenum>(c.target);
|
||||
GLint imageId = static_cast<GLint>(c.imageId);
|
||||
if (!validators_->texture_bind_target.IsValid(target)) {
|
||||
LOCAL_SET_GL_ERROR_INVALID_ENUM("glBindTexImage2DCHROMIUM", target,
|
||||
"target");
|
||||
return error::kNoError;
|
||||
}
|
||||
DoBindTexImage2DCHROMIUM(target, imageId);
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
error::Error GLES2DecoderImpl::HandleBindTexImage2DWithInternalformatCHROMIUM(
|
||||
uint32_t immediate_data_size,
|
||||
const volatile void* cmd_data) {
|
||||
const volatile gles2::cmds::BindTexImage2DWithInternalformatCHROMIUM& c =
|
||||
*static_cast<const volatile gles2::cmds::
|
||||
BindTexImage2DWithInternalformatCHROMIUM*>(cmd_data);
|
||||
GLenum target = static_cast<GLenum>(c.target);
|
||||
GLenum internalformat = static_cast<GLenum>(c.internalformat);
|
||||
GLint imageId = static_cast<GLint>(c.imageId);
|
||||
if (!validators_->texture_bind_target.IsValid(target)) {
|
||||
LOCAL_SET_GL_ERROR_INVALID_ENUM(
|
||||
"glBindTexImage2DWithInternalformatCHROMIUM", target, "target");
|
||||
return error::kNoError;
|
||||
}
|
||||
if (!validators_->texture_internal_format.IsValid(internalformat)) {
|
||||
LOCAL_SET_GL_ERROR_INVALID_ENUM(
|
||||
"glBindTexImage2DWithInternalformatCHROMIUM", internalformat,
|
||||
"internalformat");
|
||||
return error::kNoError;
|
||||
}
|
||||
DoBindTexImage2DWithInternalformatCHROMIUM(target, internalformat, imageId);
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
error::Error GLES2DecoderImpl::HandleReleaseTexImage2DCHROMIUM(
|
||||
uint32_t immediate_data_size,
|
||||
const volatile void* cmd_data) {
|
||||
const volatile gles2::cmds::ReleaseTexImage2DCHROMIUM& c =
|
||||
*static_cast<const volatile gles2::cmds::ReleaseTexImage2DCHROMIUM*>(
|
||||
cmd_data);
|
||||
GLenum target = static_cast<GLenum>(c.target);
|
||||
GLint imageId = static_cast<GLint>(c.imageId);
|
||||
if (!validators_->texture_bind_target.IsValid(target)) {
|
||||
LOCAL_SET_GL_ERROR_INVALID_ENUM("glReleaseTexImage2DCHROMIUM", target,
|
||||
"target");
|
||||
return error::kNoError;
|
||||
}
|
||||
DoReleaseTexImage2DCHROMIUM(target, imageId);
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
error::Error GLES2DecoderImpl::HandleTraceEndCHROMIUM(
|
||||
uint32_t immediate_data_size,
|
||||
const volatile void* cmd_data) {
|
||||
|
@@ -2978,52 +2978,6 @@ error::Error GLES2DecoderPassthroughImpl::HandleSetActiveURLCHROMIUM(
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
error::Error GLES2DecoderPassthroughImpl::BindTexImage2DCHROMIUMImpl(
|
||||
GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint imageId) {
|
||||
TextureTarget target_enum = GLenumToTextureTarget(target);
|
||||
if (target_enum == TextureTarget::kCubeMap ||
|
||||
target_enum == TextureTarget::kUnkown) {
|
||||
InsertError(GL_INVALID_ENUM, "Invalid target");
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
gl::GLImage* image = group_->image_manager()->LookupImage(imageId);
|
||||
if (image == nullptr) {
|
||||
InsertError(GL_INVALID_OPERATION, "No image found with the given ID");
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
const BoundTexture& bound_texture =
|
||||
bound_textures_[static_cast<size_t>(target_enum)][active_texture_unit_];
|
||||
if (bound_texture.texture == nullptr) {
|
||||
InsertError(GL_INVALID_OPERATION, "No texture bound");
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
if (image->ShouldBindOrCopy() == gl::GLImage::BIND) {
|
||||
if (internalformat)
|
||||
image->BindTexImageWithInternalformat(target, internalformat);
|
||||
else
|
||||
image->BindTexImage(target);
|
||||
} else {
|
||||
image->CopyTexImage(target);
|
||||
}
|
||||
|
||||
// Target is already validated
|
||||
UpdateTextureSizeFromTarget(target);
|
||||
|
||||
DCHECK(bound_texture.texture != nullptr);
|
||||
bound_texture.texture->SetLevelImage(target, 0, image);
|
||||
|
||||
// If there was any GLImage bound to |target| on this texture unit, then
|
||||
// forget it.
|
||||
RemovePendingBindingTexture(target, active_texture_unit_);
|
||||
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
void GLES2DecoderPassthroughImpl::VerifyServiceTextureObjectsExist() {
|
||||
resources_->texture_object_map.ForEach(
|
||||
[this](GLuint client_id, scoped_refptr<TexturePassthrough> texture) {
|
||||
|
@@ -469,10 +469,6 @@ class GPU_GLES2_EXPORT GLES2DecoderPassthroughImpl
|
||||
// up-to-date.
|
||||
void LazilyUpdateCurrentlyBoundElementArrayBuffer();
|
||||
|
||||
error::Error BindTexImage2DCHROMIUMImpl(GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint image_id);
|
||||
|
||||
void VerifyServiceTextureObjectsExist();
|
||||
|
||||
bool IsEmulatedFramebufferBound(GLenum target) const;
|
||||
|
@@ -888,11 +888,6 @@ error::Error DoCreateAndConsumeTextureINTERNAL(GLuint texture_client_id,
|
||||
error::Error DoBindUniformLocationCHROMIUM(GLuint program,
|
||||
GLint location,
|
||||
const char* name);
|
||||
error::Error DoBindTexImage2DCHROMIUM(GLenum target, GLint imageId);
|
||||
error::Error DoBindTexImage2DWithInternalformatCHROMIUM(GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint imageId);
|
||||
error::Error DoReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId);
|
||||
error::Error DoTraceBeginCHROMIUM(const char* category_name,
|
||||
const char* trace_name);
|
||||
error::Error DoTraceEndCHROMIUM();
|
||||
|
@@ -4677,55 +4677,6 @@ error::Error GLES2DecoderPassthroughImpl::DoBindUniformLocationCHROMIUM(
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
error::Error GLES2DecoderPassthroughImpl::DoBindTexImage2DCHROMIUM(
|
||||
GLenum target,
|
||||
GLint imageId) {
|
||||
return BindTexImage2DCHROMIUMImpl(target, 0, imageId);
|
||||
}
|
||||
|
||||
error::Error
|
||||
GLES2DecoderPassthroughImpl::DoBindTexImage2DWithInternalformatCHROMIUM(
|
||||
GLenum target,
|
||||
GLenum internalformat,
|
||||
GLint imageId) {
|
||||
return BindTexImage2DCHROMIUMImpl(target, internalformat, imageId);
|
||||
}
|
||||
|
||||
error::Error GLES2DecoderPassthroughImpl::DoReleaseTexImage2DCHROMIUM(
|
||||
GLenum target,
|
||||
GLint imageId) {
|
||||
TextureTarget target_enum = GLenumToTextureTarget(target);
|
||||
if (target_enum == TextureTarget::kCubeMap ||
|
||||
target_enum == TextureTarget::kUnkown) {
|
||||
InsertError(GL_INVALID_ENUM, "Invalid target");
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
const BoundTexture& bound_texture =
|
||||
bound_textures_[static_cast<size_t>(target_enum)][active_texture_unit_];
|
||||
if (bound_texture.texture == nullptr) {
|
||||
InsertError(GL_INVALID_OPERATION, "No texture bound");
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
gl::GLImage* image = group_->image_manager()->LookupImage(imageId);
|
||||
if (image == nullptr) {
|
||||
InsertError(GL_INVALID_OPERATION, "No image found with the given ID");
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
// Only release the image if it is currently bound
|
||||
if (bound_texture.texture->GetLevelImage(target, 0) == image) {
|
||||
image->ReleaseTexImage(target);
|
||||
bound_texture.texture->SetLevelImage(target, 0, nullptr);
|
||||
}
|
||||
|
||||
// Target is already validated
|
||||
UpdateTextureSizeFromTarget(target);
|
||||
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
error::Error GLES2DecoderPassthroughImpl::DoTraceBeginCHROMIUM(
|
||||
const char* category_name,
|
||||
const char* trace_name) {
|
||||
|
@@ -4302,54 +4302,6 @@ GLES2DecoderPassthroughImpl::HandleCreateAndConsumeTextureINTERNALImmediate(
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
error::Error GLES2DecoderPassthroughImpl::HandleBindTexImage2DCHROMIUM(
|
||||
uint32_t immediate_data_size,
|
||||
const volatile void* cmd_data) {
|
||||
const volatile gles2::cmds::BindTexImage2DCHROMIUM& c =
|
||||
*static_cast<const volatile gles2::cmds::BindTexImage2DCHROMIUM*>(
|
||||
cmd_data);
|
||||
GLenum target = static_cast<GLenum>(c.target);
|
||||
GLint imageId = static_cast<GLint>(c.imageId);
|
||||
error::Error error = DoBindTexImage2DCHROMIUM(target, imageId);
|
||||
if (error != error::kNoError) {
|
||||
return error;
|
||||
}
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
error::Error
|
||||
GLES2DecoderPassthroughImpl::HandleBindTexImage2DWithInternalformatCHROMIUM(
|
||||
uint32_t immediate_data_size,
|
||||
const volatile void* cmd_data) {
|
||||
const volatile gles2::cmds::BindTexImage2DWithInternalformatCHROMIUM& c =
|
||||
*static_cast<const volatile gles2::cmds::
|
||||
BindTexImage2DWithInternalformatCHROMIUM*>(cmd_data);
|
||||
GLenum target = static_cast<GLenum>(c.target);
|
||||
GLenum internalformat = static_cast<GLenum>(c.internalformat);
|
||||
GLint imageId = static_cast<GLint>(c.imageId);
|
||||
error::Error error = DoBindTexImage2DWithInternalformatCHROMIUM(
|
||||
target, internalformat, imageId);
|
||||
if (error != error::kNoError) {
|
||||
return error;
|
||||
}
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
error::Error GLES2DecoderPassthroughImpl::HandleReleaseTexImage2DCHROMIUM(
|
||||
uint32_t immediate_data_size,
|
||||
const volatile void* cmd_data) {
|
||||
const volatile gles2::cmds::ReleaseTexImage2DCHROMIUM& c =
|
||||
*static_cast<const volatile gles2::cmds::ReleaseTexImage2DCHROMIUM*>(
|
||||
cmd_data);
|
||||
GLenum target = static_cast<GLenum>(c.target);
|
||||
GLint imageId = static_cast<GLint>(c.imageId);
|
||||
error::Error error = DoReleaseTexImage2DCHROMIUM(target, imageId);
|
||||
if (error != error::kNoError) {
|
||||
return error;
|
||||
}
|
||||
return error::kNoError;
|
||||
}
|
||||
|
||||
error::Error GLES2DecoderPassthroughImpl::HandleTraceEndCHROMIUM(
|
||||
uint32_t immediate_data_size,
|
||||
const volatile void* cmd_data) {
|
||||
|
@@ -1402,19 +1402,6 @@ void GLES2DecoderTestBase::DoDeleteTexture(
|
||||
}
|
||||
}
|
||||
|
||||
void GLES2DecoderTestBase::DoBindTexImage2DCHROMIUM(GLenum target,
|
||||
GLint image_id) {
|
||||
cmds::BindTexImage2DCHROMIUM bind_tex_image_2d_cmd;
|
||||
bind_tex_image_2d_cmd.Init(target, image_id);
|
||||
EXPECT_CALL(*gl_, GetError())
|
||||
.Times(AtMost(2))
|
||||
.WillOnce(Return(GL_NO_ERROR))
|
||||
.WillOnce(Return(GL_NO_ERROR))
|
||||
.RetiresOnSaturation();
|
||||
EXPECT_EQ(error::kNoError, ExecuteCmd(bind_tex_image_2d_cmd));
|
||||
EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
||||
}
|
||||
|
||||
void GLES2DecoderTestBase::DoTexImage2D(GLenum target,
|
||||
GLint level,
|
||||
GLenum internal_format,
|
||||
|
@@ -343,7 +343,6 @@ class GLES2DecoderTestBase : public ::testing::TestWithParam<bool>,
|
||||
GLint border,
|
||||
GLsizei size,
|
||||
uint32_t bucket_id);
|
||||
void DoBindTexImage2DCHROMIUM(GLenum target, GLint image_id);
|
||||
void DoTexImage2D(GLenum target,
|
||||
GLint level,
|
||||
GLenum internal_format,
|
||||
|
@@ -265,15 +265,6 @@ class RecordReplayContext : public GpuControl {
|
||||
|
||||
const Capabilities& GetCapabilities() const override { return capabilities_; }
|
||||
|
||||
int32_t CreateImage(ClientBuffer buffer,
|
||||
size_t width,
|
||||
size_t height) override {
|
||||
NOTIMPLEMENTED();
|
||||
return -1;
|
||||
}
|
||||
|
||||
void DestroyImage(int32_t id) override { NOTREACHED(); }
|
||||
|
||||
void SignalQuery(uint32_t query, base::OnceClosure callback) override {
|
||||
NOTREACHED();
|
||||
}
|
||||
|
@@ -497,69 +497,6 @@ const Capabilities& GLManager::GetCapabilities() const {
|
||||
return capabilities_;
|
||||
}
|
||||
|
||||
int32_t GLManager::CreateImage(ClientBuffer buffer,
|
||||
size_t width,
|
||||
size_t height) {
|
||||
gfx::Size size(width, height);
|
||||
scoped_refptr<gl::GLImage> gl_image;
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
if (use_iosurface_memory_buffers_) {
|
||||
IOSurfaceGpuMemoryBuffer* gpu_memory_buffer =
|
||||
IOSurfaceGpuMemoryBuffer::FromClientBuffer(buffer);
|
||||
unsigned internalformat =
|
||||
gl::BufferFormatToGLInternalFormat(gpu_memory_buffer->GetFormat());
|
||||
const uint32_t io_surface_plane = 0;
|
||||
scoped_refptr<gl::GLImageIOSurface> image(
|
||||
gl::GLImageIOSurface::Create(size, internalformat));
|
||||
if (!image->Initialize(gpu_memory_buffer->iosurface(), io_surface_plane,
|
||||
gfx::GenericSharedMemoryId(1),
|
||||
gfx::BufferFormat::BGRA_8888)) {
|
||||
return -1;
|
||||
}
|
||||
gl_image = image;
|
||||
}
|
||||
#endif // BUILDFLAG(IS_MAC)
|
||||
|
||||
if (use_native_pixmap_memory_buffers_) {
|
||||
gfx::GpuMemoryBuffer* gpu_memory_buffer =
|
||||
reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer);
|
||||
DCHECK(gpu_memory_buffer);
|
||||
if (gpu_memory_buffer->GetType() == gfx::NATIVE_PIXMAP) {
|
||||
gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->CloneHandle();
|
||||
gfx::BufferFormat format = gpu_memory_buffer->GetFormat();
|
||||
gl_image =
|
||||
gpu_memory_buffer_factory_->AsImageFactory()
|
||||
->CreateImageForGpuMemoryBuffer(
|
||||
std::move(handle), size, format, gfx::BufferPlane::DEFAULT,
|
||||
gpu::kDisplayCompositorClientId, gpu::kNullSurfaceHandle);
|
||||
if (!gl_image)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!gl_image) {
|
||||
GpuMemoryBufferImpl* gpu_memory_buffer =
|
||||
GpuMemoryBufferImpl::FromClientBuffer(buffer);
|
||||
|
||||
gfx::BufferFormat format = gpu_memory_buffer->GetFormat();
|
||||
auto image = base::MakeRefCounted<gl::GLImageRefCountedMemory>(size);
|
||||
if (!image->Initialize(gpu_memory_buffer->bytes(), format)) {
|
||||
return -1;
|
||||
}
|
||||
gl_image = image;
|
||||
}
|
||||
|
||||
static int32_t next_id = 1;
|
||||
int32_t new_id = next_id++;
|
||||
image_manager_.AddImage(gl_image.get(), new_id);
|
||||
return new_id;
|
||||
}
|
||||
|
||||
void GLManager::DestroyImage(int32_t id) {
|
||||
image_manager_.RemoveImage(id);
|
||||
}
|
||||
|
||||
void GLManager::SignalQuery(uint32_t query, base::OnceClosure callback) {
|
||||
NOTREACHED();
|
||||
}
|
||||
|
@@ -145,10 +145,6 @@ class GLManager : private GpuControl {
|
||||
// GpuControl implementation.
|
||||
void SetGpuControlClient(GpuControlClient*) override;
|
||||
const Capabilities& GetCapabilities() const override;
|
||||
int32_t CreateImage(ClientBuffer buffer,
|
||||
size_t width,
|
||||
size_t height) override;
|
||||
void DestroyImage(int32_t id) override;
|
||||
void SignalQuery(uint32_t query, base::OnceClosure callback) override;
|
||||
void CreateGpuFence(uint32_t gpu_fence_id, ClientGpuFence source) override;
|
||||
void GetGpuFence(uint32_t gpu_fence_id,
|
||||
|
@@ -173,15 +173,6 @@ const gpu::Capabilities& Context::GetCapabilities() const {
|
||||
return capabilities_;
|
||||
}
|
||||
|
||||
int32_t Context::CreateImage(ClientBuffer buffer, size_t width, size_t height) {
|
||||
NOTREACHED();
|
||||
return -1;
|
||||
}
|
||||
|
||||
void Context::DestroyImage(int32_t id) {
|
||||
NOTREACHED();
|
||||
}
|
||||
|
||||
void Context::SignalQuery(uint32_t query, base::OnceClosure callback) {
|
||||
NOTREACHED();
|
||||
}
|
||||
|
@@ -67,10 +67,6 @@ class Context : public base::RefCountedThreadSafe<Context>,
|
||||
// GpuControl implementation.
|
||||
void SetGpuControlClient(gpu::GpuControlClient*) override;
|
||||
const gpu::Capabilities& GetCapabilities() const override;
|
||||
int32_t CreateImage(ClientBuffer buffer,
|
||||
size_t width,
|
||||
size_t height) override;
|
||||
void DestroyImage(int32_t id) override;
|
||||
void SignalQuery(uint32_t query, base::OnceClosure callback) override;
|
||||
void CreateGpuFence(uint32_t gpu_fence_id, ClientGpuFence source) override;
|
||||
void GetGpuFence(uint32_t gpu_fence_id,
|
||||
|
@@ -405,70 +405,6 @@ const gpu::Capabilities& CommandBufferProxyImpl::GetCapabilities() const {
|
||||
return capabilities_;
|
||||
}
|
||||
|
||||
int32_t CommandBufferProxyImpl::CreateImage(ClientBuffer buffer,
|
||||
size_t width,
|
||||
size_t height) {
|
||||
CheckLock();
|
||||
base::AutoLock lock(last_state_lock_);
|
||||
if (last_state_.error != gpu::error::kNoError)
|
||||
return -1;
|
||||
|
||||
int32_t new_id = channel_->ReserveImageId();
|
||||
|
||||
gfx::GpuMemoryBuffer* gpu_memory_buffer =
|
||||
reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer);
|
||||
DCHECK(gpu_memory_buffer);
|
||||
|
||||
// This handle is owned by the GPU process and must be passed to it or it
|
||||
// will leak. In otherwords, do not early out on error between here and the
|
||||
// sending of the CreateImage IPC below.
|
||||
gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->CloneHandle();
|
||||
bool requires_sync_token = handle.type == gfx::IO_SURFACE_BUFFER;
|
||||
|
||||
uint64_t image_fence_sync = 0;
|
||||
if (requires_sync_token)
|
||||
image_fence_sync = GenerateFenceSyncRelease();
|
||||
|
||||
DCHECK(gpu::IsImageFromGpuMemoryBufferFormatSupported(
|
||||
gpu_memory_buffer->GetFormat(), capabilities_))
|
||||
<< gfx::BufferFormatToString(gpu_memory_buffer->GetFormat());
|
||||
DCHECK(gpu::IsImageSizeValidForGpuMemoryBufferFormat(
|
||||
gfx::Size(width, height), gpu_memory_buffer->GetFormat()))
|
||||
<< gfx::BufferFormatToString(gpu_memory_buffer->GetFormat());
|
||||
|
||||
auto params = mojom::CreateImageParams::New();
|
||||
params->id = new_id;
|
||||
params->gpu_memory_buffer = std::move(handle);
|
||||
params->size = gfx::Size(width, height);
|
||||
params->format = gpu_memory_buffer->GetFormat();
|
||||
params->plane = gfx::BufferPlane::DEFAULT;
|
||||
params->image_release_count = image_fence_sync;
|
||||
command_buffer_->CreateImage(std::move(params));
|
||||
|
||||
if (image_fence_sync) {
|
||||
gpu::SyncToken sync_token(GetNamespaceID(), GetCommandBufferID(),
|
||||
image_fence_sync);
|
||||
|
||||
// Force a synchronous IPC to validate sync token.
|
||||
EnsureWorkVisible();
|
||||
sync_token.SetVerifyFlush();
|
||||
|
||||
gpu_memory_buffer_manager_->SetDestructionSyncToken(gpu_memory_buffer,
|
||||
sync_token);
|
||||
}
|
||||
|
||||
return new_id;
|
||||
}
|
||||
|
||||
void CommandBufferProxyImpl::DestroyImage(int32_t id) {
|
||||
CheckLock();
|
||||
base::AutoLock lock(last_state_lock_);
|
||||
if (last_state_.error != gpu::error::kNoError)
|
||||
return;
|
||||
|
||||
command_buffer_->DestroyImage(id);
|
||||
}
|
||||
|
||||
void CommandBufferProxyImpl::SetLock(base::Lock* lock) {
|
||||
lock_ = lock;
|
||||
}
|
||||
|
@@ -125,10 +125,6 @@ class GPU_EXPORT CommandBufferProxyImpl : public gpu::CommandBuffer,
|
||||
// gpu::GpuControl implementation:
|
||||
void SetGpuControlClient(GpuControlClient* client) override;
|
||||
const gpu::Capabilities& GetCapabilities() const override;
|
||||
int32_t CreateImage(ClientBuffer buffer,
|
||||
size_t width,
|
||||
size_t height) override;
|
||||
void DestroyImage(int32_t id) override;
|
||||
void SignalQuery(uint32_t query, base::OnceClosure callback) override;
|
||||
void CreateGpuFence(uint32_t gpu_fence_id, ClientGpuFence source) override;
|
||||
void GetGpuFence(uint32_t gpu_fence_id,
|
||||
|
@@ -237,15 +237,6 @@ interface GpuChannel {
|
||||
ReleaseSysmemBufferCollection(mojo_base.mojom.UnguessableToken id);
|
||||
};
|
||||
|
||||
struct CreateImageParams {
|
||||
int32 id;
|
||||
gfx.mojom.GpuMemoryBufferHandle gpu_memory_buffer;
|
||||
gfx.mojom.Size size;
|
||||
gfx.mojom.BufferFormat format;
|
||||
gfx.mojom.BufferPlane plane;
|
||||
uint64 image_release_count;
|
||||
};
|
||||
|
||||
// Interface used to issue commands to a specific CommandBuffer instance in the
|
||||
// GPU process.
|
||||
interface CommandBuffer {
|
||||
@@ -266,17 +257,6 @@ interface CommandBuffer {
|
||||
// Requests retrieval of a GpuFenceHandle by ID.
|
||||
GetGpuFenceHandle(uint32 id) => (gfx.mojom.GpuFenceHandle? fence_handle);
|
||||
|
||||
// Creates an image from an existing gpu memory buffer. The id that can be
|
||||
// used to identify the image from a command buffer.
|
||||
//
|
||||
// TODO(crbug.com/1216120): Remove this once CreateImageCHROMIUM is gone.
|
||||
CreateImage(CreateImageParams params);
|
||||
|
||||
// Destroys a previously created image identified by `id`.
|
||||
//
|
||||
// TODO(crbug.com/1216120): Remove this once CreateImageCHROMIUM is gone.
|
||||
DestroyImage(int32 id);
|
||||
|
||||
// Asynchronously waits until the SyncToken is signaled, then sends a
|
||||
// corresponding SignalAck on the CommandBufferClient interface, using
|
||||
// `signal_id` to identify this request.
|
||||
|
@@ -96,8 +96,6 @@ namespace gpu {
|
||||
|
||||
namespace {
|
||||
|
||||
base::AtomicSequenceNumber g_next_image_id;
|
||||
|
||||
template <typename T>
|
||||
base::OnceClosure WrapTaskWithResult(base::OnceCallback<T(void)> task,
|
||||
T* result,
|
||||
@@ -1064,118 +1062,6 @@ const GpuFeatureInfo& InProcessCommandBuffer::GetGpuFeatureInfo() const {
|
||||
return task_executor_->gpu_feature_info();
|
||||
}
|
||||
|
||||
int32_t InProcessCommandBuffer::CreateImage(ClientBuffer buffer,
|
||||
size_t width,
|
||||
size_t height) {
|
||||
DCHECK(gpu_memory_buffer_manager_);
|
||||
gfx::GpuMemoryBuffer* gpu_memory_buffer =
|
||||
reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer);
|
||||
DCHECK(gpu_memory_buffer);
|
||||
|
||||
int32_t new_id = g_next_image_id.GetNext() + 1;
|
||||
|
||||
DCHECK(IsImageFromGpuMemoryBufferFormatSupported(
|
||||
gpu_memory_buffer->GetFormat(), capabilities_));
|
||||
|
||||
// This handle is owned by the GPU thread and must be passed to it or it
|
||||
// will leak. In otherwords, do not early out on error between here and the
|
||||
// queuing of the CreateImage task below.
|
||||
gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->CloneHandle();
|
||||
bool requires_sync_point = handle.type == gfx::IO_SURFACE_BUFFER;
|
||||
|
||||
uint64_t fence_sync = 0;
|
||||
if (requires_sync_point)
|
||||
fence_sync = GenerateFenceSyncRelease();
|
||||
|
||||
ScheduleGpuTask(base::BindOnce(
|
||||
&InProcessCommandBuffer::CreateImageOnGpuThread,
|
||||
gpu_thread_weak_ptr_factory_.GetWeakPtr(), new_id, std::move(handle),
|
||||
gfx::Size(base::checked_cast<int>(width),
|
||||
base::checked_cast<int>(height)),
|
||||
gpu_memory_buffer->GetFormat(), fence_sync));
|
||||
|
||||
if (fence_sync) {
|
||||
SyncToken sync_token(GetNamespaceID(), GetCommandBufferID(), fence_sync);
|
||||
sync_token.SetVerifyFlush();
|
||||
gpu_memory_buffer_manager_->SetDestructionSyncToken(gpu_memory_buffer,
|
||||
sync_token);
|
||||
}
|
||||
|
||||
return new_id;
|
||||
}
|
||||
|
||||
void InProcessCommandBuffer::CreateImageOnGpuThread(
|
||||
int32_t id,
|
||||
gfx::GpuMemoryBufferHandle handle,
|
||||
const gfx::Size& size,
|
||||
gfx::BufferFormat format,
|
||||
uint64_t fence_sync) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(gpu_sequence_checker_);
|
||||
gles2::ImageManager* image_manager = task_executor_->image_manager();
|
||||
DCHECK(image_manager);
|
||||
if (image_manager->LookupImage(id)) {
|
||||
LOG(ERROR) << "Image already exists with same ID.";
|
||||
return;
|
||||
}
|
||||
|
||||
switch (handle.type) {
|
||||
case gfx::SHARED_MEMORY_BUFFER: {
|
||||
if (!base::IsValueInRangeForNumericType<size_t>(handle.stride)) {
|
||||
LOG(ERROR) << "Invalid stride for image.";
|
||||
return;
|
||||
}
|
||||
auto image = base::MakeRefCounted<gl::GLImageSharedMemory>(size);
|
||||
if (!image->Initialize(handle.region, handle.id, format, handle.offset,
|
||||
handle.stride)) {
|
||||
LOG(ERROR) << "Failed to initialize image.";
|
||||
return;
|
||||
}
|
||||
|
||||
image_manager->AddImage(image.get(), id);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (!image_factory_) {
|
||||
LOG(ERROR) << "Image factory missing but required by buffer type.";
|
||||
return;
|
||||
}
|
||||
|
||||
scoped_refptr<gl::GLImage> image =
|
||||
image_factory_->CreateImageForGpuMemoryBuffer(
|
||||
std::move(handle), size, format, gfx::BufferPlane::DEFAULT,
|
||||
kDisplayCompositorClientId, kNullSurfaceHandle);
|
||||
if (!image.get()) {
|
||||
LOG(ERROR) << "Failed to create image for buffer.";
|
||||
return;
|
||||
}
|
||||
|
||||
image_manager->AddImage(image.get(), id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fence_sync)
|
||||
sync_point_client_state_->ReleaseFenceSync(fence_sync);
|
||||
}
|
||||
|
||||
void InProcessCommandBuffer::DestroyImage(int32_t id) {
|
||||
ScheduleGpuTask(
|
||||
base::BindOnce(&InProcessCommandBuffer::DestroyImageOnGpuThread,
|
||||
gpu_thread_weak_ptr_factory_.GetWeakPtr(), id));
|
||||
}
|
||||
|
||||
void InProcessCommandBuffer::DestroyImageOnGpuThread(int32_t id) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(gpu_sequence_checker_);
|
||||
gles2::ImageManager* image_manager = task_executor_->image_manager();
|
||||
DCHECK(image_manager);
|
||||
if (!image_manager->LookupImage(id)) {
|
||||
LOG(ERROR) << "Image with ID doesn't exist.";
|
||||
return;
|
||||
}
|
||||
|
||||
image_manager->RemoveImage(id);
|
||||
}
|
||||
|
||||
void InProcessCommandBuffer::OnConsoleMessage(int32_t id,
|
||||
const std::string& message) {
|
||||
// TODO(piman): implement this.
|
||||
|
@@ -61,7 +61,6 @@ class GLShareGroup;
|
||||
|
||||
namespace gfx {
|
||||
struct GpuFenceHandle;
|
||||
class Size;
|
||||
}
|
||||
|
||||
namespace ui {
|
||||
@@ -153,10 +152,6 @@ class GL_IN_PROCESS_CONTEXT_EXPORT InProcessCommandBuffer
|
||||
void SetGpuControlClient(GpuControlClient*) override;
|
||||
// GetCapabilities() can be called on any thread.
|
||||
const Capabilities& GetCapabilities() const override;
|
||||
int32_t CreateImage(ClientBuffer buffer,
|
||||
size_t width,
|
||||
size_t height) override;
|
||||
void DestroyImage(int32_t id) override;
|
||||
void SignalQuery(uint32_t query_id, base::OnceClosure callback) override;
|
||||
void CreateGpuFence(uint32_t gpu_fence_id, ClientGpuFence source) override;
|
||||
void GetGpuFence(uint32_t gpu_fence_id,
|
||||
@@ -327,13 +322,6 @@ class GL_IN_PROCESS_CONTEXT_EXPORT InProcessCommandBuffer
|
||||
scoped_refptr<Buffer> buffer);
|
||||
void DestroyTransferBufferOnGpuThread(int32_t id);
|
||||
|
||||
void CreateImageOnGpuThread(int32_t id,
|
||||
gfx::GpuMemoryBufferHandle handle,
|
||||
const gfx::Size& size,
|
||||
gfx::BufferFormat format,
|
||||
uint64_t fence_sync);
|
||||
void DestroyImageOnGpuThread(int32_t id);
|
||||
|
||||
void SetGetBufferOnGpuThread(int32_t shm_id, base::WaitableEvent* completion);
|
||||
|
||||
void CreateGpuFenceOnGpuThread(uint32_t gpu_fence_id,
|
||||
|
@@ -545,14 +545,6 @@ void CommandBufferStub::GetGpuFenceHandle(uint32_t id,
|
||||
std::move(callback).Run(gfx::GpuFenceHandle());
|
||||
}
|
||||
|
||||
void CommandBufferStub::CreateImage(mojom::CreateImageParamsPtr params) {
|
||||
DLOG(ERROR) << "CreateImage unsupported.";
|
||||
}
|
||||
|
||||
void CommandBufferStub::DestroyImage(int32_t id) {
|
||||
DLOG(ERROR) << "DestroyImage unsupported.";
|
||||
}
|
||||
|
||||
void CommandBufferStub::OnDestroyTransferBuffer(int32_t id) {
|
||||
TRACE_EVENT0("gpu", "CommandBufferStub::OnDestroyTransferBuffer");
|
||||
|
||||
|
@@ -217,8 +217,6 @@ class GPU_IPC_SERVICE_EXPORT CommandBufferStub
|
||||
gfx::GpuFenceHandle handle) override;
|
||||
void GetGpuFenceHandle(uint32_t id,
|
||||
GetGpuFenceHandleCallback callback) override;
|
||||
void CreateImage(mojom::CreateImageParamsPtr params) override;
|
||||
void DestroyImage(int32_t id) override;
|
||||
void SignalSyncToken(const SyncToken& sync_token, uint32_t id) override;
|
||||
void SignalQuery(uint32_t query, uint32_t id) override;
|
||||
void BindMediaReceiver(mojo::GenericPendingAssociatedReceiver receiver,
|
||||
|
@@ -503,68 +503,6 @@ void GLES2CommandBufferStub::GetGpuFenceHandle(
|
||||
std::move(callback).Run(std::move(handle));
|
||||
}
|
||||
|
||||
void GLES2CommandBufferStub::CreateImage(mojom::CreateImageParamsPtr params) {
|
||||
TRACE_EVENT0("gpu", "GLES2CommandBufferStub::OnCreateImage");
|
||||
const int32_t id = params->id;
|
||||
const gfx::Size& size = params->size;
|
||||
const gfx::BufferFormat& format = params->format;
|
||||
const gfx::BufferPlane& plane = params->plane;
|
||||
const uint64_t image_release_count = params->image_release_count;
|
||||
ScopedContextOperation operation(*this);
|
||||
if (!operation.is_context_current())
|
||||
return;
|
||||
|
||||
gles2::ImageManager* image_manager = channel_->image_manager();
|
||||
DCHECK(image_manager);
|
||||
if (image_manager->LookupImage(id)) {
|
||||
LOG(ERROR) << "Image already exists with same ID.";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gpu::IsImageFromGpuMemoryBufferFormatSupported(
|
||||
format, gles2_decoder_->GetCapabilities())) {
|
||||
LOG(ERROR) << "Format is not supported.";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gpu::IsImageSizeValidForGpuMemoryBufferFormat(size, format)) {
|
||||
LOG(ERROR) << "Invalid image size for format.";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gpu::IsPlaneValidForGpuMemoryBufferFormat(plane, format)) {
|
||||
LOG(ERROR) << "Invalid plane " << gfx::BufferPlaneToString(plane) << " for "
|
||||
<< gfx::BufferFormatToString(format);
|
||||
return;
|
||||
}
|
||||
|
||||
scoped_refptr<gl::GLImage> image = channel()->CreateImageForGpuMemoryBuffer(
|
||||
std::move(params->gpu_memory_buffer), size, format, plane,
|
||||
surface_handle_);
|
||||
if (!image.get())
|
||||
return;
|
||||
|
||||
image_manager->AddImage(image.get(), id);
|
||||
if (image_release_count)
|
||||
sync_point_client_state_->ReleaseFenceSync(image_release_count);
|
||||
}
|
||||
|
||||
void GLES2CommandBufferStub::DestroyImage(int32_t id) {
|
||||
TRACE_EVENT0("gpu", "GLES2CommandBufferStub::OnDestroyImage");
|
||||
ScopedContextOperation operation(*this);
|
||||
if (!operation.is_context_current())
|
||||
return;
|
||||
|
||||
gles2::ImageManager* image_manager = channel_->image_manager();
|
||||
DCHECK(image_manager);
|
||||
if (!image_manager->LookupImage(id)) {
|
||||
LOG(ERROR) << "Image with ID doesn't exist.";
|
||||
return;
|
||||
}
|
||||
|
||||
image_manager->RemoveImage(id);
|
||||
}
|
||||
|
||||
void GLES2CommandBufferStub::OnSwapBuffers(uint64_t swap_id, uint32_t flags) {
|
||||
pending_swap_completed_params_.push_back({swap_id, flags});
|
||||
pending_presented_params_.push_back({swap_id, flags});
|
||||
|
@@ -68,8 +68,6 @@ class GPU_IPC_SERVICE_EXPORT GLES2CommandBufferStub
|
||||
gfx::GpuFenceHandle handle) override;
|
||||
void GetGpuFenceHandle(uint32_t gpu_fence_id,
|
||||
GetGpuFenceHandleCallback callback) override;
|
||||
void CreateImage(mojom::CreateImageParamsPtr params) override;
|
||||
void DestroyImage(int32_t id) override;
|
||||
|
||||
void OnSwapBuffers(uint64_t swap_id, uint32_t flags) override;
|
||||
|
||||
|
@@ -77,8 +77,7 @@ class GPU_IPC_SERVICE_EXPORT GpuMemoryBufferFactoryIOSurface
|
||||
typedef std::unordered_map<IOSurfaceMapKey,
|
||||
base::ScopedCFTypeRef<IOSurfaceRef>>
|
||||
IOSurfaceMap;
|
||||
// TODO(reveman): Remove |io_surfaces_| and allow IOSurface backed GMBs to be
|
||||
// used with any GPU process by passing a mach_port to CreateImageCHROMIUM.
|
||||
|
||||
IOSurfaceMap io_surfaces_;
|
||||
base::Lock io_surfaces_lock_;
|
||||
};
|
||||
|
@@ -257,17 +257,6 @@ const gpu::Capabilities& PpapiCommandBufferProxy::GetCapabilities() const {
|
||||
return capabilities_;
|
||||
}
|
||||
|
||||
int32_t PpapiCommandBufferProxy::CreateImage(ClientBuffer buffer,
|
||||
size_t width,
|
||||
size_t height) {
|
||||
NOTREACHED();
|
||||
return -1;
|
||||
}
|
||||
|
||||
void PpapiCommandBufferProxy::DestroyImage(int32_t id) {
|
||||
NOTREACHED();
|
||||
}
|
||||
|
||||
bool PpapiCommandBufferProxy::Send(IPC::Message* msg) {
|
||||
DCHECK(last_state_.error == gpu::error::kNoError);
|
||||
|
||||
|
@@ -62,10 +62,6 @@ class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy : public gpu::CommandBuffer,
|
||||
// gpu::GpuControl implementation:
|
||||
void SetGpuControlClient(gpu::GpuControlClient*) override;
|
||||
const gpu::Capabilities& GetCapabilities() const override;
|
||||
int32_t CreateImage(ClientBuffer buffer,
|
||||
size_t width,
|
||||
size_t height) override;
|
||||
void DestroyImage(int32_t id) override;
|
||||
void SignalQuery(uint32_t query, base::OnceClosure callback) override;
|
||||
void CreateGpuFence(uint32_t gpu_fence_id, ClientGpuFence source) override;
|
||||
void GetGpuFence(uint32_t gpu_fence_id,
|
||||
|
@@ -204,10 +204,8 @@ class GLES2InterfaceForTests : public gpu::gles2::GLES2InterfaceStub,
|
||||
void ProduceTextureDirectCHROMIUM(GLuint texture, GLbyte* mailbox) override {
|
||||
++current_mailbox_byte_;
|
||||
memset(mailbox, current_mailbox_byte_, GL_MAILBOX_SIZE_CHROMIUM);
|
||||
if (!create_image_chromium_fail_) {
|
||||
ASSERT_TRUE(texture_sizes_.Contains(texture));
|
||||
most_recently_produced_size_ = texture_sizes_.at(texture);
|
||||
}
|
||||
ASSERT_TRUE(texture_sizes_.Contains(texture));
|
||||
most_recently_produced_size_ = texture_sizes_.at(texture);
|
||||
}
|
||||
|
||||
void TexImage2D(GLenum target,
|
||||
@@ -225,44 +223,6 @@ class GLES2InterfaceForTests : public gpu::gles2::GLES2InterfaceStub,
|
||||
}
|
||||
}
|
||||
|
||||
GLuint CreateImageCHROMIUM(ClientBuffer buffer,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLenum internalformat) override {
|
||||
if (create_image_chromium_fail_)
|
||||
return 0;
|
||||
image_sizes_.Set(current_image_id_, gfx::Size(width, height));
|
||||
return current_image_id_++;
|
||||
}
|
||||
|
||||
MOCK_METHOD1(DestroyImageMock, void(GLuint imageId));
|
||||
void DestroyImageCHROMIUM(GLuint image_id) override {
|
||||
image_sizes_.erase(image_id);
|
||||
// No textures should be bound to this.
|
||||
CHECK(image_to_texture_map_.find(image_id) == image_to_texture_map_.end());
|
||||
image_sizes_.erase(image_id);
|
||||
DestroyImageMock(image_id);
|
||||
}
|
||||
|
||||
MOCK_METHOD1(BindTexImage2DMock, void(GLint imageId));
|
||||
void BindTexImage2DCHROMIUM(GLenum target, GLint image_id) override {
|
||||
if (target == kImageCHROMIUMTarget) {
|
||||
GLuint value = bound_textures_.find(target)->value;
|
||||
texture_sizes_.Set(value, image_sizes_.find(image_id)->value);
|
||||
image_to_texture_map_.Set(image_id, value);
|
||||
BindTexImage2DMock(image_id);
|
||||
}
|
||||
}
|
||||
|
||||
MOCK_METHOD1(ReleaseTexImage2DMock, void(GLint imageId));
|
||||
void ReleaseTexImage2DCHROMIUM(GLenum target, GLint image_id) override {
|
||||
if (target == kImageCHROMIUMTarget) {
|
||||
image_sizes_.Set(current_image_id_, gfx::Size());
|
||||
image_to_texture_map_.erase(image_id);
|
||||
ReleaseTexImage2DMock(image_id);
|
||||
}
|
||||
}
|
||||
|
||||
void GenTextures(GLsizei n, GLuint* textures) override {
|
||||
static GLuint id = 1;
|
||||
for (GLsizei i = 0; i < n; ++i)
|
||||
@@ -357,10 +317,6 @@ class GLES2InterfaceForTests : public gpu::gles2::GLES2InterfaceStub,
|
||||
return most_recently_produced_size_;
|
||||
}
|
||||
|
||||
void SetCreateImageChromiumFail(bool fail) {
|
||||
create_image_chromium_fail_ = fail;
|
||||
}
|
||||
|
||||
// Saves current GL state for later verification.
|
||||
void SaveState() { saved_state_ = state_; }
|
||||
void VerifyStateHasNotChangedSinceSave() const {
|
||||
@@ -432,7 +388,6 @@ class GLES2InterfaceForTests : public gpu::gles2::GLES2InterfaceStub,
|
||||
gpu::SyncToken most_recently_waited_sync_token_;
|
||||
GLbyte current_mailbox_byte_ = 0;
|
||||
gfx::Size most_recently_produced_size_;
|
||||
bool create_image_chromium_fail_ = false;
|
||||
GLuint current_image_id_ = 1;
|
||||
HashMap<GLuint, gfx::Size> texture_sizes_;
|
||||
HashMap<GLuint, gfx::Size> image_sizes_;
|
||||
|
Reference in New Issue
Block a user