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

74 Коммитов

Автор SHA1 Сообщение Дата
Jamie Nicol 836b0d935c Bug 1857447 - Avoid redundant UniformData calls in DrawTargetWebgl. r=lsalzman
Calling ClientWebGLContext::UniformData() many times causes the
command buffer to fill up and we spend a fair amount of time flushing
the old buffer and allocating a new one, as well as serializing the
values.

The uniforms themselves are very small but they add up over a large
number of calls. We already have some code to track whether the
uniform values are dirty to avoid some redundancy, but a) this doesn't
cover every uniform, and b) we invalidate them all when switching
program.

This patch makes us track the value of every uniform that gets set
dynamically, and tracks the values separately for each program
used. It then uses these to avoid calling UniformData redundantly.

Differential Revision: https://phabricator.services.mozilla.com/D190269
2023-10-06 15:12:48 +00:00
Lee Salzman 3ebedffae0 Bug 1850727 - Only clear last clip mask when destroying clip mask. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D187366
2023-09-04 17:39:16 +00:00
Lee Salzman 3c8f363117 Bug 1837728 - Allow alpha directly on stroked lines and rects. r=aosmond
For lines and rects, we don't have to worry about AARect generating overlapping
triangles when alpha is used. In these cases we can avoid drawing to a mask first
and avoid a performance cliff.

Differential Revision: https://phabricator.services.mozilla.com/D180525
2023-06-10 18:30:47 +00:00
Lee Salzman 5676a2eb44 Bug 1837068 - Support alpha strokes by rendering with AAStroke to a mask render target. r=aosmond
Since AAStroke can't deal with non-opaque stroked path, we first generate a normal opaque, anti-aliased
stroked path with AAStroke and render it to a cache texture bound to a render target. We can then later
just use that texture with alpha to support the initial alpha stroke request.

One caveat is that trying to both render to a texture bound to a framebuffer and also upload directly to
it with texSubImage2D can expose bugs in some OpenGL drivers that have different underlying representations
for data textures and for render target textures. To avoid this problem, we segregate the texture cache
pages based on whether they are used as render targets or for direct data uploads.

This ultimately all avoids the fallback of having to draw the alpha stroke in software with Skia and
then upload it to a texture. For stroked paths with large hollow areas, uploading a Skia surface whose
bounds contain the full stroke can cause a lot of uploading of unnecessary pixel data. This allows us
to only upload the triangle mesh for AAStroke and otherwise keep generation solely on the GPU.

Differential Revision: https://phabricator.services.mozilla.com/D180143
2023-06-07 19:47:04 +00:00
Lee Salzman 12aaadd1d1 Bug 1829058 - Cache scissor state in DrawTargetWebgl. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D175986
2023-04-20 14:27:52 +00:00
Lee Salzman 5f37f41db4 Bug 1828137 - Support accelerating large clearRects if they encompass entire viewport. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D175727
2023-04-18 15:08:27 +00:00
Lee Salzman 805dbc2586 Bug 1826420 - Fast-path non-aligned clip rects in DrawTargetWebgl. r=gfx-reviewers,aosmond
This adds interpolants to the AA distance calculation to handle the AA'ing of
the clip rect.

Differential Revision: https://phabricator.services.mozilla.com/D174650
2023-04-05 15:52:36 +00:00
Lee Salzman eabc73b16a Bug 1820546 - Avoid fallbacks in DrawTargetWebgl::CopySurface. r=aosmond,gfx-reviewers
This implements some optimizations targeted at Canvas2D's putImageData:

1) Track whether the canvas is in the initially clear state so that we avoid
reading back from the WebGL framebuffer into the Skia framebuffer when a
fallback does occur or when a data snapshot is needed.

2) For surfaces that are too large to upload to a texture, directly use
glTexSubImage2D to draw data to the WebGL framebuffer, bypassing a separate
texture upload.

3) Disregard the surface size limits for SurfacePatterns containing a
compatible texture handle.

Differential Revision: https://phabricator.services.mozilla.com/D171773
2023-03-07 08:51:44 +00:00
Lee Salzman f7cb3c64f6 Bug 1817873 - Use line join for closed single line paths. r=aosmond
If we choose to accelerate a single line path, we need to take care not to use
the line cap when the path is closed. When the path is closed, we need to use
the line join instead.

Differential Revision: https://phabricator.services.mozilla.com/D170469
2023-02-21 18:03:37 +00:00
Lee Salzman 5203daccb2 Bug 1812970 - Avoid using Skia's deprecated clip ops. r=jrmuizel
Skia upstream removed deprecated clip ops that could be used to replace
the clipping stack and bypass clips. We shouldn't really need to do this
anymore, as we can work around it just using public APIs.

The only SkCanvas operation that allows us to bypass clipping is
writePixels, which still allows us to implement CopySurface/putImageData.

Other instances where we were using the replace op for DrawTargetWebgl
layering support can just be worked around by creating a separate
DrawTargetSkia pointing to the same pixel data, but on which no clipping
or transforms are applied so that we can freely do drawing operations
on it to the base layer pixel data regardless of any user-applied clipping.

Differential Revision: https://phabricator.services.mozilla.com/D168039
2023-01-28 11:24:54 +00:00
Jeff Muizelaar 3a46da3d80 Bug 1803375. Use different coordinates when running on AMD. r=lsalzman,jgilbert
This updates the version wpf-gpu-raster which adds support for
GPUs/drivers that use truncation instead of rounding when converting
vertices to fixed point.

It also adds the GL vendor to InitContextResult so that we can detect
AMD on macOS and tell wpf-gpu-raster that truncation is going to happen.

Differential Revision: https://phabricator.services.mozilla.com/D167503
2023-01-27 01:45:17 +00:00
Lee Salzman ca22cda7c8 Bug 1752841 - Add ExtractSubrect API to SourceSurface. r=jrmuizel
CanvasRenderingContext2D relies upon CreateSimilarDrawTarget to create extract
a subrect from a surface to draw. However, DrawTargetWebgl does not return an
accelerated DT for that API as creating an entirely new context can be quite
expensive.

To work around this, this adds a specific ExtractSubrect API for SourceSurface
that can bypass the entire need to create a temporary DrawTarget to copy into.

Differential Revision: https://phabricator.services.mozilla.com/D164118
2022-12-07 21:06:32 +00:00
Lee Salzman 2aa384ef7f Bug 1804340 - Generate path vertexes into pre-allocated output buffer. r=jrmuizel
This pre-allocates a vertex output buffer in DrawTargetWebgl so that we can generate
wpf-gpu-raster and aa-stroke output into it. This way, they don't have to realloc
a Vec for pushes or changing into a boxed slice. This can net 5-10% on profiles for
the demos noted in the bug.

Depends on D163989

Differential Revision: https://phabricator.services.mozilla.com/D163990
2022-12-07 00:53:55 +00:00
Lee Salzman aa85bdae23 Bug 1803604 - Use aa-stroke to accelerate stroked paths in Canvas2D. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D163609
2022-12-03 08:21:50 +00:00
Cosmin Sabou bc234a7f64 Backed out 2 changesets (bug 1803604) for causing talos crashes on pdfpaint.
Backed out changeset 0be171a7d6ac (bug 1803604)
Backed out changeset 9c9e6c4e7864 (bug 1803604)
2022-12-03 02:59:04 +02:00
Lee Salzman 12243b8955 Bug 1803604 - Use aa-stroke to accelerate stroked paths in Canvas2D. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D163609
2022-12-02 19:49:38 +00:00
Lee Salzman 06f0c7307f Bug 1802625 - Hide GPU path stroking behind a pref. r=jrmuizel
It seems like this is slow for now until we implement a better way than WPF-gpu-raster
for stroking paths. Just hide this behind a pref so we can at least test it but not
impact performance as badly.

Differential Revision: https://phabricator.services.mozilla.com/D163248
2022-11-28 20:31:02 +00:00
Lee Salzman 65e2fbed09 Bug 1801539 - Attempt to cache the state of the clip mask for when mask is regenerated. r=aosmond
For use-cases that repeatedly pop and re-push the same clips over and over, we can regenerate the
same mask that is already still stored, because we only detect that clip state changed, rather than
that it changed to exactly the same state it was previously.

This just remembers the previous state of the clip stack at the time the clip mask was generated
so that we can compare the previous and current state. If they're the same, we can assume there
is no need to regenerate the clip mask again and simply reuse it.

Differential Revision: https://phabricator.services.mozilla.com/D162699
2022-11-28 17:55:07 +00:00
Lee Salzman 5f482e37ed Bug 1801584 - Avoid relying on WebGL line smoothing. r=jrmuizel
WebGL doesn't reliably implement line smoothing, so we can't rely on it, making it
useless for canvas lines. Instead, just fall back to emulating it manually with paths.

Differential Revision: https://phabricator.services.mozilla.com/D162540
2022-11-28 17:54:44 +00:00
Lee Salzman f5ed77ef10 Bug 1801446 - Limit the maximum complexity of paths used with wpf-gpu-raster. r=jrmuizel
Some paths may contain so many types that their vertex representation far exceeds their
software rasterized representation in memory size. As a sanity-check, we should just set
a hard limit on the maximum allowed complexity of a path that we attempt to supply to
wpf-gpu-raster. Beyond that, we will instead just rasterize in software and upload
to a texture which can be more performant.

Differential Revision: https://phabricator.services.mozilla.com/D162481
2022-11-22 05:25:59 +00:00
Lee Salzman 5f08669bab Bug 1800826 - Remove all clips when reusing a target in Canvas2D. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D162237
2022-11-17 03:10:35 +00:00
Lee Salzman f73a41e1ac Bug 1800581 - Use optimized snapshots for drawImage if canvases share internal context. r=aosmond
By default, BorrowSnapshot is pessimistic and forces DrawTargetWebgl to return a data snapshot on
the assumption that the snapshot might be used off thread. However, if we actually know the DrawTarget
we're going to be drawing the snapshot to, then we can check if they're both DrawTargetWebgls with
the same internal SharedContext. In that case, we can use a SourceSurfaceWebgl snapshot which can
pass through a GPU texture to the target. This requires us to plumb the DrawTarget down through
SurfaceFromElement all the way to DrawTargetWebgl to make this decision.

Differential Revision: https://phabricator.services.mozilla.com/D162176
2022-11-17 03:07:18 +00:00
Lee Salzman cb9096e766 Bug 1799402 - Use WGR to rasterize paths in DrawTargetWebgl. r=jrmuizel
This adds a path vertex buffer where triangle list output from WGR is stored.
Each PathCacheEntry can potentially reference a range of vertexes in this buffer
corresponding to triangles for that entry. When this buffer is full, it gets
orphaned and clears corresponding cache entries, so that it can start anew.

Differential Revision: https://phabricator.services.mozilla.com/D161479
2022-11-12 08:06:44 +00:00
Iulian Moraru f838c68136 Backed out 3 changesets (bug 1799402) for causing windows build bustages. CLOSED TREE
Backed out changeset e51cd76008ef (bug 1799402)
Backed out changeset 3ff660b475ff (bug 1799402)
Backed out changeset 9cfa7581565e (bug 1799402)
2022-11-12 08:33:24 +02:00
Lee Salzman bea9f37e42 Bug 1799402 - Use WGR to rasterize paths in DrawTargetWebgl. r=jrmuizel
This adds a path vertex buffer where triangle list output from WGR is stored.
Each PathCacheEntry can potentially reference a range of vertexes in this buffer
corresponding to triangles for that entry. When this buffer is full, it gets
orphaned and clears corresponding cache entries, so that it can start anew.

Differential Revision: https://phabricator.services.mozilla.com/D161479
2022-11-12 05:42:30 +00:00
Lee Salzman b00c9670cf Bug 1799495 - Ensure WaitForShmem has a valid DrawTargetWebgl to access. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D161554
2022-11-08 16:23:56 +00:00
Lee Salzman 78fb03e6fc Bug 1793769 - Avoid recreating the main DrawTargetWebgl SharedContext. r=aosmond
For canvas users that rapidly create and destroy canvases, we may end up creating
a new SharedContext (and hence ClientWebGLContext) if there are no more canvases
left between destruction and creation. To work around this, just keep alive the
SharedContext for the main thread (other threads are unfortunately a bit tricky
to support) so that canvas creation remains fast in this instance.

Differential Revision: https://phabricator.services.mozilla.com/D158904
2022-10-14 20:06:20 +00:00
Norisz Fay a4e22af322 Backed out 2 changesets (bug 1793769) for causing multiple WebGL related failures CLOSED TREE
Backed out changeset f824c70961a7 (bug 1793769)
Backed out changeset 01a92b6503fe (bug 1793769)
2022-10-14 22:33:11 +03:00
Lee Salzman ec985c8284 Bug 1793769 - Avoid recreating the main DrawTargetWebgl SharedContext. r=aosmond
For canvas users that rapidly create and destroy canvases, we may end up creating
a new SharedContext (and hence ClientWebGLContext) if there are no more canvases
left between destruction and creation. To work around this, just keep alive the
SharedContext for the main thread (other threads are unfortunately a bit tricky
to support) so that canvas creation remains fast in this instance.

Differential Revision: https://phabricator.services.mozilla.com/D158904
2022-10-14 18:26:23 +00:00
Sandor Molnar ac8dd3115a Backed out 2 changesets (bug 1793769) for causing crashes in @ std::_Hashtable<unsigned int, std::pair<unsigned int const, RefPtr<mozilla::WebGLTextureJS> CLOSED TREE
Backed out changeset 6387a6e7bbd5 (bug 1793769)
Backed out changeset 0737cb829b7e (bug 1793769)
2022-10-13 20:34:00 +03:00
Lee Salzman 63344170d4 Bug 1793769 - Avoid recreating the main DrawTargetWebgl SharedContext. r=aosmond
For canvas users that rapidly create and destroy canvases, we may end up creating
a new SharedContext (and hence ClientWebGLContext) if there are no more canvases
left between destruction and creation. To work around this, just keep alive the
SharedContext for the main thread (other threads are unfortunately a bit tricky
to support) so that canvas creation remains fast in this instance.

Depends on D158903

Differential Revision: https://phabricator.services.mozilla.com/D158904
2022-10-13 16:44:24 +00:00
Lee Salzman a57e6f5dfb Bug 1789849 - Use a separate DrawTargetSkia for rendering clip masks. r=aosmond
Previously we were reusing the framebuffer's Skia DT to render the clip mask.
This was the path of least resistance since SkCanvas does not allow exporting
clip information, and there is no way to reset the bitmap storage inside an
SkCanvas temporarily.

However, this can cause a feedback cycle of unnecessary WaitForShmem operations,
since we need to wait before we can generate the clip mask into the Skia target,
and then anything else after it needs to wait for the clip mask to finish uploading
before the Skia DT can be used again.

To alleviate this, we just allocate a new DrawTargetSkia to render the clip mask
into. We carefully clip the size of the DT so that in the common case we avoid
having to upload a surface the size of the entire framebuffer. Further, since
this is a completely different DT, we can now use an A8 format (1/4 the memory
overhead) instead of a BGRA8 format for the clip mask, which gives a further
memory usage gain.

A further complication is that we need to log the current clip stack state so
that we can replay it onto the new DrawTargetSkia. This avoids having to add
a mechanism to SkCanvas to export clip information.

Differential Revision: https://phabricator.services.mozilla.com/D157050
2022-09-12 15:26:03 +00:00
Lee Salzman 90a8a6adf3 Bug 1789849 - Avoid regenerating clip mask unless necessary. r=aosmond
Sometimes the clip state is thrashed when we need to temporarily override
clipping to disable it. However, in this case, the clip mask itself remains
unchanged. The current invalidation scheme doesn't discern between generation
of the clip mask itself and setting the clip state for the shader, leading to
unnecessary regeneration of the clip mask.

This code just tries to discern when this is happening so we can refresh the
clip state without having to regenerate the clip mask unless truly necessary.

Differential Revision: https://phabricator.services.mozilla.com/D157048
2022-09-12 15:26:02 +00:00
Lee Salzman 6e6f7d9732 Bug 1773280 - Fall back to DrawPath if we can't accelerate StrokeLike. r=aosmond
Sometimes we hit requests to stroke a path with a rounded line in it that can't
be accelerated inside StrokeLine. This causes it to push a layer which can be
expensive. Go through DrawPath instead in this case which will still try to
accelerate the drawing with a cached texture that does not use a layer.

Differential Revision: https://phabricator.services.mozilla.com/D156791
2022-09-08 20:02:17 +00:00
Lee Salzman 775ea303b7 Bug 1773280 - Support complex clips in DrawTargetWebgl by using a mask texture. r=aosmond,gfx-reviewers
DrawTargetWebgl currently only supports aligned rectangular clips that can be approximated
with a scissor. However, many use-cases require complex clips like rounded rectangles or
not-aligned regions. We can support these cases more generally by using a mask texture that
modulates the shader color. The mask texture is generated by doing a solid fill in the Skia
target over a clear background, which is safe because the Skia target is not in use while
the WebGL target is being rendered to. This adds one unconditional texture lookup to the
shaders which shouldn't have a big performance impact. When no clip mask is needed, we just
default to using a 1x1 solid texture.

Depends on D156224

Differential Revision: https://phabricator.services.mozilla.com/D156225
2022-09-06 05:06:18 +00:00
Lee Salzman bc35a2d000 Bug 1773280 - Extend DrawTargetWebgl's glyph cache to support stroked glyphs. r=aosmond,gfx-reviewers
Currently we only support filled glyphs in DrawTargetWebgl. PDF.js can often render PDFs
that have stroked glyphs, so support for stroked glyphs is useful to prevent fallbacks.
This just adds support for plumbing StrokeOptions through to GlyphCache.

Differential Revision: https://phabricator.services.mozilla.com/D156224
2022-09-06 05:06:17 +00:00
Lee Salzman c78dca6613 Bug 1779681 - Mark WebGL framebuffer as initially valid in DrawTargetWebgl. r=aosmond,gfx-reviewers
mWebglValid gets initialized to false, but it will never get reset to true until the next
frame, causing us to render into Skia the first frame rather than accelerate. Therefor, we
should just initialize it to valid. Since it is cleared to zero initially, this is safe.

Differential Revision: https://phabricator.services.mozilla.com/D151896
2022-07-26 13:41:32 +00:00
Norisz Fay 33900387eb Backed out changeset 4b19d16c4fec (bug 1779681) for causing reftest failures on radialGradient-basic-03.svg CLOSED TREE 2022-07-26 09:59:13 +03:00
Lee Salzman 7aa0b77c94 Bug 1779681 - Mark WebGL framebuffer as initially valid in DrawTargetWebgl. r=aosmond,gfx-reviewers
mWebglValid gets initialized to false, but it will never get reset to true until the next
frame, causing us to render into Skia the first frame rather than accelerate. Therefor, we
should just initialize it to valid. Since it is cleared to zero initially, this is safe.

Differential Revision: https://phabricator.services.mozilla.com/D151896
2022-07-26 01:30:45 +00:00
Lee Salzman 11df7a2ec5 Bug 1771007 - Avoid sending SourceSurfaceWebgl off-thread. r=jrmuizel,gfx-reviewers
BorrowSnapshot can be called by OffScreenCanvas in various places that may send
a SourceSurfaceWebgl to the main thread. If it did not originate from the main
thread, then this can cause multiple threads to use it. In general we want to
avoid this. For now, override BorrowSnapshot and make it always force a Skia
snapshot that can be safely shared between threads instead of SourceSurfaceWebgl.

Differential Revision: https://phabricator.services.mozilla.com/D152417
2022-07-26 01:28:48 +00:00
Lee Salzman b7ed12cb3c Bug 1780574 - Support imageSmoothingEnabled in DrawTargetWebgl. r=jrmuizel,gfx-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152415
2022-07-26 01:27:04 +00:00
Lee Salzman 4a88a37cf6 Bug 1777872 - Use Shmem for backing DrawTargetWebgl's Skia target. r=jgilbert
When rendering large and/or fullscreen Canvas2Ds, excessive time can be spent
in calls to TexImage/ReadPixels copying into and out of Shmems to the separate
buffer for DrawTargetSkia. To alleviate this, we can make the DrawTargetSkia
directly wrap the Shmem, so that calls to TexImage/ReadPixels then directly
read or write to this without any separate copy. We modify RawTexImage to use
the IPDL SendTexImage path so that Shmems can be sent via SurfaceDescriptor.
Since SendTexImage is nominally async (which is beneficial), we rely on a
call to GetError later to verify that the Shmem processing is completely before
we further modify the DrawTargetSkia. We further add a ReadPixelsIntoShmem IPDL
call to allow sending the Shmem in the other direction directly.

Differential Revision: https://phabricator.services.mozilla.com/D151286
2022-07-12 09:25:35 +00:00
Bogdan Szekely 8702a09262 Backed out changeset 458aae4c5d0a (bug 1777872) for causing mochitest failures on Shmem.cpp CLOSED TREE 2022-07-12 12:03:35 +03:00
Lee Salzman 72406ec267 Bug 1777872 - Use Shmem for backing DrawTargetWebgl's Skia target. r=jgilbert
When rendering large and/or fullscreen Canvas2Ds, excessive time can be spent
in calls to TexImage/ReadPixels copying into and out of Shmems to the separate
buffer for DrawTargetSkia. To alleviate this, we can make the DrawTargetSkia
directly wrap the Shmem, so that calls to TexImage/ReadPixels then directly
read or write to this without any separate copy. We modify RawTexImage to use
the IPDL SendTexImage path so that Shmems can be sent via SurfaceDescriptor.
Since SendTexImage is nominally async (which is beneficial), we rely on a
call to GetError later to verify that the Shmem processing is completely before
we further modify the DrawTargetSkia. We further add a ReadPixelsIntoShmem IPDL
call to allow sending the Shmem in the other direction directly.

Differential Revision: https://phabricator.services.mozilla.com/D151286
2022-07-12 08:32:40 +00:00
Cristian Tuns 452dd9b5cf Backed out changeset 2c17688069a7 (bug 1777872) for causing mochitest failures in browser_rules_flexbox-highlighter-on-mutation.js CLOSED TREE 2022-07-12 03:44:25 -04:00
Lee Salzman 0e9626ea47 Bug 1777872 - Use Shmem for backing DrawTargetWebgl's Skia target. r=jgilbert
When rendering large and/or fullscreen Canvas2Ds, excessive time can be spent
in calls to TexImage/ReadPixels copying into and out of Shmems to the separate
buffer for DrawTargetSkia. To alleviate this, we can make the DrawTargetSkia
directly wrap the Shmem, so that calls to TexImage/ReadPixels then directly
read or write to this without any separate copy. We modify RawTexImage to use
the IPDL SendTexImage path so that Shmems can be sent via SurfaceDescriptor.
Since SendTexImage is nominally async (which is beneficial), we rely on a
call to GetError later to verify that the Shmem processing is completely before
we further modify the DrawTargetSkia. We further add a ReadPixelsIntoShmem IPDL
call to allow sending the Shmem in the other direction directly.

Differential Revision: https://phabricator.services.mozilla.com/D151286
2022-07-12 07:00:05 +00:00
Lee Salzman 0da1cdb579 Bug 1777426 - Remove CopySnapshotTo in favor of async present. r=aosmond
With async present we can now rely on being able to do readbacks from WebGL
in the GPU process, rather than needing CopySnapshotTo to accelerate this in
the content process. Just remove CopySnapshotTo since it doesn't help anymore.

Differential Revision: https://phabricator.services.mozilla.com/D150721
2022-07-12 06:56:20 +00:00
Lee Salzman 74b05fc71b Bug 1774343 - Support PushLayer/PopLayer in DrawTargetWebgl. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D149353
2022-06-16 21:37:41 +00:00
Lee Salzman 87094c967b Bug 1773270 - Check for subpixel AA in DrawTargetWebgl::StrokeGlyphs. r=aosmond,gfx-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D148744
2022-06-09 15:33:21 +00:00
Lee Salzman d87f81eedd Bug 1771504 - Handle mapped DrawTargetWebgl snapshots that subsequently need to be drawn. r=aosmond,gfx-reviewers
If a DrawTargetWebgl's snapshot is mapped, then subsequently drawn, this can cause an assert to
trigger as we may not have a handle available when we go to unlink the cached snapshot that later
gets added to the texture cache. This assert is otherwise harmless, so we just fix the assert.

Otherwise, there are some inefficiencies with this scenario that this patch also tries to address.
When we go to draw the snapshot, DrawTargetWillChange gets invoked on the snapshot, and we can
ensure in this case the handle is copied efficiently here rather than later uploaded from mapped
data.

Differential Revision: https://phabricator.services.mozilla.com/D148102
2022-06-02 15:27:00 +00:00