Name Description Size
Sk4px.h 8880
SkAAClip.cpp Data runs are packed [count, alpha] 57265
SkAAClip.h Allocates a mask the size of the aaclip, and expands its data into the mask, using kA8_Format. Used for tests and visualization purposes. 3513
SkAdvancedTypefaceMetrics.h \class SkAdvancedTypefaceMetrics The SkAdvancedTypefaceMetrics class is used by the PDF backend to correctly embed typefaces. This class is created and filled in with information by SkTypeface::getAdvancedMetrics. 2918
SkAlphaRuns.cpp 1763
SkAlphaRuns.h Sparse array of run-length-encoded alpha (supersampling coverage) values. Sparseness allows us to independently compose several paths into the same SkAlphaRuns buffer. 6127
SkAnalyticEdge.cpp 29097
SkAnalyticEdge.h 4826
SkAnnotation.cpp 1432
SkAnnotationKeys.h Returns the canonical key whose payload is a URL 728
SkATrace.cpp 3104
SkATrace.h This class is used to support ATrace in android apps. It hooks into the SkEventTracer system. It currently supports the macros TRACE_EVENT*, TRACE_EVENT_INSTANT*, and TRACE_EVENT_BEGIN/END*. For versions of these calls that take additoinal args and value pairs we currently just drop them and report only the name. Since ATrace is a simple push and pop system (all traces are fully nested), if using BEGIN and END you should also make sure your calls are properly nested (i.e. if startA is before startB, then endB is before endA). 2225
SkAutoBlitterChoose.h 2466
SkAutoPixmapStorage.cpp 2047
SkAutoPixmapStorage.h Leave the moved-from object in a free-but-valid state. 2795
SkBBHFactory.cpp 478
SkBigPicture.cpp 2473
SkBigPicture.h 2370
SkBitmap.cpp 22409
SkBitmapCache.cpp Use this for bitmapcache and mipmapcache entries. 10015
SkBitmapCache.h Search based on the desc. If found, returns true and result will be set to the matching bitmap with its pixels already locked. 1932
SkBitmapDevice.cpp 26572
SkBitmapDevice.h Construct a new device with the specified bitmap as its backend. It is valid for the bitmap to have no pixels associated with it. In that case, any drawing to this device will have no effect. 5926
SkBitmapProcState.cpp 22887
SkBitmapProcState.h Given the byte size of the index buffer to be passed to the matrix proc, return the maximum number of resulting pixels that can be computed (i.e. the number of SkPMColor values to be written by the sample proc). This routine takes into account that filtering and scale-vs-affine affect the amount of buffer space needed. Only valid to call after chooseProcs (setContext) has been called. It is safe to call this inside the shader's shadeSpan() method. 8635
SkBitmapProcState_matrixProcs.cpp The decal_ functions require that 1. dx > 0 2. [fx, fx+dx, fx+2dx, fx+3dx, ... fx+(count-1)dx] are all <= maxX In addition, we use SkFixed3232 to keep more precision than just SkFixed, so we will abort the decal_ call if dx is very small, since the decal_ function just operates on SkFixed. If that were changed, we could skip the very_small test here. 19421
SkBitmapProcState_opts.cpp 1349
SkBitmapProcState_opts_lasx.cpp 1048
SkBitmapProcState_opts_ssse3.cpp 997
SkBlenderBase.h Encapsulates a blend function, including non-public APIs. Blends combine a source color (the result of our paint) and destination color (from the canvas) into a final color. 2133
SkBlendMode.cpp 11000
SkBlendModeBlender.cpp 3859
SkBlendModeBlender.h 961
SkBlendModePriv.h Sentinel value for SkBlendMode enum. Will never be a valid enum value, but will be storable in a byte. 1324
SkBlitBWMaskTemplate.h SK_BLITBWMASK_NAME name of function(const SkPixmap& dstPixmap, const SkMask& mask, const SkIRect& clip, SK_BLITBWMASK_ARGS) SK_BLITBWMASK_ARGS list of additional arguments to SK_BLITBWMASK_NAME, beginning with a comma SK_BLITBWMASK_BLIT8 name of function(U8CPU byteMask, SK_BLITBWMASK_DEVTYPE* dst, int x, int y) SK_BLITBWMASK_GETADDR either writable_addr[8,16,32] SK_BLITBWMASK_DEVTYPE either U32 or U16 or U8 4384
SkBlitMask.h 572
SkBlitMask_opts.cpp 1032
SkBlitMask_opts_ssse3.cpp 962
SkBlitRow.h Function pointer that blends 32bit colors onto a 32bit destination. @param dst array of dst 32bit colors @param src array of src 32bit colors (w/ or w/o alpha) @param count number of colors to blend @param alpha global alpha to be applied to all src colors 1340
SkBlitRow_D32.cpp 19908
SkBlitRow_opts.cpp 1276
SkBlitRow_opts_hsw.cpp 1015
SkBlitRow_opts_lasx.cpp 1094
SkBlitter.cpp 27020
SkBlitter.h SkBlitter and its subclasses are responsible for actually writing pixels into memory. Besides efficiency, they handle clipping and antialiasing. A SkBlitter subclass contains all the context needed to generate pixels for the destination and how src/generated pixels map to the destination. The coordinates passed to the blitX calls are in destination pixel space. 10975
SkBlitter_A8.cpp 9499
SkBlitter_A8.h ignored 1828
SkBlitter_ARGB32.cpp We want all of these in 5bits, hence the shifts in case one of them (green) is 6bits. 87773
SkBlitter_Sprite.cpp 8802
SkBlurEngine.cpp 73683
SkBlurEngine.h SkBlurEngine is a backend-agnostic provider of blur algorithms. Each Skia backend defines a blur engine with a set of supported algorithms and/or implementations. A given implementation may be optimized for a particular color type, sigma range, or available hardware. Each engine and its algorithms are assumed to operate only on SkImages corresponding to its Skia backend, and will produce output SkImages of the same type. Algorithms are allowed to specify a maximum supported sigma. If the desired sigma is higher than this, the input image and output region must be downscaled by the caller before invoking the algorithm. This is to provide the most flexibility for input representation (e.g. directly rasterize at half resolution or apply deferred filter effects during the first downsample pass). skif::FilterResult::Builder::blur() is a convenient wrapper around the blur engine and automatically handles resizing. 15487
SkBlurMask.cpp 24877
SkBlurMask.h Helper functions for analytic rectangle blurs 4557
SkBlurMaskFilterImpl.cpp 23959
SkBlurMaskFilterImpl.h 2769
SkCachedData.cpp 4717
SkCachedData.h Attaching a data to to a SkResourceCache (only one at a time) enables the data to be unlocked when the cache is the only owner, thus freeing it to be purged (assuming the data is backed by a SkDiscardableMemory). When attached, it also automatically attempts to "lock" the data when the first client ref's the data (typically from a find(key, visitor) call). Thus the data will always be "locked" when a non-cache has a ref on it (whether or not the lock succeeded to recover the memory -- check data() to see if it is nullptr). 3436
SkCanvas.cpp Return true if the drawing this rect would hit every pixels in the canvas. Returns false if - rect does not contain the canvas' bounds - paint is not fill - paint would blur or otherwise change the coverage of the rect 119091
SkCanvas_Raster.cpp 1780
SkCanvasPriv.cpp 13144
SkCanvasPriv.h This constant is trying to balance the speed of ref'ing a subpicture into a parent picture, against the playback cost of recursing into the subpicture to get at its actual ops. For now we pick a conservatively small value, though measurement (and other heuristics like the type of ops contained) may justify changing this value. 7072
SkCapabilities.cpp 618
SkChecksum.cpp 3544
SkChecksum.h Our hash functions are exposed as SK_SPI (e.g. SkParagraph) 3969
SkClipStack.cpp 34597
SkClipStack.h An element of the clip stack. It represents a shape combined with the prevoius clip using a set operator. Each element can be antialiased or not. 19860
SkClipStackDevice.cpp doAA= 4301
SkClipStackDevice.h 1779
SkColor.cpp 4943
SkColorData.h See ITU-R Recommendation BT.709 at http://www.itu.int/rec/R-REC-BT.709/ . 14007
SkColorFilter.cpp 2469
SkColorFilterPriv.h 1242
SkColorPriv.h Turn 0..255 into 0..256 by adding 1 at the half-way point. Used to turn a byte into a scale value, so that we can say scale * value >> 8 instead of alpha * value / 255. In debugging, asserts that alpha is 0..255 5339
SkColorSpace.cpp 17867
SkColorSpacePriv.h 2730
SkColorSpaceXformSteps.cpp 11343
SkColorSpaceXformSteps.h 2146
SkColorTable.cpp 1599
SkCompressedDataUtils.cpp 0 11153
SkCompressedDataUtils.h Returns the data size for the given SkTextureCompressionType 1613
SkContourMeasure.cpp if the dash as a zero-length on segment, add a corresponding zero-length line. The stroke code will add end caps to zero length lines as appropriate 26542
SkConvertPixels.cpp 10832
SkConvertPixels.h 454
SkCoreBlitters.h The storage for shaderContext is owned by the caller, but the object itself is not. The blitter only ensures that the storage always holds a live object, but it may exchange that object. 4898
SkCpu.cpp 3787
SkCpu.h 3215
SkCPUContext.cpp 853
SkCPUContextImpl.h 501
SkCPURecorder.cpp 452
SkCPURecorderImpl.h 672
SkCubicClipper.cpp 4707
SkCubicClipper.h This class is initialized with a clip rectangle, and then can be fed cubics, which must already be monotonic in Y. In the future, it might return a series of segments, allowing it to clip also in X, to ensure that all segments fit in a finite coordinate system. 959
SkCubicMap.cpp 3148
SkData.cpp This constructor means we are inline with our fPtr's contents. Thus we set fPtr to point right after this. 6429
SkDataTable.cpp 3684
SkDebugUtils.h 1600
SkDescriptor.cpp 7296
SkDescriptor.h 3435
SkDevice.cpp 26643
SkDevice.h SkDevice is the internal API and implementation that SkCanvas will use to perform rendering and implement the saveLayer abstraction. A device wraps some pixel allocation (for non-document based devices) or wraps some other container that stores rendering operations. The drawing operations perform equivalently to their corresponding functions in SkCanvas except that the canvas is responsible for all SkImageFilters. An image filter is applied by automatically creating a layer, drawing the filter-less paint into the layer, and then evaluating the filter on the layer's image. Each layer in an SkCanvas stack is represented by an SkDevice instance that was created by the parent SkDevice (up to the canvas's base device). In most cases these devices will be pixel aligned with one another but may differ in size based on the known extent of the active clip. In complex image filtering scenarios, they may not be axis aligned, although the effective pixel size should remain approximately equal across all devices in a canvas. While SkCanvas manages a single stack of layers and canvas transforms, SkDevice does not have a stack of transforms. Instead, it has a single active transform that is modified as needed by SkCanvas. However, SkDevices are the means by which SkCanvas manages the clip stack because each layer's clip stack starts anew (although the layer's results are then clipped by its parent's stack when it is restored). 29443
SkDistanceFieldGen.cpp 19952
SkDistanceFieldGen.h Given 8-bit mask data, generate the associated distance field @param distanceField The distance field to be generated. Should already be allocated by the client with the padding above. @param image 8-bit mask we're using to generate the distance field. @param w Width of the original image. @param h Height of the original image. @param rowBytes Size of each row in the image, in bytes 3749
SkDocument.cpp 2139
SkDraw.cpp 47238
SkDraw.h Helper function that creates a mask from a path and a required maskfilter. Note however, that the resulting mask will not have been actually filtered, that must be done afterwards (by calling filterMask). The maskfilter is provided solelely to assist in computing the mask's bounds (if the mode requests that). 10017
SkDraw_atlas.cpp 5647
SkDraw_text.cpp UINT16_MIN 5461
SkDraw_vertices.cpp 13732
SkDrawable.cpp 2507
SkDrawProcs.h If the current paint is set to stroke and the stroke-width when applied to the matrix is <= 1.0, then this returns true, and sets coverage (simulating a stroke by drawing a hairline with partial coverage). If any of these conditions are false, then this returns false and coverage is ignored. 1301
SkDrawShadowInfo.cpp 9576
SkDrawShadowInfo.h 3731
SkDrawTypes.h 407
SkEdge.cpp In setLine, setQuadratic, setCubic, the first thing we do is to convert the points into FDot6. This is modulated by the shift parameter, which will either be 0, or something like 2 for antialiasing. In the float case, we want to turn the float into .6 by saying pt * 64, or pt * 256 for antialiasing. This is implemented as 1 << (shift + 6). In the fixed case, we want to turn the fixed into .6 by saying pt >> 10, or pt >> 8 for antialiasing. This is implemented as pt >> (10 - shift). 19387
SkEdge.h SkEdge approximates monotonic curves with one or more line segments in a way that makes computing scan lines (rows of horizontal pixels between multiple edges) efficient and easier to do. In particular, the line segments will be in terms of Y instead of a general Bezier curve which is in terms of t. The number of segments will be a power of 2 (for easy division) based on internal heuristics about how bendy the curve is. The general flow is to create an SkEdge (or one of its subclasses), use the fields to represent a line segment, and then use updateQuadratic or updateCubic to update the fields with the next line segment's values. 6950
SkEdgeBuilder.cpp 12921
SkEdgeBuilder.h 2985
SkEdgeClipper.cpp src[] must be monotonic in Y. This routine copies src into dst, and sorts it to be increasing in Y. If it had to reverse the order of the points, it returns true, otherwise it returns false 19478
SkEdgeClipper.h This is basically an iterator. It is initialized with an edge and a clip, and then next() is called until it returns kDone_Verb. 2317
SkEffectPriv.h 992
SkEnumerate.h 4443
SkExecutor.cpp workList 7458
SkFDot6.h This uses the magic number approach suggested here: http://stereopsis.com/sree/fpu2006.html and used in _cairo_fixed_from_double. It does banker's rounding (i.e. round to nearest even) 1924
SkFlattenable.cpp 4300
SkFont.cpp 13940
SkFont_serial.cpp 3475
SkFontDescriptor.cpp 11081
SkFontDescriptor.h Makes a copy of the data in 'axis'. 6487
SkFontMetricsPriv.cpp 2197
SkFontMetricsPriv.h 526
SkFontMgr.cpp 10242
SkFontPriv.h This is the size we use when we ask for a glyph's path. We then post-transform it as we draw to match the request. This is done to try to re-use cache entries for the path. This value is somewhat arbitrary. In theory, it could be 1, since we store paths as floats. However, we get the path from the font scaler, and it may represent its paths as fixed-point (or 26.6), so we shouldn't ask for something too big (might overflow 16.16) or too small (underflow 26.6). This value could track kMaxSizeForGlyphCache, assuming the above constraints, but since we ask for unhinted paths, the two values need not match per-se. 4369
SkFontStream.cpp Return the number of tables, or if this is a TTC (collection), return the number of tables in the first element of the collection. In either case, if offsetToDir is not-null, set it to the offset to the beginning of the table headers (SkSFNTDirEntry), relative to the start of the stream. On an error, return 0 for number of tables, and ignore offsetToDir 6746
SkFontStream.h Return the number of shared directories inside a TTC sfnt, or return 1 if the stream is a normal sfnt (ttf). If there is an error or no directory is found, return 0. Note: the stream is rewound initially, but is returned at an arbitrary read offset. 1502
SkGaussFilter.cpp 3528
SkGaussFilter.h 945
SkGeometry.cpp From Numerical Recipes in C. Q = -1/2 (B + sign(B) sqrt[B*B - 4*A*C]) x1 = Q / A x2 = C / Q 62158
SkGeometry.h Given a quadratic equation Ax^2 + Bx + C = 0, return 0, 1, 2 roots for the equation. 20068
SkGlobalInitialization_core.cpp 483
SkGlyph.cpp 24765
SkGlyph.h 24985
SkGlyphRunPainter.cpp 19388
SkGlyphRunPainter.h 1235
SkGraphics.cpp 3776
SkIDChangeListener.cpp Used to be notified when a gen/unique ID is invalidated, typically to preemptively purge associated items from a cache that are no longer reachable. The listener can be marked for deregistration if the cached item is remove before the listener is triggered. This prevents unbounded listener growth when cache items are routinely removed before the gen ID/unique ID is invalidated. 2016
SkImageFilter.cpp Returns the number of inputs this filter will accept (some inputs can be NULL). 14993
SkImageFilter_Base.h Request a new filtered image to be created from the src image. The returned skif::Image provides both the pixel data and the origin point that it should be drawn at, relative to the layer space defined by the provided context. If the result image cannot be created, or the result would be transparent black, returns a skif::Image that has a null special image, in which its origin should be ignored. TODO: Right now the imagefilters sometimes return empty result bitmaps/ specialimages. That doesn't seem quite right. 18113
SkImageFilterCache.cpp 5266
SkImageFilterCache.h 3212
SkImageFilterTypes.cpp 113072
SkImageFilterTypes.h 60560
SkImageGenerator.cpp 1348
SkImageInfo.cpp 11063
SkImageInfoPriv.h 9094
SkImagePriv.h Examines the bitmap to decide if it can share the existing pixelRef, or if it needs to make a deep-copy of the pixels. The bitmap's pixelref will be shared if either the bitmap is marked as immutable, or CopyPixelsMode allows it. Shared pixel refs are also locked when kLocked_SharedPixelRefMode is specified. Passing kLocked_SharedPixelRefMode allows the image's peekPixels() method to succeed, but it will force any lazy decodes/generators to execute if they exist on the pixelref. It is illegal to call this with a texture-backed bitmap. If the bitmap's colortype cannot be converted into a corresponding SkImageInfo, or the bitmap's pixels cannot be accessed, this will return nullptr. 3055
SkIPoint16.h \struct SkIPoint16 SkIPoint16 holds two 16 bit integer coordinates. 1263
SkKnownRuntimeEffects.cpp 24858
SkKnownRuntimeEffects.h 6102
SkLatticeIter.cpp Divs must be in increasing order with no duplicates. 10217
SkLatticeIter.h Disect a lattice request into an sequence of src-rect / dst-rect pairs 2337
SkLineClipper.cpp 8864
SkLineClipper.h Clip the line pts[0]...pts[1] against clip, ignoring segments that lie completely above or below the clip. For portions to the left or right, turn those into vertical line segments that are aligned to the edge of the clip. Return the number of line segments that result, and store the end-points of those segments sequentially in lines as follows: 1st segment: lines[0]..lines[1] 2nd segment: lines[1]..lines[2] 3rd segment: lines[2]..lines[3] 1541
SkLocalMatrixImageFilter.cpp 3832
SkLocalMatrixImageFilter.h Wraps another imagefilter + matrix, such that using this filter will give the same result as using the wrapped filter with the matrix applied to its context. 2454
SkLRUCache.h context 3756
SkM44.cpp 12755
SkMallocPixelRef.cpp 2773
SkMask.cpp returns the product if it is positive and fits in 31 bits. Otherwise this returns 0. 3474
SkMask.h \class SkMask SkMask is used to describe alpha bitmaps, either 1bit, 8bit, or the 3-channel 3D format. These are passed to SkMaskFilter objects. 11877
SkMaskBlurFilter.cpp 37741
SkMaskBlurFilter.h 1049
SkMaskCache.cpp 6882
SkMaskCache.h On success, return a ref to the SkCachedData that holds the pixels, and have mask already point to that memory. On failure, return nullptr. 1706
SkMaskFilter.cpp 828
SkMaskFilterBase.cpp 12363
SkMaskFilterBase.h Returns the format of the resulting mask that this subclass will return when its filterMask() method is called. 8942
SkMaskGamma.cpp static 5011
SkMaskGamma.h SkColorSpaceLuminance is used to convert luminances to and from linear and perceptual color spaces. Luma is used to specify a linear luminance value [0.0, 1.0]. Luminance is used to specify a luminance value in an arbitrary color space [0.0, 1.0]. 10080
SkMasks.cpp Used to convert 1-7 bit color components into 8-bit color components 4699
SkMasks.h 1443
SkMatrix.cpp 62241
SkMatrixInvert.cpp 5244
SkMatrixInvert.h Computes the inverse of `inMatrix`, passed in column-major order. `inMatrix` and `outMatrix` are allowed to point to the same array of scalars in memory. `outMatrix` is allowed to be null. The return value is the determinant of the input matrix. If zero is returned, the matrix was non-invertible, and `outMatrix` has been left in an indeterminate state. 868
SkMatrixPriv.h Attempt to map the rect through the inverse of the matrix. If it is not invertible, then this returns false and dst is unchanged. 8885
SkMatrixUtils.h Given a matrix, size and an antialias setting, return true if the computed dst-rect would align such that there is a 1-to-1 coorspondence between src and dst pixels. This can be called by drawing code to see if drawBitmap can be turned into drawSprite (which is faster). The src-rect is defined to be { 0, 0, size.width(), size.height() } 1352
SkMD5.cpp MD5 basic transformation. Transforms state based on block. 10895
SkMD5.h Calculate a 128-bit MD5 message-digest of the bytes sent to this stream. 1302
SkMemset.h 720
SkMemset_opts.cpp 1232
SkMemset_opts_avx.cpp 1135
SkMemset_opts_erms.cpp 4568
SkMesh.cpp 36973
SkMeshPriv.h A varying is dead if it is never referenced OR it is only referenced as a passthrough for local coordinates. In the latter case, its index will returned as PassthroughLocalCoordsVaryingIndex. Our analysis is not very sophisticated so this is determined conservatively. 5116
SkMessageBus.h The following method must have a specialization for type 'Message': bool SkShouldPostMessageToBus(const Message&, IDType msgBusUniqueID) We may want to consider providing a default template implementation, to avoid this requirement by sending to all inboxes when the specialization for type 'Message' is not present. 6178
SkMipmap.cpp 9721
SkMipmap.h SkMipmap will generate mipmap levels when given a base mipmap level image. Any function which deals with mipmap levels indices will start with index 0 being the first mipmap level which was generated. Said another way, it does not include the base level in its range. 3841
SkMipmapAccessor.cpp 4167
SkMipmapAccessor.h 1720
SkMipmapBuilder.cpp factoryProc= 1040
SkMipmapBuilder.h If these levels are compatible with src, return a new Image that combines src's base level with these levels as mip levels. If not compatible, this returns nullptr. 784
SkMipmapDrawDownSampler.cpp 2194
SkMipmapHQDownSampler.cpp 21348
SkNextID.h Shared between SkPixelRef's generationID and SkImage's uniqueID 386
SkOpts.cpp 2781
SkOpts.h SkOpts (short for SkOptimizations) is a mechanism where we can ship with multiple implementations of a set of functions and dynamically choose the best one at runtime (e.g. the call to SkGraphics::Init(), which calls SkOpts::Init()) depending on the detected CPU features. This is also referred to as having "specializations" of a given function. For example, Skia might be compiled to support CPUs that only have the sse2 instruction set (https://en.wikipedia.org/wiki/X86_instruction_listings#SSE2_instructions) but may be run on a more modern CPU that supports AVX2 instructions. (https://en.wikipedia.org/wiki/Advanced_Vector_Extensions) SkOpts allow Skia to have two versions of a row-blitting function, one that uses normal C++ code (e.g. loops, scalar integer math) and one that makes use of the AVX2 vector types and intrinsic functions. This function is declared here in the SkOpts namespace, and then the implementation (see SkOpts.cpp) is deferred to a function of the same name in the sse2:: namespace (the minimum Skia is compiled with) using DEFINE_DEFAULT. All implementations of this blit function are done in a header file file in //src/opts (e.g. //src/opts/SkBlitRow_opts.h). ifdefs guard each of the implementations, such that only one implementation is possible for a given SK_CPU_SSE_LEVEL. This header will be compiled *multiple* times with a different SK_CPU_SSE_LEVEL each compilation. Each CPU instruction set that we want specializations for has a .cpp file in //src/opts which defines an Init() function that replaces the function pointers in the SkOpts namespace with the ones from the specialized namespace (e.g. hsw::). These .cpp files don't implement the specializations, they just refer to the specialization created in the header files (e.g. SkBlitRow_opts.h). At compile time: - SkOpts.cpp is compiled with the minimum CPU level (e.g. SSE2). Because this file includes all the headers in //src/opts/, those headers add "the default implementation" of all their functions to the SK_OPTS_NS namespace (e.g. sse2::blit_row_color32). - Each of the specialized .cpp files in //src/opts/ are compiled with their respective compiler flags. Because the specialized .cpp file includes the headers that implement the functions using intrinsics or other CPU-specific code, those specialized functions end up in the specialized namespace, e.g. (hsw::blit_row_color32). At link time, the default implementations and all specializations of all SkOpts functions are included in the resulting library/binary file. At runtime, SkOpts::Init() will run the appropriate Init functions that the current CPU level supports specializations for (e.g. Init_hsw, Init_ssse3). Note multiple Init functions can be called as CPU instruction sets are typically super sets of older instruction sets 4526
SkOptsTargets.h 394
SkOSFile.h Maps a file into memory. Returns the address and length on success, NULL otherwise. The mapping is read only. When finished with the mapping, free the returned pointer with sk_fmunmap. 3004
SkOverdrawCanvas.cpp 10230
SkPaint.cpp 8828
SkPaintDefaults.h Any of these can be specified by the build system (or SkUserConfig.h) to change the default values for a SkPaint. This file should not be edited directly. 746
SkPaintPriv.cpp 11257
SkPaintPriv.h Returns true if drawing with this paint (or nullptr) will ovewrite all affected pixels. Note: returns conservative true, meaning it may return false even though the paint might in fact overwrite its pixels. 2261
SkPath.cpp Stores the verbs and points as they are given to us, with exceptions: - we only record "Close" if it was immediately preceeded by Move | Line | Quad | Cubic - we insert a Move(0,0) if Line | Quad | Cubic is our first command The iterator does more cleanup, especially if forceClose == true 1. If we encounter degenerate segments, remove them 2. if we encounter Close, return a cons'd up Line() first (if the curr-pt != start-pt) 3. if we encounter Move without a preceeding Close, and forceClose is true, goto #2 4. if we encounter Line | Quad | Cubic after Close, cons up a Move 122216
SkPath_serial.cpp 9098
SkPathBuilder.cpp Some old behavior in SkPath -- should we keep it? After each edit (i.e. adding a verb) this->setConvexityType(SkPathConvexity::kUnknown); this->setFirstDirection(SkPathPriv::kUnknown_FirstDirection); 37659
SkPathEffect.cpp \class SkPairPathEffect Common baseclass for Compose and Sum. This subclass manages two pathEffects, including flattening them. It does nothing in filterPath, and is only useful for managing the lifetimes of its two arguments. 8145
SkPathEffectBase.h \class PointData PointData aggregates all the information needed to draw the point primitives returned by an 'asPoints' call. 6011
SkPathEnums.h 2827
SkPathIter.cpp Close is funny -- it has no explicit point data, but we return 2 points, the logical 2 points that would make up the line connecting the end of the contour, and its beginning. To do this, we have local storage (fClosePointStorage) 2385
SkPathMakers.h 2950
SkPathMeasure.cpp 2352
SkPathMeasurePriv.h 877
SkPathPriv.cpp Determines if path is a rect by keeping track of changes in direction and looking for a loop either clockwise or counterclockwise. The direction is computed such that: 0: vertical up 1: horizontal left 2: vertical down 3: horizontal right A rectangle cycles up/right/down/left or up/left/down/right. The test fails if: The path is closed, and followed by a line. A second move creates a new endpoint. A diagonal line is parsed. There's more than four changes of direction. There's a discontinuity on the line (e.g., a move in the middle) The line reverses direction. The path contains a quadratic or cubic. The path contains fewer than four points. The rectangle doesn't complete a cycle. The final point isn't equal to the first point. These last two conditions we relax if we have a 3-edge path that would form a rectangle if it were closed (as we do when we fill a path) It's OK if the path has: Several colinear line segments composing a rectangle side. Single points on the rectangle side. The direction takes advantage of the corners found since opposite sides must travel in opposite directions. FIXME: Allow colinear quads and cubics to be treated like lines. FIXME: If the API passes fill-only, return true if the filled stroke is a rectangle, though the caller failed to close the path. directions values: 0x1 is set if the segment is horizontal 0x2 is set if the segment is moving to the right or down thus: two directions are opposites iff (dirA ^ dirB) == 0x2 two directions are perpendicular iff (dirA ^ dirB) == 0x1 8975
SkPathPriv.h Return the opposite of the specified direction. kUnknown is its own opposite. 21460
SkPathRaw.cpp 959
SkPathRaw.h SkPathRaw is a non-owning, immutable view of the path geometry. It allows us to have stack-allocated paths, see SkPathRawShapes.h It is the responsibility of the creator to ensure that the spans in SkPathRaw point to valid data that outlives the SkPathRaw instance. 1701
SkPathRawShapes.cpp 6354
SkPathRawShapes.h These classes provide their own stack-based storage for path data, making them efficient alternatives to SkPath for known geometries, avoiding heap allocations. The defaults were chosen to match those in SkPathBuilder.h 1539
SkPathRef.cpp 21042
SkPathUtils.cpp 2756
SkPicture.cpp SkPicture impl. This handles generic responsibilities like unique IDs and serialization. 11843
SkPictureData.cpp 21711
SkPictureData.h 6767
SkPictureFlat.cpp 451
SkPictureFlat.h Note: While adding new DrawTypes, it is necessary to add to the end of this list and update LAST_DRAWTYPE_ENUM to avoid having the code read older skps wrong. (which can cause segfaults) Reordering can be done during version updates. 6225
SkPicturePlayback.cpp 31032
SkPicturePlayback.h 1750
SkPicturePriv.h Recreate a picture that was serialized into a buffer. If the creation requires bitmap decoding, the decoder must be set on the SkReadBuffer parameter by calling SkReadBuffer::setBitmapDecoder() before calling SkPicture::MakeFromBuffer(). @param buffer Serialized picture data. @return A new SkPicture representing the serialized data, or NULL if the buffer is invalid. 9082
SkPictureRecord.cpp No need for a (potentially very big) layer which we don't actually need at this time (and may not be able to afford since during record our clip starts out the size of the picture, which is often much larger than the size of the actual device we'll use during playback). 34305
SkPictureRecord.h Write the 'drawType' operation and chunk size to the skp. 'size' can potentially be increased if the chunk size needs its own storage location (i.e., it overflows 24 bits). Returns the start offset of the chunk. This is the location at which the opcode & size are stored. TODO: since we are handing the size into here we could call reserve and then return a pointer to the memory storage. This could decrease allocation overhead but could lead to more wasted space (the tail end of blocks could go unused). Possibly add a second addDraw that operates in this manner. 10760
SkPictureRecorder.cpp bbh 5121
SkPixelRef.cpp We are forcing the genID to match an external value. The caller must ensure that this value does not conflict with other content. One use is to force this pixelref's id to match an SkImage's id 4916
SkPixelRefPriv.h Return a new SkMallocPixelRef with the provided pixel storage and rowBytes. On destruction, ReleaseProc will be called. If ReleaseProc is NULL, the pixels will never be released. This can be useful if the pixels were stack allocated. However, such an SkMallocPixelRef must not live beyond its pixels (e.g. by copying an SkBitmap pointing to it, or drawing to an SkPicture). Returns NULL on failure. 927
SkPixmap.cpp 31602
SkPixmapDraw.cpp 3311
SkPoint.cpp We have to worry about 2 tricky conditions: 1. underflow of mag2 (compared against nearlyzero^2) 2. overflow of mag2 (compared w/ isfinite) If we underflow, we return false. If we overflow, we compute again using doubles, which is much slower (3x in a desktop test) but will not overflow. 5470
SkPoint3.cpp We have to worry about 2 tricky conditions: 1. underflow of magSq (compared against nearlyzero^2) 2. overflow of magSq (compared w/ isfinite) If we underflow, we return false. If we overflow, we compute again using doubles, which is much slower (3x in a desktop test) but will not overflow. 2645
SkPointPriv.h 4178
SkPtrRecorder.cpp 1796
SkPtrRecorder.h Maintains a set of ptrs, assigning each a unique ID [1...N]. Duplicate ptrs return the same ID (since its a set). Subclasses can override inPtr() and decPtr(). incPtr() is called each time a unique ptr is added ot the set. decPtr() is called on each ptr when the set is destroyed or reset. 4709
SkQuadClipper.cpp Solve F(t) = y where F(t) := [0](1-t)^2 + 2[1]t(1-t) + [2]t^2 We solve for t, using quadratic equation, hence we have to rearrange our cooefficents to look like At^2 + Bt + C 3450
SkQuadClipper.h This class is initialized with a clip rectangle, and then can be fed quads, which must already be monotonic in Y. In the future, it might return a series of segments, allowing it to clip also in X, to ensure that all segments fit in a finite coordinate system. 2062
SkRasterClip.cpp Our antialiasing currently has a granularity of 1/4 of a pixel along each axis. Thus we can treat an axis coordinate as an integer if it differs from its nearest int by < half of that value (1/8 in this case). 9127
SkRasterClip.h Wraps a SkRegion and SkAAClip, so we have a single object that can represent either our BW or antialiased clips. 5372
SkRasterClipStack.h 3432
SkRasterPipeline.cpp 30850
SkRasterPipeline.h SkRasterPipeline provides a cheap way to chain together a pixel processing pipeline. It's particularly designed for situations where the potential pipeline is extremely combinatoric: {N dst formats} x {M source formats} x {K mask formats} x {C transfer modes} ... No one wants to write specialized routines for all those combinations, and if we did, we'd end up bloating our code size dramatically. SkRasterPipeline stages can be chained together at runtime, so we can scale this problem linearly rather than combinatorically. Each stage is represented by a function conforming to a common interface and by an arbitrary context pointer. The stage function arguments and calling convention are designed to maximize the amount of data we can pass along the pipeline cheaply, and vary depending on CPU feature detection. 7208
SkRasterPipelineBlitter.cpp 31114
SkRasterPipelineContextUtils.h SkRPCtxUtils::Pack will check if the passed-in struct is small enough to fit directly in the context field. If so, it will return the data bit-casted into a void pointer. If not, it allocates a copy of the struct inside the alloc and then returns a pointer to the copy. 1854
SkRasterPipelineOpContexts.h 9151
SkRasterPipelineOpList.h `SK_RASTER_PIPELINE_OPS_SKSL` defines ops used by SkSL. Design docs for SkSL in Raster Pipeline: go/sksl-rp https://docs.google.com/document/d/1GCQeAGVGHubOCbmULVdXUkNiXdw9J4umai_M5X3JGS4/edit?usp=sharing 18102
SkRasterPipelineVizualizer.h 4379
SkReadBuffer.cpp 17025
SkReadBuffer.h Returns true IFF the version is older than the specified version. 8389
SkReadPixelsRec.cpp 1135
SkReadPixelsRec.h Helper class to package and trim the parameters passed to readPixels() 1285
SkRecord.cpp 1017
SkRecord.h 7054
SkRecordCanvas.cpp 17878
SkRecordCanvas.h 7081
SkRecordDraw.cpp save now, restore at exit 23044
SkRecordDraw.h 2288
SkRecordedDrawable.cpp 3594
SkRecordedDrawable.h 1521
SkRecordOpts.cpp 11119
SkRecordOpts.h 901
SkRecordPattern.h 6236
SkRecords.cpp 488
SkRecords.h 13292
SkRect.cpp Both of these variants compute the same numerics. But, the "simple" one (no explicit skvx) runs faster (most of the time) on 64bit machines, and the tricky skvx version runs faster (most of the time) on 32bit machines. Hence the if/else 14029
SkRectPriv.h 4489
SkRegion.cpp Region Layout TOP [ Bottom, X-Intervals, [Left, Right]..., X-Sentinel ] ... Y-Sentinel 48084
SkRegion_path.cpp Scanline mimics a row in the region, nearly. A row in a region is: [Bottom IntervalCount [L R]... Sentinel] while a Scanline is [LastY XCount [L R]... uninitialized] The two are the same length (which is good), but we have to transmute the scanline a little when we convert it to a region-row. Potentially we could recode this to exactly match the row format, in which case copyToRgn() could be a single memcpy. Not sure that is worth the effort. 19845
SkRegionPriv.h Number of spans with different Y values. This does not count the initial Top value, nor does it count the final Y-Sentinel value. In the logical case of a rectangle, this would return 1, and an empty region would return 0. 7953
SkResourceCache.cpp 16437
SkResourceCache.h Cache object for bitmaps (with possible scale in X Y as part of the key). Multiple caches can be instantiated, but each instance is not implicitly thread-safe, so if a given instance is to be shared across threads, the caller must manage the access itself (e.g. via a mutex). As a convenience, a global instance is also defined, which can be safely access across threads via the static methods (e.g. FindAndLock, etc.). 10572
SkRRect.cpp 35901
SkRRectPriv.h 2688
SkRSXform.cpp 1432
SkRTree.cpp 5268
SkRTree.h An R-Tree implementation. In short, it is a balanced n-ary tree containing a hierarchy of bounding rectangles. It only supports bulk-loading, i.e. creation from a batch of bounding rectangles. This performs a bottom-up bulk load using the STR (sort-tile-recursive) algorithm. TODO: Experiment with other bulk-load algorithms (in particular the Hilbert pack variant, which groups rects by position on the Hilbert curve, is probably worth a look). There also exist top-down bulk load variants (VAMSplit, TopDownGreedy, etc). For more details see: Beckmann, N.; Kriegel, H. P.; Schneider, R.; Seeger, B. (1990). "The R*-tree: an efficient and robust access method for points and rectangles" 2565
SkRuntimeBlender.cpp debugTrace= 3909
SkRuntimeBlender.h 1596
SkRuntimeEffect.cpp 42409
SkRuntimeEffectPriv.h 9952
SkSafeRange.h 1144
SkSamplingPriv.h 3133
SkScalar.cpp 1152
SkScalerContext.cpp In order to call cachedDeviceLuminance, cachedPaintLuminance, or cachedMaskGamma the caller must hold the mask_gamma_cache_mutex and continue to hold it until the returned pointer is refed or forgotten. 51013
SkScalerContext.h To allow this to be forward-declared, it must be its own typename, rather than a nested struct inside SkScalerContext (where it started). SkScalerContextRec must be dense, and all bytes must be set to a know quantity because this structure is used to calculate a checksum. 20006
SkScaleToSides.h 2444
SkScan.cpp 2932
SkScan.h Defines a fixed-point rectangle, identical to the integer SkIRect, but its coordinates are treated as SkFixed rather than int32_t. 5905
SkScan_AAAPath.cpp The following is a high-level overview of our analytic anti-aliasing algorithm. We consider a path as a collection of line segments, as quadratic/cubic curves are converted to small line segments. Without loss of generality, let's assume that the draw region is [0, W] x [0, H]. Our algorithm is based on horizontal scan lines (y = c_i) as the previous sampling-based algorithm did. However, our algorithm uses non-equal-spaced scan lines, while the previous method always uses equal-spaced scan lines, such as (y = 1/2 + 0, 1/2 + 1, 1/2 + 2, ...) in the previous non-AA algorithm, and (y = 1/8 + 1/4, 1/8 + 2/4, 1/8 + 3/4, ...) in the previous 16-supersampling AA algorithm. Our algorithm contains scan lines y = c_i for c_i that is either: 1. an integer between [0, H] 2. the y value of a line segment endpoint 3. the y value of an intersection of two line segments For two consecutive scan lines y = c_i, y = c_{i+1}, we analytically computes the coverage of this horizontal strip of our path on each pixel. This can be done very efficiently because the strip of our path now only consists of trapezoids whose top and bottom edges are y = c_i, y = c_{i+1} (this includes rectangles and triangles as special cases). We now describe how the coverage of single pixel is computed against such a trapezoid. That coverage is essentially the intersection area of a rectangle (e.g., [0, 1] x [c_i, c_{i+1}]) and our trapezoid. However, that intersection could be complicated, as shown in the example region A below: +-----------\----+ | \ C| | \ | \ \ | |\ A \| | \ \ | \ | | B \ | +----\-----------+ However, we don't have to compute the area of A directly. Instead, we can compute the excluded area, which are B and C, quite easily, because they're just triangles. In fact, we can prove that an excluded region (take B as an example) is either itself a simple trapezoid (including rectangles, triangles, and empty regions), or its opposite (the opposite of B is A + C) is a simple trapezoid. In any case, we can compute its area efficiently. In summary, our algorithm has a higher quality because it generates ground- truth coverages analytically. It is also faster because it has much fewer unnessasary horizontal scan lines. For example, given a triangle path, the number of scan lines in our algorithm is only about 3 + H while the 16-supersampling algorithm has about 4H scan lines. 70774
SkScan_Antihair.cpp Our attempt to compute the worst case "bounds" for the horizontal and vertical cases has some numerical bug in it, and we sometimes undervalue our extends. The bug is that when this happens, we will set the clip to nullptr (for speed), and thus draw outside of the clip by a pixel, which might only look bad, but it might also access memory outside of the valid range allcoated for the device bitmap. This define enables our fix to outset our "bounds" by 1, thus avoiding the chance of the bug, but at the cost of sometimes taking the rectblitter case (i.e. not setting the clip to nullptr) when we might not actually need to. If we can improve/fix the actual calculations, then we can remove this step. 32735
SkScan_AntiPath.cpp Would any of the coordinates of this rectangle not fit in a short, when left-shifted by shift? 5041
SkScan_Hairline.cpp 29291
SkScan_Path.cpp 25014
SkScanPriv.h 2439
SkSLTypeShared.cpp Is the shading language type full precision? 7610
SkSLTypeShared.h Types of shader-language-specific boxed variables we can create. 7372
SkSpecialImage.cpp 7164
SkSpecialImage.h This is a restricted form of SkImage solely intended for internal use. It differs from SkImage in that: - it can only be backed by raster or gpu (no generators) - it can be backed by a GrTextureProxy larger than its nominal bounds - it can't be drawn tiled - it can't be drawn with MIPMAPs It is similar to SkImage in that it abstracts how the pixels are stored/represented. Note: the contents of the backing storage outside of the subset rect are undefined. 6219
SkSpriteBlitter.h 1486
SkSpriteBlitter_ARGB32.cpp 2487
SkStream.cpp 27454
SkStreamPriv.h Copy the provided stream to an SkData variable. Note: Assumes the stream is at the beginning. If it has a length, but is not at the beginning, this call will fail (return NULL). @param stream SkStream to be copied into data. @return The resulting SkData after the copy, nullptr on failure. 2648
SkStrike.cpp 14998
SkStrike.h 8496
SkStrikeCache.cpp 10475
SkStrikeCache.h 4413
SkStrikeSpec.cpp 8977
SkStrikeSpec.h 5885
SkString.cpp 18195
SkStringUtils.cpp 3269
SkStringUtils.h Indents every non-empty line of the string by tabCnt tabs 2022
SkStroke.cpp Enable to show the decisions made in subdividing the curve -- helpful when the resulting stroke has more than the optimal number of quadratics and lines 63041
SkStroke.h \class SkStroke SkStroke is the utility class that constructs paths by stroking geometries (lines, rects, ovals, roundrects, paths). This is invoked when a geometry or text is drawn in a canvas with the kStroke_Mask bit set in the paint. 2628
SkStrokeRec.cpp 5332
SkStrokerPriv.cpp In the degenerate case that the stroke radius is larger than our segments just connecting the two inner segments may "show through" as a funny diagonal. To pseudo-fix this, we go through the pivot point. This adds an extra point/edge, but I can't see a cheap way to know when this is not needed :( 8224
SkStrokerPriv.h 1489
SkSurfacePriv.h 568
SkSwizzle.cpp 329
SkSwizzlePriv.h 2385
SkSwizzler_opts.cpp 1810
SkSwizzler_opts_hsw.cpp 1398
SkSwizzler_opts_lasx.cpp 1427
SkSwizzler_opts_ssse3.cpp 1523
SkSynchronizedResourceCache.cpp 2607
SkSynchronizedResourceCache.h 1365
SkTaskGroup.cpp workList= 1983
SkTaskGroup.h 1519
SkTDynamicHash.h 1764
SkTextBlob.cpp 38424
SkTextBlobPriv.h Serialize to a buffer. 7688
SkTextFormatParams.h 1028
SkTHash.h 23892
SkTMultiMap.h A set that contains pointers to instances of T. Instances can be looked up with key Key. Multiple (possibly same) values can have the same key. 5535
SkTraceEvent.h 17272
SkTraceEventCommon.h 46177
SkTypeface.cpp 19680
SkTypeface_remote.cpp 6854
SkTypeface_remote.h 6827
SkTypefaceCache.cpp 3178
SkTypefaceCache.h Callback for FindByProc. Returns true if the given typeface is a match for the given context. The passed typeface is owned by the cache and is not additionally ref()ed. The typeface may be in the disposed state. 2104
SkUnPreMultiply.cpp 4478
SkValidationUtils.h Returns true if mode's value is in the SkBlendMode enum. 939
SkVertices.cpp 13387
SkVerticesPriv.h Class that adds methods to SkVertices that are only intended for use internal to Skia. This class is purely a privileged window into SkVertices. It should never have additional data members or virtual methods. 2146
SkVertState.cpp 2797
SkVertState.h \struct VertState This is a helper for drawVertices(). It is used to iterate over the triangles that are to be rendered based on an SkCanvas::VertexMode and (optionally) an index array. It does not copy the index array and the client must ensure it remains valid for the lifetime of the VertState object. 1625
SkWriteBuffer.cpp 10594
SkWriteBuffer.h Concrete implementation that serializes to a flat binary blob. 6016
SkWritePixelsRec.cpp 1144
SkWritePixelsRec.h Helper class to package and trim the parameters passed to writePixels() 1289
SkWriter32.cpp 2221
SkWriter32.h The caller can specify an initial block of storage, which the caller manages. SkWriter32 will try to back reserve and write calls with this external storage until the first time an allocation doesn't fit. From then it will use dynamically allocated storage. This used to be optional behavior, but pipe now relies on it. 8969
SkYUVAInfo.cpp 13968
SkYUVAInfoLocation.h The location of Y, U, V, or A values within the planes described by SkYUVAInfo. Computed from a SkYUVAInfo and the set of channels present in a set of pixmaps/textures. 2102
SkYUVAPixmaps.cpp 10704
SkYUVMath.cpp 32516
SkYUVMath.h 453
SkYUVPlanesCache.cpp 2953
SkYUVPlanesCache.h On success, return a ref to the SkCachedData that holds the pixel data. The SkYUVAPixmaps contains a description of the YUVA data and has a SkPixmap for each plane that points into the SkCachedData. On failure, return nullptr. 1167