Name Description Size
Sk4px.h 8887
SkAAClip.cpp Data runs are packed [count, alpha] 56753
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. 3410
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. 2884
SkAlphaRuns.cpp 1798
SkAnalyticEdge.cpp 19986
SkAnalyticEdge.h 4704
SkAnnotation.cpp 1432
SkAnnotationKeys.h Returns the canonical key whose payload is a URL 728
SkAntiRun.h Sparse array of run-length-encoded alpha (supersampling coverage) values. Sparseness allows us to independently compose several paths into the same SkAlphaRuns buffer. 5980
SkATrace.cpp 3055
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). 2199
SkAutoBlitterChoose.h 1829
SkAutoPixmapStorage.cpp 1946
SkAutoPixmapStorage.h Leave the moved-from object in a free-but-valid state. 2729
SkBBHFactory.cpp 444
SkBigPicture.cpp 2872
SkBigPicture.h 2529
SkBitmap.cpp 21853
SkBitmapCache.cpp Use this for bitmapcache and mipmapcache entries. 9636
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. 1869
SkBitmapDevice.cpp 25892
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. 6501
SkBitmapProcState.cpp 22973
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. 8430
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. 18962
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. 3597
SkBlendMode.cpp 7548
SkBlendModeBlender.cpp 4759
SkBlendModeBlender.h 1174
SkBlendModePriv.h Sentinel value for SkBlendMode enum. Will never be a valid enum value, but will be storable in a byte. 1068
SkBlitBWMaskTemplate.h SK_BLITBWMASK_NAME name of function(const SkBitmap& bitmap, 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 4178
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 1158
SkBlitRow_D32.cpp 10917
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"); } 29389
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. 11214
SkBlitter_A8.cpp 8953
SkBlitter_A8.h 1351
SkBlitter_ARGB32.cpp We want all of these in 5bits, hence the shifts in case one of them (green) is 6bits. 53757
SkBlitter_Sprite.cpp 8499
SkBlurMask.cpp 24617
SkBlurMask.h Helper functions for analytic rectangle blurs 4370
SkBlurMF.cpp 70505
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). 3416
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 118899
SkCanvas_Raster.cpp 1780
SkCanvasPriv.cpp 4984
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. 4019
SkCapabilities.cpp 704
SkChromeRemoteGlyphCache.cpp 47995
SkClipStack.cpp 35656
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= 4076
SkClipStackDevice.h 1564
SkColor.cpp 4513
SkColorFilter.cpp 24874
SkColorFilter_Matrix.cpp dst 9711
SkColorFilterBase.h Returns the flags for this filter. Override in subclasses to return custom flags. 4840
SkColorFilterPriv.h 1242
SkColorSpace.cpp 14503
SkColorSpacePriv.h 3119
SkColorSpaceXformSteps.cpp 8337
SkColorSpaceXformSteps.h 1771
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 23476
SkConvertPixels.cpp 9508
SkConvertPixels.h 510
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. 5122
SkCpu.cpp 6598
SkCpu.h 3284
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. 975
SkCubicMap.cpp 2154
SkCubicSolver.h 1571
SkData.cpp This constructor means we are inline with our fPtr's contents. Thus we set fPtr to point right after this. 6104
SkDataTable.cpp 3684
SkDebug.cpp 334
SkDebugUtils.h 582
SkDeferredDisplayList.cpp 2142
SkDeferredDisplayListPriv.h / /** Class that adds methods to SkDeferredDisplayList that are only intended for use internal to Skia. This class is purely a privileged window into SkDeferredDisplayList. It should never have additional data members or virtual methods. 1996
SkDeferredDisplayListRecorder.cpp 10641
SkDescriptor.cpp 7277
SkDescriptor.h 3337
SkDevice.cpp localToDevice = 25859
SkDevice.h Return ImageInfo for this device. If the canvas is not backed by pixels (cpu or gpu), then the info's ColorType will be kUnknown_SkColorType. 26513
SkDistanceFieldGen.cpp 19842
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 2098
SkDraw.cpp 21092
SkDraw.h If dstOrNull is null, computes a dst by mapping the bitmap's bounds through the matrix. 2684
SkDraw_atlas.cpp 8496
SkDraw_text.cpp UINT16_MIN 5357
SkDraw_vertices.cpp 20833
SkDrawable.cpp 2462
SkDrawBase.cpp 27349
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. 6311
SkDrawLooper.cpp 3143
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 9653
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). 15545
SkEdge.h 3686
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
SkEnumBitMask.h Wraps an enum that is used for flags, and enables masking with type safety. Example: enum class MyFlags { kNone = 0, kA = 1, kB = 2, kC = 4, }; MAKE_MASK_OPS(MyFlags) ... Mask<MyFlags> flags = MyFlags::kA | MyFlags::kB; if (flags & MyFlags::kB) {} ... 2787
SkEnumerate.h 4443
SkExecutor.cpp 4709
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 4284
SkFont.cpp 13149
SkFont_serial.cpp 3307
SkFontDescriptor.cpp 11074
SkFontDescriptor.h Makes a copy of the data in 'axis'. 6268
SkFontMetricsPriv.cpp 2115
SkFontMetricsPriv.h 545
SkFontMgr.cpp 10579
SkFontMgrPriv.h 332
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. 4333
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 6589
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. 1443
SkFuzzLogging.h 633
SkGaussFilter.cpp 3568
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 60619
SkGeometry.h Given a quadratic equation Ax^2 + Bx + C = 0, return 0, 1, 2 roots for the equation. 19761
SkGlobalInitialization_core.cpp 483
SkGlyph.cpp 23629
SkGlyph.h 24006
SkGlyphRunPainter.cpp 17340
SkGlyphRunPainter.h 1844
SkGpuBlurUtils.cpp Draws 'dstRect' into 'surfaceFillContext' evaluating a 1D Gaussian over 'srcView'. The src rect is 'dstRect' offset by 'dstToSrcOffset'. 'mode' and 'bounds' are applied to the src coords. 49165
SkGpuBlurUtils.h Maximum sigma before the implementation downscales the input image. 4403
SkGraphics.cpp 2912
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. 1953
SkImageFilter.cpp Returns the number of inputs this filter will accept (some inputs can be NULL). 30348
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. 25165
SkImageFilterCache.cpp 5125
SkImageFilterCache.h 2888
SkImageFilterTypes.cpp 20551
SkImageFilterTypes.h 36804
SkImageGenerator.cpp 4151
SkImageInfo.cpp 9132
SkImageInfoPriv.h 7729
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. 2768
SkIPoint16.h \struct SkIPoint16 SkIPoint16 holds two 16 bit integer coordinates. 1263
SkLatticeIter.cpp Divs must be in increasing order with no duplicates. 10089
SkLatticeIter.h Disect a lattice request into an sequence of src-rect / dst-rect pairs 2245
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 2798
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. 1344
SkLRUCache.h A generic LRU cache. 3119
SkM44.cpp 12641
SkMallocPixelRef.cpp 2640
SkMask.cpp returns the product if it is positive and fits in 31 bits. Otherwise this returns 0. 3303
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. 8703
SkMaskBlurFilter.cpp 37151
SkMaskBlurFilter.h 1042
SkMaskCache.cpp 6090
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. 1555
SkMaskFilter.cpp 14315
SkMaskFilterBase.h Returns the format of the resulting mask that this subclass will return when its filterMask() method is called. 11036
SkMaskGamma.cpp static 5007
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]. 9291
SkMatrix.cpp 64391
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. 7922
SkMatrixProvider.h All matrix providers report a flag: "localToDeviceHitsPixelCenters". This is confusing. It doesn't say anything about the actual matrix in the provider. Instead, it means: "is it safe to tweak sampling based on the contents of the matrix". In other words, does the device end of the local-to-device matrix actually map to pixels, AND are the local coordinates being fed to the shader produced by the inverse of that matrix? For a normal device, this is trivially true. The matrix may be updated via transforms, but when we draw (and the local coordinates come from rasterization of primitives against that device), we can know that the device coordinates will land on pixel centers. In a few places, the matrix provider is lying about how sampling "works". When we invoke a child from runtime effects, we give that child a matrix provider with an identity matrix. However -- the coordinates being passed to that child are not the result of device -> local transformed coordinates. Runtime effects can generate coordinates arbitrarily - even though the provider has an identity matrix, we can't assume it's safe to (for example) convert linear -> nearest. Clip shaders are similar - they overwrite the local-to-device matrix (to match what it was when the clip shader was inserted). The CTM continues to change before drawing, though. In that case, the two matrices are not inverses, so the local coordinates may not land on texel centers in the clip shader. In cases where we need to inhibit filtering optimizations, use SkOverrideDeviceMatrixProvider. 3166
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. 10217
SkMD5.h Calculate a 128-bit MD5 message-digest of the bytes sent to this stream. 1163
SkMesh.cpp 37009
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 it's index will returned as PassthroughLocalCoordsVaryingIndex. Our analysis is not very sophisticated so this is determined conservatively. 8746
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 31342
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. 3580
SkMipmapAccessor.cpp 4034
SkMipmapAccessor.h 1530
SkMipmapBuilder.cpp 901
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. 870
SkModeColorFilter.cpp sRGB 9457
SkNextID.h Shared between SkPixelRef's generationID and SkImage's uniqueID 386
SkOpts.cpp 4926
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 sse42 instructions. (https://en.wikipedia.org/wiki/SSE4) SkOpts allow Skia to have two versions of a CRC32 checksum function, one that uses normal C++ code (e.g. loops, bit operations, table lookups) and one that makes use of the _mm_crc32_u64 intrinsic function which uses the SSE4.2 crc32 machine instruction under the hood. This hash 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 hash function are done in a header file file in //src/opts (e.g. //src/opts/SkChecksum_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. sse42::). These .cpp files don't implement the specializations, they just refer to the specialization created in the header files (e.g. SkChecksum_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::hash_fn). - 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. (sse42::hash_fn). 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_sse42, Init_ssse3). Note multiple Init functions can be called as CPU instruction sets are typically super sets of older instruction sets 7206
SkOpts_erms.cpp 5115
SkOrderedReadBuffer.h 257
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 9991
SkPaint.cpp 8856
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 9426
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. 2207
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 131970
SkPath_serial.cpp 9003
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); 31418
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. 7531
SkPathEffectBase.h \class PointData PointData aggregates all the information needed to draw the point primitives returned by an 'asPoints' call. 5770
SkPathMakers.h 2950
SkPathMeasure.cpp 1490
SkPathMeasurePriv.h 746
SkPathPriv.h Return the opposite of the specified direction. kUnknown is its own opposite. 19842
SkPathRef.cpp 22948
SkPathUtils.cpp 2855
SkPicture.cpp SkPicture impl. This handles generic responsibilities like unique IDs and serialization. 11734
SkPictureData.cpp 21398
SkPictureData.h 6819
SkPictureFlat.cpp 604
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. 5981
SkPictureImageGenerator.cpp 6334
SkPicturePlayback.cpp 29510
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. 7395
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). 33154
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. 10120
SkPictureRecorder.cpp bbh 4960
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 4888
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 28539
SkPixmapDraw.cpp 3360
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. 5633
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 4194
SkPromiseImageTexture.cpp 467
SkPtrRecorder.cpp 1752
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. 4689
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 3431
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. 1918
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). 8929
SkRasterClip.h Wraps a SkRegion and SkAAClip, so we have a single object that can represent either our BW or antialiased clips. 5181
SkRasterClipStack.h 3432
SkRasterPipeline.cpp 22360
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. 5598
SkRasterPipelineBlitter.cpp 24865
SkRasterPipelineOpContexts.h <= SkRasterPipeline_kMaxStride_highp 6640
SkRasterPipelineOpList.h 14109
SkReadBuffer.cpp 14569
SkReadBuffer.h Returns true IFF the version is older than the specified version. 8448
SkReadPixelsRec.cpp 1135
SkReadPixelsRec.h Helper class to package and trim the parameters passed to readPixels() 1285
SkRecord.cpp 1050
SkRecord.h 6969
SkRecordDraw.cpp save now, restore at exit 22728
SkRecordDraw.h 3251
SkRecordedDrawable.cpp 3495
SkRecordedDrawable.h 1231
SkRecorder.cpp 15240
SkRecorder.h 6420
SkRecordOpts.cpp 11748
SkRecordOpts.h 979
SkRecordPattern.h 5075
SkRecords.cpp 728
SkRecords.h 12536
SkRect.cpp %f 11234
SkRectPriv.h 3672
SkRegion.cpp Region Layout TOP [ Bottom, X-Intervals, [Left, Right]..., X-Sentinel ] ... Y-Sentinel 47829
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. 18824
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 17904
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.). 10449
SkRRect.cpp 33873
SkRRectPriv.h 2688
SkRSXform.cpp 1436
SkRTree.cpp 5182
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" 2508
SkRuntimeEffect.cpp 87125
SkRuntimeEffectPriv.h 7106
SkSafeRange.h 1144
SkSamplingPriv.h 2963
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. 48010
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. 18727
SkScaleToSides.h 2444
SkScan.cpp 2986
SkScan.h Defines a fixed-point rectangle, identical to the integer SkIRect, but its coordinates are treated as SkFixed rather than int32_t. 6221
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. 81843
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. 32027
SkScan_AntiPath.cpp Would any of the coordinates of this rectangle not fit in a short, when left-shifted by shift? 6713
SkScan_Hairline.cpp 26922
SkScan_Path.cpp 25535
SkScan_SAAPath.cpp @file We have two techniques for capturing the output of the supersampler: - SUPERMASK, which records a large mask-bitmap this is often faster for small, complex objects - RLE, which records a rle-encoded scanline this is often faster for large objects with big spans These blitters use two coordinate systems: - destination coordinates, scale equal to the output - often abbreviated with 'i' or 'I' in variable names - supersampled coordinates, scale equal to the output * SCALE 19093
SkScanPriv.h 2629
SkSharedMutex.cpp Report that a lock has been created at address "lock". 13347
SkSharedMutex.h 3155
SkSLTypeShared.cpp Is the shading language type full precision? 7610
SkSLTypeShared.h Types of shader-language-specific boxed variables we can create. 6557
SkSpecialImage.cpp 19527
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. 10806
SkSpecialSurface.cpp addInitialClear= 4791
SkSpecialSurface.h SkSpecialSurface is a restricted form of SkSurface solely for internal use. It differs from SkSurface in that: - it can be backed by GrTextures larger than [ fWidth, fHeight ] - it can't be used for tiling - it becomes inactive once a snapshot of it is taken (i.e., no copy-on-write) - it has no generation ID 3201
SkSpinlock.cpp stderr 1358
SkSpriteBlitter.h 1486
SkSpriteBlitter_ARGB32.cpp 3826
SkStream.cpp 27278
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 15082
SkStrike.h 8358
SkStrikeCache.cpp 9846
SkStrikeCache.h 4137
SkStrikeSpec.cpp 12217
SkStrikeSpec.h 6257
SkString.cpp 18058
SkStringUtils.cpp 3142
SkStringUtils.h Indents every non-empty line of the string by tabCnt tabs 1950
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 62822
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. 2440
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 :( 8023
SkStrokerPriv.h 1374
SkSurfaceCharacterization.cpp 7021
SkSurfacePriv.h 568
SkSwizzle.cpp 322
SkSwizzlePriv.h 1022
SkTaskGroup.cpp 1589
SkTaskGroup.h 1388
SkTDynamicHash.h 1754
SkTextBlob.cpp 37965
SkTextBlobPriv.h Serialize to a buffer. 7940
SkTextBlobTrace.cpp 4288
SkTextBlobTrace.h 1236
SkTextFormatParams.h 1009
SkTHash.h 19202
SkTime.cpp 2764
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 17603
SkTraceEventCommon.h 32315
SkTypeface.cpp 20225
SkTypeface_remote.cpp 6684
SkTypeface_remote.h 6692
SkTypefaceCache.cpp 2887
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 4484
SkValidationUtils.h Returns true if mode's value is in the SkBlendMode enum. 1013
SkVertices.cpp 11996
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. 2106
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. 1605
SkVM.cpp 178388
SkVM.h 58118
SkVM_fwd.h 423
SkVMBlitter.cpp device 32295
SkVMBlitter.h 4065
SkWriteBuffer.cpp Format: flags: U32 encoded : size_32 + data[] [subset: IRect] [mips] : size_32 + data[] 8731
SkWriteBuffer.h Concrete implementation that serializes to a flat binary blob. 6097
SkWritePixelsRec.cpp 1144
SkWritePixelsRec.h Helper class to package and trim the parameters passed to writePixels() 1289
SkWriter32.cpp 2182
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. 8829
SkXfermode.cpp rgb_coverage= 5912
SkXfermodeInterpretation.cpp 1703
SkXfermodeInterpretation.h By analyzing the paint, we may decide we can take special action. This enum lists our possible actions. 899
SkXfermodePriv.h Return an SkXfermode object for the specified mode. 1830
SkYUVAInfo.cpp 13933
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 11670
SkYUVMath.cpp 13235
SkYUVMath.h 463
SkYUVPlanesCache.cpp 2905
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. 1147