Граф коммитов

2749 Коммитов

Автор SHA1 Сообщение Дата
Nicolas Silva 32c8731610 Bug 1709535 - Fix clear tiles. r=gfx-reviewers,jnicol
In bug 1696905 I changed how clear tiles are rendered from multiply blend to opaque, however it breaks window controls on Windows 8 (the only thing that clear tiles are used for). This patch reverts clear tiles to the previous behavior.

I'm not sure how to test this part of the code because it depends on the widget integration code having something to show behind the window.

Differential Revision: https://phabricator.services.mozilla.com/D114327
2021-05-05 09:22:48 +00:00
Glenn Watson b845f71b44 Bug 1709507 - Reduce allocations and memmove during scene building. r=gfx-reviewers,jrmuizel
This can make scene building up to 10% faster on some pages (such
as the youtube.com front page) that use a large number of clips.

Differential Revision: https://phabricator.services.mozilla.com/D114312
2021-05-05 03:00:28 +00:00
Nicolas Silva 1f87bb2116 Bug 1696905 - Store composite tiles in a single array. r=gfx-reviewers,bradwerth
It used to be more convenient to store them in separate arrays but with the new occlusion culling code we don't benefit from it and have to undo it to traverse tiles from front to back.
This is a cleanup patch that should not change the behavior of the code.

Differential Revision: https://phabricator.services.mozilla.com/D113989
2021-05-04 12:54:52 +00:00
Nicolas Silva 67286e28c2 Bug 1696905 - CPU-side occlusion culling for picture cache tiles. r=gfx-reviewers,lsalzman,gw
This patch introduces a simple culling algorithm that splits compositor tiles into only their visible parts, removing the need for a depth buffer. This reduces the draw-call count as well well as the memory usage and bandwidth associated with the depth buffer.

Differential Revision: https://phabricator.services.mozilla.com/D113532
2021-05-04 12:54:52 +00:00
Glenn Watson 759e747d77 Bug 1708337 - Fix rounded clips on root iframe tile caches. r=gfx-reviewers,lsalzman
If an iframe has complex clips, we need to skip including them
in the iframe specific clip applied to the tile cache, as that
path only supports rectangle clips.

Differential Revision: https://phabricator.services.mozilla.com/D114190
2021-05-04 03:37:38 +00:00
Glenn Watson 7947bc10f1 Bug 1706824 - Remove old direct-composition example. r=gfx-reviewers,lsalzman
This was an old example / proof of concept of directly drawing
to a DirectComposition surface.

We now have the example-compositor/ project that shows how to
integrate with DirectComposition on Windows and Wayland on
Linux, in addition to a shipping implementation in Gecko for
CoreAnimation and DirectComposition.

Differential Revision: https://phabricator.services.mozilla.com/D113052
2021-05-04 00:32:41 +00:00
Glenn Watson 6bfb59cac9 Bug 1708444 - Don't create compositor surfaces inside blend containers. r=gfx-reviewers,bradwerth
If we optimize a root level blend container to be a tile cache, we
need to ensure we don't promote compositor surfaces within this slice
as it can result in incorrect blending.

Differential Revision: https://phabricator.services.mozilla.com/D114176
2021-05-04 00:02:45 +00:00
Jeff Muizelaar 3e6d79347c Bug 1708937. Work around a gen6 shader compiler bug. r=gw
This was found through experimentation. Hopefully,
we'll get a better understanding of what's going on in the future.

Differential Revision: https://phabricator.services.mozilla.com/D114166
2021-05-03 21:35:49 +00:00
Nicolas Silva ab62b81a1f Bug 1707930 - Account for reversed stops in the gradient cache key. r=gfx-reviewers,lsalzman
WebRender internally reverses gradient stops when they are ordered from right to left. This is done while building the GPU data and the gradient cache key stored the reversed stops without sepcifying if they were revered or originally in that order. This meant that if a page had two similar gradients with the only difference being that on was reversed but not the other, they could end up using the same cache key and one of the two would not be rendered properly.

This patch includes a boolean in the cache key to make sure reversed gradients don't accidentally use the same key as similar non-reversed gradients.

Differential Revision: https://phabricator.services.mozilla.com/D113975
2021-05-03 09:12:43 +00:00
Nicolas Silva 06ef812482 Bug 1707744 - Avoid far gradient endpoints causing large gradient segments. r=gfx-reviewers,lsalzman
Large segment bounds trip an assertion when casting coordinates to integers. Clipping early also reduces the amount of cached pixels.

Differential Revision: https://phabricator.services.mozilla.com/D113819
2021-05-03 09:12:42 +00:00
Nicolas Silva 720d336a44 Bug 1706678 - Fix cached gradient scaling. r=gfx-reviewers,lsalzman
Large gradients are cached scaled down and stretched back by the image brush. Because the scaling factor is non-uniform the shader has to take it into account. The previous implementation was incorrectly accounting for the scale.

Differential Revision: https://phabricator.services.mozilla.com/D113753
2021-05-03 09:12:42 +00:00
Lee Salzman d85019f12d Bug 1704750 - Use simpler check for triangle winding. r=aosmond
The original triangle winding check was designed to be run inside the span
rasterizer every time the edges changed. However, at present, this only ever
gets used once at the very top of the triangle to determine winding and then
assumes winding is constant thereafter.

This updates the check to work on these assumptions to be simpler and less
fragile where numerical precision is concerned. If we can assume the candidate
edges both start on the same row, then the check boils down to seeing if they
share the same starting point and doing a cross-product.

Differential Revision: https://phabricator.services.mozilla.com/D113900
2021-04-30 13:11:37 +00:00
Lee Salzman 565bba41e8 Bug 1708590 - Don't call add_surface or start_compositing unless actually rendering. r=sotaro
Rather than have SwCompositor or the individual RenderCompositors track this, it seems easier
to just have WR itself avoid calling add_surface or start_compositing if we're inside an update.

Differential Revision: https://phabricator.services.mozilla.com/D113953
2021-04-30 12:26:53 +00:00
Dorel Luca dbd079f286 Backed out changeset 8a51e4315c4f (bug 1706678) for Webrench failures. CLOSED TREE 2021-04-29 23:53:43 +03:00
Nicolas Silva 6f87c8e46e Bug 1706678 - Fix cached gradient scaling. r=gfx-reviewers,lsalzman
Large gradients are cached scaled down and stretched back by the image brush. Because the scaling factor is non-uniform the shader has to take it into account. The previous implementation was incorrectly accounting for the scale.

Differential Revision: https://phabricator.services.mozilla.com/D113753
2021-04-29 20:08:03 +00:00
Lee Salzman 0d7f643ddb Bug 1708224 - Make draw_perspective more resilient to NaNs. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D113671
2021-04-28 15:54:24 +00:00
Lee Salzman 9c947c8891 Bug 1707798 - Use rough clipping in cs_clip_image. r=aosmond
We were already clipping off most of the AA inside cs_clip_image previously anyway.
Given that it is too unpredictable in what situations the little bit of remaining
AA was actually applying, and that it causes visual artifacts sometimes when it
activates where it shouldn't, we're better off just using a rough clip inside this
shader for everything so that it is always predictable.

Differential Revision: https://phabricator.services.mozilla.com/D113545
2021-04-27 17:03:49 +00:00
Nicolas Silva 28cb8bdbd1 Bug 1707460 - Better handle reversed gradient stops. r=gfx-reviewers,bradwerth
The code that decompose linear gradients inserts fake gradient stops to deal with the potential constant color areas before and after the gradient endpoints. The offsets of these extra stops were computed without accounting for the transformation the loop does in the case of reversed stops. This patch fixes that.

Differential Revision: https://phabricator.services.mozilla.com/D113290
2021-04-27 07:44:26 +00:00
Nicolas Silva 4ae4ba4201 WIP: Bug 1707181 - Avoid zero-sized gradient tasks. r=gfx-reviewers,lsalzman
Add missing check for linear gradients. Also, instead of just casting to int round out the task size.

Differential Revision: https://phabricator.services.mozilla.com/D113289
2021-04-27 07:44:25 +00:00
Lee Salzman edf1e67938 Bug 1707228 - Check for no perspective dependency on Z component on axis-aligned transforms. r=aosmond
Recent changes in cs_clip_image are exposing some cases where we are letting rectangles being warped
by perspective transform get considered as axis-aligned. This makes the axis-alignment check stronger
for clipping to guard against the Z dependency in the W coordinate that is messing up clipping.

Differential Revision: https://phabricator.services.mozilla.com/D113259
2021-04-26 18:49:24 +00:00
Robert Mader 003138f3e9 Bug 1707202 - Remove surface_origin_is_top_left support from NativeSurface again, r=nical
Using native compositor integration should imply the y-flip can be
done by the system compositor - this is true for CA, DC and Wayland.
As the Wayland backend now does so, remove the
surface_origin_is_top_left support again, making sure
the Wayland backend uses the same code paths as CA/DC backends do.

Note:
 - In order to not regress bug 1680128, do not revert the override
   of `SurfaceOriginIsTopLeft()` in `RenderCompositorNative.h`
 - Explicitely set `surface_origin_is_top_left: false` in the example
   compositor. This is the default, however setting it explicitely
   would have helped me bring up the Wayland example compositor.
   This is purely a hint for potential future backends.

Differential Revision: https://phabricator.services.mozilla.com/D113217
2021-04-26 12:48:39 +00:00
Lee Salzman f6a009e6e3 Bug 1706846 - Verify that total clip transform is axis-aligned rather than just the primitive transform. r=gfx-reviewers,aosmond
It's possible that the overall clip transform isn't axis-aligned even if the primitive transform is. So we rather
need to verify that this overall transform is axis-aligned.

Differential Revision: https://phabricator.services.mozilla.com/D113188
2021-04-22 22:57:30 +00:00
Miko Mynttinen f3891ac138 Bug 1676657 - Port paint phase weight histograms to WebRender r=nical
Differential Revision: https://phabricator.services.mozilla.com/D108043
2021-04-22 13:31:42 +00:00
Nicolas Silva 4a1117087f Bug 1702228 - Adjust reftests. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D112970
2021-04-22 10:34:55 +00:00
Nicolas Silva 9bde5de742 Bug 1702228 - Check gradient parameters. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D112969
2021-04-22 10:34:55 +00:00
Nicolas Silva 9b31d6c49b Bug 1702228 - Cache linear gradients by default. r=gw
This patch breaks linear gradients into two primitives:
 - LinearGradient is always rendered via the brush shader. It is only used with SWGL.
 - CachedLinearGradient is always rendered via a cached render task and the brush image shader. Its implementation is very similar to conic and radial gradients, with the addition of a fast-path for axis aligned gradients with two stops.

In addition the following changes are made:
 - The gradient fast path is simpler (only deals with two gradient stops).
 - Decomposing axis-aligned gradients into parts eligible for the fast path happens during scene building instead of frame building.

Differential Revision: https://phabricator.services.mozilla.com/D112018
2021-04-22 10:34:54 +00:00
Nicolas Silva a5f12f2a34 Bug 1702638 - Apply the local clip early for cached gradient primitives. r=gfx-reviewers,gw
It avoids rasterizing large cached gradients that are mostly clipped out later.

Differential Revision: https://phabricator.services.mozilla.com/D111395
2021-04-22 10:34:54 +00:00
Glenn Watson ba81b408e0 Bug 1706827 - Remove unused shaders. r=gfx-reviewers,lsalzman
The pathfinder prototype shaders are not currently used, so they
can be removed for now.

Differential Revision: https://phabricator.services.mozilla.com/D113053
2021-04-22 02:47:25 +00:00
Glenn Watson d23fc2d663 Bug 1706801 - Invalidate dirty rect state when an external compositor surface is removed r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D113041
2021-04-22 00:43:12 +00:00
Lee Salzman 96cf843676 Bug 1706537 - Silence SwCompositor tsan warning. r=aosmond
This forces current_job to null as soon as it is known whether there are no more
bands available so that current_job is always null if job_count is zero.

Differential Revision: https://phabricator.services.mozilla.com/D112891
2021-04-21 15:56:14 +00:00
Alexandru Michis 1b2962d3ec Backed out changeset ca4d87f2ec7b (bug 1676657) for causing webrender bustages.
CLOSED TREE
2021-04-21 18:41:23 +03:00
Miko Mynttinen 8249149314 Bug 1676657 - Port paint phase weight histograms to WebRender r=nical
Differential Revision: https://phabricator.services.mozilla.com/D108043
2021-04-21 15:13:42 +00:00
Glenn Watson 5daecc2aad Bug 1700235 - Apply iframe clips on tile caches instead of prims. r=gfx-reviewers,kvark
Differential Revision: https://phabricator.services.mozilla.com/D112728
2021-04-20 23:59:45 +00:00
Lee Salzman 05f2cdffa6 Bug 1706198 - Avoid source-to-dest-to-source conversions during clipping of blit rects. r=mattwoodrow
The problem stems from the fact that to clip the dest rectangle to the source rectangle when there is
scaling between them, we have to round at each step due to the fact we're working in integer coordinates.
This causes us to nudge the coordinates in weird directions.

To avoid this, this uses a slightly different approach where we essentially modify the existing clip
rectangle functionality to factor in the texture bounds so that we don't have to do as many lossy
conversions.

Differential Revision: https://phabricator.services.mozilla.com/D112688
2021-04-20 20:55:55 +00:00
Butkovits Atila 70de203efd Merge mozilla-central to autoland. CLOSED TREE 2021-04-20 19:03:13 +03:00
Jamie Nicol a603deeb55 Bug 1706277 - Remove blit_workaround_buffer from webrender. r=nical
This was required to workaround a driver bug on Adreno devices when
blitting to texture arrays. It is no longer required as we have
stopped using texture arrays, due to all the driver bugs.

It's currently just dead code as we stopped initializing the buffers
when we removed texture array support. This patch just removes the
dead code.

Differential Revision: https://phabricator.services.mozilla.com/D112697
2021-04-20 12:23:36 +00:00
imoraru 9b430bb1a1 Merge autoland to mozilla-central a=merge 2021-04-20 12:49:23 +03:00
Jamie Nicol 56f9b83c08 Bug 1705433 - Pack more varyings in vectors to work around Adreno 3xx bug. r=kvark
In bug 1630356 we found a driver bug on some Adreno 3xx devices where
flat scalar varyings in shaders incorrectly caused the output of every
fragment in the triangle to be calculated as if flat. To work around
the bug, we pack the scalar varyings in a vector. At the time we
believed it may be limited to varyings used to calculate UV
coordinates, however, we have now seen more cases of this bug (in box
shadows, gradients, and svg filters).

Unfortunately it is not yet clear what precise conditions are required
to trigger this bug, so for now we just apply the workaround to the
varyings we know are affected due to failing wrench tests on the device.

Differential Revision: https://phabricator.services.mozilla.com/D112334
2021-04-20 07:08:40 +00:00
Dorel Luca 037aa2c337 Merge autoland to mozilla-central. a=merge 2021-04-20 01:15:05 +03:00
R. Martinho Fernandes 4ecee0b048 Bug 1677866 - Report memory allocated by `cert_storage` crate r=keeler,emilio
Differential Revision: https://phabricator.services.mozilla.com/D107105
2021-04-19 22:12:56 +00:00
Lee Salzman 3e9c27fa37 Bug 1705979 - Make it easier to distinguish between copying and scaling in profile. r=aosmond
With the copying and scaling code in one place, it gets a bit hard to see in the profile which one
is being used. This just moves some of the dispatching between the two up a level so they show up as
different functions in a profile.

Differential Revision: https://phabricator.services.mozilla.com/D112613
2021-04-19 16:26:23 +00:00
Sebastian Hengst 389332c42a Backed out changeset 8a4eff9d5f94 (bug 1700235) for painting regressions. a=backout 2021-04-19 22:37:10 +02:00
Lee Salzman a2ff3c9c3f Bug 1705979 - Add support for nearest filtered scaled composites to SWGL. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D112493
2021-04-19 03:34:42 +00:00
Glenn Watson 93a6a5e91f Bug 1700235 - Apply iframe clips on tile caches instead of prims. r=nical,kvark
Differential Revision: https://phabricator.services.mozilla.com/D112142
2021-04-18 22:05:37 +00:00
Lee Salzman 1cf069460b Bug 1705836 - Check for negative sample bounds r=tsmith,kvark
Differential Revision: https://phabricator.services.mozilla.com/D112444
2021-04-16 23:21:35 +00:00
Glenn Watson 26344c3634 Bug 1705569 - Prevent non-premultiplied alpha images being promoted to compositor surfaces r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D112300
2021-04-16 01:53:20 +00:00
Glenn Watson f0adb01cd3 Bug 1705270 - Fix assert when compositor surface is in a pass-through picture r=gfx-reviewers,lsalzman
We don't currently handle the case where a compositor surface is inside a
picture primitive that is a pass through (has composite mode of None),
because we only count required compositor surfaces at the top level prim
list of a tile cache.

However, the code to promote a surface was only checking if it existed on
the same physical surface, not the root picture cache.

This patch prevents compositor surfaces being promoted in this case (which
only occurs if inside a backdrop-filter container, or a 3d transform root).

Differential Revision: https://phabricator.services.mozilla.com/D112153
2021-04-15 20:08:51 +00:00
Brad Werth 8474c82f86 Bug 1675375 Part 4: Perform the polygon hit test in WebRender, and add unit tests. r=gw
This performs a winding number calculation on the polygon and matches the
result against the fill rule of the supplied polygon.

Differential Revision: https://phabricator.services.mozilla.com/D109946
2021-04-15 18:54:39 +00:00
Brad Werth 7155ccc182 Bug 1675375 Part 3: Stub in polygon clipping in WebRender. r=gw
This defines a PolygonKey and includes it in ClipItemKind::ImageMask. The
actual process of clipping is just a stub.

Differential Revision: https://phabricator.services.mozilla.com/D105548
2021-04-15 18:54:38 +00:00
Brad Werth 06dadaa7a6 Bug 1675375 Part 2: Add a polygon clips to image masks. r=gw
This patch augments the pushing of an image mask to allow a polygon clip
region to be attached to it.

Differential Revision: https://phabricator.services.mozilla.com/D105397
2021-04-15 18:54:38 +00:00