Name Description Size Coverage
2D.h This structure is used to send draw options that are universal to all drawing operations. 90084 70 %
AutoHelpersWin.h 1490 0 %
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*'. 3287 100 %
BaseMargin.h Sides represents a set of physical sides. 5380 96 %
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*'. 3929 100 %
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*'. 3519 74 %
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*'. 3266 100 %
BaseRect.h Rectangles have two interpretations: a set of (zero-size) 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 zero-width and zero-height rectangles are equal to each other since they represent the empty area. But when a rectangle represents a set of mathematical points, zero-width and zero-height rectangles can be unequal. -- The union operation can behave differently. When rectangles represent areas, taking the union of a zero-width or zero-height 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 zero-width or zero-height 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. 27943 99 %
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*'. 3289 98 %
BezierUtils.cpp 10924 78 %
BezierUtils.h 5372 100 %
BigEndianInts.h 1559 100 %
Blur.cpp 12647 71 %
Blur.h Implementation 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. This is a "service" class; the constructors set up all the information based on the values. 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. 6117 100 %
BorrowedContext.h This is a helper class that let's you borrow a CGContextRef from a DrawTargetCG. This is used for drawing themed widgets. Callers should check the cg member after constructing the object to see if it succeeded. The DrawTarget should not be used while the context is borrowed. 2082 -
BufferEdgePad.cpp 3387 0 %
BufferEdgePad.h 570 -
BufferUnrotate.cpp 2306 100 %
BufferUnrotate.h 568 -
ConvolutionFilter.cpp 4577 41 %
ConvolutionFilter.h MOZILLA_GFX_CONVOLUTION_FILTER_H_ 1510 50 %
ConvolutionFilterAVX2.cpp 4851 100 %
ConvolutionFilterNEON.cpp hasAlpha 11832 -
ConvolutionFilterSSE2.cpp hasAlpha 12787 37 %
Coord.h 7330 100 %
CriticalSection.h 1689 68 %
DataSourceSurface.cpp 557 100 %
DataSourceSurfaceWrapper.h MOZILLA_GFX_DATASOURCESURFACEWRAPPER_H_ 1639 60 %
DataSurfaceHelpers.cpp 11242 56 %
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. 4916 -
DrawEventRecorder.cpp 5906 73 %
DrawEventRecorder.h This is a combination of HasStoredObject and AddStoredObject, so that we only have to call ProcessPendingDeletions once, which involves locking. @param aObject the object to store if not already stored @return true if the object was not already stored, false if it was 10855 82 %
DrawEventRecorderTypes.h MOZILLA_GFX_DRAWEVENTRECORDERTYPES_H_ 821 -
DrawTarget.cpp Byte offsets of channels in a native packed gfxColor or cairo image surface. 13728 48 %
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. 68330 48 %
DrawTargetCairo.h 9770 45 %
DrawTargetOffset.cpp 8886 90 %
DrawTargetOffset.h Not implemented 8066 57 %
DrawTargetRecording.cpp 36443 90 %
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 18412 95 %
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. 75365 79 %
DrawTargetSkia.h 9246 100 %
DWriteSettings.cpp static 5547 47 %
DWriteSettings.h 962 -
Factory.cpp 39124 72 %
FilterNodeSoftware.cpp This class provides a way to get a pow() results in constant-time. It works by caching 257 ((1 << sCacheIndexPrecisionBits) + 1) values for bases between 0 and 1 and a fixed exponent. 126492 90 %
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. 30081 50 %
FilterProcessing.cpp 6265 78 %
FilterProcessing.h 8792 67 %
FilterProcessingScalar.cpp 8511 0 %
FilterProcessingSIMD-inl.h 52228 95 %
FilterProcessingSSE2.cpp 4012 100 %
Filters.h 13812 8 %
FontFeature.h 918 100 %
FontVariation.h MOZILLA_GFX_FONTVARIATION_H_ 695 100 %
GenericRefCounted.h Common base class for GenericRefCounted and GenericAtomicRefCounted. Having this shared base class, common to both the atomic and non-atomic cases, allows to have RefPtr's that don't care about whether the objects they're managing have atomic refcounts or not. 3657 94 %
gfx2d.sln 1494 -
gfx2d.vcxproj 5838 -
Helpers.h 1654 100 %
HelpersCairo.h 10218 47 %
HelpersSkia.h 12712 81 %
HelpersWin.h MOZILLA_GFX_HELPERSWIN_H_ 1032 67 %
HelpersWinFonts.h 914 67 %
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. 7937 56 %
ImageScaling.h 2938 100 %
ImageScalingSSE2.cpp The functions below use the following system for averaging 4 pixels: The first observation is that a half-adder 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 bitwise-or 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) 12769 76 %
InlineTranslator.cpp 2573 64 %
InlineTranslator.h 6101 91 %
IterableArena.h 4916 87 %
Logging.h 30738 45 %
LoggingConstants.h MOZILLA_GFX_LOGGING_CONSTANTS_H_ 883 -
LuminanceNEON.cpp Byte offsets of channels in a native packed gfxColor or cairo image surface. 3199 -
LuminanceNEON.h LUMINANCENEON_H_ 640 -
MacIOSurface.cpp static 27590 -
MacIOSurface.h 6787 -
Matrix.cpp Force small values to zero. We do this to avoid having sin(360deg) evaluate to a tiny but nonzero value. 5676 98 %
Matrix.h In most cases you probably want to use TransformBounds. This function just transforms the top-left and size separately and constructs a rect from those results. 81971 94 %
MatrixFwd.h 1011 -
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. ============================================================================ 8384 -
moz.build 5439 -
NativeFontResource.cpp 1819 100 %
NativeFontResourceDWrite.cpp Important! Note the key here has to be a uint64_t that will have been generated by incrementing sNextFontFileKey. 8277 74 %
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. 1900 100 %
NativeFontResourceFreeType.cpp 3296 86 %
NativeFontResourceFreeType.h 2482 -
NativeFontResourceGDI.cpp static 1556 0 %
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. 1471 0 %
NativeFontResourceMac.cpp static 5246 -
NativeFontResourceMac.h 1366 -
NumericTools.h MOZILLA_GFX_NUMERICTOOLS_H_ 1307 100 %
Path.cpp 18169 85 %
PathAnalysis.h 1838 100 %
PathCairo.cpp 9362 33 %
PathCairo.h MOZILLA_GFX_PATH_CAIRO_H_ 3137 50 %
PathHelpers.cpp 10508 83 %
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. 14535 82 %
PathRecording.cpp 14531 81 %
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. 7733 94 %
PathSkia.cpp 9536 84 %
PathSkia.h MOZILLA_GFX_PATH_SKIA_H_ 3638 100 %
PatternHelpers.h This class is used to allow general pattern creation functions to return any type of pattern via an out-paramater without allocating a pattern instance on the free-store (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 free-store 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 free-store. 5049 86 %
Point.h 14527 87 %
Polygon.h Calculates the w = 0 intersection point for the edge defined by |aFirst| and |aSecond|. 12199 93 %
Quaternion.cpp 581 0 %
Quaternion.h 3683 37 %
RecordedEvent.cpp static 6741 22 %
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 18943 83 %
RecordedEventImpl.h 143104 72 %
RecordingTypes.h MOZILLA_GFX_RECORDINGTYPES_H_ 2926 91 %
Rect.h 20728 96 %
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 bare-bones; 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. 11532 85 %
Scale.h Scale an image using a high-quality filter. Synchronously scales an image and writes the output to the destination in 32-bit format. The destination must be pre-allocated 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 high-quality scaler at draw time. 1425 -
ScaledFontBase.cpp 6893 61 %
ScaledFontBase.h MOZILLA_GFX_SCALEDFONTBASE_H_ 1830 29 %
ScaledFontDWrite.cpp 22004 67 %
ScaledFontDWrite.h MOZILLA_GFX_SCALEDFONTDWRITE_H_ 3016 100 %
ScaledFontFontconfig.cpp 17733 73 %
ScaledFontFontconfig.h MOZILLA_GFX_SCALEDFONTFONTCONFIG_H_ 2643 100 %
ScaledFontFreeType.cpp 4391 -
ScaledFontFreeType.h MOZILLA_GFX_SCALEDFONTCAIRO_H_ 2049 -
ScaledFontMac.cpp 28984 -
ScaledFontMac.h MOZILLA_GFX_SCALEDFONTMAC_H_ 3345 -
ScaledFontWin.cpp 3839 0 %
ScaledFontWin.h MOZILLA_GFX_SCALEDFONTWIN_H_ 1207 0 %
ScaleFactor.h This class represents a scaling factor between two different pixel unit systems. This is effectively a type-safe float, intended to be used in combination with the known-type 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. 2754 93 %
ScaleFactors2D.h This class is like ScaleFactor, but allows different scales on the x and y axes. 6968 88 %
SFNTData.cpp static 6201 67 %
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. 1637 100 %
SIMD.h Consumers of this file need to #define SIMD_COMPILE_SSE2 before including it if they want access to the SSE2 functions. 34452 32 %
SkConvolver.cpp 26560 31 %
SkConvolver.h 6126 82 %
SourceSurfaceCairo.cpp = nullptr 3869 93 %
SourceSurfaceCairo.h 2116 75 %
SourceSurfaceD3D11.cpp static 2028 83 %
SourceSurfaceD3D11.h MOZILLA_GFX_SourceSurfaceD3D11_H_ 1836 25 %
SourceSurfaceRawData.cpp static 3742 76 %
SourceSurfaceRawData.h MOZILLA_GFX_SOURCESURFACERAWDATA_H_ 4045 100 %
SourceSurfaceSkia.cpp 7431 80 %
SourceSurfaceSkia.h The caller is responsible for ensuring aMappedSurface is not null. 2027 100 %
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. 819 100 %
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 945 69 %
SVGTurbulenceRenderer-inl.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 13312 99 %
Swizzle.cpp Convenience macros for dispatching to various format combinations. 64395 71 %
Swizzle.h Premultiplies source and writes it to destination. Source and destination may be the same to premultiply in-place. The source format must have an alpha channel. 4129 -
SwizzleAVX2.cpp 3153 100 %
SwizzleNEON.cpp 18312 -
SwizzleSSE2.cpp 16249 100 %
SwizzleSSSE3.cpp 2098 100 %
Tools.h 6036 82 %
Triangle.h A simple triangle data structure. 1650 100 %
Types.cpp 2987 6 %
Types.h Data surface - bitmap in memory 35846 79 %
unittest 99 %
UnscaledFontDWrite.h MOZILLA_GFX_UNSCALEDFONTDWRITE_H_ 1956 100 %
UnscaledFontFreeType.cpp 7737 72 %
UnscaledFontFreeType.h MOZILLA_GFX_UNSCALEDFONTFREETYPE_H_ 4205 94 %
UnscaledFontGDI.h MOZILLA_GFX_UNSCALEDFONTGDI_H_ 1399 0 %
UnscaledFontMac.h MOZILLA_GFX_UNSCALEDFONTMAC_H_ 3296 -
UserData.h this class is basically a clone of the user data concept from cairo 5491 86 %