New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 737726 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[chromecast] SurfaceFactoryCast should create NULL surface/canvas

Project Member Reported by alokp@chromium.org, Jun 28 2017

Issue description

SurfaceFactoryCast::CreateCanvasForWidget creates surface backed by a real 720p bitmap which consumes 3.6M. This bitmap is never shown, so we may save this memory by creating an SkNullCanvas. It would not consume any memory and draw calls would be much faster.

We need to add an SkNullSurface that vends SkNullCanvas.
 

Comment 1 by reed@google.com, Jun 28 2017

Cc: -reed@chromium.org reed@google.com
Surfaces have a few methods:
1. getCanvas
2. draw(canvas)
3. makeImageSnapshot()

Clearly you could make a SkNullCanvas yourself. If you also need a null-surface, is it ok for that surface to return null from makeImageSnapshot?

Comment 2 by alokp@chromium.org, Jun 28 2017

Yes - it is fine to return null from makeImageSnapshot

Comment 3 by reed@google.com, Jun 28 2017

I'll take a crack at adding this
Project Member

Comment 5 by bugdroid1@chromium.org, Jul 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f0e03cff8b74271d63e44f3154a86408fc5f42f9

commit f0e03cff8b74271d63e44f3154a86408fc5f42f9
Author: Alok Priyadarshi <alokp@chromium.org>
Date: Mon Jul 31 20:41:13 2017

[chromecast] Use null SkSurface instead of bitmap-backed one.

On audio-only devices there is no need to perform rasterization for
real. We just need a dummy SkSurface that simply ignores all draw calls.
Using the null surface saves 3.6M memory and draw calls are much faster.

Bug:  737726 
Change-Id: Ic11ee7afc80dd71a6ae5d5d2ba5e4aae513fcb61
Reviewed-on: https://chromium-review.googlesource.com/594643
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Commit-Queue: Alok Priyadarshi <alokp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490794}
[modify] https://crrev.com/f0e03cff8b74271d63e44f3154a86408fc5f42f9/ui/ozone/platform/cast/surface_factory_cast.cc

Comment 6 by alokp@chromium.org, Jul 31 2017

Status: Fixed (was: Assigned)

Sign in to add a comment