16 Commits

Author SHA1 Message Date
Chris Craik
bf27b995ae Avoid reentrance on ClipArea APIs
bug:28144676

Calling ClipArea::clipRegion from within ClipArea::clipPathWithTransform
has us handling op-based special casing twice, which caused all clip
paths to appear to be replace ops.

Change-Id: Ib842db53ffed4eee29470f773d59a3a1d07a1a0e
2016-04-13 15:59:32 -07:00
Chris Craik
04d46eb69f Support replace op in new pipeline
bug:26562461

Change-Id: Ie48d2da30f5e9d9abe88a5cd973dfb26e38abf63
2016-04-07 15:02:39 -07:00
Chris Craik
02806288d1 Fix flickering when layers resize in-place
bug:27248275
Change-Id: Ia11c93ebc1097f3735071204b6f14ca079bb9fc4
2016-03-14 13:26:25 -07:00
Chris Craik
69aeabe618 Fix clip rect snapping at non-integer scale values
bug:26923968

Also removes several reinterprets to ClipRect, since Rect member is in
base class.

Change-Id: If46dbdcea05b1257af185ccb38058735ebe81f79
2016-03-03 16:52:34 -08:00
Chris Craik
261725fdb2 Fix matrix mapping of negative rects
bug:27381362

Also rejects ops with empty clip at record time, and short circuits clip
intersection, when one is empty.

Change-Id: I842612da14ad8fd9f1ba5e9e4fd027ba4e08d365
2016-02-29 13:10:25 -08:00
Chris Craik
4f4c608209 Fix build
Change-Id: I24d82c44db9d9e04098a0d7cb9289d6b9fc19e41
2016-02-09 16:32:49 -08:00
Chris Craik
b4f4f3e16d Calculate clip bounds correctly when serializing
bug:26585671

Change-Id: Ic70769bce6fa2a7b65cb893ba4a45c65fdc0b7e3
2016-02-09 01:27:56 +00:00
Chris Craik
7fc1b0349b Fix ripple clipping + quick rejection
bug:26524690

Don't intersect the first clip with the viewport. Instead, the first
clip op should always be a replace op.

Additionally, only quick reject nodes that clip to bounds, since some
nodes (like ripples) draw outside their own bounds.

Change-Id: I96a52029f360328aba19af7349888cc0a026b5b1
2016-02-03 20:09:00 -08:00
Chris Craik
e4db79de12 Stencil support in new recorder/reorderer
bug:22480459
bug:26358504

Adds complex (non-rectangular) clipping support, and overdraw
visualization. Doesn't support stencil clipping in layers.

Change-Id: I8d10c7f1d2769ab5756774ca672344cc09901f87
2016-01-04 17:00:03 -08:00
Chris Craik
a2a70723b8 Simplify ClipArea to prefer Rect args
Change-Id: I8af83d01dc5dd8009a0cd235dd8b59dab61d8560
2015-12-17 23:31:44 +00:00
Chris Craik
15c3f19a44 Merged op dispatch in OpReorderer
bug:22480459

Also switches std::functions to function pointers on OpReorderer, and
switches AssetAtlas' entry getter methods to using pixelRef pointers,
so it's clear they're the keys.

Change-Id: I3040ce5ff4e178a8364e0fd7ab0876ada7d4de05
2015-12-07 12:34:46 -08:00
Chris Craik
ac02eb9035 Remove confusing behavior of Rect::intersect() and rename
bug:24670525

Removes silly 'do nothing if rects do not intersect' behavior, and
changes the name to clarify the difference (contrasting against
SkRect::intersect())

bug:24670525

Change-Id: Id2ca1cfea1a9d720d4dc70b251f426d9916f8b53
2015-10-05 14:16:26 -07:00
Chris Craik
4d3e704b04 Remove return values from clipping operations
bug:22530947

Also switch mode to enum class

Change-Id: Iabb38634c01f2e3203b1b715967d8828d95da190
2015-08-20 15:00:11 -07:00
Chris Craik
8ce8f3f4d6 Fix clip area behavior for REPLACE op
bug:22291400

Work around clippath-clipped-to-view-bounds behavior by
implementing REPLACE op fast path, avoiding the transition to
SkRegion/SkPath.

Change-Id: I63c1cf961db2d6e3759d83914de1036c9ac7497a
2015-07-16 13:31:41 -07:00
Tom Hudson
e30b53cec5 Enter RectangleMode when the clip region is a rectangle
ClipArea's region mode implementation store the region's boundary in
a rectangle, and if the region is that rectangle, set its region to
empty.  This is a bug, since as long as the ClipArea is in region
mode it treats its region as determinitive. When the next clipping
operation comes in, it is tested against the empty region instead of
against the valid rect.

Discovered via Skia GM testing.

Change-Id: I3bbc4e81c8d68636061f830156e017e9b5c7e587
2015-03-30 16:57:43 -04:00
Rob Tsuk
487a92caef Clipping performance improvements
Create a ClipArea class to handle tracking clip regions. This class can
select the most efficient implementation depending on the types of
clipping presented.

ClipArea re-used the rectangle and region-based clipping
implementations as well as adding a "list of rotated rectangles"
approach that is more efficient for rotated views with children.

Change-Id: I2133761a2462ebc0852b394220e265974b3086f0
2015-01-14 17:24:58 -08:00