| Index: chrome/browser/android/compositor/layer/crushed_sprite_layer.cc
|
| diff --git a/chrome/browser/android/compositor/layer/crushed_sprite_layer.cc b/chrome/browser/android/compositor/layer/crushed_sprite_layer.cc
|
| index f7799bc50140f58cea621331c2364fb1248961f3..3a6e604908cdad2c5bd37dd833c865e519531b61 100644
|
| --- a/chrome/browser/android/compositor/layer/crushed_sprite_layer.cc
|
| +++ b/chrome/browser/android/compositor/layer/crushed_sprite_layer.cc
|
| @@ -53,13 +53,13 @@
|
| SkBitmap bitmap;
|
| bitmap.allocN32Pixels(resource->GetUnscaledSpriteSize().width(),
|
| resource->GetUnscaledSpriteSize().height());
|
| - SkCanvas canvas(bitmap);
|
| + sk_sp<SkCanvas> canvas = sk_make_sp<SkCanvas>(bitmap);
|
|
|
| if (previous_frame_ == -1 ||
|
| sprite_frame == resource->GetFrameCount() - 1) {
|
| // The newly allocated pixels for the SkBitmap need to be cleared if this
|
| // is the first frame being drawn or the last frame. See crbug.com/549453.
|
| - canvas.clear(SK_ColorTRANSPARENT);
|
| + canvas->clear(SK_ColorTRANSPARENT);
|
| }
|
|
|
| // If this isn't the first or last frame, draw the previous frame(s).
|
| @@ -70,17 +70,17 @@
|
| if (sprite_frame != 0 && sprite_frame != resource->GetFrameCount() - 1) {
|
| // Draw the previous frame.
|
| if (previous_frame_ != -1) {
|
| - canvas.drawBitmap(previous_frame_bitmap_, 0, 0, nullptr);
|
| + canvas->drawBitmap(previous_frame_bitmap_, 0, 0, nullptr);
|
| }
|
|
|
| // Draw any skipped frames.
|
| for (int i = previous_frame_ + 1; i < sprite_frame; ++i) {
|
| - DrawRectanglesForFrame(resource, i, &canvas);
|
| + DrawRectanglesForFrame(resource, i, canvas);
|
| }
|
| }
|
|
|
| // Draw the current frame.
|
| - DrawRectanglesForFrame(resource, sprite_frame, &canvas);
|
| + DrawRectanglesForFrame(resource, sprite_frame, canvas);
|
|
|
| // Set the bitmap on layer_.
|
| bitmap.setImmutable();
|
| @@ -103,7 +103,7 @@
|
| void CrushedSpriteLayer::DrawRectanglesForFrame(
|
| ui::CrushedSpriteResource* resource,
|
| int frame,
|
| - SkCanvas* canvas) {
|
| + sk_sp<SkCanvas> canvas) {
|
| ui::CrushedSpriteResource::FrameSrcDstRects src_dst_rects =
|
| resource->GetRectanglesForFrame(frame);
|
| for (const auto& rect : src_dst_rects) {
|
|
|