This patch:
- Makes the following substitutions (plus necessary namespace qualifiers:
gfxImageFormat::ARGB32 --> SurfaceFormat::A8R8G8B8_UINT32
gfxImageFormat::RGB24 --> SurfaceFormat::X8R8G8B8_UINT32
gfxImageFormat::A8 --> SurfaceFormat::A8
gfxImageFormat::RGB16_565 --> SurfaceFormat::R5G6B5_UINT16
gfxImageFormat::Unknown --> SurfaceFormat::UNKNOWN
- Changes gfxImageFormat to be a typedef to gfx::SurfaceFormat. This will be
removed soon.
- Removes gfxCairoFormatToImageFormat() and gfxImageFormatToCairoFormat() and
replace calls to them with CairoFormatToGfxFormat() and
GfxFormatToCairoFormat().
- Removes ParamTraits<gfxImageFormat>.
- Add namespace qualifiers to SurfaceFormat instances where necessary.
--HG--
extra : rebase_source : f56e92b1593957a9e4e00171100bc7605816e696
AutoTextRun now only needs a DrawTarget instead of an nsRenderingContext, and
similar nsRenderingContext/gfxContext-to-DrawTarget replacements can be
propagated a long way up the call graph. This patch replaces 93 occurrences of
nsRenderingContext and 135 occurrences of gfxContext with DrawTarget; that's
13% of them.
The patch is mostly plumbing changes. A couple of not-entirely-plumbing
changes:
- It adds a comment about the null check in
gfxGlyphExtents::GetTightGlyphExtentsAppUnits().
- A couple of functions simply had an unused gfxContext or nsRenderingContext
parameter removed, e.g. SetLineBreaks().
--HG--
extra : rebase_source : 8f56994bb4d254a86788b17ab2864ebc758a7e6b
Move queue and stack includes outside of mozilla namespace.
Test the following for searches:
- Null root returns null.
- Needle is root returns root.
- No needle results in full traversal.
- Needle node in middle returns that needle, and stops traversing.
Test the following for ForEachNode:
- Null root still runs correctly.
- No skips results in traversal of entire tree.
- Root skip results in only changing the root.
- First skips are still included (whether leaf or parent).
--HG--
extra : source : 6d2572c274363c7544c4f96f0016fead098b157e
In nsIWidget, GetBoundsUntyped(), GetClientBoundsUntyped() and
GetScreenBoundsUntyped() are currently the primary implementations, and the
untyped versions are defined on top of them. This patch flips that around.
--HG--
extra : rebase_source : 15b2f08f90bf4d1e209c6cb885f6a6e3b8db6708
The patch renames the existing functions (GetBounds(), GetClientBounds(), etc)
by adding an |Untyped| suffix. It then adds typed equivalents, and uses those
typed equivalents in all the call sites where it's easy to do so. The trickier
remaining call sites are converted to use the Untyped-suffix version.
--HG--
extra : rebase_source : 6bfb15bfc4698e2eba7d4db55497299d3dffcd51
The test changes here are to adjust for the fact that
nsTextFrame::GetRenderedText can now trim whitespace from the end of lines
that end in a hard line break.
--HG--
extra : commitid : 42YjYQUaiwY
extra : rebase_source : 69d3a9c5086c116365a0488d1b4fc52fc6524196
The test changes here are to adjust for the fact that
nsTextFrame::GetRenderedText can now trim whitespace from the end of lines
that end in a hard line break.
--HG--
extra : commitid : Dn0U0KPLfbY
extra : rebase_source : 57a6ad2e3ba1f7ec6aef9b940d8facdbba7e9c91
Having to include all of Layers.h just to get at the definition of
LayerUserData is inconvenient, especially as most of the interesting
things in Layers.h can be forward-declared. Let's move LayerUserData to
its own header, so clients can include a small header for that,
forward-declare anything else they need from Layers.h, and reduce header
bloat.
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout. The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.
CLOSED TREE makes big refactorings like this a piece of cake.
# The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
xargs perl -p -i -e '
s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
s/nsRefPtr ?</RefPtr</g; # handle declarations and variables
'
# Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h
# Handle nsRefPtr.h itself, a couple places that define constructors
# from nsRefPtr, and code generators specially. We do this here, rather
# than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
# things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
mfbt/nsRefPtr.h \
xpcom/glue/nsCOMPtr.h \
xpcom/base/OwningNonNull.h \
ipc/ipdl/ipdl/lower.py \
ipc/ipdl/ipdl/builtin.py \
dom/bindings/Codegen.py \
python/lldbutils/lldbutils/utils.py
# In our indiscriminate substitution above, we renamed
# nsRefPtrGetterAddRefs, the class behind getter_AddRefs. Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'
if [ -d .git ]; then
git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
This commit was generated using the following script, executed at the
top level of a typical source code checkout.
# Don't modify select files in mfbt/ because it's not worth trying to
# tease out the dependencies currently.
#
# Don't modify anything in media/gmp-clearkey/0.1/ because those files
# use their own RefPtr, defined in their own RefCounted.h.
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
grep -v 'mfbt/RefPtr.h' | \
grep -v 'mfbt/nsRefPtr.h' | \
grep -v 'mfbt/RefCounted.h' | \
grep -v 'media/gmp-clearkey/0.1/' | \
xargs perl -p -i -e '
s/mozilla::RefPtr/nsRefPtr/g; # handle declarations in headers
s/\bRefPtr</nsRefPtr</g; # handle local variables in functions
s#mozilla/RefPtr.h#mozilla/nsRefPtr.h#; # handle #includes
s#mfbt/RefPtr.h#mfbt/nsRefPtr.h#; # handle strange #includes
'
# |using mozilla::RefPtr;| is OK; |using nsRefPtr;| is invalid syntax.
find . -name '*.cpp' -o -name '*.mm' | xargs sed -i -e '/using nsRefPtr/d'
# RefPtr.h used |byRef| for dealing with COM-style outparams.
# nsRefPtr.h uses |getter_AddRefs|.
# Fixup that mismatch.
find . -name '*.cpp' -o -name '*.h'| \
xargs perl -p -i -e 's/byRef/getter_AddRefs/g'
In this process, TaskThrottler is made reference-counted.
--HG--
extra : source : 68295d4d1616e257732b8f2e8dd46c24debc8626
extra : intermediate-source : 2cd0c4caec06689c5325e23006d2cb14d40c5b5c
There are many sub-classes of nsExpirationTracker. In order to distinguish them
nicely in the logging of timer firings, it's necessary to manually name each
one. (This wouldn't be necessary if there was a way to stringify template
parameters, but there isn't.)
--HG--
extra : rebase_source : 89b99e9dbb2a806bd21145d04a5e023794643b61
This file has an intriguing mix of 1, 2, 3 and 4 space indentation, which this
patch fixes. The patch also fixes a small number of other style violations,
such as long lines.
--HG--
extra : rebase_source : 5a4668ddc2441c190a393f3a8519ad451918c4f0
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.
--HG--
extra : rebase_source : 82e3387abfbd5f1471e953961d301d3d97ed2973
The bulk of this commit was generated by running:
run-clang-tidy.py \
-checks='-*,llvm-namespace-comment' \
-header-filter=^/.../mozilla-central/.* \
-fix
We'll need this later so ImageHost can select the correct image to use.
Adding a TimeStamp parameter to BeginFrame is a bit annoying since BeginFrame
is overridden by every subclass. It's a bit more convenient to just call a
separate non-virtual method just before we call BeginFrame.
--HG--
extra : commitid : 3QUviDozXL
extra : rebase_source : ba6bc3d846606f3f7598f4a3b687b68746067ce3
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.
The fix for _cairo_bentley_ottmann_tessellate_boxes is from cairo upstream
commit 11b6c49c103d53526e9805c8906fde5dbb2eb884.
--HG--
extra : rebase_source : f9a52a5c6d20e560946abc4fb61bfd4a71fafb6a
We can run these now that we don't split out gkmedias.
This also changes a test to avoid MSVC codegening a divide by 0
--HG--
extra : rebase_source : 06af10f1d6779237d2cc6c1dabfd9378889893ee
Part 5 adds an assert that we always return an APZC from GetAPZCAtPoint. The test for bug 1119497 fails this assumption because it does not give it's layer tree a root AZPC. In all non-test code we ensure that there is always a root APZC and many things would break without such. So we modify the test to always have a root APZC more like actual code.
The test is testing that we don't return the layer below (with an APZC) the topmost child layer (without an APZC). So checking if we hit the root APZC still makes the test test the same thing.
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.