This is needed so that we can use SourceSurfaces that don't have a
implicit 0,0 origin like those that would come from a DrawTargetTiled
or DrawTargetOffset.
Differential Revision: https://phabricator.services.mozilla.com/D17684
--HG--
extra : moz-landing-system : lando
This fixes a situation where a Device Reset occurs during initialization, after mDC has already been created but before mBitmap is created. In this case IsValid and EnsureInitialized would previously return 'true' in subsequent calls, since they were only checking for the DC.
This patch makes us properly store the full result of initialization for checking with IsValid and re-runs of EnsureInitialized.
Differential Revision: https://phabricator.services.mozilla.com/D17486
--HG--
extra : rebase_source : a20480486c094e14c3a2f67e5f39b1efbece5c69
Also make a const-correctness fix to PointTyped::WithinEpsilonOf().
Depends on D15974
Differential Revision: https://phabricator.services.mozilla.com/D15975
--HG--
extra : moz-landing-system : lando
RectAbsolute contained a MoveBy(Point) function where Point was not a
template parameter but the actual gfx::Point type. This seems to be an
unintentional copy/paste error. This patch fixes it to be properly
templated.
Differential Revision: https://phabricator.services.mozilla.com/D15135
--HG--
extra : moz-landing-system : lando
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal. I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.
Differential Revision: https://phabricator.services.mozilla.com/D13073
--HG--
extra : moz-landing-system : lando
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal. I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.
Differential Revision: https://phabricator.services.mozilla.com/D13073
--HG--
extra : moz-landing-system : lando
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal. I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.
Differential Revision: https://phabricator.services.mozilla.com/D13073
--HG--
extra : moz-landing-system : lando
Badly-behaved consumers of DrawTargetRecording can trigger recording of
draw calls that will fail to allocate required draw targets when the
recording is replayed. This patch tries to guard against this by
detecting these situations at record-time rather than crashing at
replay-time. When such a situation is detected, it will crash (for
content processes, to catch such scenarios) or gracefully fail (for
other processes).
Differential Revision: https://phabricator.services.mozilla.com/D11527
--HG--
extra : moz-landing-system : lando
This got added in bug 1429508 and then removed in bug 1451845. Tiled blobs adds tests for this, so it shouldn't break again.
MozReview-Commit-ID: 3azL7SoWlr2
Depends on D10038
Differential Revision: https://phabricator.services.mozilla.com/D10041
--HG--
extra : moz-landing-system : lando
This just makes the existing hack available to all DataSourceSurface implementations by default, since we use different ones with WR.
MozReview-Commit-ID: GVR0rIx8wtD
Depends on D10036
Differential Revision: https://phabricator.services.mozilla.com/D10038
--HG--
extra : moz-landing-system : lando
This got added in bug 1429508 and then removed in bug 1451845. Tiled blobs adds tests for this, so it shouldn't break again.
MozReview-Commit-ID: 3azL7SoWlr2
Depends on D10038
Differential Revision: https://phabricator.services.mozilla.com/D10041
--HG--
extra : moz-landing-system : lando
This just makes the existing hack available to all DataSourceSurface implementations by default, since we use different ones with WR.
MozReview-Commit-ID: GVR0rIx8wtD
Depends on D10036
Differential Revision: https://phabricator.services.mozilla.com/D10038
--HG--
extra : moz-landing-system : lando
This got added in bug 1429508 and then removed in bug 1451845. Tiled blobs adds tests for this, so it shouldn't break again.
MozReview-Commit-ID: 3azL7SoWlr2
Depends on D10038
Differential Revision: https://phabricator.services.mozilla.com/D10041
--HG--
extra : moz-landing-system : lando
This just makes the existing hack available to all DataSourceSurface implementations by default, since we use different ones with WR.
MozReview-Commit-ID: GVR0rIx8wtD
Depends on D10036
Differential Revision: https://phabricator.services.mozilla.com/D10038
--HG--
extra : moz-landing-system : lando
This is only used with DXVA decoder. P016 and P010 are just like NV12 but with 16 bits data..
Depends on D8246
Differential Revision: https://phabricator.services.mozilla.com/D8136
--HG--
extra : moz-landing-system : lando
The methods BytesPerPixel, SurfaceFormatForColorDepth, BitDepthForColorDepth, ColorDepthForBitDepth and RescalingFactorForColorDepth all directly depends on the types defined in Types.h, they also return constant values.
As such it makes more sense to have them defined at the same level where the types themselves are declared.
Depends on D8065
Differential Revision: https://phabricator.services.mozilla.com/D8073
--HG--
extra : moz-landing-system : lando
Additionally, add info for the following type:
R8G8B8
B8G8R8
R8G8
HSV
Lab
DEPTH
Differential Revision: https://phabricator.services.mozilla.com/D8065
--HG--
extra : moz-landing-system : lando
This commit adds an API to DrawTarget to draw a surface that will be provided
at the time a recording is replayed. The surface is referenced using a user
interpreted ID.
This will be used for drawing a OOP iframe, and the ID will be the TabId.
Differential Revision: https://phabricator.services.mozilla.com/D6786
--HG--
extra : rebase_source : d5ce9b429c89e9adb0e5fb180f60125e64f12d4a
This was giving me some font assertion crashes, and changing this as a hunch fixed it.
Differential Revision: https://phabricator.services.mozilla.com/D6784
--HG--
extra : rebase_source : 99bf039f33e314fb6f88ea283cf4cc575b054566
The same is done for NEON, and the check folds to nothing when building
when the build target supports SSE2 and runtime detection is not
necessary.
Differential Revision: https://phabricator.services.mozilla.com/D6129
--HG--
extra : moz-landing-system : lando
In MultiTiledContentClient we can create a DrawTargetTiled with a
different origin than the layer we are painting. We must therefore
ensure when edge-padding that we provide the valid region in the draw
target's device-space rather than layer-space. Not doing so was
causing us to pad out in incorrect directions, causing visible seams.
Differential Revision: https://phabricator.services.mozilla.com/D3993
--HG--
extra : moz-landing-system : lando
This commit exposes a method on DrawTargetCapture to see if it has
captured any drawing commands. This allows us to not dispatch
paint tasks if they will do nothing.
Ideally these tasks would execute instantly on the PaintThread, and
we would never delay sending the layer transaction or block on the
next paint, but with thread starvation and context switches it's
best to just not send them.
MozReview-Commit-ID: 7ywkEDBw6EX
--HG--
extra : rebase_source : c60c1c25d551e4a7c14c529137f8e0babc888466
extra : source : 7ae4c893867a5f7df81e0757d4b4a6a21cbc6986
This commit adds the ability to create a different kind of DrawTargetCapture which
has a limit on the size of which its CaptureCommandList can grow before it is
synchronously flushed to its destination DrawTarget.
Special care is taken to not do a sync flush until we would need to resize
the backing store of the CaptureCommandList. This allows us to not waste
memory we've already allocated.
The async painting content clients are updated to use it, and get a default
value from a new preference.
MozReview-Commit-ID: CJL7ffvaRzR
--HG--
extra : rebase_source : f646862dcef7a480b21dfb7ddb1fa165338ba506
extra : source : b865a866fe5a3257615cb54b7e5e790cc9331988
This commit moves ContentClient from creating a CapturedBufferState for
buffer operations, to performing all of those operations on the
DrawTarget(Capture). Creating a DrawTargetCapture is now performed
by the RotatedBuffer when we BeginPaint, all operations are performed
on this capture, and then it's returned to the ClientPaintedLayer
as a PaintTask.
This commit is an involved refactoring of ContentClient and RotatedBuffer
to get this all to work. Here are the major parts:
1. RotatedBuffer is refactored to always perform operations on a single
DrawTarget, which may be a single DT, dual DT, or capture.
2. RotatedBuffer adds BeginCapture and EndCapture methods to switch
which DT is used in operations
3. ContentClient uses the RB capture methods when we are async painting
4. CC::BeginPaint is refactored to only perform capturing on a single
RotatedBuffer. This is because we can't have the output of one
PaintTask be the input of a different PaintTask due to the design
of the Snapshot API.
a. This can occur, today, by doing a FinalizeFrame only to later
fail to Unrotate the buffer, causing a new RB to be created
and painted into
b. The previous PaintThread code worked because it used the
buffer operations which didn't use Snapshot's
c. This is fixed by not doing FinalizeFrame on a buffer if we
realize we cannot unrotate it, and switching to initializing
a buffer using the front buffer which should be up to date.
d. I don't like touching this code, but it passes reftests,
might be a performance improvement, and I've tested it on
known regressions from the last time I messed up this code.
5. CC::PrepareForPaint is inlined into BeginPaint because dual draw
targets can be cleared correctly from a previous commit
6. The code paths in ClientPaintedLayer are unified because we no
longer need to special case this beyond setting the correct
ContentClient flag.
7. CapturedPaintState and CapturedBufferState are removed in favor
of PaintTask. Additionally EndLayer is no longer needed as all
quadrants of a rotated buffer are in the same capture, so we
don't need special case flushing code.
MozReview-Commit-ID: 9UI40dwran
--HG--
extra : rebase_source : 809d9816970648468de972c30b0c230c2f21e27b
extra : source : 405ad351821813333c0e989b93e2aeb49ba8552c
This commit adds a buffer unrotate operation to DrawTarget. It's
initially implemented with LockBits in DrawTarget. DrawTargetDual
overrides the implementation to pass on the operation to it's
DrawTargets.
No override is given for DrawTargetCapture as we intentionally
avoid this code path when async painting as it can fail.
This is needed so that RotatedBuffer can expose a single DrawTarget,
which can be a DrawTarget (for normal alpha), DrawTargetDual (for
component alpha), or DrawTargetCapture (when async painting).
MozReview-Commit-ID: csjjZ733hl
--HG--
rename : gfx/layers/BufferUnrotate.cpp => gfx/2d/BufferUnrotate.cpp
rename : gfx/layers/BufferUnrotate.h => gfx/2d/BufferUnrotate.h
extra : rebase_source : 5d96e2a5d36a01f2f9992adb37830e56436c7c35
extra : source : 64cb50b227e0ae604653f03ce2e892493126392e
This commit adds the ability to create a SourceSurfaceDual directly,
instead of only from a DrawTargetDual. This allows SourceRotatedBuffer
to expose itself as a single SourceSurface for a later commit.
MozReview-Commit-ID: K21K42cGDy1
--HG--
extra : rebase_source : d3fe48ac711f9cd28799bfd8d36b74750cb15554
extra : source : 392a724d5acd25854e871fa47335c4b938fe9ae1
This commit changes the behavior of DrawTargetDual::Clear to be aware that
it has on-white and on-black buffers, and perform clearing appropriately.
This is slightly against what the DrawTarget documentation says the method
should do, but it allows us to move another paint thread operation into
DrawTargetCapture and simplify our ContentClient implementations.
I haven't seen any obvious breakage with this, and reftests are green.
An alternative would be to add a separate Clear method with documented
difference here.
MozReview-Commit-ID: 65CzcxlRqv7
--HG--
extra : rebase_source : 299adbb02e79f66f7d6860c5fe86784bad8332f8
extra : source : 3dc47f17fa446bb7f2b5876753f8271a93c0e0c8
This commit adds an operation to perform 'edge padding' on a draw
target. By default this is performed using LockBits, but it's
overriden in DrawTargetTiled and DrawTargetCapture to propagate
the call so it functions correctly.
This helps TiledContentClient move from applying this operation
on a per texture client basis, to being able to do it on the
DrawTargetTiled after painting. This in turn helps move all
paint thread operations into DrawTargetCapture.
MozReview-Commit-ID: 2ncOTxGXQfk
--HG--
rename : gfx/layers/BufferEdgePad.cpp => gfx/2d/BufferEdgePad.cpp
rename : gfx/layers/BufferEdgePad.h => gfx/2d/BufferEdgePad.h
extra : rebase_source : a3315644fe31f2a432935dcbfdb9969c58b691e1
extra : source : 699c954992f87db7fc792f5562090de42a8162cb
This lets us avoid filtering the entire source image when we only need a small portion of it.
This makes a big performance difference with tiled blob images with WebRender.
MozReview-Commit-ID: EbMZ7ZJEeCe
--HG--
extra : rebase_source : 3f507ca5776e4ad63ac2ea71f20376519953274c
This adds a DrawTargetOffset which is basically a simplified
DrawTargetTiled that only supports one tile. It useful for situations
where Cairo's device offset was used previously.
This also replaces WebRender's use of DrawTargetTiled which was just trying to
apply offset.
MozReview-Commit-ID: I33PB6CnHh0
--HG--
extra : rebase_source : 9fa51a0180343231cfca41daa0e3fa53f1b7befe
Rendering glyphs at many different rotations was causing the D2D glyph
cache to grow very large. Calling EndDraw/BeginDraw will prune the
cache, but is costly, so only do it for every 1000 glyphs.
MozReview-Commit-ID: HUFpxDvYAzQ
--HG--
extra : rebase_source : de283c5e687da07e5417e0d221d7f45b992080d5
For example, if we set a transform to rotate3d(0, 0, 1e50, 45deg), the
expected normalized rotate axis is (0, 0, 1).
However, the length is larger than the maximum of float, so the actual value is
(0/inf, 0/inf, 1e50/inf) == (0, 0, 0). Therefore, we scale the vector before
doing normalization to avoid getting a zero vector.
MozReview-Commit-ID: 5LUDWD4RuNj
--HG--
extra : rebase_source : eb82f0b3979bf6ea3cd11b643ebb30a49edc24f8
Same approach as the other bug, mostly replacing automatically by removing
'using mozilla::Forward;' and then:
s/mozilla::Forward/std::forward/
s/Forward</std::forward</
The only file that required manual fixup was TestTreeTraversal.cpp, which had
a class called TestNodeForward with template parameters :)
MozReview-Commit-ID: A88qFG5AccP
This was done automatically replacing:
s/mozilla::Move/std::move/
s/ Move(/ std::move(/
s/(Move(/(std::move(/
Removing the 'using mozilla::Move;' lines.
And then with a few manual fixups, see the bug for the split series..
MozReview-Commit-ID: Jxze3adipUh
We can easily use Maybe<DataSourceSurface::ScopedMap> instead of
allocated the map on the heap. This does require some minor changes to
ScopedMap to properly support moves, but should be much more efficient.
Patch originally developed on bug 1458921 but needs to land with the WR update.
MozReview-Commit-ID: 82BYyNWBAfn
--HG--
extra : rebase_source : e6bca2f446c019fd41a37c2c28db73bbe1cfc216
We must check mIsMapped inside mChangeMutex or else we could run into a race condition where
the source surface is subsequently mapped again before the function terminates. This was
being hit on try.
MozReview-Commit-ID: 1eot3DVW8VD
--HG--
extra : rebase_source : 19f2514d9e2412ee5fe7c99844b7f64f78a7425e