aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkGradientShader.cpp
Commit message (Collapse)AuthorAge
* Add SkDEBUGFAIL to clean up use of SkASSERT(!"text");Gravatar tomhudson@google.com2011-12-28
| | | | | | | | | | catch a couple of latent SkASSERT("text") bugs. http://codereview.appspot.com/5504090/ git-svn-id: http://skia.googlecode.com/svn/trunk@2926 2bbb7eff-a529-9590-31e7-b0007b416f81
* add optional manual global initializationGravatar caryclark@google.com2011-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | M include/effects/SkAvoidXfermode.h M include/effects/SkDiscretePathEffect.h M include/effects/Sk1DPathEffect.h M include/effects/Sk2DPathEffect.h M include/effects/SkBlurDrawLooper.h M include/effects/SkPixelXorXfermode.h M include/effects/SkDashPathEffect.h M include/effects/SkColorMatrixFilter.h M include/effects/SkEmbossMaskFilter.h M include/effects/SkLayerDrawLooper.h M include/effects/SkGroupShape.h M include/effects/SkBlurImageFilter.h M include/effects/SkRectShape.h A include/effects/SkEffects.h M include/effects/SkCornerPathEffect.h M include/effects/SkGradientShader.h M include/effects/SkBlurMaskFilter.h M include/effects/SkLayerRasterizer.h M include/core/SkMallocPixelRef.h M include/core/SkFlattenable.h M include/core/SkShape.h M include/core/SkPixelRef.h M include/core/SkGraphics.h M include/core/SkPathEffect.h M include/core/SkPostConfig.h M include/core/SkXfermode.h M include/core/SkColorFilter.h M include/images/SkFlipPixelRef.h M include/images/SkImageRef_GlobalPool.h M src/effects/SkDashPathEffect.cpp M src/effects/SkColorMatrixFilter.cpp M src/effects/SkBlurImageFilter.cpp M src/effects/SkGroupShape.cpp M src/effects/SkCornerPathEffect.cpp M src/effects/SkGradientShader.cpp M src/effects/SkBlurMaskFilter.cpp M src/effects/SkAvoidXfermode.cpp M src/effects/Sk2DPathEffect.cpp M src/effects/SkBlurDrawLooper.cpp M src/effects/SkPixelXorXfermode.cpp M src/effects/SkColorFilters.cpp M src/effects/SkLayerDrawLooper.cpp M src/effects/SkRectShape.cpp A src/effects/SkEffects.cpp M src/effects/SkLayerRasterizer.cpp M src/effects/SkDiscretePathEffect.cpp M src/effects/Sk1DPathEffect.cpp A src/effects/SkEffects_none.cpp M src/core/SkPixelRef.cpp M src/core/SkGraphics.cpp M src/core/SkFlattenable.cpp M src/core/SkBitmapProcShader.h M src/core/SkPathEffect.cpp M src/core/SkShape.cpp M src/core/SkXfermode.cpp M src/core/SkMallocPixelRef.cpp M src/core/SkBitmapProcShader.cpp M src/images/SkFlipPixelRef.cpp M src/images/SkImageRef_GlobalPool.cpp A src/ports/SkGlobalInitialization_chromium.cpp M src/ports/SkImageRef_ashmem.h M src/ports/SkImageRef_ashmem.cpp A src/ports/SkGlobalInitialization_default.cpp M gyp/effects.gyp M gyp/tools.gyp M gyp/ports.gyp git-svn-id: http://skia.googlecode.com/svn/trunk@2876 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding isOpaque method to skia shader classesGravatar junov@chromium.org2011-12-09
| | | | | | | | | REVIEW=http://codereview.appspot.com/5451102/ TEST=unit test ShaderOpacity git-svn-id: http://skia.googlecode.com/svn/trunk@2840 2bbb7eff-a529-9590-31e7-b0007b416f81
* revert 2826, restore option for non-dithered gradients (used by chrome)Gravatar reed@google.com2011-12-08
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2836 2bbb7eff-a529-9590-31e7-b0007b416f81
* use dithered gradients by defaultGravatar reed@google.com2011-12-08
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2826 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix win compile: sure wish SK_OVERRIDE was testable on mac buildGravatar reed@google.com2011-12-07
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2821 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SK_OVERRIDEsGravatar reed@google.com2011-12-07
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2820 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SK_RESTRICT inside radial gradient shader - we can't currently see a ↵Gravatar tomhudson@google.com2011-09-30
| | | | | | benefit, but it shouldn't hurt, and some compiler somewhere ought to benefit from it. git-svn-id: http://skia.googlecode.com/svn/trunk@2383 2bbb7eff-a529-9590-31e7-b0007b416f81
* Optimize software radial gradients (remove branches from the inner loop whereGravatar tomhudson@google.com2011-09-26
| | | | | | | | | | we can, because an entire row is conservatively either outside or inside the gradient.) Change the gradient benchmark to capture both cases, and add new gm to detect errors in these optimized paths. git-svn-id: http://skia.googlecode.com/svn/trunk@2327 2bbb7eff-a529-9590-31e7-b0007b416f81
* speed up radial-mirror 16x, sweep by ~2xGravatar reed@google.com2011-09-21
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2294 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SK_RESTRICT in shadeSpan methodsGravatar reed@google.com2011-09-20
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2288 2bbb7eff-a529-9590-31e7-b0007b416f81
* Automatic update of all copyright notices to reflect new license terms.Gravatar epoger@google.com2011-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have manually examined all of these diffs and restored a few files that seem to require manual adjustment. The following files still need to be modified manually, in a separate CL: android_sample/SampleApp/AndroidManifest.xml android_sample/SampleApp/res/layout/layout.xml android_sample/SampleApp/res/menu/sample.xml android_sample/SampleApp/res/values/strings.xml android_sample/SampleApp/src/com/skia/sampleapp/SampleApp.java android_sample/SampleApp/src/com/skia/sampleapp/SampleView.java experimental/CiCarbonSampleMain.c experimental/CocoaDebugger/main.m experimental/FileReaderApp/main.m experimental/SimpleCocoaApp/main.m experimental/iOSSampleApp/Shared/SkAlertPrompt.h experimental/iOSSampleApp/Shared/SkAlertPrompt.m experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig gpu/src/android/GrGLDefaultInterface_android.cpp gyp/common.gypi gyp_skia include/ports/SkHarfBuzzFont.h include/views/SkOSWindow_wxwidgets.h make.bat make.py src/opts/memset.arm.S src/opts/memset16_neon.S src/opts/memset32_neon.S src/opts/opts_check_arm.cpp src/ports/SkDebug_brew.cpp src/ports/SkMemory_brew.cpp src/ports/SkOSFile_brew.cpp src/ports/SkXMLParser_empty.cpp src/utils/ios/SkImageDecoder_iOS.mm src/utils/ios/SkOSFile_iOS.mm src/utils/ios/SkStream_NSData.mm tests/FillPathTest.cpp Review URL: http://codereview.appspot.com/4816058 git-svn-id: http://skia.googlecode.com/svn/trunk@1982 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove dead codeGravatar reed@google.com2011-07-07
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1824 2bbb7eff-a529-9590-31e7-b0007b416f81
* ensure that our bitmap is built with opaque cachedalphaGravatar reed@google.com2011-07-05
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1789 2bbb7eff-a529-9590-31e7-b0007b416f81
* make inline version of premultiply, to speed up gradient creation.Gravatar reed@google.com2011-06-30
| | | | | | | | | | | We could speed-up again if we... - respected kDither and only built 1/2 of the table for non-dither requests - output simple params to the gpu rather than always a texture - detected that we have no alpha, and then can skip premul per-entry git-svn-id: http://skia.googlecode.com/svn/trunk@1772 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix div-by-zero (triggers debugging assert when scalar=fixed) and add masterGravatar reed@google.com2011-06-27
| | | | | | | | (raster only) images for degenerate gradient test git-svn-id: http://skia.googlecode.com/svn/trunk@1729 2bbb7eff-a529-9590-31e7-b0007b416f81
* detect when our quadratic is really linear for 2-point radial, and don'tGravatar reed@google.com2011-06-23
| | | | | | | | divide by zero, but rather just return -c/b git-svn-id: http://skia.googlecode.com/svn/trunk@1684 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix bug where we wrote uninitialized data to the flatten stream for shaders.Gravatar reed@google.com2011-05-10
| | | | | | | | | | | | | | | | | | | Both shader and gradient_shader write matrices to the flatten stream. However, they were just calling write(&matrix, sizeof(SkMatrix)) and the matrix can contain lazily-computed function ptrs as part of its internal cache. Thus two matrices that are logically the same may write different bytes. This is a problem because picture relies on flattening objects and then using the flatten stream as a key into its cache. This matrix-write bug effectively kills the effectiveness of the cache for shaders. The fix is to write proper read/write functions for matrix (and region btw). These call through to the existing low-level flatten routines (which just write into a memory ptr). git-svn-id: http://skia.googlecode.com/svn/trunk@1290 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add flattenable registrar for Two_Point_Radial_Gradient.Gravatar tomhudson@google.com2011-04-27
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1198 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix to (two-point radial) gradient playback error in SkPictures that swappedGravatar tomhudson@google.com2011-04-25
| | | | | | | | the X and Y coordinates of their centers. git-svn-id: http://skia.googlecode.com/svn/trunk@1179 2bbb7eff-a529-9590-31e7-b0007b416f81
* handle overflowGravatar reed@google.com2011-04-18
| | | | | | | | | | note: gradient caller doesn't so we can still draw wrong when the caller converts its initial fx from float->fixed. Perhaps SkClampRange should offer a float interface as well. git-svn-id: http://skia.googlecode.com/svn/trunk@1149 2bbb7eff-a529-9590-31e7-b0007b416f81
* disable fast linear for now (really this time)Gravatar reed@google.com2011-04-18
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1144 2bbb7eff-a529-9590-31e7-b0007b416f81
* disable fast linear until we handle the overflow casesGravatar reed@google.com2011-04-18
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1143 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SK_USE_SLOW_2POINT_RADIAL_GRADIENT option for clients that like slownessGravatar reed@google.com2011-04-15
| | | | | | | | (or the previous images) git-svn-id: http://skia.googlecode.com/svn/trunk@1140 2bbb7eff-a529-9590-31e7-b0007b416f81
* use SkClampRange to speedup clamp iteratorsGravatar reed@google.com2011-04-15
| | | | | | | | speeds up linear gradients 4x git-svn-id: http://skia.googlecode.com/svn/trunk@1139 2bbb7eff-a529-9590-31e7-b0007b416f81
* code styleGravatar reed@google.com2011-04-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1133 2bbb7eff-a529-9590-31e7-b0007b416f81
* speed up 2-point-radial gradients by 9x, using float instead of fixedGravatar reed@google.com2011-04-13
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1118 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix SkFixed overflows in SkFixedSquare, SkGradientShader.Gravatar wjmaclean@chromium.org2011-04-13
| | | | | | Return SK_FixedMax when overflow occurs. git-svn-id: http://skia.googlecode.com/svn/trunk@1117 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix Two Pt Radial when circles are concentric.Gravatar bsalomon@google.com2011-04-06
| | | | | | | | Review URL: http://codereview.appspot.com/4368047/ git-svn-id: http://skia.googlecode.com/svn/trunk@1069 2bbb7eff-a529-9590-31e7-b0007b416f81
* make asABitmap() constGravatar reed@google.com2011-03-07
| | | | | | | | change private cache fields in gradient to be mutable git-svn-id: http://skia.googlecode.com/svn/trunk@898 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add asAGradient shader extraction API.Gravatar vandebo@chromium.org2011-02-24
| | | | | | | | | Store initial gradient parameters. Add compile asserts in GPU code for BitmapType ordering. Review URL: http://codereview.appspot.com/4178063 git-svn-id: http://skia.googlecode.com/svn/trunk@845 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SkRefCnt safeRef() and safeUnref(), and replace the call-sites withGravatar reed@google.com2011-02-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkSafeRef() and SkSafeUnref(). This is basically a bug waiting to happen. An optimizing compiler can remove checks for null on "this" if it chooses. However, SkRefCnt::safeRef() relies on precisely this check... void SkRefCnt::safeRef() { if (this) { this->ref(); } } Since a compiler might skip the if-clause, it breaks the intention of this method, hence its removal. static inline void SkSafeRef(SkRefCnt* obj) { if (obj) { obj->ref(); } } This form is not ignored by an optimizing compile, so we use it instead. git-svn-id: http://skia.googlecode.com/svn/trunk@762 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SK_DISABLE_DITHER_32BIT_GRADIENT flag. If defined, disables the newly addedGravatar reed@google.com2011-01-17
| | | | | | | | dithering for 32bit linear gradients. git-svn-id: http://skia.googlecode.com/svn/trunk@699 2bbb7eff-a529-9590-31e7-b0007b416f81
* add dithering to 32bit linear gradientsGravatar reed@google.com2011-01-13
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@691 2bbb7eff-a529-9590-31e7-b0007b416f81
* merge in gpu changes to gradientshadersGravatar reed@google.com2010-12-23
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@655 2bbb7eff-a529-9590-31e7-b0007b416f81
* update windows portGravatar reed@android.com2009-12-18
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@461 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix repeat/mirror for new larger 16bit cacheGravatar reed@android.com2009-12-14
| | | | | | | | update gm images git-svn-id: http://skia.googlecode.com/svn/trunk@459 2bbb7eff-a529-9590-31e7-b0007b416f81
* make the 16bit cache larger, to handle multiple colors in the gradient w/oGravatar reed@android.com2009-12-14
| | | | | | | | | | obvious artifacts. We need a more comprehensive fix for all gradients (32bit and 16bit) when we have a large number of colors (or they are spaced out very non-linearly), to avoid banding. git-svn-id: http://skia.googlecode.com/svn/trunk@458 2bbb7eff-a529-9590-31e7-b0007b416f81
* flatten/unflatten custom fields for 2-point gradientGravatar reed@android.com2009-11-10
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@423 2bbb7eff-a529-9590-31e7-b0007b416f81
* clear the kHasSpan16 bit for two-point-radial, since we don't implement thatGravatar reed@android.com2009-09-22
| | | | | | | | fix perspective loop x (dstX) git-svn-id: http://skia.googlecode.com/svn/trunk@364 2bbb7eff-a529-9590-31e7-b0007b416f81
* Two-point radial gradient implementation.Gravatar senorblanco@chromium.org2009-09-22
| | | | | | | | Review URL: http://codereview.appspot.com/112058 git-svn-id: http://skia.googlecode.com/svn/trunk@361 2bbb7eff-a529-9590-31e7-b0007b416f81
* expand SkShader's flag kConstInY to 16 and 32 variants, allowing a shaderGravatar reed@android.com2009-08-27
| | | | | | | | | | | | (like gradients) to support predithering. If they do, then they would suppress kConstInY16, since they no longer are const. The blitters now check for each flag separately, so we don't have to give up const-in-Y in the 32bit case, since in that mode we don't care about dithering. git-svn-id: http://skia.googlecode.com/svn/trunk@339 2bbb7eff-a529-9590-31e7-b0007b416f81
* add FIXME to commentGravatar reed@android.com2009-07-07
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@253 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix gradients with alpha to convert to premul *after* the intermediate colorGravatar reed@android.com2009-07-02
| | | | | | | | | has been computed, othewise we can't distinguish 0x00000000 from 0x00FF0000 Add fast case for index blit where we read 4 src pixels at a time git-svn-id: http://skia.googlecode.com/svn/trunk@248 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove (ack) test code in lineargradient when pos array is nullGravatar reed@android.com2009-07-01
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@247 2bbb7eff-a529-9590-31e7-b0007b416f81
* add shader flag kConstInY_FlagGravatar reed@android.com2009-06-12
| | | | | | | | | | | this signals blitters that the shader will return the same results for a given x value, independent of y. Useful inside blitRect(), where it can cache the first call to shadeSpan() and reuse it on all subsequent scans. Works with (non-rotated) linear-gradients, and Nx1 bitmaps. git-svn-id: http://skia.googlecode.com/svn/trunk@214 2bbb7eff-a529-9590-31e7-b0007b416f81
* make the same prerounding fix for the shadeSpan16 caseGravatar reed@android.com2009-06-12
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@213 2bbb7eff-a529-9590-31e7-b0007b416f81
* preround our fx fractional coordiante, so we get rounded integers (0..255) whenGravatar reed@android.com2009-06-12
| | | | | | | | stepping through the gradient. git-svn-id: http://skia.googlecode.com/svn/trunk@212 2bbb7eff-a529-9590-31e7-b0007b416f81
* update for cache updatesGravatar reed@android.com2009-06-05
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@202 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix dumpcanvas to recurse on pictures and shapesGravatar reed@android.com2009-06-05
| | | | | | | | add cached bitmap for gradients to avoid thrashing textures in gl git-svn-id: http://skia.googlecode.com/svn/trunk@201 2bbb7eff-a529-9590-31e7-b0007b416f81