Commit Graph

189 Commits

Author SHA1 Message Date
vandebo@chromium.org
b70ae310bb Fix a memory leak in the new Canvas/Device workflow.
The previous change made it difficult to inherit from SkCanvas without leaking memory.  By making SkDeviceFactory not reference counted, the right thing happens more naturally, just NewCanvas : public SkCanvas(new NewDeviceFactory()) {...}

Review URL: http://codereview.appspot.com/2530042

git-svn-id: http://skia.googlecode.com/svn/trunk@605 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-10-15 18:58:19 +00:00
vandebo@chromium.org
8d84fac294 Refactor SkCanvas so that backends don't need to override it.
Methods or classes that should go away are marked deprecated. The only thing I know of that breaks backward compatibility is SkCanvas((SkDevice*)NULL), but that is fairly unlikely to occur in the wild because that constructor had a default value of NULL.

Review URL: http://codereview.appspot.com/2103045

git-svn-id: http://skia.googlecode.com/svn/trunk@604 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-10-13 22:13:05 +00:00
vandebo@chromium.org
d877fdbb6e High level pdf classes and pdf specific interface.
The guts of the implementation will be in SkPDFDevice and below.  This is a first implementation of everything above that point.

Review URL: http://codereview.appspot.com/2342043

git-svn-id: http://skia.googlecode.com/svn/trunk@602 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-10-12 23:08:13 +00:00
reed@android.com
ce4e53a234 add abstract wrapper for platform-specific bitmap backends
git-svn-id: http://skia.googlecode.com/svn/trunk@596 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-09-09 16:01:26 +00:00
agl@chromium.org
c9c9ebbc29 Make SKColorSetARGB() a macro when not building debug.
This allows GCC to avoid generating static initializers for code that
uses it.

Patch by: Dave Moore

http://codereview.appspot.com/1883043/show

git-svn-id: http://skia.googlecode.com/svn/trunk@592 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-07-28 17:10:30 +00:00
reed@android.com
097a351353 add SkRegion::setRects(), and its unit tests
git-svn-id: http://skia.googlecode.com/svn/trunk@588 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-07-13 18:35:14 +00:00
kbr@chromium.org
2e086190e5 Added optional "ambiguous" outgoing argument to XRay queries so that
calling code may choose different y-coordinates for better robustness.
Tested and verified manually inside O3D.

BUG=none
TEST=none

Review URL: http://codereview.appspot.com/1695051


git-svn-id: http://skia.googlecode.com/svn/trunk@586 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-07-07 22:20:35 +00:00
reed@android.com
4040861465 oops, also update dox for saveLayerAlpha
git-svn-id: http://skia.googlecode.com/svn/trunk@585 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-07-02 17:24:23 +00:00
reed@android.com
ad164b2025 update dox for saveLayer()
git-svn-id: http://skia.googlecode.com/svn/trunk@584 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-07-02 17:20:51 +00:00
agl@chromium.org
a2c71cbd51 Add support for forcing autohinting.
http://codereview.appspot.com/1651044/show

git-svn-id: http://skia.googlecode.com/svn/trunk@580 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-06-17 20:49:17 +00:00
reed@android.com
f59799139b rename round, ceil, etc. to avoid some platform macros
git-svn-id: http://skia.googlecode.com/svn/trunk@577 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-06-15 00:57:50 +00:00
reed@android.com
e89d3ec443 Fix 64-bit Mac warnings/memory corruption
git-svn-id: http://skia.googlecode.com/svn/trunk@569 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-05-18 21:23:30 +00:00
agl@chromium.org
5f6a0762f1 Add a SkTypeface::CreateForChars() function.
This allows us to do font fallback for strange scripts.
Added empty stubs to the implementations on all platforms.

Patch-by: Evan Martin
Signed-off-by: Adam Langley

http://codereview.appspot.com/950041

git-svn-id: http://skia.googlecode.com/svn/trunk@557 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-04-20 22:06:40 +00:00
reed@android.com
756f6dd82d dox
git-svn-id: http://skia.googlecode.com/svn/trunk@556 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-04-16 20:56:00 +00:00
reed@android.com
b00cd7258c add SkRefPtr class (for testing at the moment)
git-svn-id: http://skia.googlecode.com/svn/trunk@555 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-04-16 20:35:47 +00:00
reed@android.com
337d42626b remove obsolete header
git-svn-id: http://skia.googlecode.com/svn/trunk@544 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-04-13 13:40:58 +00:00
reed@android.com
9aa8b32233 add SKIA_VERSION_[MAJOR, MINOR, PATCH] in header and SkGraphics API
git-svn-id: http://skia.googlecode.com/svn/trunk@542 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-04-13 13:22:54 +00:00
reed@android.com
2687ae05cb add more MakeFoo factories for SkRect
git-svn-id: http://skia.googlecode.com/svn/trunk@541 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-04-12 21:21:59 +00:00
reed@android.com
735b790150 fix dither-to-4444 to keep the alpha value >= colors
git-svn-id: http://skia.googlecode.com/svn/trunk@534 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-04-06 21:03:33 +00:00
reed@android.com
3f1f06a26b add optional pref-config table to codecs
git-svn-id: http://skia.googlecode.com/svn/trunk@519 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-03-03 21:04:12 +00:00
reed@android.com
8de2e6de5b add kNONE_LCDOrder for screens with no recognizable rgb order
git-svn-id: http://skia.googlecode.com/svn/trunk@518 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-03-02 19:56:53 +00:00
reed@android.com
d055c1fde2 convert matrix <--> matrix44
add glyphrec to bounder



git-svn-id: http://skia.googlecode.com/svn/trunk@516 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-03-01 14:54:05 +00:00
reed@android.com
233481ebd0 add static Make methods to return rects
git-svn-id: http://skia.googlecode.com/svn/trunk@508 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-02-24 01:49:13 +00:00
reed@android.com
da6fb3246a more layers extracted from webkit
git-svn-id: http://skia.googlecode.com/svn/trunk@503 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-02-19 21:41:30 +00:00
reed@android.com
dc3381fc81 update save/restore comments to mention that the drawFilter is also saved
add wrapper for harfbuzz font/fontclass



git-svn-id: http://skia.googlecode.com/svn/trunk@500 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-02-11 16:05:15 +00:00
reed@android.com
c83d422b63 doh - fix build
git-svn-id: http://skia.googlecode.com/svn/trunk@498 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-02-11 11:17:00 +00:00
reed@android.com
60bc6d5cb0 add Make to SkTSize
git-svn-id: http://skia.googlecode.com/svn/trunk@497 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-02-11 11:09:39 +00:00
reed@android.com
eebf5cb6c0 add copysign for ints and floats
fix addArc to not wrap around if the sweepAngle is close to 360 but lost
precision when convert to radians (and then to unit vectors ala sin/cos)



git-svn-id: http://skia.googlecode.com/svn/trunk@495 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-02-09 18:30:59 +00:00
reed@android.com
d3aa4ff7a5 add countPoints() and getPoint()
git-svn-id: http://skia.googlecode.com/svn/trunk@494 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-02-09 16:38:45 +00:00
senorblanco@chromium.org
4526a847da This patch allows the use of the native FreeType emboldening
algorithm when "fake bold" text is used in SkPaint.

It's enabled by #defining SK_USE_FREETYPE_EMBOLDEN.

Review URL:  http://codereview.appspot.com/198077



git-svn-id: http://skia.googlecode.com/svn/trunk@490 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-02-05 23:08:20 +00:00
reed@android.com
ba09de4c4b respect edgetype in quickreject
git-svn-id: http://skia.googlecode.com/svn/trunk@489 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-02-05 20:46:05 +00:00
reed@android.com
945a139553 add SkXRay geometry routines
git-svn-id: http://skia.googlecode.com/svn/trunk@488 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-02-05 20:41:02 +00:00
reed@android.com
a5dcaf6fd8 add containsText() api
git-svn-id: http://skia.googlecode.com/svn/trunk@487 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-02-05 17:12:32 +00:00
reed@android.com
ac753098e8 add some utils to SkPoint
git-svn-id: http://skia.googlecode.com/svn/trunk@485 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-01-28 21:34:33 +00:00
reed@android.com
ec10d21eb9 remove obsolete SK_BUILD_FOR_BREW conditional
git-svn-id: http://skia.googlecode.com/svn/trunk@473 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-01-12 22:58:35 +00:00
reed@android.com
9d3a985aa3 add glyph->unichar query (inverse of a cmap)
git-svn-id: http://skia.googlecode.com/svn/trunk@472 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-01-08 14:07:42 +00:00
agl@chromium.org
13c8558e37 Fix r466 which was causing Chromium valgrind failures.
See the added comment for details.

TBR=reed (since it's a build fix)

git-svn-id: http://skia.googlecode.com/svn/trunk@469 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-01-04 23:56:43 +00:00
reed@android.com
474a12c497 Added a virtual to SkBounder, called by text, that passes
the glyph's ID as well as its bounds. Made the universal
doIRect() non-abstract so that a child class can override
either the general flavor or the text flavor.



git-svn-id: http://skia.googlecode.com/svn/trunk@468 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-01-04 19:35:33 +00:00
reed@android.com
69975b0fce chant __ARM_ARCH_4__ to __ARM_ARCH_4T__, to reflect known android targets
git-svn-id: http://skia.googlecode.com/svn/trunk@467 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-01-04 19:23:32 +00:00
agl@chromium.org
e95c91e6d9 Add flag to enable bitmap strikes.
http://codereview.appspot.com/183096

git-svn-id: http://skia.googlecode.com/svn/trunk@466 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-01-04 18:27:55 +00:00
reed@android.com
63debae4c1 initial checkin for visualstudio build support
git-svn-id: http://skia.googlecode.com/svn/trunk@460 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-12-16 17:25:43 +00:00
reed@android.com
cb60844b34 add drawData() to canvas, to record data blobs
git-svn-id: http://skia.googlecode.com/svn/trunk@452 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-12-04 21:32:27 +00:00
reed@android.com
e522ca5d5f fix winding bug in lineclipper
expose path.dump() all the time
UP arrow now toggles a grid of clip rects in sample app



git-svn-id: http://skia.googlecode.com/svn/trunk@443 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-11-23 20:10:41 +00:00
reed@android.com
90209caa68 doh. make the new S16 and U16 checkers inline
git-svn-id: http://skia.googlecode.com/svn/trunk@442 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-11-21 19:58:04 +00:00
reed@android.com
d457775787 add checks for exceeding 16bits, and apply those for glyphs in getMetrics()
git-svn-id: http://skia.googlecode.com/svn/trunk@441 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-11-21 02:48:11 +00:00
senorblanco@chromium.org
9a62fa7052 Remove SK_USE_OLD_255_TO_256.
Review URL:  http://codereview.appspot.com/156057/show.



git-svn-id: http://skia.googlecode.com/svn/trunk@438 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-11-20 04:25:41 +00:00
reed@android.com
e28ff55d98 retool clipping in hairlines to catch huge coordinates
git-svn-id: http://skia.googlecode.com/svn/trunk@436 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-11-19 20:46:39 +00:00
reed@android.com
909994fbae new scanconversion technique
This technique geometrically clips all segments against the clip bounds,
ensuring that we never send a value to the edgelist that might overflow in
fixedpoint.

Current disabled in SkScan_Path.cpp by a #define. There are a few minor pixel
differences between this and the old technique, as found by the gm tool, so
at the moment this new code is off by default.



git-svn-id: http://skia.googlecode.com/svn/trunk@432 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-11-18 16:09:51 +00:00
reed@android.com
77f0ef726f add quadclipping utility, plus sample test
git-svn-id: http://skia.googlecode.com/svn/trunk@429 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-11-17 18:47:52 +00:00
senorblanco@chromium.org
4e753558fc More SSE2-ification; fix for gcc -msse2.
Review URL:  http://codereview.appspot.com/154163



git-svn-id: http://skia.googlecode.com/svn/trunk@428 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-11-16 21:09:00 +00:00
reed@android.com
70149060a7 add lineclipper, and test case
git-svn-id: http://skia.googlecode.com/svn/trunk@427 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-11-16 20:39:43 +00:00
reed@android.com
f0f4e9abba remove const modifiers on function return types (unneeded, and caused an error
on some gccs).



git-svn-id: http://skia.googlecode.com/svn/trunk@425 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-11-13 19:00:49 +00:00
senorblanco@chromium.org
9272761b22 SSE2 optimizations for 32bit blending blitters.
This CL implements SSE2 optimizations for 3 of the 32bit blending blitters.  It
uses CPUID to detect for SSE2 at runtime.  In order to accomodate runtime
detection, it changes the platform procs from static arrays to static
functions.

It also includes an implementation of SkTime for Win32.

http://codereview.appspot.com/144072



git-svn-id: http://skia.googlecode.com/svn/trunk@418 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-11-04 20:51:06 +00:00
reed@android.com
34245c7871 add OVerView slide to samplecode
change inline functions in SkColorPriv.h to static inline



git-svn-id: http://skia.googlecode.com/svn/trunk@415 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-11-03 04:00:48 +00:00
reed@android.com
c4cae85752 add BlitRow procs for 32->32, to allow for neon and other optimizations.
call these new procs in (nearly) all the places we had inlined loops before.
In once instance (blitter_argb32::blitAntiH) we get different results by a
  tiny bit. The new code is more accurate, and exactly inline with all of the
  other like-minded blits, so I think the change is good going forward.



git-svn-id: http://skia.googlecode.com/svn/trunk@366 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-09-23 15:06:10 +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
19a89f287f add boolean tests and IF/ELSE/END
git-svn-id: http://skia.googlecode.com/svn/trunk@344 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-08-30 03:24:51 +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
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
0da41dbf5b add detach() method
git-svn-id: http://skia.googlecode.com/svn/trunk@334 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-08-25 16:03:59 +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
deanm@chromium.org
d5ed395048 Fix compliation on gcc-4.3 and ARMv5T
- smulbb is only on ARMv5TE and above (p316, ARM Architecture Reference Manual)
 - an empty clobber list causes a compiler error with my compiler, gcc-4.3.2

Patch by Joel Stanley <joel@jms.id.au>

Review URL: http://codereview.appspot.com/96165


git-svn-id: http://skia.googlecode.com/svn/trunk@329 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-08-21 17:17:35 +00:00
agl@chromium.org
4484d23ab4 Remove assertion in getAddrLCD.
Because the underlying mask extends a pixel to the left and right (or
top and bottom on vertical LCDs), the requested pixel can actaully be
one pixel outside the bounds, thus this assertion is incorrect.

http://codereview.appspot.com/105077


git-svn-id: http://skia.googlecode.com/svn/trunk@312 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-08-11 17:21:21 +00:00
reed@android.com
ac98154faa add GetFileName api to SkFontHost
git-svn-id: http://skia.googlecode.com/svn/trunk@299 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-31 16:17:01 +00:00
reed@android.com
e2ca20740b ws fixes
use enum in getHinting() function, rather than hard-coded constants



git-svn-id: http://skia.googlecode.com/svn/trunk@290 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-27 16:39:38 +00:00
reed@android.com
41f8d4807b remove const from function return-type signature (useless, and generates gcc
warnings)



git-svn-id: http://skia.googlecode.com/svn/trunk@286 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-23 16:00:37 +00:00
reed@android.com
36a4c2aa2d Add SkFontHost::FilterRect() which allows the font host to filter our request
before we turn it into a font-cache entry, for the cases where the scaler will
ignore and/or collapse certain feature requests (e.g. doesn't support all levels
of hinting)



git-svn-id: http://skia.googlecode.com/svn/trunk@283 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-22 19:52:11 +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
agl@chromium.org
f03642675e Typo fix.
git-svn-id: http://skia.googlecode.com/svn/trunk@279 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-21 18:58:43 +00:00
agl@chromium.org
309485b7b5 Subpixel glyph rendering support.
This patch adds support for rendering subpixel glyphs (using
Freetype). In order to control this rendering see
SkPaint::setLCDRenderText in SkPaint.h.

To setup the LCD mode, see SkFontHost::SetSubpixelOrientation and
SkFontHost::SetSubpixelOrder in SkFontHost.h.

This patch also adds more fine grained control over hinting (again,
only for Freetype currently). One can now control the hinting with
SkPaint::setHinting.


git-svn-id: http://skia.googlecode.com/svn/trunk@275 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-21 17:41:32 +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
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
40443b2371 fix (aaaargh) white-space
git-svn-id: http://skia.googlecode.com/svn/trunk@260 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-08 15:11:19 +00:00
reed@android.com
187d559590 add dox for scalarcomparetype
use internal mutable version of drawPath when we've cons'd up a path on behalf
of a rect



git-svn-id: http://skia.googlecode.com/svn/trunk@258 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-08 14:03:56 +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
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
4b7577b042 add unittest for matrix::flatten
define constant for max value flatten/unflatten can return (so clients can put
the buffer on the stack)



git-svn-id: http://skia.googlecode.com/svn/trunk@243 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-29 16:14:41 +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
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
8015dd83ae almost there on gm (need to fix image writes/reads/compares)
move SkAutoGraphics into SkGraphics.h
add [] operators to SkString



git-svn-id: http://skia.googlecode.com/svn/trunk@228 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-21 00:49:18 +00:00
reed@android.com
086f2896e0 add width()/height() getters
git-svn-id: http://skia.googlecode.com/svn/trunk@226 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-20 02:34:55 +00:00
deanm@chromium.org
81aaa9d8c0 Fix MSVC builds by avoiding a uint to bool warning.
warning C4800: 'const uint8_t' : forcing value to bool 'true' or 'false' (performance warning)

Review URL: http://codereview.appspot.com/79043


git-svn-id: http://skia.googlecode.com/svn/trunk@220 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-18 14:46:03 +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
reed@android.com
f16c899a74 add equals()
git-svn-id: http://skia.googlecode.com/svn/trunk@210 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-12 02:06:36 +00:00
reed@android.com
199f108f14 only call SkDevice::gainFocus() if we're actually drawing to a different device.
Saves overhead when using GL.



git-svn-id: http://skia.googlecode.com/svn/trunk@207 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-06-10 02:12: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
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
89bb83abb4 fix trailing-ws
initialize fFlags in bitmapprocshader



git-svn-id: http://skia.googlecode.com/svn/trunk@191 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-05-29 21:30:42 +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
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
6a5a2667a7 add SkSize for dimensions
git-svn-id: http://skia.googlecode.com/svn/trunk@172 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-05-08 16:45:52 +00:00
reed@android.com
f76b1b6566 add SK_USE_OLD_255_TO_256 define to disable alpha+1 change to SkAlpha255To256
git-svn-id: http://skia.googlecode.com/svn/trunk@171 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-05-08 13:10:38 +00:00
reed@android.com
fbaa88d969 add canCopyTo(), to preflight if copyTo can succeed. update unittests for it
git-svn-id: http://skia.googlecode.com/svn/trunk@169 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-05-06 17:44:34 +00:00
weita@google.com
f9ab99aaad Allow copying an Index8 bitmap when srcConfig and dstConfig are both
Index8.

Also, change the logic of SkBitmap.copyTo() to do memcpy() if srcConfig
and dstConfig are the same.


git-svn-id: http://skia.googlecode.com/svn/trunk@164 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-05-03 18:23:30 +00:00
reed@android.com
543ed9352c add ADD xfermode
safely handle (don't draw) if the size of SkMask exceeds 31bits



git-svn-id: http://skia.googlecode.com/svn/trunk@159 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-04-24 12:43:40 +00:00