aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapProcShader.cpp
Commit message (Collapse)AuthorAge
* Tweaks in how to apply bitmap filter levels in GPU.Gravatar commit-bot@chromium.org2013-12-16
| | | | | | | | | | | | | | Fix fallback to MIP from bicubic for bitmap shaders Skip MIP level generation on GPU when not minifying Add medium quality and mixed up/down matrix test cases to filterbitmap tests R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/103913012 git-svn-id: http://skia.googlecode.com/svn/trunk@12697 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make GrBicubicEffect take tile modes rather than GrTextureParams.Gravatar commit-bot@chromium.org2013-12-10
| | | | | | | | | | | | | | GrTextureParams allows the caller to override the filter mode. But no filtering other than nearest neighbor makes sense. Also removes coord set from creation signature since it is unused. R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/99523008 git-svn-id: http://skia.googlecode.com/svn/trunk@12591 2bbb7eff-a529-9590-31e7-b0007b416f81
* Do not use GrBicubic effect when downscaling. Also, don't use glTexStorage ↵Gravatar commit-bot@chromium.org2013-12-09
| | | | | | | | | | | | as it interferes with deleyed mipmap generation. R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/105353002 git-svn-id: http://skia.googlecode.com/svn/trunk@12576 2bbb7eff-a529-9590-31e7-b0007b416f81
* start to remove lockPixels from bitmapshaderGravatar reed@google.com2013-09-13
| | | | | | | | | BUG= R=scroggo@google.com Review URL: https://codereview.chromium.org/23591030 git-svn-id: http://skia.googlecode.com/svn/trunk@11258 2bbb7eff-a529-9590-31e7-b0007b416f81
* forgot to guard GPU includes when SK_SUPPORT_GPU not definedGravatar humper@google.com2013-09-04
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@11089 2bbb7eff-a529-9590-31e7-b0007b416f81
* add support for high quality image filtering on the GPUGravatar humper@google.com2013-09-04
| | | | | | | | R=bsalomon@google.com, reed@google.com Review URL: https://codereview.chromium.org/23779003 git-svn-id: http://skia.googlecode.com/svn/trunk@11087 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-07-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@10385 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix android buildGravatar humper@google.com2013-07-25
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@10369 2bbb7eff-a529-9590-31e7-b0007b416f81
* make the filter mode for GrTextureAccess an enum so we can plumb downGravatar humper@google.com2013-07-25
| | | | | | | | | | | the paint's filter modes to the GPU BUG= R=bsalomon@google.com Review URL: https://codereview.chromium.org/20362002 git-svn-id: http://skia.googlecode.com/svn/trunk@10368 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix trivial matrix computationGravatar humper@google.com2013-07-14
| | | | | | | | | | | | | | Revert "Reverted 10056-10059" This reverts commit bab4ebcaa7270c3b866a8e10917c39b055ebd51a. Fix broken GM test, reintroduce image scaling. BUG= Review URL: https://codereview.chromium.org/18721006 git-svn-id: http://skia.googlecode.com/svn/trunk@10066 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reverted 10056-10059Gravatar robertphillips@google.com2013-07-13
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@10060 2bbb7eff-a529-9590-31e7-b0007b416f81
* Working plumb of image scaling:Gravatar humper@google.com2013-07-12
| | | | | | | | | | | | | | | | 1) always generate mipmaps if we detect that we are downsampling. 2) pre-scale the image if we detect that we are upsampling (currently valid for scale+translate only) 3) A few miscellaneous bug fixes related to image scaling. Still need SSE/Neon versions of these image scalers. BUG= R=bsalomon@google.com, robertphillips@google.com Review URL: https://codereview.chromium.org/18978014 git-svn-id: http://skia.googlecode.com/svn/trunk@10056 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make all GrContext members that return a texture also ref the texture for ↵Gravatar bsalomon@google.com2013-01-24
| | | | | | | | the caller. Review URL: https://codereview.appspot.com/7198049 git-svn-id: http://skia.googlecode.com/svn/trunk@7362 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove default implementation of GrEffect::isEqual. Make ↵Gravatar bsalomon@google.com2013-01-17
| | | | | | | | GrSingleTextureEffect abstract. Review URL: https://codereview.appspot.com/7142049 git-svn-id: http://skia.googlecode.com/svn/trunk@7254 2bbb7eff-a529-9590-31e7-b0007b416f81
* Wrap GrEffects in GrEffectPtr.Gravatar bsalomon@google.com2013-01-16
| | | | | | | | | This is the first step towards automatic recycling of scratch resouces in the cache via ref-cnts. R=robertphillips@google.com Review URL: https://codereview.appspot.com/7092061 git-svn-id: http://skia.googlecode.com/svn/trunk@7222 2bbb7eff-a529-9590-31e7-b0007b416f81
* Added print out of SkShader information to debuggerGravatar robertphillips@google.com2013-01-15
| | | | | | | | https://codereview.appspot.com/7105045/ git-svn-id: http://skia.googlecode.com/svn/trunk@7201 2bbb7eff-a529-9590-31e7-b0007b416f81
* call endContext() if we have to return false from setContext(), to keep theGravatar mike@reedtribe.org2013-01-15
| | | | | | | | debugging fInSetContext flag up-to-date. git-svn-id: http://skia.googlecode.com/svn/trunk@7175 2bbb7eff-a529-9590-31e7-b0007b416f81
* false --> NULL for failure returnGravatar humper@google.com2013-01-14
| | | | | | | | BUG= Review URL: https://codereview.appspot.com/7096058 git-svn-id: http://skia.googlecode.com/svn/trunk@7165 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change signature of SkShader::asNewEffect(), implement for SkBitmapProcShader.Gravatar bsalomon@google.com2013-01-14
| | | | | | Review URL: https://codereview.appspot.com/7086051 git-svn-id: http://skia.googlecode.com/svn/trunk@7153 2bbb7eff-a529-9590-31e7-b0007b416f81
* reland 6798 w/ fix for bitmap-as-mask pixel-lockingGravatar reed@google.com2012-12-13
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6806 2bbb7eff-a529-9590-31e7-b0007b416f81
* revert 6798 (assert in GM)Gravatar reed@google.com2012-12-13
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6802 2bbb7eff-a529-9590-31e7-b0007b416f81
* Goal: ensure we always balance lock/unlock pixels calls.Gravatar reed@google.com2012-12-13
| | | | | | | | | | | | A big caller of lockPixels is setContext in the bitmapshader. This change replaces beginSession/endSession with adding endContext(), and adds debugging code to ensure that 1. setContext calls are never nested 2. endContext is always called after each setContext call. Review URL: https://codereview.appspot.com/6937046 git-svn-id: http://skia.googlecode.com/svn/trunk@6798 2bbb7eff-a529-9590-31e7-b0007b416f81
* mark our unflattened bitmap as immutable (just as picture deserialization does)Gravatar reed@google.com2012-12-10
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6736 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make SkShader store localM directly rather than as a separate alloc.Gravatar bsalomon@google.com2012-10-31
| | | | | | | May cause very slight GM changes in gpu two pt radial/conical radients. Review URL: https://codereview.appspot.com/6821056 git-svn-id: http://skia.googlecode.com/svn/trunk@6221 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkShader::asShadeProc to fast-path the caller when the shader is fastGravatar reed@google.com2012-10-12
| | | | | | Review URL: https://codereview.appspot.com/6649055 git-svn-id: http://skia.googlecode.com/svn/trunk@5930 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make flattenables no longer depend on global static initializers.Gravatar scroggo@google.com2012-09-21
| | | | | | | | | | | | | | | | | Instead, force all builds to call InitializeFlattenables. Remove the make_debugger script, which was created to force rebuilding without global static initializers so that all flattenables would be linked. It is no longer necessary since all flattenables will be linked thanks to InitializeFlattenables, which now can (and must) be called when global static initializers are turned on. BUG=https://code.google.com/p/skia/issues/detail?id=903 BUG=https://code.google.com/p/skia/issues/detail?id=902 Review URL: https://codereview.appspot.com/6548044 git-svn-id: http://skia.googlecode.com/svn/trunk@5642 2bbb7eff-a529-9590-31e7-b0007b416f81
* Update SkFlattenable buffers to be more modular.Gravatar djsollen@google.com2012-08-07
| | | | | | | | | | | | | | | | | This CL is an effort to stage the conversion to named parameters for all SkFlattenable commands. This particular stage only does the following two things... 1. Move flattenable buffers from SkFlattenable.h into their own header. 2. Update and Add new read write methods for better clarity and convenience. BUG= Review URL: https://codereview.appspot.com/6448095 git-svn-id: http://skia.googlecode.com/svn/trunk@4980 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use asNewCustomStage instead of asABitmap in SkGpuDevice, also removed ↵Gravatar rileya@google.com2012-07-25
| | | | | | | | | now-unecessary twoPointRadialParams parameter from asABitmap. In SkGpuDevice we still fall back on using asABitmap for effects that don't have asNewCustomStage implemented, but it still simplifies things a fair amount. Review URL: https://codereview.appspot.com/6430060 git-svn-id: http://skia.googlecode.com/svn/trunk@4755 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
* We were numerically overflowing our 16bit coordinates that we communicateGravatar reed@google.com2012-05-03
| | | | | | | | | | | | | between these two procs. The fixes was in two parts: 1. Just don't draw bitmaps larger than 64K-1 in width or height, since we can't represent those coordinates in our transport format (yet). 2. Perform an unsigned shift during the calculation, so we don't get sign-extension bleed when packing the two values (X,Y) into our 32bit slot. Review URL: https://codereview.appspot.com/6173046 git-svn-id: http://skia.googlecode.com/svn/trunk@3836 2bbb7eff-a529-9590-31e7-b0007b416f81
* Cleanup code related to SkFlattenable::flatten()Gravatar djsollen@google.com2012-03-29
| | | | | | | | | | | | | | | | | The following changes were made by this CL: 1. Make flatten() a protected method as callers should use SkFlattenableWriteBuffer to flatten an object 2. Make flatten a const method (including subclasses) 3. Mark subclass implementation of flatten with SK_OVERRIDE 4. Ensure overridden flatten impls call their parent 5. Remove no-op implementations of flatten from subclasses Additionally, if necessary the unflattening constructor was also moved to the protected section of the subclasses header if it was not already there. git-svn-id: http://skia.googlecode.com/svn/trunk@3540 2bbb7eff-a529-9590-31e7-b0007b416f81
* add debuggin matrix-proc to validate its output before calling the samplersGravatar reed@google.com2012-03-27
| | | | | | Review URL: https://codereview.appspot.com/5901063 git-svn-id: http://skia.googlecode.com/svn/trunk@3505 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
* 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
* add SkEmptyShader, and return it from CreateBitmapShader if the bitmap is emptyGravatar reed@google.com2011-07-05
| | | | | | | | (i.e. has no pixels at all) git-svn-id: http://skia.googlecode.com/svn/trunk@1792 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
* merge with changes for GPU backendGravatar reed@android.com2010-12-20
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@637 2bbb7eff-a529-9590-31e7-b0007b416f81
* call readyToDraw() instead of just checking for null pixels, since we couldGravatar reed@android.com2010-09-10
| | | | | | | | | have a bitmap with pixels, but no (required) colortable. readyToDraw() knows to check for this. git-svn-id: http://skia.googlecode.com/svn/trunk@599 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix overflow in matrixproc, and add debugging code to test thatGravatar reed@android.com2010-04-14
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@548 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove check for filtering. Now if the src is opaque, the filtered resultGravatar reed@android.com2009-10-26
| | | | | | | | always will be too. git-svn-id: http://skia.googlecode.com/svn/trunk@406 2bbb7eff-a529-9590-31e7-b0007b416f81
* don't force bitmapIsOpaque to false if we're instrinsically 16bitGravatar reed@android.com2009-10-14
| | | | | | | | This allows us to take more optimal paths, even when filtering or dithering git-svn-id: http://skia.googlecode.com/svn/trunk@386 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
* special case 1x1 bitmaps when drawn as a shader (treat as a solid color)Gravatar reed@android.com2009-08-25
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@336 2bbb7eff-a529-9590-31e7-b0007b416f81
* fixes around isOpaque and ditheringGravatar reed@android.com2009-08-22
| | | | | | | | | | | | | | - copyTo() now preserves isOpaqueness, and BitmapCopyTest tests it - bitmap shader doesn't claim to have shadespan16 if dithering is on, since its sampler doesn't auto-dither (note that gradients do auto-dither in their 16bit sampler) - blitter setup just relies on the shader to report if its 16bit sampler can be called (allowing gradients to say yes regardless of dither, but bitmaps to say no if dithering is on) git-svn-id: http://skia.googlecode.com/svn/trunk@331 2bbb7eff-a529-9590-31e7-b0007b416f81
* add method to compute max count for a given buffer size in the bitmap shader.Gravatar reed@android.com2009-08-14
| | | | | | | | fix bug in quad loop of fill_sequential where we were going one quad too far. git-svn-id: http://skia.googlecode.com/svn/trunk@322 2bbb7eff-a529-9590-31e7-b0007b416f81
* add special matrixprocs when the matrix is at most translate. These are fasterGravatar reed@android.com2009-08-13
| | | | | | | | | | | (somewhat) than their scale counterparts, but are also numerically exact for any size bitmaps. The scale versions, because they operate in a scaled 65535 space, are not always exact for large images (due to SK_Fixed1 / width) loss of bits git-svn-id: http://skia.googlecode.com/svn/trunk@320 2bbb7eff-a529-9590-31e7-b0007b416f81
* add shaderprocs for all-in-one special blits (matrix+sampler)Gravatar reed@android.com2009-07-16
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@267 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
* fix trailing-wsGravatar reed@android.com2009-05-29
| | | | | | | | initialize fFlags in bitmapprocshader git-svn-id: http://skia.googlecode.com/svn/trunk@191 2bbb7eff-a529-9590-31e7-b0007b416f81