| Index: gpu/command_buffer/client/gles2_implementation.cc
|
| diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
|
| index 584353f07f26e4d8e0d8dfcf201880fb68cce162..d481a6b60154b54a92aa0a821cf46f5914064570 100644
|
| --- a/gpu/command_buffer/client/gles2_implementation.cc
|
| +++ b/gpu/command_buffer/client/gles2_implementation.cc
|
| @@ -4626,6 +4626,8 @@ void GLES2Implementation::DeleteTexturesHelper(
|
| return;
|
| }
|
| for (GLsizei ii = 0; ii < n; ++ii) {
|
| + share_group_->discardable_manager()->FreeTexture(textures[ii]);
|
| +
|
| for (GLint tt = 0; tt < capabilities_.max_combined_texture_image_units;
|
| ++tt) {
|
| TextureUnit& unit = texture_units_[tt];
|
| @@ -7044,6 +7046,46 @@ void GLES2Implementation::ProgramPathFragmentInputGenCHROMIUM(
|
| CheckGLError();
|
| }
|
|
|
| +void GLES2Implementation::InitializeDiscardableTextureCHROMIUM(
|
| + GLuint texture_id) {
|
| + ClientDiscardableManager* manager = share_group()->discardable_manager();
|
| + if (manager->TextureIsValid(texture_id)) {
|
| + SetGLError(GL_INVALID_VALUE, "glInitializeDiscardableTextureCHROMIUM",
|
| + "Texture ID already initialized");
|
| + return;
|
| + }
|
| + ClientDiscardableHandle handle =
|
| + manager->InitializeTexture(helper_->command_buffer(), texture_id);
|
| + helper_->InitializeDiscardableTextureCHROMIUM(texture_id, handle.shm_id(),
|
| + handle.byte_offset());
|
| +}
|
| +
|
| +void GLES2Implementation::UnlockDiscardableTextureCHROMIUM(GLuint texture_id) {
|
| + ClientDiscardableManager* manager = share_group()->discardable_manager();
|
| + if (!manager->TextureIsValid(texture_id)) {
|
| + SetGLError(GL_INVALID_VALUE, "glUnlockDiscardableTextureCHROMIUM",
|
| + "Texture ID not initialized");
|
| + return;
|
| + }
|
| + helper_->UnlockDiscardableTextureCHROMIUM(texture_id);
|
| +}
|
| +
|
| +bool GLES2Implementation::LockDiscardableTextureCHROMIUM(GLuint texture_id) {
|
| + ClientDiscardableManager* manager = share_group()->discardable_manager();
|
| + if (!manager->TextureIsValid(texture_id)) {
|
| + SetGLError(GL_INVALID_VALUE, "glLockDiscardableTextureCHROMIUM",
|
| + "Texture ID not initialized");
|
| + return false;
|
| + }
|
| + if (!manager->LockTexture(texture_id)) {
|
| + // Failure to lock means that this texture has been deleted on the service
|
| + // side. Delete it here as well.
|
| + DeleteTexturesHelper(1, &texture_id);
|
| + return false;
|
| + }
|
| + return true;
|
| +}
|
| +
|
| void GLES2Implementation::UpdateCachedExtensionsIfNeeded() {
|
| if (cached_extension_string_) {
|
| return;
|
|
|