Precondition:
In an SVG doc, giving an invalid local-ref mask, e.g. mask="url"#foo"", and
clipState.mDirtyRectInDevPx be empty. e.g. apply mask onto a path object which
the size of area is zero(Please refers to the reftest in Part 2)
1. PaintStyleImageLayerWithSC early continue at [1], and the value of result is
still the initial value, DrawResult::SUCCESS.
2. The caller is not aware of that the mask image was left unresolved since it get
DrawResult::SUCCESS from #1.
This patch fixed this problem by calling PrepareImageLayer before early return
for updating correct drawing result.
[1]
https://hg.mozilla.org/mozilla-central/file/ebf68ba9b098/layout/painting/nsCSSRendering.cpp#l2682
MozReview-Commit-ID: DjJ0Nni1gDl
--HG--
extra : rebase_source : 949101547b6cb4db93c8a889210c768fb81cff7a
This updates more code that was using RelativeToParent() to use the
stacking context helper's ToRelativeWr* functions instead. This get us
closer to breaking the assumption that the WR stacking context order maps
1:1 to the layer tree structure.
MozReview-Commit-ID: HQrbvCgPOW4
This propagates the StackingContextHelper to the rest of the code that
builds WR display items, because we will need it in future patches to
stop using RelativeToParent.
MozReview-Commit-ID: 3PlQrJRhH36
This is needed for the next patch, because the bullet frame WR rendering
code will need a StackingContextHelper to pass to the PushGlyphs call.
It also helps with some of the later patches in this series, when we get
rid of the RelativeToParent calls.
MozReview-Commit-ID: Is0aciHhy2N
By passing the startTime as a TimeDuration we are able to represent times in the
distant past (and with the same range as we can represent on the main thread so
that if we do encounter range errors in future, they should not differ between
the main thread and the compositor).
This patch includes a crashtest. I have verified that, without the code changes
included in this patch, this crashtest fails on debug builds on OSX.
MozReview-Commit-ID: EDuKLzfEC0K
--HG--
extra : rebase_source : 1883080fdfac8c33f70698145f21e67cbdfdd4f2
The origin of a tiled gradient needs to be positioned less than the origin
of its clip bounds, otherwise it won't fill all of its clip bounds. There
is an existing function used by the current code path that can be used to
do this.
MozReview-Commit-ID: 13EtwmZYT4P
--HG--
extra : amend_source : 4fbe6b72efc61b1ef8303422e6e0910970d49fa0
As we are often converting from LayoutDevicePixel to LayerPixel types
in WebRenderDisplayItem code, I added a convenience overload of
RelativeToParent that takes a LayoutDeviceRect and returns a LayerRect,
even though this is a potential footgun if abused.
MozReview-Commit-ID: DABAWdOBsbV
Add MOZ_FORMAT_PRINTF to the definitions of PrintAsFormatString in
nsCSSRenderingBorders.h.
MozReview-Commit-ID: 9ZcSgNIPPhM
--HG--
extra : rebase_source : e2c3f86ac58835c0bdaf442f45fee25db99e52a6
nsStyleImage::ComputeActualCropRect may return false under 4 conditions
1. mType is not eStyleImageType_Image.
This function is design to be used when mType is eStyleImageType_Image.
Replace this 'if' check by MOZ_ASSERT.
2. nsStyleImage::GetImageData() returns nullptr
This function will return true if this image refers to a local-ref resource.
3. GetImage returns failure or does not return a valid imgIContainer.
It's possible. Please refers to the comment in imgReqestProxy::GetImage
at [1].
4. imageSize is empty
It's possible too. By giving a malformed image to a style image, we will hit
this condition. And this is right what we met in this bug.
Since ComputeActualCropRect may actaully return false, we should remove the
NS_ASSERTION that assume it will always return true.
[1]
https://hg.mozilla.org/mozilla-central/file/7f1f1559cd8d/image/imgRequestProxy.cpp#l513
MozReview-Commit-ID: KHTFQJjiLtT
--HG--
extra : rebase_source : c4e119dd250094115ab23c323ca49f9ebc296698
Fixed backgrounds were not being clipped correctly when rendered using
inactive layers.
MozReview-Commit-ID: 3v8tajr3MoB
--HG--
extra : rebase_source : 25329cb9efb998c64924916d4ea496a439688c8d
We will use this later in this patch series to simplify the creation of SMIL's
ValueWrapper objects.
MozReview-Commit-ID: 7EF9CN2SdwQ
--HG--
extra : rebase_source : e7cf5adc4c3f72dcc4b99625a8d0cb1a2d17f7d4
In nsCSSRendering::PaintBorderWithStyleBorder:
DrawResult
nsCSSRendering::PaintBorderWithStyleBorder()
{
if (aStyleBorder.IsBorderImageLoaded()) {
(1)
}
(2)
}
At (1), we create a nsCSSBorderImageRenderer object. While creating it, we call
imgRenderer.PrepareImage() to ensure a full image decode at [1]. PrepareImage is
used in both bg-image/mask-image and border-image. The difference is, in
bg-image/mask-image painting path, we unconditionally use PrepareImage(in
nsCSSRendering::PrepareImageLayer), whereas in border-image painting path we
use it only after border-image was downloaded. This difference does cause a
problem. After border image was downloaded, the decoder will not do full decoding
since we did not ask for it, so there will be no repaint notification and no
chance to paint border-image again.
In this patch, I try to align the behavior between bg-image/mask-image and
border-image: always call nsImageRenderer::PrepareImage.
This is a generic fix for both stylo-enable and stylo-disable build. We do not
find this problem in reftest is because we use SYNC_DECODE in reftest harness, which
hides this race condition. When daily using firefox, if
nsCSSRendering::PaintBorderWithStyleBorder is called after border-image was
loaded, your program run into (1), border-image will be drawn correctly; In the
case that nsCSSRendering::PaintBorderWithStyleBorder is called before
border-image is loaded, your program run into (2), and you can only see
border-color.
[1]
https://hg.mozilla.org/mozilla-central/file/a6f35285bd1e/layout/painting/nsCSSRenderingBorders.cpp#l3598
MozReview-Commit-ID: 6pidHJdPG8I
--HG--
extra : rebase_source : 2be402f59a42ef767ab6bae2962cd2ec55b36c50
clang's -Wcomma warning warns about suspicious use of the comma operator such as between two statements or to call a function for side effects within an expression. In addition to fixing the warnings, replace some char16_t(' ') casts of char literals with shorter UTF-16 character literals u' '.
layout/painting/FrameLayerBuilder.cpp:3647:31 [-Wcomma] possible misuse of comma operator here
layout/painting/FrameLayerBuilder.cpp:3657:41 [-Wcomma] possible misuse of comma operator here
layout/painting/nsCSSRenderingBorders.cpp:3336:33 [-Wcomma] possible misuse of comma operator here
layout/painting/nsCSSRenderingBorders.cpp:3336:60 [-Wcomma] possible misuse of comma operator here
layout/painting/nsCSSRenderingBorders.cpp:3337:33 [-Wcomma] possible misuse of comma operator here
layout/painting/nsCSSRenderingBorders.cpp:3337:60 [-Wcomma] possible misuse of comma operator here
layout/style/Declaration.cpp:808:41 [-Wcomma] possible misuse of comma operator here
layout/style/Declaration.cpp:812:42 [-Wcomma] possible misuse of comma operator here
layout/style/FontFaceSet.cpp:1118:60 [-Wcomma] possible misuse of comma operator here
MozReview-Commit-ID: 9tfcIsnnBwM
--HG--
extra : rebase_source : 89916d1d7b43e4c4793364637a8d015242cb033f
extra : source : c5921d4d63f8f68eafe5a33013e08f9a455429d9
This avoids conflicts with mozilla::dom::FrameType.
MozReview-Commit-ID: 7aEMbHRaTFk
--HG--
extra : rebase_source : 2d01321f5ce0ec8c0e3f70984674f82678034b3c
In nsCSSRenderingGradients the logic for handling many error conditions
and normalizing the gradient stops is shared between the paint path and
the WebRender path. WebRender now normalizes gradients and handles any
error conditions that it needs to. There are some conditions that are not
problems for it, like repeating radial gradients with stops below zero.
This commit undoes the work done in bug 1341101 to share this logic. Some
conditions were moved around in bug 1341101 to make things simpler, and
that has been undone. Now the paint path is identical to how it was
originally.
There is one exception, which is ResolveMidpoints which is kept between
both code paths. This should be safe.
MozReview-Commit-ID: LMhMNXNquXM
--HG--
extra : rebase_source : 2d389f76134671b6caa44a3b7370b1c786576bdc
extra : histedit_source : caf5d3a456cbb9987970783969d0eb2a424e7eca
LayerActivityTracker::NotifyExpired() will be invoked by
nsExpirationTracker::TimerCallback() from an unlabeled runnable.
We provide a SystemGroup EventTarget for the invocation of this
callback since there's nothing within a page that would rely on
the timer firing at a particular time (i.e., it doesn't matter
when this timer's callback is scheduled, relative to other
runnables dispatched for the page).
MozReview-Commit-ID: FZHtqicwDG5
--HG--
extra : rebase_source : 741983a64e7b9835999bdb344bc5f163eebac246
We will obsolete StyleAnimationValue in the future, and can treat
AnimationValue as a wrapper of RawServoAnimationValue to hide the FFIs
at that moment. For now, we still need both types, so it's better to make sure
they are mutually exclusive in AnimationValue. Therefore, let's add some
assertions.
Besides, I think those FFIs might do many things and it seems those methods
are not critical, so let's move them into the cpp file, so we can remove
some dependencies to avoid re-compiling so many files if someone needs
revise ServoBindings.h.
MozReview-Commit-ID: FJ1uTvEQ7NT
--HG--
extra : rebase_source : 8ef99c659f2721c8425364051db19b66536bccc6
This switches over layout's usage of PLArena to ArenaAllocator. This allows
us to build more files in unified sources and gets rid of various CONST masks.
MozReview-Commit-ID: Aaf3Dl2kaoz
Refactor the existing PaintGradient method into a nsCSSGradientRenderer class. The purpose
of this is to separate the calculation of gradient parameters from the painting of the
gradients. This should help us to share code between WebRender and our existing
painting code. It does not change how we render gradients currently.
MozReview-Commit-ID: 4P8vPqK4V8g
--HG--
extra : rebase_source : 031cd8d15148153b0af23fa9ff0abbf037d028db
It's ok to pass aRenderingContext to DrawableForElement, since DrawableForElement
only use aRenderingContext to create a similiar draw target. Replace
aRenderingContext by ctx make code more consistent since the draw call
bellow(nsLayoutUtils::DrawImage) use ctx.
MozReview-Commit-ID: 6n0nYfcFPui
--HG--
extra : rebase_source : 1374c8b5be9fe5351a5a126e39773c9493cf233d
If mask-mode is luminace, we will create a temporary context at [1]. It's
obvious we do not use this gfxContext at all in PaintGradient path. This patch is
trying to fix this problem by pass gfxContext, instead of RenderingContext,
directly to PaintGraident.
[1] https://hg.mozilla.org/mozilla-central/file/991f5724e58f/layout/painting/nsCSSRendering.cpp#l5811
MozReview-Commit-ID: LLmg4k6IEm3
--HG--
extra : rebase_source : ed42e3f5ddf1314300259c3f74d43aac8b4683de
This is a largely uninteresting patch that just uses the DisplayListBuilder
directly. A wonderful cleanup patch will come after this. One of the more
interesting pieces is the use of PushBuiltDisplayList. This is needed for
handling empty transactions. See https://github.com/servo/webrender/pull/934
for more info.
This change is to use gecko_enum_prefix in helpers.mako.rs, so that we do not
need to manually write code for nsStyleDisplay::mTransformBox.
MozReview-Commit-ID: 7UAL0iUcSIO
--HG--
extra : rebase_source : e99b7c163991df7ef3e7c0404fcef1832718a150
This function is not a virtual function and always returns CAIRO_STATUS_SUCCESS
after the patch in bug 1054838 landed. There is no reason to keep it anymore.
MozReview-Commit-ID: EadrrFQyjfY
--HG--
extra : rebase_source : 3f6a284dc9fa396d5cfd3f64190562373801a0a2
This basically just splits the enum in two and does the necessary plumbing. The
worst part is that now DisplayItemLayers need to have two arrays of commands.
Fortunately, this will be going away in the future.
This makes it so we don't send the child side commands to the parent.
We don't need to update the time during composing style, we just need to
update when transform animations are sent to the compositor. The most
recent refresh time of nsRefreshDriver should be the same in either side.
If the time is skewed, that means we skip composing style, if it happened
that's another bug.
MozReview-Commit-ID: Dxtuocf1ml1
--HG--
extra : rebase_source : 93e8fad24948b1c0b89fa7946639154a82f4a3ae