Commit 087971c6 authored by xlai's avatar xlai Committed by Commit Bot

Correct comment in OffscreenCanvasResourceProvider

Over code changes, the comment has been shifted to wrong places.

Bug: 651456
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I5b9cbe92d55a68bdd9547a000398d53fc58c3958
Reviewed-on: https://chromium-review.googlesource.com/1055892Reviewed-by: default avatarJustin Novosad <junov@chromium.org>
Commit-Queue: Olivia Lai <xlai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558103}
parent 512ccca0
......@@ -89,9 +89,8 @@ void OffscreenCanvasResourceProvider::SetTransferableResourceToSharedBitmap(
}
void* pixels = frame_resource->shared_memory->memory();
DCHECK(pixels);
// TODO(xlai): Optimize to avoid copying pixels. See crbug.com/651456.
// However, in the case when |image| is texture backed, this function call
// does a GPU readback which is required.
// When |image| is texture backed, this function does a GPU readback which is
// required.
sk_sp<SkImage> sk_image = image->PaintImageForCurrentFrame().GetSkImage();
if (sk_image->bounds().isEmpty())
return;
......@@ -105,6 +104,9 @@ void OffscreenCanvasResourceProvider::SetTransferableResourceToSharedBitmap(
if (RuntimeEnabledFeatures::CanvasColorManagementEnabled()) {
image_info = image_info.makeColorType(sk_image->colorType());
}
// TODO(junov): Optimize to avoid copying pixels for non-texture-backed
// sk_image. See crbug.com/651456.
bool read_pixels_successful =
sk_image->readPixels(image_info, pixels, image_info.minRowBytes(), 0, 0);
DCHECK(read_pixels_successful);
......
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