New issue
Advanced search Search tips
Starred by 4 users

Issue metadata

Status: New
Owner:
Cc:
Area: Bitmap
Priority: Low
Type: Defect



Sign in to add a comment

Implement additional TileModes to avoid image copies

Project Member Reported by schenney@chromium.org, Jan 9 2015 Back to list

Issue description

The existing kClamp_TileMode and kRepeat_TileMode are insufficient to cover all use cases required by Chrome.

crbug.com/447618 lists the cases where Blink creates bitmaps and copies them in order to get behavior not supported, but reasonably easy to support, in Skia.

In particular, it would be good to support:
- Tiling a sub-rect of the given image
- a kBorderColor_TileMode equivalent to the OpenGL texture border behavior where a constant color is used to pad out the dest. Maybe the def-ed out kDecal_TileMode is intended to do this.
- less simple would be tile-with-padding, but the motivation for that is not as great.

 
Project Member

Comment 1 by hcm@google.com, Apr 6 2015

Cc: reed@google.com hcm@google.com
Labels: -M-43 M-44
Mr Bitmap, what are your thoughts esp on first bullet?

Bump to M44, but I don't have a great sense of priority on this one vs other work...
Project Member

Comment 2 by hcm@google.com, Dec 7 2015

Labels: Hotlist-Fixit
Project Member

Comment 3 by caryclark@google.com, Jan 6 2016

Owner: caryclark@google.com
I'll look at it if Mike isn't already working on it
Project Member

Comment 4 by reed@google.com, Jan 6 2016

Cc: fmalita@chromium.org
The only new tile-mode I have been contemplating is "decal", where we return 0 if the sample coordinate is outside of the intrinsic domain, though that work has never gotten very far.
Project Member

Comment 5 by fmalita@chromium.org, Jan 6 2016

kDecal_TileMode is the missing mode I'm aware of.

Most of the initial problematic Blink cases have been refactored to avoid making image copies (picture shader tricks for subset patterns, etc), but non-repeat image tiling still involves creating a bitmap with one extra pixel row/column: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp&l=46

It may be possible to also refactor non-repeat tiling (I have a couple of ideas but I haven't worked out all the implications).

One idea for cheap decal mode: instead of adding decal support to all shaders, implement as a composable shader which delegates to the real shader only for spans within the decal rect, and fills with transparent otherwise.
Project Member

Comment 6 by hcm@google.com, Jan 12 2016

Labels: -M-44
Project Member

Comment 7 by hcm@google.com, Jan 12 2016

Labels: -Priority-Medium Priority-Low
Project Member

Comment 8 by caryclark@google.com, Jan 21 2016

Cc: -fmalita@chromium.org
Owner: fmalita@chromium.org
It sounds like Florin has some ideas -- feel free to assign it back to me if you're overwhelmed with other things to do

Sign in to add a comment