Name Description Size
Sk4px.h 8887
SkAAClip.cpp Data runs are packed [count, alpha] 56906
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. 3471
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 20071
SkAnalyticEdge.h 4852
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). 2219
SkAutoBlitterChoose.h 1689
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 22423
SkBitmapCache.cpp Use this for bitmapcache and mipmapcache entries. 9975
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 25368
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. 5516
SkBitmapProcState.cpp For the purposes of drawing bitmaps, if a matrix is "almost" translate go ahead and treat it as if it were, so that subsequent code can go fast. 21958
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. 8868
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 SkFractionalInt to keep more fractional 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. 19281
SkBitmapProcState_opts.cpp 1072
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 10876
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. 1331
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 19912
SkBlitRow_opts.cpp 1062
SkBlitRow_opts_hsw.cpp 1015
SkBlitter.cpp void SkBlitter::blitH(int x, int y, int width) { SkDEBUGFAIL("unimplemented"); } void SkBlitter::blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]) { SkDEBUGFAIL("unimplemented"); } 27734
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. 10812
SkBlitter_A8.cpp 8994
SkBlitter_A8.h 1377
SkBlitter_ARGB32.cpp We want all of these in 5bits, hence the shifts in case one of them (green) is 6bits. 86765
SkBlitter_Sprite.cpp 8791
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. 4032
SkBlurMask.cpp 25032
SkBlurMask.h Helper functions for analytic rectangle blurs 4368
SkBlurMaskFilterImpl.cpp 21005
SkBlurMaskFilterImpl.h 2540
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 137091
SkCanvas_Raster.cpp 1780
SkCanvasPriv.cpp 12949
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. 6300
SkCapabilities.cpp 618
SkChecksum.cpp 3544
SkChecksum.h Our hash functions are exposed as SK_SPI (e.g. SkParagraph) 3969
SkClipStack.cpp 35804
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. 19961
SkClipStackDevice.cpp doAA= 4278
SkClipStackDevice.h 1779
SkColor.cpp 4513
SkColorFilter.cpp 2855
SkColorFilterPriv.h 1242
SkColorSpace.cpp 10932
SkColorSpacePriv.h 2730
SkColorSpaceXformSteps.cpp 5435
SkColorSpaceXformSteps.h 1653
SkColorTable.cpp 1599
SkCompressedDataUtils.cpp 0 11193
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 24782
SkConvertPixels.cpp 10795
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. 5150
SkCpu.cpp 3787
SkCpu.h 3215
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 3189
SkData.cpp This constructor means we are inline with our fPtr's contents. Thus we set fPtr to point right after this. 6116
SkDataTable.cpp 3684
SkDebugUtils.h 582
SkDescriptor.cpp 7296
SkDescriptor.h 3393
SkDevice.cpp 26979
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). 29770
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 18185
SkDraw.h If dstOrNull is null, computes a dst by mapping the bitmap's bounds through the matrix. 2672
SkDraw_atlas.cpp 5244
SkDraw_text.cpp UINT16_MIN 5352
SkDraw_vertices.cpp 13737
SkDrawable.cpp 2507
SkDrawBase.cpp 26631
SkDrawBase.h To save on mallocs, we allow a flag that tells us that srcPath is mutable, so that we don't have to make copies of it as we transform it. If prePathMatrix is not null, it should logically be applied before any stroking or other effects. If there are no effects on the paint that affect the geometry/rasterization, then the pre matrix can just be pre-concated with the current matrix. 6238
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. 1238
SkDrawShadowInfo.cpp 9651
SkDrawShadowInfo.h 3731
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). 15620
SkEdge.h 3880
SkEdgeBuilder.cpp 14597
SkEdgeBuilder.h 2786
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 19461
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. 2266
SkEffectPriv.h 743
SkEnumerate.h 4443
SkExecutor.cpp 4728
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) 1864
SkFlattenable.cpp 4300
SkFont.cpp 13499
SkFont_serial.cpp 3475
SkFontDescriptor.cpp 10926
SkFontDescriptor.h Makes a copy of the data in 'axis'. 6421
SkFontMetricsPriv.cpp 2197
SkFontMetricsPriv.h 526
SkFontMgr.cpp 10234
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. 4371
SkFontScanner.h instanceIndex 0 is the default instance, 1 to numInstances are the named instances. 1422
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 6686
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. 1463
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 62007
SkGeometry.h Given a quadratic equation Ax^2 + Bx + C = 0, return 0, 1, 2 roots for the equation. 19902
SkGlobalInitialization_core.cpp 483
SkGlyph.cpp 24713
SkGlyph.h 24008
SkGlyphRunPainter.cpp 17736
SkGlyphRunPainter.h 1879
SkGraphics.cpp 3043
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). 14891
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 5111
SkImageFilterCache.h 3053
SkImageFilterTypes.cpp 95777
SkImageFilterTypes.h 59639
SkImageGenerator.cpp 1348
SkImageInfo.cpp 9325
SkImageInfoPriv.h 8201
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 25053
SkKnownRuntimeEffects.h 5496
SkLatticeIter.cpp Divs must be in increasing order with no duplicates. 10218
SkLatticeIter.h Disect a lattice request into an sequence of src-rect / dst-rect pairs 2337
SkLineClipper.cpp 8860
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 3849
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 A generic LRU cache. 3148
SkM44.cpp 12765
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. 11888
SkMaskBlurFilter.cpp 37186
SkMaskBlurFilter.h 1049
SkMaskCache.cpp 6757
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. 1551
SkMaskFilter.cpp 11615
SkMaskFilterBase.h Returns the format of the resulting mask that this subclass will return when its filterMask() method is called. 7528
SkMaskGamma.cpp static 5033
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]. 9430
SkMasks.cpp Used to convert 1-7 bit color components into 8-bit color components 4699
SkMasks.h 1443
SkMatrix.cpp 64900
SkMatrixInvert.cpp 5268
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. 8877
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. 10907
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 36965
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 9737
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 21244
SkNextID.h Shared between SkPixelRef's generationID and SkImage's uniqueID 386
SkOpts.cpp 2565
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 4494
SkOptsTargets.h 357
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 10211
SkPaint.cpp 8872
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 11233
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 Path.bounds is defined to be the bounds of all the control points. If we called bounds.join(r) we would skip r if r was empty, which breaks our promise. Hence we have a custom joiner that doesn't look at emptiness 133572
SkPath_serial.cpp 8333
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); 31391
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. 7834
SkPathEffectBase.h \class PointData PointData aggregates all the information needed to draw the point primitives returned by an 'asPoints' call. 5770
SkPathEnums.h 505
SkPathMakers.h 2950
SkPathMeasure.cpp 1898
SkPathMeasurePriv.h 877
SkPathPriv.h Return the opposite of the specified direction. kUnknown is its own opposite. 20332
SkPathRef.cpp 22955
SkPathUtils.cpp 2958
SkPicture.cpp SkPicture impl. This handles generic responsibilities like unique IDs and serialization. 11843
SkPictureData.cpp 21668
SkPictureData.h 6727
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. 6174
SkPicturePlayback.cpp 30581
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. 8405
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). 33990
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. 10718
SkPictureRecorder.cpp bbh 5113
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 30879
SkPixmapDraw.cpp 3249
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. 5524
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. 2714
SkPointPriv.h 4194
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. 2020
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). 9133
SkRasterClip.h Wraps a SkRegion and SkAAClip, so we have a single object that can represent either our BW or antialiased clips. 5330
SkRasterClipStack.h 3432
SkRasterPipeline.cpp load= 29517
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. 6534
SkRasterPipelineBlitter.cpp 24608
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 10372
SkRasterPipelineOpList.h 17404
SkReadBuffer.cpp 16709
SkReadBuffer.h Returns true IFF the version is older than the specified version. 8396
SkReadPixelsRec.cpp 1135
SkReadPixelsRec.h Helper class to package and trim the parameters passed to readPixels() 1285
SkRecord.cpp 1017
SkRecord.h 7047
SkRecordDraw.cpp save now, restore at exit 22530
SkRecordDraw.h 2288
SkRecordedDrawable.cpp 3594
SkRecordedDrawable.h 1517
SkRecorder.cpp 15415
SkRecorder.h 6389
SkRecordOpts.cpp 11116
SkRecordOpts.h 901
SkRecordPattern.h 6236
SkRecords.cpp 488
SkRecords.h 13224
SkRect.cpp %f 12755
SkRectPriv.h 4489
SkRegion.cpp Region Layout TOP [ Bottom, X-Intervals, [Left, Right]..., X-Sentinel ] ... Y-Sentinel 47950
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. 19285
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 18198
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.). 10409
SkRRect.cpp 34096
SkRRectPriv.h 2688
SkRSXform.cpp 1436
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= 3144
SkRuntimeBlender.h 1596
SkRuntimeEffect.cpp 42608
SkRuntimeEffectPriv.h 8844
SkSafeRange.h 1144
SkSamplingPriv.h 3133
SkScalar.cpp 1160
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. 49583
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. 19525
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. 5962
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. 81683
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. 32408
SkScan_AntiPath.cpp Would any of the coordinates of this rectangle not fit in a short, when left-shifted by shift? 5442
SkScan_Hairline.cpp 27312
SkScan_Path.cpp 25747
SkScanPriv.h 2629
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 8072
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 27362
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. 1535
SkStrike.cpp 15111
SkStrike.h 8481
SkStrikeCache.cpp 10475
SkStrikeCache.h 4413
SkStrikeSpec.cpp 9815
SkStrikeSpec.h 6013
SkString.cpp 18163
SkStringUtils.cpp 3281
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 63261
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. 2539
SkStrokeRec.cpp 5328
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 :( 8101
SkStrokerPriv.h 1461
SkSurfacePriv.h 568
SkSwizzle.cpp 329
SkSwizzlePriv.h 2392
SkSwizzler_opts.cpp 1594
SkSwizzler_opts_hsw.cpp 1398
SkSwizzler_opts_ssse3.cpp 1523
SkTaskGroup.cpp 1622
SkTaskGroup.h 1426
SkTDynamicHash.h 1764
SkTextBlob.cpp 38262
SkTextBlobPriv.h Serialize to a buffer. 7684
SkTextFormatParams.h 1028
SkTHash.h 20094
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. 5174
SkTraceEvent.h 17249
SkTraceEventCommon.h 32776
SkTypeface.cpp 18835
SkTypeface_remote.cpp 6867
SkTypeface_remote.h 6925
SkTypefaceCache.cpp 3107
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 4482
SkValidationUtils.h Returns true if mode's value is in the SkBlendMode enum. 976
SkVertices.cpp 12034
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 10577
SkWriteBuffer.h Concrete implementation that serializes to a flat binary blob. 6133
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 10615
SkYUVMath.cpp 28850
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