platform/upstream/libSkiaSharp.git
13 years agoSecurity fixes re getSize().
wjmaclean@chromium.org [Wed, 22 Dec 2010 17:43:54 +0000 (17:43 +0000)]
Security fixes re getSize().

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

13 years agoadd for quick gl-offscreen context (so we can draw and then readpixels for GM)
reed@google.com [Tue, 21 Dec 2010 16:26:39 +0000 (16:26 +0000)]
add for quick gl-offscreen context (so we can draw and then readpixels for GM)

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

13 years ago-d dir will write out a difference-bitmap for each compare that failes
reed@google.com [Mon, 20 Dec 2010 21:10:29 +0000 (21:10 +0000)]
-d dir will write out a difference-bitmap for each compare that failes

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

13 years agoremove ZLIB include from SkUserConfig for how (doesn't work on mac sampleapp) but,
reed@google.com [Mon, 20 Dec 2010 20:53:13 +0000 (20:53 +0000)]
remove ZLIB include from SkUserConfig for how (doesn't work on mac sampleapp) but,
add it to Makefile if SKIA_PDF_SUPPORT is true

Use compile_assert (yea!)

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

13 years agoadd option to write PDFs from gm
reed@google.com [Mon, 20 Dec 2010 19:46:07 +0000 (19:46 +0000)]
add option to write PDFs from gm
fix some compile warnings (reorder initializers, init local ptr)

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

13 years agoadd SkFlate.cpp
reed@google.com [Mon, 20 Dec 2010 18:48:46 +0000 (18:48 +0000)]
add SkFlate.cpp

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

13 years agoadd
reed@android.com [Mon, 20 Dec 2010 18:34:17 +0000 (18:34 +0000)]
add

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

13 years agoadd
reed@android.com [Mon, 20 Dec 2010 18:33:15 +0000 (18:33 +0000)]
add

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

13 years agoupdate for GPU backend
reed@android.com [Mon, 20 Dec 2010 18:32:39 +0000 (18:32 +0000)]
update for GPU backend

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

13 years agomerge with changes for GPU backend
reed@android.com [Mon, 20 Dec 2010 18:26:13 +0000 (18:26 +0000)]
merge with changes for GPU backend

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

13 years agoFix perf regression in Color32.
senorblanco@chromium.org [Thu, 16 Dec 2010 19:07:45 +0000 (19:07 +0000)]
Fix perf regression in Color32.

The regression was due to the fact that we were calling PlatformColorProc() for
every span (which in turns makes CPUID, a fairly expensive call).  Since we draw
a lot of rects, and rects have 1-pixel wide spans for the vertical segments,
that's a lot of CPUID.

Fixed by cacheing the result of PlatformColorProc(), as is done for the other
platform-specific blitters.

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

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

13 years agoUnreviewed; ARM build fix.
senorblanco@chromium.org [Wed, 15 Dec 2010 16:20:59 +0000 (16:20 +0000)]
Unreviewed; ARM build fix.

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

13 years agodump message confirming read or write directory
reed@android.com [Tue, 14 Dec 2010 17:46:14 +0000 (17:46 +0000)]
dump message confirming read or write directory

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

13 years agoSSE2 optimizations for 32bit Color operation.
senorblanco@chromium.org [Mon, 13 Dec 2010 15:27:20 +0000 (15:27 +0000)]
SSE2 optimizations for 32bit Color operation.

[Patch from weiwei.li@intel.com]

SSE2 optimization has been added by Stephen White before, this improves the skia
performance on SSE2-supporting platform. (please refer to below issues)

Issue 171055: More SSE2ification
Issue 157141: More SSE2ification
Issue 150060: minor tweaks to SSE2 code for -fPIC
Issue 144072: SSE2 optimizations for 32bit blending blitters

This CL implements SSE2 optimizations for the 32bit Color operation. Like above
issues, it uses CPUID to detect for SSE2 and changes the platform procs at
runtime as well. The 32bit Color operation is heavily used on Chrome HTML5
canvas operations. Take Microsoft IE test drives Pulsating Bubbles as example
(http://ie.microsoft.com/testdrive/Performance/PulsatingBubbles/Default.xhtml),
if running this cases on Chrome, the overhead of 32bit Color operation is about
40~50%. So this CL will make skia performance more better, and also make Chrome
HTML5 canvas performance more better.

Additional, this CL has passed the skia bench & tests validation, the result is
pretty good. We also apply this CL to the latest chromium, and re-run Microsoft
IE test drives Pulsating Bubbles, the performance is improved by almost 9~10%.

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

13 years agoUpstream mulDiv255Ceil() from WebKit to the skia repository.
senorblanco@chromium.org [Tue, 7 Dec 2010 21:07:56 +0000 (21:07 +0000)]
Upstream mulDiv255Ceil() from WebKit to the skia repository.

(Patch by Noel Gordon (noel.gordon@gmail.com))

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

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

13 years agoPatch by Mike Lawther (mikelawther@chromium.org).
senorblanco@chromium.org [Mon, 6 Dec 2010 23:45:58 +0000 (23:45 +0000)]
Patch by Mike Lawther (mikelawther@chromium.org).

The HTML5 canvas client of BlurDrawLooper needs the option to not apply the
canvas transform to the blur offset.

see
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-elemen...
- "The shadowOffsetX and shadowOffsetY attributes specify the distance that the
shadow will be offset in the positive horizontal and positive vertical distance
respectively. Their values are in coordinate space units. They are not affected
by the current transformation matrix."

This patch is part of fixing
http://code.google.com/p/chromium/issues/detail?id=64647.

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

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

13 years agoCorrectly handle SkPath::kInverseWinding_FillType
agl@chromium.org [Mon, 6 Dec 2010 18:52:40 +0000 (18:52 +0000)]
Correctly handle SkPath::kInverseWinding_FillType

Fix for http://code.google.com/p/skia/issues/detail?id=87

Even when SkPath::kInverseWinding_FillType is given, Skia left some
lines not filled(cleared) in one case.

Patch-by: morrita
http://codereview.appspot.com/3443041

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

13 years agoAdd flate compression test and fix bugs.
vandebo@chromium.org [Thu, 2 Dec 2010 22:55:33 +0000 (22:55 +0000)]
Add flate compression test and fix bugs.

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

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

13 years agoAdd deflate support to SkPDFStream.
vandebo@chromium.org [Wed, 1 Dec 2010 22:17:20 +0000 (22:17 +0000)]
Add deflate support to SkPDFStream.

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

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

14 years agoAllow zero text size to be specified for an SkPaint.
vandebo@chromium.org [Wed, 17 Nov 2010 21:44:28 +0000 (21:44 +0000)]
Allow zero text size to be specified for an SkPaint.

We have to support zero sized fonts and generate correct metrics
to pass Acid3.  There don't seem to be any requirements that textsize
be >0, just that it not be negative.

Original issue: http://codereview.appspot.com/3174041/

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

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

14 years ago Add safe size/copy functions to Skia.
wjmaclean@chromium.org [Tue, 16 Nov 2010 20:22:41 +0000 (20:22 +0000)]
Add safe size/copy functions to Skia.

    This patch adds four methods to SkBitmap. There are two functions to return
    "safe size", defined as the number of pixels from the value returned by
    getPixels() to the end of the allocated buffer.

    There is one version of fillPixels() to copy the bitmap instance into an
    external buffer (with specified size, and using specified stride), and another
    fillPixels() to copy from an external buffer to the instance bitmap. In the
    latter case the specified height, width and pixel format must match that used by
    the bitmap instance, although the specified stride may be any value at least as
    large as the minimum stride for the specified geometry. It is assumed that the
    external buffer is of size at least (height - 1)*stride + width *
    bytesPerPixel.

    Both fillPixels() functions return false if the copy is not possible with the
    specified parameters.

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

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

14 years agoPDF: Add text support with a font framework (font embedding to come).
vandebo@chromium.org [Thu, 11 Nov 2010 21:37:00 +0000 (21:37 +0000)]
PDF: Add text support with a font framework (font embedding to come).

Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.

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

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

14 years agoRemove include of SkGLDevice.h from SkGLCanvas.h
vandebo@chromium.org [Thu, 11 Nov 2010 00:49:41 +0000 (00:49 +0000)]
Remove include of SkGLDevice.h from SkGLCanvas.h

The '#include "SkGLDevice.h"' from include/core/SkDevice.h requires internal
Skia code to be added to the include search paths when using the deprecated API.
This change adds back SkGLCanvas.cpp to avoid exposing SkGLDevice.h to the
public API.

The change also includes an explicit virtual destructor on SkDeviceFactory to
silence a -Wnon-virtual-dtor warning and allow for -Werror.

Original Issue: http://codereview.appspot.com/3009041/

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

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

14 years agoAdd clipping support and some small fixes.
vandebo@chromium.org [Wed, 3 Nov 2010 23:55:28 +0000 (23:55 +0000)]
Add clipping support and some small fixes.

Reorganize how the PDF graphic state stack is managed (fixing several bugs incidentally).
Style: fix variables with underscores.
Bug: fix image matrix application order, which enabled a small refactor.

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

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

14 years agoAdd PDF support for drawDevice using a form xobject.
vandebo@chromium.org [Tue, 26 Oct 2010 19:54:45 +0000 (19:54 +0000)]
Add PDF support for drawDevice using a form xobject.

This depends on:
http://codereview.appspot.com/2719041
http://codereview.appspot.com/2720041
http://codereview.appspot.com/2721041

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

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

14 years agoImplement SkPDFDevice::drawPath(...)
vandebo@chromium.org [Tue, 26 Oct 2010 19:51:44 +0000 (19:51 +0000)]
Implement SkPDFDevice::drawPath(...)

This depends on http://codereview.appspot.com/2721041

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

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

14 years agoSeveral cleanups:
vandebo@chromium.org [Tue, 26 Oct 2010 19:48:49 +0000 (19:48 +0000)]
Several cleanups:

Fix the spelling of resource in several places
Make getResouce(resourceList) part of SkPDFObject
make SkDynamicMemoryWStream::getOffset and SkPDFPage::getMediaBox const
Add a temporary NOT_IMPLEMENTED macro instead of using SkASSERT

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

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

14 years agoMove the device capability method to SkDevice.
vandebo@chromium.org [Tue, 26 Oct 2010 19:47:30 +0000 (19:47 +0000)]
Move the device capability method to SkDevice.

These are not the capabilities of the factory, but of the device.  Additionally, it is more often needed when you have a device then when you have a factory, which caused creating of a new factory.

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

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

14 years agoCleanup/unify matrix transform for PDF backend.
vandebo@chromium.org [Tue, 26 Oct 2010 19:45:06 +0000 (19:45 +0000)]
Cleanup/unify matrix transform for PDF backend.

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

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

14 years agoFix SkDraw::validate to work with vector Devices.
vandebo@chromium.org [Tue, 26 Oct 2010 19:44:10 +0000 (19:44 +0000)]
Fix SkDraw::validate to work with vector Devices.

Vector devices don't have a (valid) fBitmap, so pass in width and height.

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

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

14 years agoBug fix in SkPDFImage.
vandebo@chromium.org [Tue, 26 Oct 2010 19:43:14 +0000 (19:43 +0000)]
Bug fix in SkPDFImage.

Need to lock the pixels to make sure they are there.

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

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

14 years agoFirst pieces of SkPDFDevice. Supports:
vandebo@chromium.org [Wed, 20 Oct 2010 22:23:29 +0000 (22:23 +0000)]
First pieces of SkPDFDevice. Supports:

Matrix transforms.
Rendering bitmaps.
Basic paint parameters.
Rendering rectangles, points, lines, polygons.
Render a paint to the page.

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

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

14 years agoClamp the maximum size of glyph width we will attempt to render.
scarybeasts@gmail.com [Mon, 18 Oct 2010 23:29:36 +0000 (23:29 +0000)]
Clamp the maximum size of glyph width we will attempt to render.

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

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

14 years agoFix a signedness issue with massive allocations, and also a truncation issue on
scarybeasts@gmail.com [Mon, 18 Oct 2010 22:56:49 +0000 (22:56 +0000)]
Fix a signedness issue with massive allocations, and also a truncation issue on
64-bit.

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

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

14 years agoFix a memory leak in the new Canvas/Device workflow.
vandebo@chromium.org [Fri, 15 Oct 2010 18:58:19 +0000 (18:58 +0000)]
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

14 years agoRefactor SkCanvas so that backends don't need to override it.
vandebo@chromium.org [Wed, 13 Oct 2010 22:13:05 +0000 (22:13 +0000)]
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

14 years agoSkPath::arcTo() will cause uninitialized memory reads in the following cases:
senorblanco@chromium.org [Wed, 13 Oct 2010 18:47:00 +0000 (18:47 +0000)]
SkPath::arcTo() will cause uninitialized memory reads in the following cases:

- when the previous point in the path and (x1, y1) are coincident
- when (x1, y1) and (x2, y2) are coincident

These cause the setNormalize() calls to leave the "before" and "after" vectors
uninitialized, respectively, which are then used to compute cosh and sinh.

I chose to implement HTML5 canvas behaviour for these cases (as well as for the
case where all three points are collinear):  add a line to the first point, and
bail.  I think this is ok, since skia is mostly used for HTML5 browsers, and
this case is degenerate anyway.

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

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

14 years agoHigh level pdf classes and pdf specific interface.
vandebo@chromium.org [Tue, 12 Oct 2010 23:08:13 +0000 (23:08 +0000)]
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

14 years agoAddress senorblanco's comments on r600.
vandebo@chromium.org [Fri, 1 Oct 2010 23:26:55 +0000 (23:26 +0000)]
Address senorblanco's comments on r600.

Don't inline constructors and destructors.
Include license in test file.
A few nits
Also, cleanup a couple compile warnings.

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

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

14 years agoInitial PDF backend commit: directories, build rules, primitives
vandebo@chromium.org [Fri, 24 Sep 2010 22:25:30 +0000 (22:25 +0000)]
Initial PDF backend commit: directories, build rules, primitives

This change establishes and tests the building blocks of the PDF file format.
For now, PDF code is not compiled by default.

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

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

14 years agocall readyToDraw() instead of just checking for null pixels, since we could
reed@android.com [Fri, 10 Sep 2010 17:26:24 +0000 (17:26 +0000)]
call readyToDraw() instead of just checking for null pixels, since we could
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

14 years agoS32A_Blend_BlitRow32: for ARM without NEON
agl@chromium.org [Fri, 10 Sep 2010 15:09:42 +0000 (15:09 +0000)]
S32A_Blend_BlitRow32: for ARM without NEON

The S32A_Blend_BlitRow32 function was written and unrolled in ARM
assembly to improve the rendering performance on ARM cores lacking
NEON.

Added in SkBlitRow_opts_arm.cpp.

Performance improvement about ~18% on micro benchmarking.

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

14 years agomove SkMallocPixelRef into its own .cpp file, rather than embedding it
reed@android.com [Thu, 9 Sep 2010 16:07:53 +0000 (16:07 +0000)]
move SkMallocPixelRef into its own .cpp file, rather than embedding it
inside SkBitmap.cpp.

core_files.mk updated, but if your build does not reference that, you will
need to add SkMallocPixelRef.cpp to your list

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

14 years agoadd abstract wrapper for platform-specific bitmap backends
reed@android.com [Thu, 9 Sep 2010 16:01:26 +0000 (16:01 +0000)]
add abstract wrapper for platform-specific bitmap backends

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

14 years agoWrite S32A_Opaque_BlitRow32 function in ARM assembly.
agl@chromium.org [Tue, 17 Aug 2010 16:24:15 +0000 (16:24 +0000)]
Write S32A_Opaque_BlitRow32 function in ARM assembly.

(Improves the rendering performance on ARM cores lacking NEON.)

Performance improvement about ~9% on Peacekeeper rendering benchmarks.

Patch by: Vasileios Laganakos (ARM)

http://codereview.appspot.com/1873044/

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

14 years agoAdd versions of memset16() and memset32() in ARM assembly.
agl@chromium.org [Fri, 13 Aug 2010 17:05:28 +0000 (17:05 +0000)]
Add versions of memset16() and memset32() in ARM assembly.

In benchmarks here on Cortex A9 processors, this code runs 25-30% faster
than the C equivalent.

Patch by: Steve McIntyre (ARM)

http://codereview.appspot.com/1973042

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

14 years agoAdd support for TTC font files in SkFontHost_Freetype.
agl@chromium.org [Fri, 6 Aug 2010 18:08:18 +0000 (18:08 +0000)]
Add support for TTC font files in SkFontHost_Freetype.
This is a companion change to a Chrome CL (
http://codereview.chromium.org/2870073/show )

(Patch by: jshin (Chromium))

BUG=http://crbug.com/50389
TEST=See the Chromium CL mentioned above.

http://codereview.appspot.com/1847046

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

14 years agoMake SKColorSetARGB() a macro when not building debug.
agl@chromium.org [Wed, 28 Jul 2010 17:10:30 +0000 (17:10 +0000)]
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

14 years agoFix precedence error.
agl@chromium.org [Wed, 28 Jul 2010 17:10:28 +0000 (17:10 +0000)]
Fix precedence error.

Flagged as a compiler warning. It appears that it was intended that the
conjuction not bind so tightly.

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

14 years agofix matrix use in coretext fonthost
reed@android.com [Thu, 22 Jul 2010 18:27:53 +0000 (18:27 +0000)]
fix matrix use in coretext fonthost
update gm images to new baseline

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

14 years agoFix for SkMatrix::invert() for large coordinate values.
senorblanco@chromium.org [Tue, 20 Jul 2010 15:20:01 +0000 (15:20 +0000)]
Fix for SkMatrix::invert() for large coordinate values.

See http://codereview.appspot.com/1731053

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

14 years agoadd SkRegion::setRects(), and its unit tests
reed@android.com [Tue, 13 Jul 2010 18:35:14 +0000 (18:35 +0000)]
add SkRegion::setRects(), and its unit tests

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

14 years agofix reference bugs in font linklist
reed@android.com [Thu, 8 Jul 2010 16:39:02 +0000 (16:39 +0000)]
fix reference bugs in font linklist

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

14 years agoAdded optional "ambiguous" outgoing argument to XRay queries so that
kbr@chromium.org [Wed, 7 Jul 2010 22:20:35 +0000 (22:20 +0000)]
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

14 years agooops, also update dox for saveLayerAlpha
reed@android.com [Fri, 2 Jul 2010 17:24:23 +0000 (17:24 +0000)]
oops, also update dox for saveLayerAlpha

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

14 years agoupdate dox for saveLayer()
reed@android.com [Fri, 2 Jul 2010 17:20:51 +0000 (17:20 +0000)]
update dox for saveLayer()

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

14 years agohttp://codereview.appspot.com/1706045/show
reed@android.com [Thu, 24 Jun 2010 21:04:23 +0000 (21:04 +0000)]
http://codereview.appspot.com/1706045/show

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

14 years agoRevert "Implementing S32A_Opaque_BlitRow32 using v7 neon instructions."
agl@chromium.org [Fri, 18 Jun 2010 15:30:12 +0000 (15:30 +0000)]
Revert "Implementing S32A_Opaque_BlitRow32 using v7 neon instructions."

Broke ARM build.

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

14 years agoRevert "We extract a sub-function from MAKENAME(_nofilter_DX), only dealing with...
agl@chromium.org [Fri, 18 Jun 2010 15:30:10 +0000 (15:30 +0000)]
Revert "We extract a sub-function from MAKENAME(_nofilter_DX), only dealing with reading"

Broke ARM build.

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

14 years agoAdd support for forcing autohinting.
agl@chromium.org [Thu, 17 Jun 2010 20:49:17 +0000 (20:49 +0000)]
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

14 years agoWe extract a sub-function from MAKENAME(_nofilter_DX), only dealing with reading
agl@chromium.org [Wed, 16 Jun 2010 20:04:13 +0000 (20:04 +0000)]
We extract a sub-function from MAKENAME(_nofilter_DX), only dealing with reading
one index array, indexing into src array and output to dst array.

Because of the scatter-gather nature, we can not do much burst/batch
reading/writing to improve the performance.

We tried Neon vector instructions.  We also tried the hand optimize the compiler
generated assembly (non-neon) code.  The latter seems to have better gain.
About 6% improvements, not much though...

Patch-by: Xin Qi of codeaurora.org
http://codereview.appspot.com/1127042/show

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

14 years agoImplementing S32A_Opaque_BlitRow32 using v7 neon instructions.
agl@chromium.org [Wed, 16 Jun 2010 19:52:29 +0000 (19:52 +0000)]
Implementing S32A_Opaque_BlitRow32 using v7 neon instructions.

Taking the advantage of 16 channels of each QualWord register.  Also using the
software pipelining to scatter the loads/stores among vector operations.

Got roughly 70% improvements on simulation environments.

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

Patch-by: XinQi of codeaurora.org
git-svn-id: http://skia.googlecode.com/svn/trunk@578 2bbb7eff-a529-9590-31e7-b0007b416f81

14 years agorename round, ceil, etc. to avoid some platform macros
reed@android.com [Tue, 15 Jun 2010 00:57:50 +0000 (00:57 +0000)]
rename round, ceil, etc. to avoid some platform macros

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

14 years agoCompile fix for shared library builds.
agl@chromium.org [Thu, 10 Jun 2010 21:32:00 +0000 (21:32 +0000)]
Compile fix for shared library builds.

Patch by: Evan Martin.

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

14 years agoAdd include of FT_SYNTHESIS_H
agl@chromium.org [Fri, 4 Jun 2010 20:57:16 +0000 (20:57 +0000)]
Add include of FT_SYNTHESIS_H

In older versions of Freetype, the FT_GlyphSlot_Own_Bitmap function is
defined in FT_SYNTHESIS_H. Modern versions have it in FT_BITMAP_H.

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

14 years agoAdd support for fake bold of bitmap fonts.
agl@chromium.org [Fri, 4 Jun 2010 20:31:17 +0000 (20:31 +0000)]
Add support for fake bold of bitmap fonts.

BUG=45874

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

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

14 years agoAdd Neon versions of memset32 and memset16
agl@chromium.org [Fri, 4 Jun 2010 14:47:38 +0000 (14:47 +0000)]
Add Neon versions of memset32 and memset16

Patch by pgalizia (of codeaurora.org)

(Note: I don't read ARM and I didn't manage to find a reviewer for the
ARM assembly code so this is landing somewhat unreviewed.)

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

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

14 years agoadd carbon.h include
reed@android.com [Thu, 3 Jun 2010 14:47:27 +0000 (14:47 +0000)]
add carbon.h include

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

14 years agoremove duplicate LCD functions (these are portable, and live in SkFontHost.cpp)
reed@android.com [Tue, 1 Jun 2010 21:01:35 +0000 (21:01 +0000)]
remove duplicate LCD functions (these are portable, and live in SkFontHost.cpp)

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

14 years agoseparate mac fonthost into atsui (32bit, pre-10.6) and coretext (64bit, 10.6)
reed@android.com [Wed, 19 May 2010 13:47:05 +0000 (13:47 +0000)]
separate mac fonthost into atsui (32bit, pre-10.6) and coretext (64bit, 10.6)
implementations.

code submitted by http://codereview.appspot.com/user/refnum

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

14 years agoFix 64-bit Mac warnings/memory corruption
reed@android.com [Tue, 18 May 2010 21:23:30 +0000 (21:23 +0000)]
Fix 64-bit Mac warnings/memory corruption

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

14 years agoexport line counts
reed@android.com [Tue, 18 May 2010 21:17:43 +0000 (21:17 +0000)]
export line counts

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

14 years agoupdates
reed@android.com [Mon, 17 May 2010 14:50:04 +0000 (14:50 +0000)]
updates

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

14 years agoupdate to match latest skia apis
reed@android.com [Mon, 17 May 2010 14:34:13 +0000 (14:34 +0000)]
update to match latest skia apis

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

14 years agofix maxWidth when using linear-text
reed@android.com [Mon, 17 May 2010 14:15:14 +0000 (14:15 +0000)]
fix maxWidth when using linear-text

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

14 years agoforce 10.4 SDK for macs, as the font porter there needs those APIs
reed@android.com [Wed, 12 May 2010 17:25:30 +0000 (17:25 +0000)]
force 10.4 SDK for macs, as the font porter there needs those APIs

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

14 years agoMinor fixes to build under Clang:
agl@chromium.org [Mon, 10 May 2010 21:20:58 +0000 (21:20 +0000)]
Minor fixes to build under Clang:
  - Remove an unused ctor that was wrong anyway.
  - Add magic angle brackets to a template declaration.

Patch-by: Evan Martin
git-svn-id: http://skia.googlecode.com/svn/trunk@563 2bbb7eff-a529-9590-31e7-b0007b416f81

14 years ago[FreeType] Always use MONO hinting when hinting in monochrome.
agl@chromium.org [Mon, 10 May 2010 14:15:50 +0000 (14:15 +0000)]
[FreeType] Always use MONO hinting when hinting in monochrome.

This matches the behaviour of Cairo. It appears to be an undocumented
trick of font rendering on Linux that, in monochrome, all the hinting
modes expect no-hinting are mapped to FreeType's MONO hinting.

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

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

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

14 years agoRevert "Revert "Use hairline when line width <= 1.0, instead of < 1.0.""
agl@chromium.org [Tue, 27 Apr 2010 15:47:34 +0000 (15:47 +0000)]
Revert "Revert "Use hairline when line width <= 1.0, instead of < 1.0.""

This reverts commit r560. Chromium has landed at r560, so I'm applying the
revert-revert. (See the comments in r560 for details.)

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

14 years agoRevert "Use hairline when line width <= 1.0, instead of < 1.0."
agl@chromium.org [Mon, 26 Apr 2010 21:47:25 +0000 (21:47 +0000)]
Revert "Use hairline when line width <= 1.0, instead of < 1.0."

This reverts commit r538 for the moment. In order to roll Chrome to include
some bug fixes, I want to land it in between this revert, and the revert
revert. That way the baseline changes from the other revisions can be
considered without conflating the huge number of changes due to r538.

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

14 years agoFix internal compiler error on ARM.
agl@chromium.org [Mon, 26 Apr 2010 21:45:08 +0000 (21:45 +0000)]
Fix internal compiler error on ARM.

For the moment, at least, switch back to the old Neon code because the
new code is triggering internal compiler errors in Chromium ARM.

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

14 years agoupdates
reed@android.com [Thu, 22 Apr 2010 16:07:49 +0000 (16:07 +0000)]
updates

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

14 years agoAdd a SkTypeface::CreateForChars() function.
agl@chromium.org [Tue, 20 Apr 2010 22:06:40 +0000 (22:06 +0000)]
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

14 years agodox
reed@android.com [Fri, 16 Apr 2010 20:56:00 +0000 (20:56 +0000)]
dox

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

14 years agoadd SkRefPtr class (for testing at the moment)
reed@android.com [Fri, 16 Apr 2010 20:35:47 +0000 (20:35 +0000)]
add SkRefPtr class (for testing at the moment)

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

14 years agoremove obsolete closeStream() method -- the caller just unref's the stream when they...
reed@android.com [Fri, 16 Apr 2010 12:51:29 +0000 (12:51 +0000)]
remove obsolete closeStream() method -- the caller just unref's the stream when they're done

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

14 years agoadd EmptyTypeface class, to gracefully handle when there are no fonts avail.
reed@android.com [Fri, 16 Apr 2010 12:40:08 +0000 (12:40 +0000)]
add EmptyTypeface class, to gracefully handle when there are no fonts avail.

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

14 years agoadd FPSBench.cpp
reed@android.com [Thu, 15 Apr 2010 16:34:54 +0000 (16:34 +0000)]
add FPSBench.cpp

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

14 years agoadd png to makefile for linux
reed@android.com [Thu, 15 Apr 2010 14:28:24 +0000 (14:28 +0000)]
add png to makefile for linux

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

14 years agoadd SK_ENABLE_LIBPNG to force reference to PNG codec
reed@android.com [Thu, 15 Apr 2010 14:24:50 +0000 (14:24 +0000)]
add SK_ENABLE_LIBPNG to force reference to PNG codec

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

14 years agobe sure to ref() before returning a typeface from Create
reed@android.com [Thu, 15 Apr 2010 14:04:52 +0000 (14:04 +0000)]
be sure to ref() before returning a typeface from Create
skip duplicate faces in the same family+style slot

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

14 years agofix overflow in matrixproc, and add debugging code to test that
reed@android.com [Wed, 14 Apr 2010 13:36:33 +0000 (13:36 +0000)]
fix overflow in matrixproc, and add debugging code to test that

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

14 years agofix build for SK_SCALAR_IS_FIXED
reed@android.com [Tue, 13 Apr 2010 15:29:15 +0000 (15:29 +0000)]
fix build for SK_SCALAR_IS_FIXED

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

14 years agoextend sentinel array to avoid reading uninitialized memory
reed@android.com [Tue, 13 Apr 2010 14:52:52 +0000 (14:52 +0000)]
extend sentinel array to avoid reading uninitialized memory

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

14 years agocall premultiply instead of pack32
reed@android.com [Tue, 13 Apr 2010 14:03:27 +0000 (14:03 +0000)]
call premultiply instead of pack32

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

14 years agoremove obsolete header
reed@android.com [Tue, 13 Apr 2010 13:40:58 +0000 (13:40 +0000)]
remove obsolete header

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

14 years agofix paraens to avoid warnings
reed@android.com [Tue, 13 Apr 2010 13:36:20 +0000 (13:36 +0000)]
fix paraens to avoid warnings

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

14 years agoadd SKIA_VERSION_[MAJOR, MINOR, PATCH] in header and SkGraphics API
reed@android.com [Tue, 13 Apr 2010 13:22:54 +0000 (13:22 +0000)]
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

14 years agoadd more MakeFoo factories for SkRect
reed@android.com [Mon, 12 Apr 2010 21:21:59 +0000 (21:21 +0000)]
add more MakeFoo factories for SkRect

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

14 years agofix refcnt for streams
reed@android.com [Mon, 12 Apr 2010 20:16:49 +0000 (20:16 +0000)]
fix refcnt for streams

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