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

Issue 760391 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Lower quality of snippet previews on 512 devices

Project Member Reported by dskiba@chromium.org, Aug 30 2017

Issue description

On 512 low-end devices we render pages to 16-bit textures to save memory (see condition in GetCompositorContextAttributes).

I propose we do the same with snippets, and lower their quality accordingly to decrease their in-memory size (plus this will decrease amount of data that we need to transfer when decoding).

512 Go devices are under constant memory pressure, and I observed that when scrolling suggestions back and forth images are constantly reloaded (i.e. scroll to the bottom - see bottom images reload, scroll to the top - top images reload, scroll to the bottom - bottom images reload again).


 

Comment 1 by dskiba@chromium.org, Aug 30 2017

Labels: Performance-Memory LowMemory
Labels: zine-triaged
Status: Available (was: Untriaged)

Comment 4 by fi...@chromium.org, Jan 12 2018

Components: -UI>Browser>NewTabPage UI>Browser>ContentSuggestions
Labels: target-jardin

Comment 5 by bauerb@chromium.org, Feb 14 2018

Cc: cblume@chromium.org
I assume we would want to use something like SkConvertPixels to convert the image to 16-bit colors?

Comment 6 by dskiba@chromium.org, Feb 14 2018

Cc: ericrk@chromium.org
Yes, something like that.

Right now previews look nice and crisp on 512MiB devices compared to actual page which is rendered to 16-bit textures. If we render previews in 16-bit mode too, we can save half of the memory they are currently using.

This looks like the place where we prefer 565 textures on 512MiB devices: https://cs.chromium.org/chromium/src/content/browser/renderer_host/compositor_impl_android.cc?l=195

+ericrk@ to confirm.

Comment 7 by ericrk@chromium.org, Feb 14 2018

That looks right. We should definitely be using 16-bit textures for everything.

Assuming you're just dealing with software Skia types here, you should be able to allocate a new bitmap/pixmap in 16 bit kRGB_565_SkColorType format then provide that as the destination for SkBitmap::readPixels (https://cs.chromium.org/chromium/src/third_party/skia/include/core/SkBitmap.h?rcl=0be01ccecba9c330baf4ba3840e57f34f6cdf320&l=959)

How does the snippet preview get eventually rendered to screen? Is it sent in software form to the browser? Passed to CC in the renderer?

Comment 8 by bauerb@chromium.org, Feb 15 2018

It's converted to a Java Bitmap and then put into an ImageView.

Sign in to add a comment