Commit 5f5ee515 authored by Mike Reed's avatar Mike Reed Committed by Commit Bot

Skip alloc by placing SkiaPaintCanvas on stack

Partial land of https://chromium-review.googlesource.com/c/chromium/src/+/1476977

Change-Id: Ib2ba65e026db6429c88d64141334fcfcdc440d2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1529071
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: default avatarMike Klein <mtklein@chromium.org>
Reviewed-by: default avatarFlorin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#641709}
parent 5e668fda
......@@ -255,14 +255,11 @@ static bool ExtractImageData(Image* image,
PaintFlags flags;
FloatRect image_source_rect(FloatPoint(), FloatSize(image->Size()));
IntRect image_dest_rect(IntPoint(), image_size);
// TODO(ccameron): No color conversion is required here.
std::unique_ptr<cc::PaintCanvas> canvas =
color_params.WrapCanvas(surface->getCanvas());
canvas->save();
canvas->clear(SK_ColorTRANSPARENT);
image->Draw(canvas.get(), flags, FloatRect(image_dest_rect),
image_source_rect, kDoNotRespectImageOrientation,
SkiaPaintCanvas canvas(surface->getCanvas());
canvas.clear(SK_ColorTRANSPARENT);
image->Draw(&canvas, flags, FloatRect(image_dest_rect), image_source_rect,
kDoNotRespectImageOrientation,
Image::kDoNotClampImageToSourceRect, Image::kSyncDecode);
return StaticBitmapImage::ConvertToArrayBufferContents(
......
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