aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
Commit message (Collapse)AuthorAge
* Make SkPath::RawIter require a non-NULL pts pointer.Gravatar bsalomon@google.com2012-06-07
| | | | | | | | Review URL: http://codereview.appspot.com/6301060/ git-svn-id: http://skia.googlecode.com/svn/trunk@4206 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix warnings on Mac in src/coreGravatar caryclark@google.com2012-06-06
| | | | | | | | | | | | | | | | | | Fix these class of warnings: - unused functions - unused locals - sign mismatch - missing function prototypes - missing newline at end of file - 64 to 32 bit truncation The changes prefer to link in dead code in the debug build with 'if (false)' than to comment it out, but trivial cases are commented out or sometimes deleted if it appears to be a copy/paste error. Review URL: https://codereview.appspot.com/6301046 git-svn-id: http://skia.googlecode.com/svn/trunk@4182 2bbb7eff-a529-9590-31e7-b0007b416f81
* Instance counting for SkRefCnt-derived objects (w/ CanvasTest fix)Gravatar robertphillips@google.com2012-06-05
| | | | | | | | http://codereview.appspot.com/6242070/ git-svn-id: http://skia.googlecode.com/svn/trunk@4170 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reverting r4162Gravatar robertphillips@google.com2012-06-05
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4164 2bbb7eff-a529-9590-31e7-b0007b416f81
* Added instance counting system for SkRefCnt-derived objectsGravatar robertphillips@google.com2012-06-05
| | | | | | | | http://codereview.appspot.com/6242070/ git-svn-id: http://skia.googlecode.com/svn/trunk@4162 2bbb7eff-a529-9590-31e7-b0007b416f81
* change gm to use concat instead of setMatrix, so we don't trash the caller ifGravatar reed@google.com2012-06-04
| | | | | | | | it was recorded into a picture. git-svn-id: http://skia.googlecode.com/svn/trunk@4147 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding option to serialize mutable bitmaps in SkPictureGravatar junov@chromium.org2012-06-01
| | | | | | | | | BUG=http://code.google.com/p/chromium/issues/detail?id=115654 REVIEW=http://codereview.appspot.com/6221066/ git-svn-id: http://skia.googlecode.com/svn/trunk@4130 2bbb7eff-a529-9590-31e7-b0007b416f81
* Punctuation cleanup to satisfy idiosyncracies of OpenBSD gcc 4.2.1.Gravatar tomhudson@google.com2012-06-01
| | | | | | | | | | Original patch by landry.breuil. http://code.google.com/p/skia/issues/detail?id=626 git-svn-id: http://skia.googlecode.com/svn/trunk@4112 2bbb7eff-a529-9590-31e7-b0007b416f81
* Update the implementation of SkTypeface_android.h functions.Gravatar djsollen@google.com2012-06-01
| | | | | | | | | | | This CL removes the hardcoded mappings of FallbackScripts to a particular font file and replaces it with a dynamic mechanism that takes a style and representative character code for a given FallbackScript class and returns the most appropriate SkTypeface that contains that character code. Review URL: https://codereview.appspot.com/6197074 git-svn-id: http://skia.googlecode.com/svn/trunk@4111 2bbb7eff-a529-9590-31e7-b0007b416f81
* We often rgn-diff an area >= the other rgn. now we detect that and return emptyGravatar reed@google.com2012-05-31
| | | | | | | We do this when we update our devices in SkCanvas.cpp Review URL: https://codereview.appspot.com/6249073 git-svn-id: http://skia.googlecode.com/svn/trunk@4101 2bbb7eff-a529-9590-31e7-b0007b416f81
* Refactor dictionaries for use by entities other than just SkPictureGravatar djsollen@google.com2012-05-30
| | | | | | Review URL: https://codereview.appspot.com/6101043 git-svn-id: http://skia.googlecode.com/svn/trunk@4077 2bbb7eff-a529-9590-31e7-b0007b416f81
* arm: First step towards dynamic NEON support.Gravatar digit@google.com2012-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds minimal support for dynamic ARM NEON support, i.e. the ability to probe the CPU at runtime for NEON and provide alternate code paths when it is available. - Add include/core/SkUtilsArm.h, which declares a few helper macros (e.g. SK_NEON_ARM_IS_DYNAMIC), plus the handy function 'sk_cpu_arm_has_neon()' which returns true if the target CPU supports the ARM NEON instruction set. Note that the header is in include/core/ because it will have to be included from NEON-specific code under src/code/ It would probably be more logical to put it under include/opts/ instead, but this would require moving all the NEON-specific stuff under src/code/ into src/opts/, which is not trivial due to the way the code is currently architected. - Add src/core/SkUtilsArm.cpp which implements 'sk_cpu_arm_has_neon' for ARM-based Linux systems, only when SK_NEON_ARM_IS_DYNAMIC is true. (For other cases, 'sk_cpu_arm_has_neon' is an inline function that returns a constant 'true' or 'false' value). There is no user-level accessible CPUID instruction on ARM, so do all CPU feature probing by parsing /proc/cpuinfo. This is Linux-specific. For Debug build types, the CPU probing result is printed to the Android log (or Linux command-line) for easier debugging. - Create a new 'opts_neon' target (static library) which shall contain all the NEON-specific code paths for the library. This is necessary because -mfpu=neon impacts also non-scalar code. Just like with -mssse3 on x86, we can't build the rest of the library with this flag. Note that for now, we only include memset16_neon and memset32_neon in this library. - Modify opts_check_arm.cpp to implement SK_ARM_NEON_IS_DYNAMIC properly. Compared to a 'xoom' build, the only difference is the use of NEON-optimized memset16/32 functions. Later patches will move more NEON-specific code paths to 'opts_neon'. Review URL: https://codereview.appspot.com/6247058 git-svn-id: http://skia.googlecode.com/svn/trunk@4069 2bbb7eff-a529-9590-31e7-b0007b416f81
* addPoly() entry-point, to quickly add MoveTo+N*LineTo (useful in dashing)Gravatar reed@google.com2012-05-29
| | | | | | Review URL: https://codereview.appspot.com/6256063 git-svn-id: http://skia.googlecode.com/svn/trunk@4061 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fixing a reader size overflow with SkOrderedReadBuffer, when unflattening ↵Gravatar junov@chromium.org2012-05-29
| | | | | | | | | | large bitmaps. REVIEW=http://codereview.appspot.com/6250054/ git-svn-id: http://skia.googlecode.com/svn/trunk@4059 2bbb7eff-a529-9590-31e7-b0007b416f81
* Detect when the caller was hairline AND strokeandfill, and resolve that into ↵Gravatar reed@google.com2012-05-29
| | | | | | | | | FILL This fixes the unittests on WIN in the trybot for DEPS roll 4048 Review URL: https://codereview.appspot.com/6242057 git-svn-id: http://skia.googlecode.com/svn/trunk@4057 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change patheffect to take a (new) StrokeRec object, which encapsulates the fillGravatar reed@google.com2012-05-25
| | | | | | | | | | | | | | | | | | | or stroke parameters for a path. Today, the patheffect only sees if the caller was going to stroke or fill, and if stroke, it just sees the width. With this change, the effect can see all of the related parameters (e.g. cap/join/miter). No other change is intended at this time. After this change, I hope to use this additional data to allow SkDashPathEffect to, at times, apply the stroke as part of its effect, which may be much more efficient than first dashing, and then reading that and stroking it. Most of these files changed just because of the new parameter to filterPath. The key changes are in SkPathEffect.[h,cpp], SkPaint.cpp and SkScalerContext.cpp Review URL: https://codereview.appspot.com/6250051 git-svn-id: http://skia.googlecode.com/svn/trunk@4048 2bbb7eff-a529-9590-31e7-b0007b416f81
* revert 4046 -- GM:pathfill failed on one bot, maybe uninitialized memory ↵Gravatar reed@google.com2012-05-24
| | | | | | somewhere? git-svn-id: http://skia.googlecode.com/svn/trunk@4047 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change patheffect to take a (new) StrokeRec object, which encapsulates the fillGravatar reed@google.com2012-05-24
| | | | | | | | | | | | | | | | | | | or stroke parameters for a path. Today, the patheffect only sees if the caller was going to stroke or fill, and if stroke, it just sees the width. With this change, the effect can see all of the related parameters (e.g. cap/join/miter). No other change is intended at this time. After this change, I hope to use this additional data to allow SkDashPathEffect to, at times, apply the stroke as part of its effect, which may be much more efficient than first dashing, and then reading that and stroking it. Most of these files changed just because of the new parameter to filterPath. The key changes are in SkPathEffect.[h,cpp], SkPaint.cpp and SkScalerContext.cpp Review URL: https://codereview.appspot.com/6249050 git-svn-id: http://skia.googlecode.com/svn/trunk@4046 2bbb7eff-a529-9590-31e7-b0007b416f81
* Plumbing to propagate save & restore from SkCanvas down to GrContext & lowerGravatar robertphillips@google.com2012-05-23
| | | | | | | | http://codereview.appspot.com/6203067/ git-svn-id: http://skia.googlecode.com/svn/trunk@4034 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove bogus nearlyzero checksGravatar reed@google.com2012-05-21
| | | | | | Review URL: https://codereview.appspot.com/6213060 git-svn-id: http://skia.googlecode.com/svn/trunk@4014 2bbb7eff-a529-9590-31e7-b0007b416f81
* ~glyphcache_globals needs to actually delete its cacheGravatar reed@google.com2012-05-21
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4011 2bbb7eff-a529-9590-31e7-b0007b416f81
* minor cleanups, in prep for more work on improving precisionGravatar reed@google.com2012-05-17
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3993 2bbb7eff-a529-9590-31e7-b0007b416f81
* change SkChunkAlloc to grow its allocations geometrically (not linearly)Gravatar reed@google.com2012-05-17
| | | | | | | | plus add a bench and unittest for it. git-svn-id: http://skia.googlecode.com/svn/trunk@3989 2bbb7eff-a529-9590-31e7-b0007b416f81
* change SetTLSFontCacheLimit to be void, since it doesn't easily know the ↵Gravatar reed@google.com2012-05-17
| | | | | | prev value git-svn-id: http://skia.googlecode.com/svn/trunk@3987 2bbb7eff-a529-9590-31e7-b0007b416f81
* Allow font-cache to use thread_local_storage for a private cacheGravatar reed@google.com2012-05-17
| | | | | | Review URL: https://codereview.appspot.com/6200051 git-svn-id: http://skia.googlecode.com/svn/trunk@3986 2bbb7eff-a529-9590-31e7-b0007b416f81
* Mutexes in pixelrefs were done very sloppily initially. The code (a) assumes allGravatar reed@google.com2012-05-17
| | | | | | | | | | | | | | | | | | | | pixelref subclasses want a mutex to guard their lock/unlock virtuals, and (b) most subclasses use the same mutex for *all* of their instances, even when there is no explicit need to guard modifying one instances with another. When we try drawing bitmaps from multiple threads, we are seeing a lot of slow- down from these mutexes. This CL has two changes to try to speed things up. 1. Add setPreLocked(), for pixelrefs who never need the onLockPixels virtual to be called. This speeds up those subclasses in multithreaded environs as it avoids the mutex lock all together (e.g. SkMallocPixelRef). 2. Add setMutex() to allow a subclass to change the mutex choice. ashmem wants this, since its unflattening constructor cannot pass down the null, it needs to cleanup afterwards. Review URL: https://codereview.appspot.com/6199075 git-svn-id: http://skia.googlecode.com/svn/trunk@3985 2bbb7eff-a529-9590-31e7-b0007b416f81
* pass the region-op to the clipstack for SkCanvas::clipRegion.Gravatar reed@google.com2012-05-16
| | | | | | | | we were defaulting to intersect all the time (doh). git-svn-id: http://skia.googlecode.com/svn/trunk@3980 2bbb7eff-a529-9590-31e7-b0007b416f81
* WeakRefCntGravatar bungeman@google.com2012-05-16
| | | | | | | http://codereview.appspot.com/5649046/ git-svn-id: http://skia.googlecode.com/svn/trunk@3978 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove unused variable (isNaN)Gravatar reed@google.com2012-05-16
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3976 2bbb7eff-a529-9590-31e7-b0007b416f81
* Iter::next takes a bool (defaults to true for now) if we want to consume ↵Gravatar reed@google.com2012-05-16
| | | | | | | | | | degenerates. path-filling and stroking pass false, as they already are written to handle small segments (and it makes next() run 2x faster if you pass false). Review URL: https://codereview.appspot.com/6214049 git-svn-id: http://skia.googlecode.com/svn/trunk@3974 2bbb7eff-a529-9590-31e7-b0007b416f81
* perform quickReject in drawPoints (which is called by drawLine) just like weGravatar reed@google.com2012-05-16
| | | | | | | | already did in drawRect and drawPath git-svn-id: http://skia.googlecode.com/svn/trunk@3968 2bbb7eff-a529-9590-31e7-b0007b416f81
* add computeFastBounds to SkPathEffect, so we can attempt quickRejectGravatar reed@google.com2012-05-15
| | | | | | Review URL: https://codereview.appspot.com/6209070 git-svn-id: http://skia.googlecode.com/svn/trunk@3964 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove null-check in SKPath::Iter::next() -- not needed, and slows us down a ↵Gravatar reed@google.com2012-05-15
| | | | | | little git-svn-id: http://skia.googlecode.com/svn/trunk@3944 2bbb7eff-a529-9590-31e7-b0007b416f81
* for scalar==float, tis faster to always to MIN and MAX, than to put an ELSEGravatar reed@google.com2012-05-15
| | | | | | | | | | | | | | | | | | betwixt them. if (x < min) min = x; else if (x > max) max = x; This expression forces the compiler to know if the min expression executed, and insert a conditional jump before the max. Slow. if (x < min) min = x; if (x > max) max = x; This version allows the compiler to emitt MINSS and MAXSS unconditionally, giving us a loop with zero branches inside. git-svn-id: http://skia.googlecode.com/svn/trunk@3939 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use x*0 instead of x!=x to detect non-finite values, since x*0 also detects ↵Gravatar reed@google.com2012-05-15
| | | | | | | | | | | | | infinities and it is faster (at least faster in SkRect::set). Add unittest for SkRect::set to see that it correctly detects NaN and infinities. git-svn-id: http://skia.googlecode.com/svn/trunk@3936 2bbb7eff-a529-9590-31e7-b0007b416f81
* pre allocate space for the result (guesstimation) so we don't spend extra timeGravatar reed@google.com2012-05-15
| | | | | | | | re-growing while we build the stroke. git-svn-id: http://skia.googlecode.com/svn/trunk@3934 2bbb7eff-a529-9590-31e7-b0007b416f81
* inline the fast case for AutoDrawLoop::next() so we don't slow down simpleGravatar reed@google.com2012-05-15
| | | | | | | | draws like drawRect (with no fancy effects) git-svn-id: http://skia.googlecode.com/svn/trunk@3933 2bbb7eff-a529-9590-31e7-b0007b416f81
* special-case filling narrow rects, where we can be faster than the SSE2 asmGravatar reed@google.com2012-05-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3932 2bbb7eff-a529-9590-31e7-b0007b416f81
* update the nearly_integral calculation to be (a) faster, and (b) to correctlyGravatar reed@google.com2012-05-11
| | | | | | | | identify that the AA granularity is 1/4 of a pixel, not 1/16 (along an axis). git-svn-id: http://skia.googlecode.com/svn/trunk@3919 2bbb7eff-a529-9590-31e7-b0007b416f81
* only check for nearly-integral if we're a BW clipGravatar reed@google.com2012-05-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3915 2bbb7eff-a529-9590-31e7-b0007b416f81
* lazily make a copy of the paint when choosing a blitter. For simple draws,Gravatar reed@google.com2012-05-11
| | | | | | | | this is never actually needed, and it is faster to skip the copy. git-svn-id: http://skia.googlecode.com/svn/trunk@3908 2bbb7eff-a529-9590-31e7-b0007b416f81
* inline isEmpty and isRect (faster)Gravatar reed@google.com2012-05-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3907 2bbb7eff-a529-9590-31e7-b0007b416f81
* use mapPoints instead of mapXY for the 2 corners of a rect (faster)Gravatar reed@google.com2012-05-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3906 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SkPath::isLine(), similar to isRect()Gravatar reed@google.com2012-05-10
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3892 2bbb7eff-a529-9590-31e7-b0007b416f81
* move SkStrokePathEffect into hiding for now, as its functionality is rethought.Gravatar reed@google.com2012-05-10
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3890 2bbb7eff-a529-9590-31e7-b0007b416f81
* don't define SK_USE_LEGACY_AA_COVERAGE, so that we can get the more exactGravatar reed@google.com2012-05-09
| | | | | | | | | | | | | coverage values (which also unifies our RLE and MASK supersampler results). Chrome will want to define SK_USE_LEGACY_AA_COVERAGE for now, until it can rebaseline its affected images. A rebaseline of skia gm images will follow. git-svn-id: http://skia.googlecode.com/svn/trunk@3877 2bbb7eff-a529-9590-31e7-b0007b416f81
* invert sense of conditional EXACT_COVERAGE, renaming to LEGACY_AA_COVERAGEGravatar reed@google.com2012-05-09
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3876 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove obsolete commentsGravatar reed@google.com2012-05-09
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3875 2bbb7eff-a529-9590-31e7-b0007b416f81
* add assertGravatar reed@google.com2012-05-09
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3874 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove dead conditionalGravatar reed@google.com2012-05-09
| | | | | | Review URL: https://codereview.appspot.com/6197065 git-svn-id: http://skia.googlecode.com/svn/trunk@3873 2bbb7eff-a529-9590-31e7-b0007b416f81