Commit ea7e40bb authored by Khushal's avatar Khushal Committed by Commit Bot

canvas2d: Avoid double delete for shared image textures.

If the same texture is used for read/write access, we'd issue a
redundant command to delete the write texture.

R=fserb@chromium.org

Bug: 994563
Change-Id: Ibc5cb178fe15334aa340285bab3b8327e4cf1e4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762658
Auto-Submit: Khushal <khushalsagar@chromium.org>
Commit-Queue: Fernando Serboncini <fserb@chromium.org>
Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688990}
parent 943ca0ab
......@@ -819,7 +819,9 @@ void CanvasResourceSharedImage::TearDown() {
if (owning_thread_data().texture_id_for_read_access) {
gl->DeleteTextures(1, &owning_thread_data().texture_id_for_read_access);
}
if (owning_thread_data().texture_id_for_write_access) {
if (owning_thread_data().texture_id_for_write_access &&
owning_thread_data().texture_id_for_write_access !=
owning_thread_data().texture_id_for_read_access) {
gl->DeleteTextures(1,
&owning_thread_data().texture_id_for_write_access);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment