Commit Graph

825 Commits

Author SHA1 Message Date
reed@android.com
4913b7794a add tests for blurmask
git-svn-id: http://skia.googlecode.com/svn/trunk@359 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-09-21 00:27:39 +00:00
reed@android.com
da449a38a2 update with tests for blur
git-svn-id: http://skia.googlecode.com/svn/trunk@357 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-09-18 20:57:05 +00:00
reed@android.com
0b9e2dbf2f use doubles in matrix.invert() to keep more precision, needed for subtle
bugs when drawing stretched bitmaps (like ninepatch) at nasty scale factors
like 1.5 (where the inverse matrix steps 0.333333, 1.0, 1.666667, etc.)



git-svn-id: http://skia.googlecode.com/svn/trunk@354 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-09-16 17:00:17 +00:00
reed@android.com
ed881c2704 add neon opts for matrix procs
git-svn-id: http://skia.googlecode.com/svn/trunk@353 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-09-15 14:10:42 +00:00
reed@android.com
34e85803c2 update
git-svn-id: http://skia.googlecode.com/svn/trunk@350 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-09-02 21:11:44 +00:00
reed@android.com
47ca036e29 add
git-svn-id: http://skia.googlecode.com/svn/trunk@349 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-09-02 02:07:45 +00:00
reed@android.com
113244f1e1 add tests for extractAlpha
git-svn-id: http://skia.googlecode.com/svn/trunk@346 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-08-31 21:04:24 +00:00
reed@android.com
a964028843 http://code.google.com/p/skia/issues/detail?id=32
Detect when we no longer have a valid range for chopping due to finite float
precision, and just return a degenerate cubic at the end.



git-svn-id: http://skia.googlecode.com/svn/trunk@341 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-08-28 20:06:54 +00:00
reed@android.com
28937283e1 fix gaps in antialiased hairlines (thanks to preda)
expand SampleHairline text to check for clip violations



git-svn-id: http://skia.googlecode.com/svn/trunk@340 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-08-28 15:34:46 +00:00
reed@android.com
3c9b2a4a0e expand SkShader's flag kConstInY to 16 and 32 variants, allowing a shader
(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
2009-08-27 19:28:37 +00:00
reed@android.com
ff3e92d2f8 show the hairlines after each test iteration
git-svn-id: http://skia.googlecode.com/svn/trunk@337 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-08-25 20:40:04 +00:00
reed@android.com
c64599649b special case 1x1 bitmaps when drawn as a shader (treat as a solid color)
git-svn-id: http://skia.googlecode.com/svn/trunk@336 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-08-25 19:15:31 +00:00
reed@android.com
cafc9f9e80 fixes around isOpaque and dithering
- 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
2009-08-22 03:44:57 +00:00
reed@android.com
755dd4773d respect dither setting in index8->565 sprite case
git-svn-id: http://skia.googlecode.com/svn/trunk@328 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-08-20 21:29:45 +00:00
reed@android.com
92a50eaab9 close out previous contour (so we don't miss the last segment)
git-svn-id: http://skia.googlecode.com/svn/trunk@325 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-08-14 19:27:37 +00:00
reed@android.com
6c5f6f25b4 add 'r' (rotate) 's' (scale) options to SampleApp to test those matrix ops on
all slides

add beforeChild/afterChild methods for parents to wack the canvas before/after
it draws. These are called after the std child-view translate and clip, unlike
beforeChildren/afterChildren



git-svn-id: http://skia.googlecode.com/svn/trunk@324 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-08-14 16:08:38 +00:00
reed@android.com
f7d5726730 test for non-scaled bitmap tiles
git-svn-id: http://skia.googlecode.com/svn/trunk@319 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-08-13 19:33:44 +00:00
reed@android.com
f549369fcd rename SK_BUILD_SUBPIXEL to SK_SUPPORT_LCDTEXT to better match the name of the
feature (since we already have subpixel text support)

fix some debug-compile problems

update Makefile for lcd files



git-svn-id: http://skia.googlecode.com/svn/trunk@282 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-22 19:21:01 +00:00
reed@android.com
83f7bc30af remove conditional build flag for mipmaps
remove obsolete SkBitmapShader.cpp file



git-svn-id: http://skia.googlecode.com/svn/trunk@271 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-17 02:42:41 +00:00
reed@android.com
7a99eb1c63 add shaderprocs for all-in-one special blits (matrix+sampler)
git-svn-id: http://skia.googlecode.com/svn/trunk@267 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-16 01:13:14 +00:00
reed@android.com
b4f404ac41 handle cap==round for drawPoints
git-svn-id: http://skia.googlecode.com/svn/trunk@266 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-10 17:02:17 +00:00
reed@android.com
b602b8e533 tweaks to 16bit shaders
fix typo-bug in 4444 blend case



git-svn-id: http://skia.googlecode.com/svn/trunk@265 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-10 15:58:53 +00:00
reed@android.com
32a4249cbd make a deep copy in CreateCGImageRef if we're 565, but first upscale to 32bit.
this at least draws the right colors, since we're 565 and CG only supports 1555
(unless someone knows how to tell CG we're 565...)

Fix ws in picturerecord

Enable dither in sample gradients, so the 4444 case isn't so ugly



git-svn-id: http://skia.googlecode.com/svn/trunk@264 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-10 03:33:52 +00:00
reed@android.com
1134426f6b respect preferred config when png is index-based
git-svn-id: http://skia.googlecode.com/svn/trunk@261 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-08 20:09:23 +00:00
reed@android.com
9dc5465c1c check if the encoder factory returned null
git-svn-id: http://skia.googlecode.com/svn/trunk@255 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-07 21:18:10 +00:00
reed@android.com
8433b5db1a more checks for null shapes in pictures
git-svn-id: http://skia.googlecode.com/svn/trunk@249 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-03 02:52:27 +00:00
reed@android.com
1c12abe350 fix gradients with alpha to convert to premul *after* the intermediate color
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
2009-07-02 15:01:02 +00:00
reed@android.com
4516f4786f use sk_bzero instead of bzero, since it isn't always available.
git-svn-id: http://skia.googlecode.com/svn/trunk@244 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-29 16:25:36 +00:00
reed@android.com
0ad336f8c6 add shape flatten so they work properly in pictures
add flatten/unflatten to matrix



git-svn-id: http://skia.googlecode.com/svn/trunk@242 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-29 16:02:20 +00:00
reed@android.com
09b84a00f7 add shape recording to pictuures (sans serialization)
git-svn-id: http://skia.googlecode.com/svn/trunk@240 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-26 20:22:26 +00:00
reed@android.com
0baf193754 detect nearly translate-only matrices when drawing bitmaps (for speed)
rename setXfermode(Mode) to setXfermodeMode(Mode) for sanity
fix memory leak in setXfermode(Mode)



git-svn-id: http://skia.googlecode.com/svn/trunk@239 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-24 12:41:42 +00:00
reed@android.com
048522dd2a remove remaining references to porterduff
git-svn-id: http://skia.googlecode.com/svn/trunk@236 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-23 12:19:41 +00:00
reed@android.com
845fdaca17 remove deprecated use of porterduff enum
git-svn-id: http://skia.googlecode.com/svn/trunk@235 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-23 03:01:32 +00:00
reed@android.com
a0f5d1546d move xfermode modes from porterduff into xfermode itself
git-svn-id: http://skia.googlecode.com/svn/trunk@232 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-22 17:38:10 +00:00
reed@android.com
ad687ceae2 add sample for mipmaps
git-svn-id: http://skia.googlecode.com/svn/trunk@218 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-16 01:50:25 +00:00
reed@android.com
b3ade9d1b0 add optional Format* parameter to decoder helper functions.
git-svn-id: http://skia.googlecode.com/svn/trunk@215 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-15 13:04:45 +00:00
reed@android.com
5119bdb952 add shader flag kConstInY_Flag
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
2009-06-12 21:27:03 +00:00
deanm@chromium.org
1220e1c28a Some Linux / 64-bit compile fixes.
Review URL: http://codereview.appspot.com/63189


git-svn-id: http://skia.googlecode.com/svn/trunk@209 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-11 12:26:47 +00:00
reed@android.com
bbff1d507a add SkParsePath to go to/from SVG strings (e.g. "M0,0 L10,20")
git-svn-id: http://skia.googlecode.com/svn/trunk@203 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-05 16:21:03 +00:00
reed@android.com
9b46e77ec2 fix dumpcanvas to recurse on pictures and shapes
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
2009-06-05 12:24:41 +00:00
reed@android.com
6b82d1adc6 add isConvex() hit to SkPath, to be used to speed up fills and opengl
set linewidth in gldevice for hair rects
remove some cruft from samples
add more gl-unimpl messages



git-svn-id: http://skia.googlecode.com/svn/trunk@199 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-03 02:35:01 +00:00
reed@android.com
24cfaa7751 update includes for android for gl backend
git-svn-id: http://skia.googlecode.com/svn/trunk@194 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-01 19:48:56 +00:00
reed@android.com
44a6312cf6 call notifyPixelsChanged() when the pages are flipped in pageflippixelref
update samples



git-svn-id: http://skia.googlecode.com/svn/trunk@192 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-05-30 02:40:28 +00:00
reed@android.com
88c2d8ef15 animate matrixref in sample shapes
git-svn-id: http://skia.googlecode.com/svn/trunk@189 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-05-27 01:44:24 +00:00
reed@android.com
aa5a7db64a move shapes subclasses into effects
git-svn-id: http://skia.googlecode.com/svn/trunk@188 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-05-27 01:20:10 +00:00
reed@android.com
671cd65678 add SDL support
git-svn-id: http://skia.googlecode.com/svn/trunk@182 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-05-22 20:44:12 +00:00
reed@android.com
149e2f6159 add SkSafeRef / SkSafeUnref as inline static functions, to use in place of our
existing obj->safeRef(), which is unsafe since it can its 'if (this)' can be
optimized away by some compilers.

fix some overflows in mimpmap generation



git-svn-id: http://skia.googlecode.com/svn/trunk@181 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-05-22 14:39:03 +00:00
reed@android.com
ba974ccbdd add sample effects
git-svn-id: http://skia.googlecode.com/svn/trunk@180 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-05-22 13:48:35 +00:00
reed@android.com
f48f281766 shapes checkpoint: move matrix into groupshape and out of shape
git-svn-id: http://skia.googlecode.com/svn/trunk@178 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-05-18 04:20:55 +00:00
reed@android.com
f76bacff7f add SkSize for dimensions
add SkShape baseclass, in the hopes of having SkPicture inherit from that, and 
also using shapes as the extension mechanism for things like animated-gif



git-svn-id: http://skia.googlecode.com/svn/trunk@174 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-05-13 14:00:33 +00:00
reed@android.com
311c82db31 fix copyTo to only copy the minimum pixels per row, and to lock the src before
trying to access its colorTable. Update unittest for copyTo. Add sample for
using a mask to clip a layer.



git-svn-id: http://skia.googlecode.com/svn/trunk@168 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-05-05 23:13:23 +00:00
reed@android.com
a3c0588694 add sample for gradients
git-svn-id: http://skia.googlecode.com/svn/trunk@144 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-04-02 20:49:39 +00:00
reed@android.com
d252db03d9 API change: SkPath computeBounds -> getBounds
git-svn-id: http://skia.googlecode.com/svn/trunk@140 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-04-01 18:31:44 +00:00
reed@android.com
aefd2bc757 Add SkChunkAlloc::unalloc() to undo the last allocation, useful if the caller wants to treat the allocats like temp memory (see PictureRecord)
Call unalloc if a paint (or other cached object) is already in our list for picture recording
Use correct CompareType macro in SkCanvas::quickReject



git-svn-id: http://skia.googlecode.com/svn/trunk@138 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-03-30 21:02:14 +00:00
reed@android.com
8898363b2e add check/hack to avoid drawing outside of the clip for hairlines
git-svn-id: http://skia.googlecode.com/svn/trunk@134 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-03-23 16:05:19 +00:00
reed@android.com
49f0ff25a0 promote SkMask's rowBytes to 32bits, since its bounds is a 32bit rect
be sure a rect is sorted before using it as the path's bounds cache



git-svn-id: http://skia.googlecode.com/svn/trunk@128 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-03-19 21:52:42 +00:00
reed@android.com
452f844f64 disable cubic test for now (currently broken)
git-svn-id: http://skia.googlecode.com/svn/trunk@124 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-03-16 18:47:55 +00:00
reed@android.com
3555591c15 add sanity checks to handles extremely large coordinates or filter margins.
Should not hurt features (we hope), but is an easy way to survive malicious
values on a small-memory machine like a handset.



git-svn-id: http://skia.googlecode.com/svn/trunk@123 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-03-16 18:46:55 +00:00
reed@android.com
791f5a11f2 Change (correct) SkImageRef's ownership rule for streams to the skia standard
pattern: the receiver will call ref() if it chooses when passed to a constructor
or setter, so the caller must balance its ownership itself. This matches how all
other refcnt objects are handled.



git-svn-id: http://skia.googlecode.com/svn/trunk@120 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-03-16 13:53:11 +00:00
reed@android.com
590ef3fd3a remember to specify the bloody font tag in the constructor!
git-svn-id: http://skia.googlecode.com/svn/trunk@118 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-03-10 04:02:30 +00:00
reed@android.com
330578d67d mac fonts sort of work now
- haven't tested rotation yet
- spacing/bounds still look bad



git-svn-id: http://skia.googlecode.com/svn/trunk@117 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-03-09 18:12:13 +00:00
reed@android.com
5e5adfd12c migrate more legacy unittests into tests/
SkParse yet to be cleaned up



git-svn-id: http://skia.googlecode.com/svn/trunk@113 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-03-07 03:39:23 +00:00
reed@android.com
54043a394e patch SkMath.h to build in ARMv4
test code for mac fonts (disabled)



git-svn-id: http://skia.googlecode.com/svn/trunk@110 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-03-05 14:14:49 +00:00
reed@android.com
069b827f8e API cleanup: rename typeface Create to CreateFromName, and remove default arg
git-svn-id: http://skia.googlecode.com/svn/trunk@108 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-03-04 15:31:48 +00:00
reed@android.com
ed673310e2 add initial unittest framework (tests)
move some previous unittests out of core classes and into tests



git-svn-id: http://skia.googlecode.com/svn/trunk@96 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-02-27 16:24:51 +00:00
reed@android.com
3469c76c40 Handle kA8 bitmaps drawing through a matrix (was infinitely recursive)
git-svn-id: http://skia.googlecode.com/svn/trunk@95 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-02-24 19:03:20 +00:00
reed@android.com
c07d23a6e2 Chop quads exactly on the clip bounds, so we don't spend CPU cycles walking them
when we're above or below the clip.

Still to do:
- chop in X to avoid 16.16. overflow in the edgelist
- apply the same logic for cubics (tho much harder math)



git-svn-id: http://skia.googlecode.com/svn/trunk@88 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-02-06 13:30:58 +00:00
reed@android.com
b08eb2b3bc separate image encode and decode
remove obsolete build-flag for encode



git-svn-id: http://skia.googlecode.com/svn/trunk@56 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-01-06 20:16:26 +00:00
reed@android.com
4bdd5f60f9 remove old test that assumed fBM had been decoded
git-svn-id: http://skia.googlecode.com/svn/trunk@49 2bbb7eff-a529-9590-31e7-b0007b416f81
2008-12-23 18:50:15 +00:00
reed@android.com
da342a8917 update more sample code to new compose shader header
git-svn-id: http://skia.googlecode.com/svn/trunk@48 2bbb7eff-a529-9590-31e7-b0007b416f81
2008-12-23 18:37:08 +00:00
reed@android.com
0ae6b245f2 add mac image-encoding
add 'f' to sampleapp, which writes a png file for the currnet screen



git-svn-id: http://skia.googlecode.com/svn/trunk@47 2bbb7eff-a529-9590-31e7-b0007b416f81
2008-12-23 16:49:54 +00:00
reed@android.com
0767e4742e add CG imagedecoder (still needs encoding)
update some sample files to not use obsolete SkShaderExtras.h



git-svn-id: http://skia.googlecode.com/svn/trunk@46 2bbb7eff-a529-9590-31e7-b0007b416f81
2008-12-23 16:06:51 +00:00
reed@android.com
64ad9663d6 add sampeapp proj
git-svn-id: http://skia.googlecode.com/svn/trunk@38 2bbb7eff-a529-9590-31e7-b0007b416f81
2008-12-19 19:15:15 +00:00
reed@android.com
6efdc47afc first cut at event-based test app
git-svn-id: http://skia.googlecode.com/svn/trunk@37 2bbb7eff-a529-9590-31e7-b0007b416f81
2008-12-19 18:24:35 +00:00
reed@android.com
8a1c16ff38 grab from latest android
git-svn-id: http://skia.googlecode.com/svn/trunk@27 2bbb7eff-a529-9590-31e7-b0007b416f81
2008-12-17 15:59:43 +00:00