2D.h 
This structure is used to send draw options that are universal to all drawing
operations.

83913 
AutoHelpersWin.h 

1611 
BaseCoord.h 
Do not use this class directly. Subclass it, pass that subclass as the
Sub parameter, and only use that subclass. This allows methods to safely
cast 'this' to 'Sub*'.

3466 
BaseMargin.h 
Sides represents a set of physical sides.

5178 
BasePoint.h 
Do not use this class directly. Subclass it, pass that subclass as the
Sub parameter, and only use that subclass. This allows methods to safely
cast 'this' to 'Sub*'.

3406 
BasePoint3D.h 
Do not use this class directly. Subclass it, pass that subclass as the
Sub parameter, and only use that subclass. This allows methods to safely
cast 'this' to 'Sub*'.

3649 
BasePoint4D.h 
Do not use this class directly. Subclass it, pass that subclass as the
Sub parameter, and only use that subclass. This allows methods to safely
cast 'this' to 'Sub*'.

3387 
BaseRect.h 
Rectangles have two interpretations: a set of (zerosize) points,
and a rectangular area of the plane. Most rectangle operations behave
the same no matter what interpretation is being used, but some operations
differ:
 Equality tests behave differently. When a rectangle represents an area,
all zerowidth and zeroheight rectangles are equal to each other since they
represent the empty area. But when a rectangle represents a set of
mathematical points, zerowidth and zeroheight rectangles can be unequal.
 The union operation can behave differently. When rectangles represent
areas, taking the union of a zerowidth or zeroheight rectangle with
another rectangle can just ignore the empty rectangle. But when rectangles
represent sets of mathematical points, we may need to extend the latter
rectangle to include the points of a zerowidth or zeroheight rectangle.
To ensure that these interpretations are explicitly disambiguated, we
deny access to the == and != operators and require use of IsEqualEdges and
IsEqualInterior instead. Similarly we provide separate Union and UnionEdges
methods.
Do not use this class directly. Subclass it, pass that subclass as the
Sub parameter, and only use that subclass.

27404 
BaseSize.h 
Do not use this class directly. Subclass it, pass that subclass as the
Sub parameter, and only use that subclass. This allows methods to safely
cast 'this' to 'Sub*'.

3398 
BezierUtils.cpp 

11045 
BezierUtils.h 

5493 
BigEndianInts.h 

1680 
Blur.cpp 
Helper function to process each row of the box blur.
It takes care of transposing the data on input or output depending
on whether we intend a horizontal or vertical blur, and whether we're
reading from the initial source or writing to the final destination.
It allows starting or ending anywhere within the row to accomodate
a skip rect.

32223 
Blur.h 
Implementation of a triple box blur approximation of a Gaussian blur.
A Gaussian blur is good for blurring because, when done independently
in the horizontal and vertical directions, it matches the result that
would be obtained using a different (rotated) set of axes. A triple
box blur is a very close approximation of a Gaussian.
This is a "service" class; the constructors set up all the information
based on the values and compute the minimum size for an 8bit alpha
channel context.
The callers are responsible for creating and managing the backing surface
and passing the pointer to the data to the Blur() method. This class does
not retain the pointer to the data outside of the Blur() call.
A spread N makes each output pixel the maximum value of all source
pixels within a square of side length 2N+1 centered on the output pixel.

6593 
BlurLS3.cpp 

20656 
BlurNEON.cpp 

12072 
BlurSSE2.cpp 

13737 
BorrowedContext.h 
This is a helper class that let's you borrow an Xlib drawable from
a DrawTarget. This is used for drawing themed widgets.
Callers should check the Xlib drawable after constructing the object
to see if it succeeded. The DrawTarget should not be used while
the drawable is borrowed. 
3899 
BufferEdgePad.cpp 

3508 
BufferEdgePad.h 

691 
BufferUnrotate.cpp 

2485 
BufferUnrotate.h 

697 
ConicGradientEffectD2D1.cpp 

11570 
ConicGradientEffectD2D1.h 

3556 
ConvolutionFilter.cpp 

7611 
ConvolutionFilter.h 
MOZILLA_GFX_CONVOLUTION_FILTER_H_ 
1455 
Coord.h 

6740 
CriticalSection.h 

1810 
DataSourceSurface.cpp 

678 
DataSourceSurfaceWrapper.h 
MOZILLA_GFX_DATASOURCESURFACEWRAPPER_H_ 
1760 
DataSurfaceHelpers.cpp 

11349 
DataSurfaceHelpers.h 
Create a DataSourceSurface and init the surface with the aData. The stride
of this source surface might be different from the input data's
aDataStride. System will try to use the optimal one.

5040 
DrawEventRecorder.cpp 

5485 
DrawEventRecorder.h 
@param aUnscaledFont the UnscaledFont to increment the reference count for
@return the previous reference count

7414 
DrawTarget.cpp 
Byte offsets of channels in a native packed gfxColor or cairo image surface.

11791 
DrawTargetCairo.cpp 
Clamp r to (0,0) (2^23,2^23)
these are to be device coordinates.
Returns false if the rectangle is completely out of bounds,
true otherwise.
This function assumes that it will be called with a rectangle being
drawn into a surface with an identity transformation matrix; that
is, anything above or to the left of (0,0) will be offscreen.
First it checks if the rectangle is entirely beyond
CAIRO_COORD_MAX; if so, it can't ever appear on the screen 
false is returned.
Then it shifts any rectangles with x/y < 0 so that x and y are = 0,
and adjusts the width and height appropriately. For example, a
rectangle from (0,5) with dimensions (5,10) will become a
rectangle from (0,0) with dimensions (5,5).
If after negative x/y adjustment to 0, either the width or height
is negative, then the rectangle is completely offscreen, and
nothing is drawn  false is returned.
Finally, if x+width or y+height are greater than CAIRO_COORD_MAX,
the width and height are clamped such x+width or y+height are equal
to CAIRO_COORD_MAX, and true is returned.

65419 
DrawTargetCairo.h 

10205 
DrawTargetD2D1.cpp 

78894 
DrawTargetD2D1.h 

13310 
DrawTargetOffset.cpp 

9007 
DrawTargetOffset.h 
Not implemented 
7965 
DrawTargetRecording.cpp 

27738 
DrawTargetRecording.h 
Draw a surface to the draw target. Possibly doing partial drawing or
applying scaling. No sampling happens outside the source.
aSurface Source surface to draw
aDest Destination rectangle that this drawing operation should draw to
aSource Source rectangle in aSurface coordinates, this area of aSurface
will be stretched to the size of aDest.
aOptions General draw options that are applied to the operation
aSurfOptions DrawSurface options that are applied

14598 
DrawTargetSkia.cpp 
When constructing a temporary SkImage via GetSkImageForSurface, we may also
have to construct a temporary DataSourceSurface, which must live as long as
the SkImage. We attach this temporary surface to the image's pixelref, so
that it can be released once the pixelref is freed.

70737 
DrawTargetSkia.h 

9557 
dwextra.h 
New DirectWrite interfaces based on Win10 Fall Creators Update versions
of dwrite_3.h and dcommon.h (from SDK 10.0.17061.0). This particular
subset of declarations is intended to be just sufficient to compile the
Gecko DirectWrite font code; it omits many other new interfaces, etc.

5301 
DWriteSettings.cpp 
static 
5517 
DWriteSettings.h 

1077 
ExtendInputEffectD2D1.cpp 

6078 
ExtendInputEffectD2D1.h 

3299 
Factory.cpp 

39683 
FilterNodeD2D1.cpp 

41269 
FilterNodeD2D1.h 

5611 
FilterNodeSoftware.cpp 
This class provides a way to get a pow() results in constanttime. It works
by caching 129 ((1 << sCacheIndexPrecisionBits) + 1) values for bases between
0 and 1 and a fixed exponent.

125094 
FilterNodeSoftware.h 
Can be attached to FilterNodeSoftware instances using
AddInvalidationListener. FilterInvalidated is called whenever the output of
the observed filter may have changed; that is, whenever cached GetOutput()
results (and results derived from them) need to discarded.

29956 
FilterProcessing.cpp 

11111 
FilterProcessing.h 

11531 
FilterProcessingScalar.cpp 

12622 
FilterProcessingSIMDinl.h 

57584 
FilterProcessingSSE2.cpp 

5672 
Filters.h 

13867 
FontVariation.h 
MOZILLA_GFX_FONTVARIATION_H_ 
816 
GenericRefCounted.h 
Common base class for GenericRefCounted and GenericAtomicRefCounted.
Having this shared base class, common to both the atomic and nonatomic
cases, allows to have RefPtr's that don't care about whether the
objects they're managing have atomic refcounts or not.

3778 
genshaders.sh 

694 
gfx2d.sln 

1494 
gfx2d.vcxproj 

6646 
GradientStopsD2D.h 
MOZILLA_GFX_GRADIENTSTOPSD2D_H_ 
1210 
Helpers.h 

1775 
HelpersCairo.h 

10055 
HelpersD2D.h 

31720 
HelpersSkia.h 

12226 
HelpersWinFonts.h 

928 
ImageScaling.cpp 
The surface we sample from might not be even sized, if it's not we will
ignore the last row/column. This means we lose some data but it keeps the
code very simple. There's also no perfect answer that provides a better
solution.

8022 
ImageScaling.h 

3079 
ImageScalingSSE2.cpp 
The functions below use the following system for averaging 4 pixels:
The first observation is that a halfadder is implemented as follows:
R = S + 2C or in the case of a and b (a ^ b) + ((a & b) << 1);
This can be trivially extended to three pixels by observaring that when
doing (a ^ b ^ c) as the sum, the carry is simply the bitwiseor of the
carries of the individual numbers, since the sum of 3 bits can only ever
have a carry of one.
We then observe that the average is then ((carry << 1) + sum) >> 1, or,
assuming eliminating overflows and underflows, carry + (sum >> 1).
We now average our existing sum with the fourth number, so we get:
sum2 = (sum + d) >> 1 or (sum >> 1) + (d >> 1).
We now observe that our sum has been moved into place relative to the
carry, so we can now average with the carry to get the final 4 input
average: avg = (sum2 + carry) >> 1;
Or to reverse the proof:
avg = ((sum >> 1) + carry + d >> 1) >> 1
avg = ((a + b + c) >> 1 + d >> 1) >> 1
avg = ((a + b + c + d) >> 2)
An additional fact used in the SSE versions is the concept that we can
trivially convert a rounded average to a truncated average:
We have:
f(a, b) = (a + b + 1) >> 1
And want:
g(a, b) = (a + b) >> 1
Observe:
~f(~a, ~b) == ~((~a + ~b + 1) >> 1)
== ~((a  1 + b  1 + 1) >> 1)
== ~((a  1 + b) >> 1)
== ~(((a + b)  1) >> 1)
== ~((~(a + b)) >> 1)
== (a + b) >> 1
== g(a, b)

12890 
InlineTranslator.cpp 

3238 
InlineTranslator.h 

5809 
IterableArena.h 

5074 
Logging.h 

29340 
LoggingConstants.h 
MOZILLA_GFX_LOGGING_CONSTANTS_H_ 
1004 
LuminanceNEON.cpp 
Byte offsets of channels in a native packed gfxColor or cairo image surface.

3320 
LuminanceNEON.h 
__LUMINANCENEON_H__ 
770 
MacIOSurface.cpp 
static 
24075 
MacIOSurface.h 

6404 
Matrix.cpp 
Force small values to zero. We do this to avoid having sin(360deg)
evaluate to a tiny but nonzero value.

5818 
Matrix.h 
In most cases you probably want to use TransformBounds. This function
just transforms the topleft and size separately and constructs a rect
from those results.

77911 
MatrixFwd.h 

1132 
MMIHelpers.h 
============================================================================
Name : MMIHelpers.h
Author : Heiher <r@hev.cc>
Version : 0.0.1
Copyright : Copyright (c) 2015 everyone.
Description : The helpers for x86 SSE to Loongson MMI.
============================================================================

8381 
moz.build 

6257 
NativeFontResource.cpp 

1940 
NativeFontResourceDWrite.cpp 
Important! Note the key here has to be a uint64_t that will have been
generated by incrementing sNextFontFileKey.

8364 
NativeFontResourceDWrite.h 
Creates a NativeFontResourceDWrite if data is valid. Note aFontData will be
copied if required and so can be released after calling.
@param aFontData the SFNT data.
@param aDataLength length of data.
@return Referenced NativeFontResourceDWrite or nullptr if invalid.

2015 
NativeFontResourceFreeType.cpp 

3331 
NativeFontResourceFreeType.h 

2585 
NativeFontResourceGDI.cpp 
static 
1663 
NativeFontResourceGDI.h 
Creates a NativeFontResourceGDI if data is valid. Note aFontData will be
copied if required and so can be released after calling.
@param aFontData the SFNT data.
@param aDataLength length of data.
@return Referenced NativeFontResourceGDI or nullptr if invalid.

1663 
NativeFontResourceMac.cpp 
static 
5398 
NativeFontResourceMac.h 

1530 
NumericTools.h 
MOZILLA_GFX_NUMERICTOOLS_H_ 
1276 
Path.cpp 

18118 
PathAnalysis.h 

1540 
PathCairo.cpp 

9066 
PathCairo.h 
MOZILLA_GFX_PATH_CAIRO_H_ 
3091 
PathD2D.cpp 
Should never be called! 
11964 
PathD2D.h 
MOZILLA_GFX_PATHD2D_H_ 
3462 
PathHelpers.cpp 

9951 
PathHelpers.h 
Draws a partial arc <= 90 degrees given exact start and end points.
Assumes that it is continuing from an already specified start point.

14760 
PathRecording.cpp 

7528 
PathRecording.h 
Move the current point in the path, any figure currently being drawn will
be considered closed during fill operations, however when stroking the
closing line segment will not be drawn.

6998 
PathSkia.cpp 

7976 
PathSkia.h 
MOZILLA_GFX_PATH_SKIA_H_ 
3139 
PatternHelpers.h 
This class is used to allow general pattern creation functions to return
any type of pattern via an outparamater without allocating a pattern
instance on the freestore (an instance of this class being created on the
stack before passing it in to the creation function). Without this class
writing pattern creation functions would be a pain since Pattern objects are
not reference counted, making lifetime management of instances created on
the freestore and returned from a creation function hazardous. Besides
that, in the case that ColorPattern's are expected to be common, it is
particularly desirable to avoid the overhead of allocating on the
freestore.

5173 
Point.h 

13514 
Polygon.h 
Calculates the w = 0 intersection point for the edge defined by
aFirst and aSecond.

12320 
QuartzSupport.h 
Render the CALayer to an IOSurface. If no IOSurface
is attached then an internal pixel buffer will be
used.

3797 
QuartzSupport.mm 

20707 
Quaternion.cpp 

723 
Quaternion.h 

3867 
RadialGradientEffectD2D1.cpp 

12463 
RadialGradientEffectD2D1.h 

3572 
RecordedEvent.cpp 
static 
6336 
RecordedEvent.h 
Get GradientStops compatible with the translation DrawTarget type.
@param aRawStops array of raw gradient stops required
@param aNumStops length of aRawStops
@param aExtendMode extend mode required
@return an already addrefed GradientStops for our DrawTarget type

15461 
RecordedEventImpl.h 

123938 
RecordingTypes.h 
MOZILLA_GFX_RECORDINGTYPES_H_ 
2181 
Rect.h 

17501 
RectAbsolute.h 
A RectAbsolute is similar to a Rect (see BaseRect.h), but represented as
(x1, y1, x2, y2) instead of (x, y, width, height).
Unless otherwise indicated, methods on this class correspond
to methods on BaseRect.
The API is currently very barebones; it may be extended as needed.
Do not use this class directly. Subclass it, pass that subclass as the
Sub parameter, and only use that subclass.

11653 
Scale.cpp 

1419 
Scale.h 
Scale an image using a highquality filter.
Synchronously scales an image and writes the output to the destination in
32bit format. The destination must be preallocated by the caller.
Returns true if scaling was successful, and false otherwise. Currently, this
function is implemented using Skia. If Skia is not enabled when building,
calling this function will always return false.
IMPLEMTATION NOTES:
This API is not currently easily hardware acceleratable. A better API might
take a SourceSurface and return a SourceSurface; the Direct2D backend, for
example, could simply set a status bit on a copy of the image, and use
Direct2D's highquality scaler at draw time.

1499 
ScaledFontBase.cpp 

6752 
ScaledFontBase.h 
MOZILLA_GFX_SCALEDFONTBASE_H_ 
1951 
ScaledFontDWrite.cpp 

22977 
ScaledFontDWrite.h 
MOZILLA_GFX_SCALEDFONTDWRITE_H_ 
3531 
ScaledFontFontconfig.cpp 

18383 
ScaledFontFontconfig.h 
MOZILLA_GFX_SCALEDFONTFONTCONFIG_H_ 
2764 
ScaledFontFreeType.cpp 

4557 
ScaledFontFreeType.h 
MOZILLA_GFX_SCALEDFONTCAIRO_H_ 
2170 
ScaledFontMac.cpp 

27630 
ScaledFontMac.h 
MOZILLA_GFX_SCALEDFONTMAC_H_ 
3387 
ScaledFontWin.cpp 

3950 
ScaledFontWin.h 
MOZILLA_GFX_SCALEDFONTWIN_H_ 
1328 
ScaleFactor.h 
This class represents a scaling factor between two different pixel unit
systems. This is effectively a typesafe float, intended to be used in
combination with the knowntype instances of gfx::Point, gfx::Rect, etc.
This class is meant to be used in cases where a single scale applies to
both the x and y axes. For cases where two diferent scales apply, use
ScaleFactors2D.

2908 
ScaleFactors2D.h 
This class is like ScaleFactor, but allows different scales on the x and
y axes.

7121 
SFNTData.cpp 
static 
5863 
SFNTData.h 
Creates an SFNTData if the header is a format that we understand and
aDataLength is sufficient for the length information in the header data.
Note that the data is NOT copied, so must exist the SFNTData's lifetime.
@param aFontData the SFNT data.
@param aDataLength length
@return UniquePtr to a SFNTData or nullptr if the header is invalid.

1751 
ShadersD2D.fx 

26023 
ShadersD2D.h 
21 
654572 
ShadersD2D1.h 

67167 
ShadersD2D1.hlsl 

6338 
SIMD.h 
Consumers of this file need to #define SIMD_COMPILE_SSE2 before including it
if they want access to the SSE2 functions.

34576 
SourceSurfaceCairo.cpp 
= nullptr 
3990 
SourceSurfaceCairo.h 

2240 
SourceSurfaceD2D1.cpp 

6809 
SourceSurfaceD2D1.h 
MOZILLA_GFX_SOURCESURFACED2D2TARGET_H_ 
3184 
SourceSurfaceRawData.cpp 
actually an object count 
2403 
SourceSurfaceRawData.h 
MOZILLA_GFX_SOURCESURFACERAWDATA_H_ 
4204 
SourceSurfaceSkia.cpp 

6411 
SourceSurfaceSkia.h 
The caller is responsible for ensuring aMappedSurface is not null.

2066 
SSEHelpers.h 
Before Nehalem _mm_loadu_si128 could be very slow, this trick is a little
faster. Once enough people are on architectures where _mm_loadu_si128 is
fast we can migrate to it.

848 
ssse3scaler.c 
This has been adapted from the ssse3 code from pixman. It's currently
a mess as I want to try it out in practice before finalizing the details.

16893 
ssse3scaler.h 

814 
StackArray.h 
A handy class that will allocate data for size*T objects on the stack and
otherwise allocate them on the heap. It is similar in purpose to AutoTArray

959 
SVGTurbulenceRendererinl.h 
The turbulence calculation code is an adapted version of what
appears in the SVG 1.1 specification:
http://www.w3.org/TR/SVG11/filters.html#feTurbulence

13296 
Swizzle.cpp 
Convenience macros for dispatching to various format combinations.

64516 
Swizzle.h 
Premultiplies source and writes it to destination. Source and destination may
be the same to premultiply inplace. The source format must have an alpha
channel.

4250 
SwizzleAVX2.cpp 

3274 
SwizzleNEON.cpp 

18433 
SwizzleSSE2.cpp 

16370 
SwizzleSSSE3.cpp 

2219 
Tools.h 

6069 
Triangle.h 
A simple triangle data structure.

1771 
Types.cpp 

2514 
Types.h 
Data surface  bitmap in memory 
31029 
unittest 


UnscaledFontDWrite.h 
MOZILLA_GFX_UNSCALEDFONTDWRITE_H_ 
2022 
UnscaledFontFreeType.cpp 

7858 
UnscaledFontFreeType.h 
MOZILLA_GFX_UNSCALEDFONTFREETYPE_H_ 
4326 
UnscaledFontGDI.h 
MOZILLA_GFX_UNSCALEDFONTGDI_H_ 
1520 
UnscaledFontMac.h 
MOZILLA_GFX_UNSCALEDFONTMAC_H_ 
3124 
UserData.h 
this class is basically a clone of the user data concept from cairo 
5612 