Commit 8f9d9be9 authored by Khushal's avatar Khushal Committed by Commit Bot

cc: Remove PaintOpReader invalidation for image deserialization errors.

Creating the transfer cache entry for an image may fail if we fail to
upload the image at entry creation time. This may happen in some context
loss situations, and the GPU raster path in GpuImageDecodeCache already
handles this safely by aborting the draw using that image. Do the same
for OOP raster.

R=enne@chromium.org

Bug: 948245
Change-Id: I4760b17e8451153b29d53e1eaaef2aed5eab8543
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1634612
Auto-Submit: Khushal <khushalsagar@chromium.org>
Commit-Queue: enne <enne@chromium.org>
Reviewed-by: default avatarenne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664331}
parent f80ae1a5
...@@ -357,6 +357,7 @@ void PaintOpReader::Read(PaintImage* image) { ...@@ -357,6 +357,7 @@ void PaintOpReader::Read(PaintImage* image) {
if (transfer_cache_entry_id == kInvalidImageTransferCacheEntryId) if (transfer_cache_entry_id == kInvalidImageTransferCacheEntryId)
return; return;
// The transfer cache entry for an image may not exist if the upload fails.
if (auto* entry = if (auto* entry =
options_.transfer_cache->GetEntryAs<ServiceImageTransferCacheEntry>( options_.transfer_cache->GetEntryAs<ServiceImageTransferCacheEntry>(
transfer_cache_entry_id)) { transfer_cache_entry_id)) {
...@@ -366,10 +367,6 @@ void PaintOpReader::Read(PaintImage* image) { ...@@ -366,10 +367,6 @@ void PaintOpReader::Read(PaintImage* image) {
.set_id(PaintImage::GetNextId()) .set_id(PaintImage::GetNextId())
.set_image(entry->image(), PaintImage::kNonLazyStableId) .set_image(entry->image(), PaintImage::kNonLazyStableId)
.TakePaintImage(); .TakePaintImage();
} else {
// If a transfer cache id exists, we must have a valid entry for it in the
// cache.
SetInvalid();
} }
} }
......
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