Bug 1176077 introduced the parameter aDirtyRegion to
DrawPaintedLayerCallback, which allows the callback to recompute the
visibility of all items to be painted in that transaction in a single
go. However, this parameter can not always be determined correctly
when using RotatedBuffer, and using an incorrect value was causing
graphical glitches.
Make the parameter optional, and on null values do not perform the
optimisation. Pass null from ClientPaintedLayer, which uses
RotatedBuffer and was causing problems, but continue to pass the
correct value from other Layer implementations. This optimisation was
most important for tiled layers using progressive paint, so this is
okay.
FrameLayerManager::RecomputeItemsVisibility() was being called on every
call to FrameLayerBuilder::DrawPaintedLayer(), each time for the region
to be painted by that paint call. This is inefficient when progressive
paint is enabled. Change it so that we compute the visibility of all the
layer's items within the total region to be painted, but only on the
first paint after the display list has been modified.
The bulk of this commit was generated by running:
run-clang-tidy.py \
-checks='-*,llvm-namespace-comment' \
-header-filter=^/.../mozilla-central/.* \
-fix
This conversion was done with the script:
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl' | \
egrep -v 'cairo-win32-refptr.h|RefPtr.h|TestRefPtr.cpp' | \
xargs sed -i -e 's/mozilla::TemporaryRef</already_AddRefed</g' \
-e 's/TemporaryRef</already_AddRefed</g'
Manual fixups were performed in the following instances:
- We handled mfbt/RefPtr.h manually so as to not convert TemporaryRef itself
into already_AddRefed.
- The following files had explicit Move() calls added to make up for the lack
of a copy constructor on already_AddRefed:
dom/base/ImageEncoder.cpp
dom/media/MediaTaskQueue.{h,cpp}
dom/media/webaudio/PannerNode.cpp
- A redundant overload for MediaTaskQueue::Dispatch was deleted.
- A few manual fixups were required in mfbt/tests/TestRefPtr.cpp.
- Comments, using declarations, and forward declarations relating to
TemporaryRef in dom/canvas/ and gfx/layers/ were changed to refer to
already_AddRefed.
Having this implicit conversion means that we can silently do extra
refcounting when it's completely unnecessary. It's also an obstacle to
making RefPtr more nsRefPtr-like, so let's get rid of it.
This doesn't seem to be necessary and doesn't really make sense to me. This
will help us moving region clipping into Moz2D
--HG--
extra : rebase_source : 4a5987ce2a95eaba44a69233d1b7f461f5ec16ea
We generate a Rect from integers and then round them to do the snapping.
- Rect rect(r->x, r->y, r->width, r->height);
-
- rect.Round();
This accomplishes nothing.
Just rip it out.
--HG--
extra : rebase_source : 3194652ca83f2e66ae1cbd02573ab86c444bd2fb
We generate a Rect from integers and then round them to do the snapping.
- Rect rect(r->x, r->y, r->width, r->height);
-
- rect.Round();
This accomplishes nothing.
Just rip it out.
--HG--
extra : rebase_source : 620d4c9b4e6951e42441db336de2badb69c4a39c