platform/upstream/libSkiaSharp.git
14 years agofix overflow in qsort compare proc
reed@android.com [Tue, 25 Aug 2009 18:14:50 +0000 (18:14 +0000)]
fix overflow in qsort compare proc

git-svn-id: http://skia.googlecode.com/svn/trunk@335 2bbb7eff-a529-9590-31e7-b0007b416f81

14 years agoadd detach() method
reed@android.com [Tue, 25 Aug 2009 16:03:59 +0000 (16:03 +0000)]
add detach() method

git-svn-id: http://skia.googlecode.com/svn/trunk@334 2bbb7eff-a529-9590-31e7-b0007b416f81

14 years agofix warning in sampler
reed@android.com [Mon, 24 Aug 2009 19:11:00 +0000 (19:11 +0000)]
fix warning in sampler
lock pixels when we extract alpha
disabling hinting when linear-text is set

git-svn-id: http://skia.googlecode.com/svn/trunk@333 2bbb7eff-a529-9590-31e7-b0007b416f81

14 years agoupdate gm images with new corrected dithering
reed@android.com [Sat, 22 Aug 2009 03:48:59 +0000 (03:48 +0000)]
update gm images with new corrected dithering

git-svn-id: http://skia.googlecode.com/svn/trunk@332 2bbb7eff-a529-9590-31e7-b0007b416f81

14 years agofixes around isOpaque and dithering
reed@android.com [Sat, 22 Aug 2009 03:44:57 +0000 (03:44 +0000)]
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

14 years agoAdd a sanity check to MaskSuperBlitter::blitH(), to avoid a subsequent
senorblanco@chromium.org [Fri, 21 Aug 2009 22:00:12 +0000 (22:00 +0000)]
Add a sanity check to MaskSuperBlitter::blitH(), to avoid a subsequent
crash in *Blitter::blitMask(), and add some more asserts.

http://codereview.appspot.com/110050
http://crbug.com/17569

git-svn-id: http://skia.googlecode.com/svn/trunk@330 2bbb7eff-a529-9590-31e7-b0007b416f81

14 years agoFix compliation on gcc-4.3 and ARMv5T
deanm@chromium.org [Fri, 21 Aug 2009 17:17:35 +0000 (17:17 +0000)]
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

14 years agorespect dither setting in index8->565 sprite case
reed@android.com [Thu, 20 Aug 2009 21:29:45 +0000 (21:29 +0000)]
respect dither setting in index8->565 sprite case

git-svn-id: http://skia.googlecode.com/svn/trunk@328 2bbb7eff-a529-9590-31e7-b0007b416f81

14 years agoFix flipped text orientation on Windows.
deanm@chromium.org [Fri, 14 Aug 2009 23:09:52 +0000 (23:09 +0000)]
Fix flipped text orientation on Windows.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@327 2bbb7eff-a529-9590-31e7-b0007b416f81

14 years agoupdate location of SkNWayCanvas.cpp
reed@android.com [Fri, 14 Aug 2009 19:58:53 +0000 (19:58 +0000)]
update location of SkNWayCanvas.cpp

git-svn-id: http://skia.googlecode.com/svn/trunk@326 2bbb7eff-a529-9590-31e7-b0007b416f81

14 years agoclose out previous contour (so we don't miss the last segment)
reed@android.com [Fri, 14 Aug 2009 19:27:37 +0000 (19:27 +0000)]
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

14 years agoadd 'r' (rotate) 's' (scale) options to SampleApp to test those matrix ops on
reed@android.com [Fri, 14 Aug 2009 16:08:38 +0000 (16:08 +0000)]
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

14 years agofix typo in matrix proc index computation, where we were always taking the
reed@android.com [Fri, 14 Aug 2009 15:47:14 +0000 (15:47 +0000)]
fix typo in matrix proc index computation, where we were always taking the
perspective case when affine would have been enough (and lots faster).

git-svn-id: http://skia.googlecode.com/svn/trunk@323 2bbb7eff-a529-9590-31e7-b0007b416f81

14 years agoadd method to compute max count for a given buffer size in the bitmap shader.
reed@android.com [Fri, 14 Aug 2009 13:54:37 +0000 (13:54 +0000)]
add method to compute max count for a given buffer size in the bitmap shader.
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

14 years agobzero SkPaint in its constructor, to allow us to cleanly use memcmp in our
reed@android.com [Thu, 13 Aug 2009 20:38:25 +0000 (20:38 +0000)]
bzero SkPaint in its constructor, to allow us to cleanly use memcmp in our
operator==, given that we may be padded and not know how to init those pad bytes

git-svn-id: http://skia.googlecode.com/svn/trunk@321 2bbb7eff-a529-9590-31e7-b0007b416f81

14 years agoadd special matrixprocs when the matrix is at most translate. These are faster
reed@android.com [Thu, 13 Aug 2009 19:35:48 +0000 (19:35 +0000)]
add special matrixprocs when the matrix is at most translate. These are faster
(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

14 years agotest for non-scaled bitmap tiles
reed@android.com [Thu, 13 Aug 2009 19:33:44 +0000 (19:33 +0000)]
test for non-scaled bitmap tiles

git-svn-id: http://skia.googlecode.com/svn/trunk@319 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd benchmark for repeat-tile bitmaps
reed@android.com [Wed, 12 Aug 2009 20:30:58 +0000 (20:30 +0000)]
add benchmark for repeat-tile bitmaps

git-svn-id: http://skia.googlecode.com/svn/trunk@318 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoAdd some SkASSERT's, to try to track down a reliability issue in Chrome.
senorblanco@chromium.org [Wed, 12 Aug 2009 20:21:49 +0000 (20:21 +0000)]
Add some SkASSERT's, to try to track down a reliability issue in Chrome.

http://codereview.appspot.com/105075
http://crbug.com/17569

git-svn-id: http://skia.googlecode.com/svn/trunk@317 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoremove unneeded (empty) virtual destructor
reed@android.com [Wed, 12 Aug 2009 18:51:06 +0000 (18:51 +0000)]
remove unneeded (empty) virtual destructor

git-svn-id: http://skia.googlecode.com/svn/trunk@316 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agofixes wacky build on android. no other explanation received
reed@android.com [Tue, 11 Aug 2009 20:01:33 +0000 (20:01 +0000)]
fixes wacky build on android. no other explanation received

git-svn-id: http://skia.googlecode.com/svn/trunk@315 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agofix validate() to note that an empty path can (by side-effect) have an empty but
reed@android.com [Tue, 11 Aug 2009 19:54:35 +0000 (19:54 +0000)]
fix validate() to note that an empty path can (by side-effect) have an empty but
translated fBounds

git-svn-id: http://skia.googlecode.com/svn/trunk@314 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoFreeType: fix garbled bitmap glyphs.
agl@chromium.org [Tue, 11 Aug 2009 17:22:38 +0000 (17:22 +0000)]
FreeType: fix garbled bitmap glyphs.

At some point (probably in one of the LCD patches), the fMaskFormat
for bitmap glyphs changed from kA8 to kBW. Formerly, bitmap glyphs
were always transformed into A8 format. With this patch, we check the
fMaskFormat and pick the correct transform at run time.

http://code.google.com/p/chromium/issues/detail?id=18531
http://codereview.appspot.com/104071

git-svn-id: http://skia.googlecode.com/svn/trunk@313 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoRemove assertion in getAddrLCD.
agl@chromium.org [Tue, 11 Aug 2009 17:21:21 +0000 (17:21 +0000)]
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

15 years agoremove dead code
reed@android.com [Tue, 11 Aug 2009 15:35:36 +0000 (15:35 +0000)]
remove dead code

git-svn-id: http://skia.googlecode.com/svn/trunk@311 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoFreeType: don't use bitmap strikes when antialiasing
agl@chromium.org [Fri, 7 Aug 2009 19:19:23 +0000 (19:19 +0000)]
FreeType: don't use bitmap strikes when antialiasing

If the user requested anti-aliasing then we don't use bitmap strikes
in the font. The consensus among our Japanese users is that this
results in the best quality.

http://code.google.com/p/chromium/issues/detail?id=18333

http://codereview.appspot.com/105050

git-svn-id: http://skia.googlecode.com/svn/trunk@310 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agomore neon work:
reed@android.com [Fri, 7 Aug 2009 19:14:34 +0000 (19:14 +0000)]
more neon work:
- remove neon-specific functions that were not faster than the C version
- move the neon filter function to its own header, so it could be use in more places

git-svn-id: http://skia.googlecode.com/svn/trunk@309 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoupdate make for nwaycanvas
reed@android.com [Tue, 4 Aug 2009 19:21:28 +0000 (19:21 +0000)]
update make for nwaycanvas
remove obsolete opts_neon dir

git-svn-id: http://skia.googlecode.com/svn/trunk@308 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd -forceFilter to bench tool
reed@android.com [Tue, 4 Aug 2009 18:17:15 +0000 (18:17 +0000)]
add -forceFilter to bench tool
move some utils out of effects/

git-svn-id: http://skia.googlecode.com/svn/trunk@307 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd proper includes for arm optimizations
reed@android.com [Tue, 4 Aug 2009 01:52:27 +0000 (01:52 +0000)]
add proper includes for arm optimizations

git-svn-id: http://skia.googlecode.com/svn/trunk@306 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd -config foo to restrict the output to just the specific config
reed@android.com [Tue, 4 Aug 2009 01:51:09 +0000 (01:51 +0000)]
add -config foo to restrict the output to just the specific config
add -match foo to restrict the benchmarks to those whose names match foo

git-svn-id: http://skia.googlecode.com/svn/trunk@305 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoremove noisy font table tests from TextBench
reed@android.com [Tue, 4 Aug 2009 01:25:44 +0000 (01:25 +0000)]
remove noisy font table tests from TextBench

git-svn-id: http://skia.googlecode.com/svn/trunk@304 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoarm/neon optimizations for bitmap shader
reed@android.com [Mon, 3 Aug 2009 17:22:46 +0000 (17:22 +0000)]
arm/neon optimizations for bitmap shader
original version by ARM LIMITED 2009

git-svn-id: http://skia.googlecode.com/svn/trunk@303 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoupdate
reed@android.com [Mon, 3 Aug 2009 15:06:11 +0000 (15:06 +0000)]
update

git-svn-id: http://skia.googlecode.com/svn/trunk@302 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd platformProcs() porting function
reed@android.com [Mon, 3 Aug 2009 15:05:55 +0000 (15:05 +0000)]
add platformProcs() porting function

git-svn-id: http://skia.googlecode.com/svn/trunk@301 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoclean up SkBitmapProcState in preparation for adding porting-layer functions
reed@android.com [Mon, 3 Aug 2009 14:45:45 +0000 (14:45 +0000)]
clean up SkBitmapProcState in preparation for adding porting-layer functions

git-svn-id: http://skia.googlecode.com/svn/trunk@300 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd GetFileName api to SkFontHost
reed@android.com [Fri, 31 Jul 2009 16:17:01 +0000 (16:17 +0000)]
add GetFileName api to SkFontHost

git-svn-id: http://skia.googlecode.com/svn/trunk@299 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agofix #endif placement so it works when LCD support is not defined
reed@android.com [Fri, 31 Jul 2009 14:52:54 +0000 (14:52 +0000)]
fix #endif placement so it works when LCD support is not defined

git-svn-id: http://skia.googlecode.com/svn/trunk@298 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd opts for neon
reed@android.com [Thu, 30 Jul 2009 20:40:47 +0000 (20:40 +0000)]
add opts for neon

git-svn-id: http://skia.googlecode.com/svn/trunk@297 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd opts files to the make
reed@android.com [Thu, 30 Jul 2009 02:25:54 +0000 (02:25 +0000)]
add opts files to the make

git-svn-id: http://skia.googlecode.com/svn/trunk@296 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd optimization table for blitproc functions
reed@android.com [Thu, 30 Jul 2009 02:22:31 +0000 (02:22 +0000)]
add optimization table for blitproc functions

git-svn-id: http://skia.googlecode.com/svn/trunk@295 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoremove auto-upscaling from base class (breaks model for allocators) but improve
reed@android.com [Wed, 29 Jul 2009 20:56:52 +0000 (20:56 +0000)]
remove auto-upscaling from base class (breaks model for allocators) but improve
the upscaling inside the png codec.

git-svn-id: http://skia.googlecode.com/svn/trunk@294 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoAdd runtime detection for missing subpixel support in FreeType.
agl@chromium.org [Tue, 28 Jul 2009 18:38:08 +0000 (18:38 +0000)]
Add runtime detection for missing subpixel support in FreeType.

r291 added support for building on platforms where subpixel support
has been compiled out of FreeType. However, it turns out that there is
a common situation in which we build on platforms with subpixel
support, but have to run without it: people downloading Chromium from
the buildbots.

Because we this, we need a runtime solution. Modifying the conversion
routines for this seems suboptimal because the extra branches will
slow down everyone. So we probe subpixel support at runtime by trying
to install a low-pass filter. If we fail at this, then we map all the
SkScalerContext::Rec structures to remove subpixel mode.

http://codereview.appspot.com/98057

git-svn-id: http://skia.googlecode.com/svn/trunk@293 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoRevert "Support subpixel text when FreeType is built without such support."
agl@chromium.org [Tue, 28 Jul 2009 18:38:04 +0000 (18:38 +0000)]
Revert "Support subpixel text when FreeType is built without such support."

This reverts commit r291. It will be replaced with another solution in the next
commit.

git-svn-id: http://skia.googlecode.com/svn/trunk@292 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoSupport subpixel text when FreeType is built without such support.
agl@chromium.org [Tue, 28 Jul 2009 00:02:42 +0000 (00:02 +0000)]
Support subpixel text when FreeType is built without such support.

On Fedora, at least, FreeType is built without subpixel support. It
tries to simulate subpixel mode by replicating the gray-values three
times. However, it fails to simulate the actions of the low-pass
filter and so doesn't add border around the glyphs. This patch adds a
compile-time constant, which is the number of bytes of filter border.
If this value is zero (because FreeType is simulating subpixel
support), then we add a transparent border ourselves when transforming
from FreeType rendered glyphs to masks.

http://codereview.appspot.com/96171

git-svn-id: http://skia.googlecode.com/svn/trunk@291 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agows fixes
reed@android.com [Mon, 27 Jul 2009 16:39:38 +0000 (16:39 +0000)]
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

15 years agoadd filterrec logic for subpixel and slight-hinting
reed@android.com [Fri, 24 Jul 2009 19:53:20 +0000 (19:53 +0000)]
add filterrec logic for subpixel and slight-hinting

git-svn-id: http://skia.googlecode.com/svn/trunk@289 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoBuild fix: add FilterRec for Windows.
agl@chromium.org [Thu, 23 Jul 2009 21:10:32 +0000 (21:10 +0000)]
Build fix: add FilterRec for Windows.

Since we don't control the settings on Windows, I believe we may just
as well filter everything.

TBR=reed

http://codereview.appspot.com/97070

git-svn-id: http://skia.googlecode.com/svn/trunk@288 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agofix uninitialized library variable
reed@android.com [Thu, 23 Jul 2009 17:44:41 +0000 (17:44 +0000)]
fix uninitialized library variable

git-svn-id: http://skia.googlecode.com/svn/trunk@287 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoremove const from function return-type signature (useless, and generates gcc
reed@android.com [Thu, 23 Jul 2009 16:00:37 +0000 (16:00 +0000)]
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

15 years agofix warnings (unused local var)
reed@android.com [Thu, 23 Jul 2009 15:20:21 +0000 (15:20 +0000)]
fix warnings (unused local var)

git-svn-id: http://skia.googlecode.com/svn/trunk@285 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoFix valgrind warnings triggered in vertical mode.
agl@chromium.org [Wed, 22 Jul 2009 21:50:59 +0000 (21:50 +0000)]
Fix valgrind warnings triggered in vertical mode.

Now that Chrome is rendering subpixel text, I was able to try running
the renderer process under valgrind, which turned up a number of
issues.

First, I was calculating the stride of vertical LCD glyphs wrong
(typo).

Secondly, I was going horribly wrong when a glyph was being blitted at
the edge of a bitmap. I suspected something was wrong with the code,
but I wasn't clear enough with the structure of the code when writing
it to figure out what the correct solution was.

http://codereview.appspot.com/97059

git-svn-id: http://skia.googlecode.com/svn/trunk@284 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoAdd SkFontHost::FilterRect() which allows the font host to filter our request
reed@android.com [Wed, 22 Jul 2009 19:52:11 +0000 (19:52 +0000)]
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

15 years agorename SK_BUILD_SUBPIXEL to SK_SUPPORT_LCDTEXT to better match the name of the
reed@android.com [Wed, 22 Jul 2009 19:21:01 +0000 (19:21 +0000)]
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

15 years agoremove crufty #undefs
reed@android.com [Wed, 22 Jul 2009 17:11:41 +0000 (17:11 +0000)]
remove crufty #undefs

git-svn-id: http://skia.googlecode.com/svn/trunk@281 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agofix NaN in path iterator
reed@android.com [Wed, 22 Jul 2009 17:06:15 +0000 (17:06 +0000)]
fix NaN in path iterator
fix case where cubic is big/degenerate, and never returns a valid edge

git-svn-id: http://skia.googlecode.com/svn/trunk@280 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoTypo fix.
agl@chromium.org [Tue, 21 Jul 2009 18:58:43 +0000 (18:58 +0000)]
Typo fix.

git-svn-id: http://skia.googlecode.com/svn/trunk@279 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoRemove unused variable to fix warning on Windows:
agl@chromium.org [Tue, 21 Jul 2009 18:07:42 +0000 (18:07 +0000)]
Remove unused variable to fix warning on Windows:
  src\core\SkBlitter_ARGB32.cpp(362) : warning C4101: 'alpha32' : unreferenced local variable

git-svn-id: http://skia.googlecode.com/svn/trunk@278 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoMac: fix SkFontHost_mac.cpp to work with the new hinting interface.
agl@chromium.org [Tue, 21 Jul 2009 18:05:59 +0000 (18:05 +0000)]
Mac: fix SkFontHost_mac.cpp to work with the new hinting interface.

git-svn-id: http://skia.googlecode.com/svn/trunk@277 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoDelete duplicated code.
agl@chromium.org [Tue, 21 Jul 2009 17:52:08 +0000 (17:52 +0000)]
Delete duplicated code.

patch went wrong and duplicated SkFontHost.cpp.

git-svn-id: http://skia.googlecode.com/svn/trunk@276 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoSubpixel glyph rendering support.
agl@chromium.org [Tue, 21 Jul 2009 17:41:32 +0000 (17:41 +0000)]
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

15 years agofix quickReject() to handle perspective correctly (i.e. transform forward into
reed@android.com [Tue, 21 Jul 2009 01:17:02 +0000 (01:17 +0000)]
fix quickReject() to handle perspective correctly (i.e. transform forward into
dst-space, and perform the clip-test there).

git-svn-id: http://skia.googlecode.com/svn/trunk@274 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd special proc for repeat 16->16 filter bitmap shader
reed@android.com [Fri, 17 Jul 2009 21:24:56 +0000 (21:24 +0000)]
add special proc for repeat 16->16 filter bitmap shader

git-svn-id: http://skia.googlecode.com/svn/trunk@273 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoremove obsolete header
reed@android.com [Fri, 17 Jul 2009 15:28:17 +0000 (15:28 +0000)]
remove obsolete header

git-svn-id: http://skia.googlecode.com/svn/trunk@272 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoremove conditional build flag for mipmaps
reed@android.com [Fri, 17 Jul 2009 02:42:41 +0000 (02:42 +0000)]
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

15 years agofirst cut at support for HW-specific blits/etc.
reed@android.com [Thu, 16 Jul 2009 20:53:26 +0000 (20:53 +0000)]
first cut at support for HW-specific blits/etc.

git-svn-id: http://skia.googlecode.com/svn/trunk@270 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoquick return if we just want the bounds
reed@android.com [Thu, 16 Jul 2009 14:50:54 +0000 (14:50 +0000)]
quick return if we just want the bounds

git-svn-id: http://skia.googlecode.com/svn/trunk@269 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agotry our first special-case shaderproc
reed@android.com [Thu, 16 Jul 2009 02:03:58 +0000 (02:03 +0000)]
try our first special-case shaderproc

git-svn-id: http://skia.googlecode.com/svn/trunk@268 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd shaderprocs for all-in-one special blits (matrix+sampler)
reed@android.com [Thu, 16 Jul 2009 01:13:14 +0000 (01:13 +0000)]
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

15 years agohandle cap==round for drawPoints
reed@android.com [Fri, 10 Jul 2009 17:02:17 +0000 (17:02 +0000)]
handle cap==round for drawPoints

git-svn-id: http://skia.googlecode.com/svn/trunk@266 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agotweaks to 16bit shaders
reed@android.com [Fri, 10 Jul 2009 15:58:53 +0000 (15:58 +0000)]
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

15 years agomake a deep copy in CreateCGImageRef if we're 565, but first upscale to 32bit.
reed@android.com [Fri, 10 Jul 2009 03:33:52 +0000 (03:33 +0000)]
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

15 years agospeedup 16bit shaders in the blitRect case
reed@android.com [Fri, 10 Jul 2009 03:05:59 +0000 (03:05 +0000)]
speedup 16bit shaders in the blitRect case
faster 32->16 blend by using the expand_16 intermediate format

git-svn-id: http://skia.googlecode.com/svn/trunk@263 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agocheck for underflow in restore() during picture record, and ignore it
reed@android.com [Thu, 9 Jul 2009 15:20:25 +0000 (15:20 +0000)]
check for underflow in restore() during picture record, and ignore it

git-svn-id: http://skia.googlecode.com/svn/trunk@262 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agorespect preferred config when png is index-based
reed@android.com [Wed, 8 Jul 2009 20:09:23 +0000 (20:09 +0000)]
respect preferred config when png is index-based

git-svn-id: http://skia.googlecode.com/svn/trunk@261 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agofix (aaaargh) white-space
reed@android.com [Wed, 8 Jul 2009 15:11:19 +0000 (15:11 +0000)]
fix (aaaargh) white-space

git-svn-id: http://skia.googlecode.com/svn/trunk@260 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agouse scalarcomparetype in matrix tests, so we don't do anything tricky
reed@android.com [Wed, 8 Jul 2009 14:46:11 +0000 (14:46 +0000)]
use scalarcomparetype in matrix tests, so we don't do anything tricky
(unnecessary) when floats are fast

git-svn-id: http://skia.googlecode.com/svn/trunk@259 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd dox for scalarcomparetype
reed@android.com [Wed, 8 Jul 2009 14:03:56 +0000 (14:03 +0000)]
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

15 years agoinitial golden-master images for gm tool
reed@android.com [Wed, 8 Jul 2009 03:00:42 +0000 (03:00 +0000)]
initial golden-master images for gm tool

git-svn-id: http://skia.googlecode.com/svn/trunk@257 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agouse genericRGB space to ensure that we decode exactly the pixels we encode
reed@android.com [Wed, 8 Jul 2009 02:54:47 +0000 (02:54 +0000)]
use genericRGB space to ensure that we decode exactly the pixels we encode
add -r option to gm to read and compare against known images

git-svn-id: http://skia.googlecode.com/svn/trunk@256 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agocheck if the encoder factory returned null
reed@android.com [Tue, 7 Jul 2009 21:18:10 +0000 (21:18 +0000)]
check if the encoder factory returned null

git-svn-id: http://skia.googlecode.com/svn/trunk@255 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd support for encoding Index8 bitmaps into png
reed@android.com [Tue, 7 Jul 2009 19:38:01 +0000 (19:38 +0000)]
add support for encoding Index8 bitmaps into png

git-svn-id: http://skia.googlecode.com/svn/trunk@254 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd FIXME to comment
reed@android.com [Tue, 7 Jul 2009 18:19:59 +0000 (18:19 +0000)]
add FIXME to comment

git-svn-id: http://skia.googlecode.com/svn/trunk@253 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoinitialize fShapeCount in init()
reed@android.com [Tue, 7 Jul 2009 13:25:15 +0000 (13:25 +0000)]
initialize fShapeCount in init()

git-svn-id: http://skia.googlecode.com/svn/trunk@252 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agofix white-space
reed@android.com [Tue, 7 Jul 2009 13:20:37 +0000 (13:20 +0000)]
fix white-space

git-svn-id: http://skia.googlecode.com/svn/trunk@251 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoOptimize some alpha blending modes.
deanm@chromium.org [Fri, 3 Jul 2009 12:54:24 +0000 (12:54 +0000)]
Optimize some alpha blending modes.

- Inline the component calculation helpers.
- Reorder the computation in plus_modeproc.

This doubles the performance of plus_modeproc.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@250 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agomore checks for null shapes in pictures
reed@android.com [Fri, 3 Jul 2009 02:52:27 +0000 (02:52 +0000)]
more checks for null shapes in pictures

git-svn-id: http://skia.googlecode.com/svn/trunk@249 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agofix gradients with alpha to convert to premul *after* the intermediate color
reed@android.com [Thu, 2 Jul 2009 15:01:02 +0000 (15:01 +0000)]
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

15 years agoremove (ack) test code in lineargradient when pos array is null
reed@android.com [Wed, 1 Jul 2009 17:00:03 +0000 (17:00 +0000)]
remove (ack) test code in lineargradient when pos array is null

git-svn-id: http://skia.googlecode.com/svn/trunk@247 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoFix a precedence error in an assert in the fontconfig host.
deanm@chromium.org [Wed, 1 Jul 2009 07:49:44 +0000 (07:49 +0000)]
Fix a precedence error in an assert in the fontconfig host.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@246 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agofix config check to include SkColorPriv.h so we don't get the warning w/o need
reed@android.com [Mon, 29 Jun 2009 17:07:19 +0000 (17:07 +0000)]
fix config check to include SkColorPriv.h so we don't get the warning w/o need

git-svn-id: http://skia.googlecode.com/svn/trunk@245 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agouse sk_bzero instead of bzero, since it isn't always available.
reed@android.com [Mon, 29 Jun 2009 16:25:36 +0000 (16:25 +0000)]
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

15 years agoadd unittest for matrix::flatten
reed@android.com [Mon, 29 Jun 2009 16:14:41 +0000 (16:14 +0000)]
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

15 years agoadd shape flatten so they work properly in pictures
reed@android.com [Mon, 29 Jun 2009 16:02:20 +0000 (16:02 +0000)]
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

15 years agoadd golden master code for shapes
reed@android.com [Fri, 26 Jun 2009 20:22:44 +0000 (20:22 +0000)]
add golden master code for shapes

git-svn-id: http://skia.googlecode.com/svn/trunk@241 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd shape recording to pictuures (sans serialization)
reed@android.com [Fri, 26 Jun 2009 20:22:26 +0000 (20:22 +0000)]
add shape recording to pictuures (sans serialization)

git-svn-id: http://skia.googlecode.com/svn/trunk@240 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agodetect nearly translate-only matrices when drawing bitmaps (for speed)
reed@android.com [Wed, 24 Jun 2009 12:41:42 +0000 (12:41 +0000)]
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

15 years agofix memory leak in new setXfermode()
reed@android.com [Wed, 24 Jun 2009 12:29:16 +0000 (12:29 +0000)]
fix memory leak in new setXfermode()

git-svn-id: http://skia.googlecode.com/svn/trunk@238 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoadd new make target "all", to build all known targets
reed@android.com [Tue, 23 Jun 2009 17:13:30 +0000 (17:13 +0000)]
add new make target "all", to build all known targets

git-svn-id: http://skia.googlecode.com/svn/trunk@237 2bbb7eff-a529-9590-31e7-b0007b416f81

15 years agoremove remaining references to porterduff
reed@android.com [Tue, 23 Jun 2009 12:19:41 +0000 (12:19 +0000)]
remove remaining references to porterduff

git-svn-id: http://skia.googlecode.com/svn/trunk@236 2bbb7eff-a529-9590-31e7-b0007b416f81