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

76353 
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*'.

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

4919 
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*'.

3332 
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.

24894 
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 

10386 
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 a cairo_t from a
DrawTargetCairo. This is used for drawing themed widgets.
Callers should check the cr member after constructing the object
to see if it succeeded. The DrawTarget should not be used while
the context is borrowed. 
5922 
BufferEdgePad.cpp 

3508 
BufferEdgePad.h 

691 
BufferUnrotate.cpp 

2485 
BufferUnrotate.h 

697 
CGTextDrawing.h 

5600 
CaptureCommandList.cpp 

734 
CaptureCommandList.h 

4093 
ConicGradientEffectD2D1.cpp 

11570 
ConicGradientEffectD2D1.h 

3556 
ConvolutionFilter.cpp 

7627 
ConvolutionFilter.h 
MOZILLA_GFX_CONVOLUTION_FILTER_H_ 
1455 
Coord.h 

5391 
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 
DrawCommand.h 
MOZILLA_GFX_DRAWCOMMAND_H_ 
1431 
DrawCommands.h 

29351 
DrawEventRecorder.cpp 

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

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

9989 
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.

72644 
DrawTargetCairo.h 

9745 
DrawTargetCapture.cpp 

14346 
DrawTargetCapture.h 

8008 
DrawTargetD2D1.cpp 

79786 
DrawTargetD2D1.h 

13303 
DrawTargetDual.cpp 
This only needs to split patterns up for SurfacePatterns. Only in that
case can we be dealing with a 'dual' source (SourceSurfaceDual) and do
we need to pass separate patterns into our destination DrawTargets.

7858 
DrawTargetDual.h 
This is a special type of DrawTarget. It duplicates all drawing calls
accross two drawtargets. An exception to this is when a snapshot of another
dual DrawTarget is used as the source for any surface data. In this case
the snapshot of the first source DrawTarget is used as a source for the call
to the first destination DrawTarget (mA) and the snapshot of the second
source DrawTarget is used at the source for the second destination
DrawTarget (mB). This class facilitates blackbackground/whitebackground
drawing for percomponent alpha extraction for backends which do not support
native component alpha.

7600 
DrawTargetOffset.cpp 

8614 
DrawTargetOffset.h 
Not implemented 
8338 
DrawTargetRecording.cpp 

26090 
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

15260 
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.

69725 
DrawTargetSkia.h 

8727 
DrawTargetTiled.cpp 

17625 
DrawTargetTiled.h 
Not implemented 
9150 
DrawTargetWrapAndRecord.cpp 

28261 
DrawTargetWrapAndRecord.h 
Ensure that the DrawTarget backend has flushed all drawing operations to
this draw target. This must be called before using the backing surface of
this draw target outside of GFX 2D code.

13599 
ExtendInputEffectD2D1.cpp 

6078 
ExtendInputEffectD2D1.h 

3299 
Factory.cpp 

41439 
FilterNodeCapture.cpp 

2694 
FilterNodeCapture.h 

3996 
FilterNodeD2D1.cpp 

41371 
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.

125565 
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.

30184 
FilterProcessing.cpp 

11111 
FilterProcessing.h 

11531 
FilterProcessingSIMDinl.h 

57584 
FilterProcessingSSE2.cpp 

5672 
FilterProcessingScalar.cpp 

12622 
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 
GradientStopsD2D.h 
MOZILLA_GFX_GRADIENTSTOPSD2D_H_ 
1210 
Helpers.h 

1775 
HelpersCairo.h 

10055 
HelpersD2D.h 

31690 
HelpersSkia.h 

11211 
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 

4058 
InlineTranslator.h 

5926 
IterableArena.h 

5074 
Logging.h 

29446 
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 
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 
MacIOSurface.cpp 
static 
19855 
MacIOSurface.h 

5750 
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.

76484 
MatrixFwd.h 

1132 
NativeFontResource.cpp 

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

8348 
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 

3352 
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 

17967 
PathAnalysis.h 

1540 
PathCairo.cpp 

9066 
PathCairo.h 
MOZILLA_GFX_PATH_CAIRO_H_ 
3091 
PathCapture.cpp 

6876 
PathCapture.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.

3830 
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 

6234 
PathSkia.h 
MOZILLA_GFX_PATH_SKIA_H_ 
3004 
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 

12820 
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 

12427 
RadialGradientEffectD2D1.h 

3572 
RecordedEvent.cpp 
static 
5170 
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

14960 
RecordedEventImpl.h 

119904 
RecordingTypes.h 
MOZILLA_GFX_RECORDINGTYPES_H_ 
2181 
Rect.h 

17136 
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.

11652 
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 
SIMD.h 
Consumers of this file need to #define SIMD_COMPILE_SSE2 before including it
if they want access to the SSE2 functions.

34576 
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 
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 
Scale.cpp 

1491 
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 
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.

5051 
ScaledFontBase.cpp 

7111 
ScaledFontBase.h 
MOZILLA_GFX_SCALEDFONTBASE_H_ 
2220 
ScaledFontDWrite.cpp 

24524 
ScaledFontDWrite.h 
MOZILLA_GFX_SCALEDFONTDWRITE_H_ 
4507 
ScaledFontFontconfig.cpp 

17423 
ScaledFontFontconfig.h 
MOZILLA_GFX_SCALEDFONTFONTCONFIG_H_ 
2780 
ScaledFontFreeType.cpp 

6761 
ScaledFontFreeType.h 
MOZILLA_GFX_SCALEDFONTCAIRO_H_ 
2186 
ScaledFontMac.cpp 

26744 
ScaledFontMac.h 
MOZILLA_GFX_SCALEDFONTMAC_H_ 
3144 
ScaledFontWin.cpp 

4072 
ScaledFontWin.h 
MOZILLA_GFX_SCALEDFONTWIN_H_ 
1297 
ShadersD2D.fx 

26023 
ShadersD2D.h 
21 
654572 
ShadersD2D1.h 

67167 
ShadersD2D1.hlsl 

6338 
SourceSurfaceCairo.cpp 
= nullptr 
3990 
SourceSurfaceCairo.h 

2240 
SourceSurfaceCapture.cpp 
= LuminanceType::LINEARRGB 
6757 
SourceSurfaceCapture.h 

2510 
SourceSurfaceD2D1.cpp 

6885 
SourceSurfaceD2D1.h 
MOZILLA_GFX_SOURCESURFACED2D2TARGET_H_ 
3184 
SourceSurfaceDual.h 
MOZILLA_GFX_SOURCESURFACEDUAL_H_ 
1746 
SourceSurfaceRawData.cpp 
actually an object count 
2796 
SourceSurfaceRawData.h 
MOZILLA_GFX_SOURCESURFACERAWDATA_H_ 
4344 
SourceSurfaceSkia.cpp 

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

2442 
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 
Swizzle.cpp 
Convenience macros for dispatching to various format combinations.

54448 
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.

2715 
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 

2158 
Types.h 
Data surface  bitmap in memory 
20516 
UnscaledFontDWrite.h 
MOZILLA_GFX_UNSCALEDFONTDWRITE_H_ 
2022 
UnscaledFontFreeType.cpp 

5590 
UnscaledFontFreeType.h 
MOZILLA_GFX_UNSCALEDFONTFREETYPE_H_ 
4201 
UnscaledFontGDI.h 
MOZILLA_GFX_UNSCALEDFONTGDI_H_ 
1520 
UnscaledFontMac.h 
MOZILLA_GFX_UNSCALEDFONTMAC_H_ 
2888 
UserData.h 
this class is basically a clone of the user data concept from cairo 
3551 
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.

5312 
genshaders.sh 

694 
gfx2d.sln 

1494 
gfx2d.vcxproj 

6646 
moz.build 

6608 
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.

16915 
ssse3scaler.h 

814 
unittest 

17 