external/skia/src.git
12 hours agoSanitizing source files in Housekeeper-Nightly master
skia.committer@gmail.com [Sat, 19 Apr 2014 03:04:56 +0000 (03:04 +0000)]
Sanitizing source files in Housekeeper-Nightly

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

19 hours agoremove unused fOverflowed from SkClampRange
reed@google.com [Fri, 18 Apr 2014 19:36:22 +0000 (19:36 +0000)]
remove unused fOverflowed from SkClampRange

TBR=scroggo@google.com

Review URL: https://codereview.chromium.org/243563002

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

19 hours agofix int/size_t warnings
reed@google.com [Fri, 18 Apr 2014 19:29:07 +0000 (19:29 +0000)]
fix int/size_t warnings

patch from issue 239933002

BUG=skia:
R=bungeman@google.com

Review URL: https://codereview.chromium.org/242113010

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

21 hours agoStaging for cleanup of SkPicture-related headers
robertphillips@google.com [Fri, 18 Apr 2014 18:04:41 +0000 (18:04 +0000)]
Staging for cleanup of SkPicture-related headers

https://codereview.chromium.org/243173002

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

23 hours agorename SkPaintParts.* to SkPaintPart.*
reed@google.com [Fri, 18 Apr 2014 15:14:25 +0000 (15:14 +0000)]
rename SkPaintParts.* to SkPaintPart.*

BUG=skia:
R=caryclark@google.com

Review URL: https://codereview.chromium.org/242943004

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

24 hours agoGet gradient information for gpu effect directly from SkGradientShader instead of...
commit-bot@chromium.org [Fri, 18 Apr 2014 14:42:11 +0000 (14:42 +0000)]
Get gradient information for gpu effect directly from SkGradientShader instead of calling asAGradient

BUG=skia:
R=bsalomon@google.com

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/241173005

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

24 hours agoReduce internal explicit SaveFlags usage.
commit-bot@chromium.org [Fri, 18 Apr 2014 14:19:31 +0000 (14:19 +0000)]
Reduce internal explicit SaveFlags usage.

Most of these are either redundant/defaults or (hopefully)
unnecessarily specific.

R=reed@google.com, robertphillips@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/241453003

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

36 hours agoSanitizing source files in Housekeeper-Nightly
skia.committer@gmail.com [Fri, 18 Apr 2014 03:03:54 +0000 (03:03 +0000)]
Sanitizing source files in Housekeeper-Nightly

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

39 hours agoStaged removal of SkPicture-derived classes
commit-bot@chromium.org [Thu, 17 Apr 2014 23:35:06 +0000 (23:35 +0000)]
Staged removal of SkPicture-derived classes

This CL removes the SkPicture-derived classes (with a flag to keeps clients working). In the process it also lightens the recording factory function so it is no longer ref counted).

The only interesting bits are in SkPicture* and Sk*Picture.*

R=reed@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/238273012

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

41 hours agoRevert of Extract most of the mutable state of SkShader into a separate Context objec...
commit-bot@chromium.org [Thu, 17 Apr 2014 21:09:49 +0000 (21:09 +0000)]
Revert of Extract most of the mutable state of SkShader into a separate Context object. (https://codereview.chromium.org/207683004/)

Reason for revert:
Causing memory leaks in Chromium.

Original issue's description:
> Extract most of the mutable state of SkShader into a separate Context object.
>
> SkShader currently stores some state during draw calls via setContext(...).
> Move that mutable state into a separate SkShader::Context class that is
> constructed on demand for the duration of the draw.
>
> Calls to setContext() are replaced with createContext() which returns a context
> corresponding to the shader object or NULL if the parameters to createContext
> are invalid.
>
> TEST=out/Debug/dm
> BUG=skia:1976
>
> Committed: http://code.google.com/p/skia/source/detail?r=14216

R=scroggo@google.com, skyostil@chromium.org, tomhudson@chromium.org, senorblanco@chromium.org, reed@google.com, dominikg@chromium.org
TBR=dominikg@chromium.org, reed@google.com, scroggo@google.com, senorblanco@chromium.org, skyostil@chromium.org, tomhudson@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:1976

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/241283003

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

42 hours agoRevert of Fix memory leak in SkGradientShader. (https://codereview.chromium.org/24030...
commit-bot@chromium.org [Thu, 17 Apr 2014 21:02:29 +0000 (21:02 +0000)]
Revert of Fix memory leak in SkGradientShader. (https://codereview.chromium.org/240303003/)

Reason for revert:
This and https://codereview.chromium.org/207683004 are causing memory leaks.

Original issue's description:
> Fix memory leak in SkGradientShader.
>
> Make sure pointer to gradient shader cache is unreffed in SkGradientShaderBase::getGradientTableBitmap.
> Rename methods returning a "pre-reffed" object to indicate obligations.
>
> BUG=skia:1976
>
> Committed: http://code.google.com/p/skia/source/detail?r=14223

R=reed@google.com, scroggo@google.com, dominikg@chromium.org
TBR=dominikg@chromium.org, reed@google.com, scroggo@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:1976

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/241603002

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

45 hours agoAshmem functions compile when size_t != __u32
commit-bot@chromium.org [Thu, 17 Apr 2014 17:28:20 +0000 (17:28 +0000)]
Ashmem functions compile when size_t != __u32

R=djsollen@google.com, scroggo@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/241123002

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

46 hours agoadd some asserts for mipmaps, and cleanup fFilterLevel if mipping failed
commit-bot@chromium.org [Thu, 17 Apr 2014 16:46:07 +0000 (16:46 +0000)]
add some asserts for mipmaps, and cleanup fFilterLevel if mipping failed

BUG=skia:
R=scroggo@google.com, humper@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/240633003

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

47 hours agoOrphan ProcXfermode, with an eye towards removing it
commit-bot@chromium.org [Thu, 17 Apr 2014 15:19:32 +0000 (15:19 +0000)]
Orphan ProcXfermode, with an eye towards removing it

BUG=skia:
R=scroggo@google.com, mtklein@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/240533003

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

2 days agoRevert of Add flipped gradient branch to two point conical gradient (https://coderevi...
commit-bot@chromium.org [Thu, 17 Apr 2014 13:57:31 +0000 (13:57 +0000)]
Revert of Add flipped gradient branch to two point conical gradient (https://codereview.chromium.org/227623004/)

Reason for revert:
Breaking all CompareGMs

Original issue's description:
> Add flipped gradient branch to two point conical gradient
>
> BUG=skia:
>
> Committed: http://code.google.com/p/skia/source/detail?r=14235

R=bsalomon@google.com, mtklein@google.com
TBR=bsalomon@google.com, mtklein@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/239993006

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

2 days agoAdd flipped gradient branch to two point conical gradient
commit-bot@chromium.org [Thu, 17 Apr 2014 13:28:06 +0000 (13:28 +0000)]
Add flipped gradient branch to two point conical gradient

BUG=skia:
R=bsalomon@google.com, mtklein@google.com

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/227623004

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

2 days agoSanitizing source files in Housekeeper-Nightly
skia.committer@gmail.com [Thu, 17 Apr 2014 03:05:10 +0000 (03:05 +0000)]
Sanitizing source files in Housekeeper-Nightly

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

2 days agoDon't unset gFCSafeToUse when it's still safe to use.
commit-bot@chromium.org [Wed, 16 Apr 2014 22:10:52 +0000 (22:10 +0000)]
Don't unset gFCSafeToUse when it's still safe to use.

BUG=skia:
R=bungeman@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/240513003

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

2 days agoalways store bitfields along with dirty in FlatteningTraits
commit-bot@chromium.org [Wed, 16 Apr 2014 20:48:10 +0000 (20:48 +0000)]
always store bitfields along with dirty in FlatteningTraits

This allows us to simplify lots of setters in SkPaint, which in the non-android case, could now be just assignments (and therefore inlineable).

R=mtklein@google.com, robertphillips@google.com, tomhudson@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/240273004

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

2 days agoFix memory leak in SkGradientShader.
commit-bot@chromium.org [Wed, 16 Apr 2014 16:17:39 +0000 (16:17 +0000)]
Fix memory leak in SkGradientShader.

Make sure pointer to gradient shader cache is unreffed in SkGradientShaderBase::getGradientTableBitmap.
Rename methods returning a "pre-reffed" object to indicate obligations.

BUG=skia:1976
R=reed@google.com, scroggo@google.com

Author: dominikg@chromium.org

Review URL: https://codereview.chromium.org/240303003

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

2 days agoDouble assignment in GrGpuGL::configToGLFormats()
commit-bot@chromium.org [Wed, 16 Apr 2014 16:07:37 +0000 (16:07 +0000)]
Double assignment in GrGpuGL::configToGLFormats()

Remove the first one.

R=hcm@google.com, bsalomon@google.com
BUG=skia:2427

Author: siglesias@igalia.com

Review URL: https://codereview.chromium.org/240123002

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

2 days agoRetract SkPicture::kOptimizeForClippedPlayback_RecordingFlag from public API
commit-bot@chromium.org [Wed, 16 Apr 2014 16:02:10 +0000 (16:02 +0000)]
Retract SkPicture::kOptimizeForClippedPlayback_RecordingFlag from public API

This CL sets the stage for retracting the SkPicture::kOptimizeForClippedPlayback_RecordingFlag flag
from the public API (more work needs to be done in Blink & Chrome). In the new world the only way
to set this flag (and thus instantiate an SkPicture-derived
class) is by passing a factory to the SkPictureRecorder class. This is to get all clients always using
factories so that we can then change the factory call used (i.e., so the factory just creates a BBH) and
do away with the SkPicture-derived classes.

BUG=skia:2315
R=reed@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/239703006

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

3 days agoglDiscardFramebuffer() in GrGpuGL::discard uses invalid GLenum
commit-bot@chromium.org [Wed, 16 Apr 2014 14:33:27 +0000 (14:33 +0000)]
glDiscardFramebuffer() in GrGpuGL::discard uses invalid GLenum

According to the spec:

  "If a framebuffer object is bound to <target>, then <attachments> may
  contain COLOR_ATTACHMENT0, DEPTH_ATTACHMENT, and/or
  STENCIL_ATTACHMENT.  If the framebuffer object is not complete,
  DiscardFramebufferEXT may be ignored.

  If the default framebuffer is bound to <target>,
  then <attachment> may contain COLOR, identifying the color buffer;
  DEPTH, identifying the depth buffer; or STENCIL, identifying the
  stencil buffer."

Do the same as in glInvalidateFramebuffer() case.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
R=bsalomon@google.com
BUG=skia:2411

Author: siglesias@igalia.com

Review URL: https://codereview.chromium.org/236193007

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

3 days agoremove legacy filter-flags, and store FilterLevel directly
commit-bot@chromium.org [Wed, 16 Apr 2014 12:58:02 +0000 (12:58 +0000)]
remove legacy filter-flags, and store FilterLevel directly

BUG=skia:
R=robertphillips@google.com, humper@google.com, jvanverth@google.com, mtklein@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/239393002

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

3 days agoExtract most of the mutable state of SkShader into a separate Context object.
commit-bot@chromium.org [Wed, 16 Apr 2014 10:16:39 +0000 (10:16 +0000)]
Extract most of the mutable state of SkShader into a separate Context object.

SkShader currently stores some state during draw calls via setContext(...).
Move that mutable state into a separate SkShader::Context class that is
constructed on demand for the duration of the draw.

Calls to setContext() are replaced with createContext() which returns a context
corresponding to the shader object or NULL if the parameters to createContext
are invalid.

TEST=out/Debug/dm
BUG=skia:1976
R=scroggo@google.com, skyostil@chromium.org, tomhudson@chromium.org, senorblanco@chromium.org, reed@google.com, bungeman@google.com

Author: dominikg@chromium.org

Review URL: https://codereview.chromium.org/207683004

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

3 days agoSanitizing source files in Housekeeper-Nightly
skia.committer@gmail.com [Wed, 16 Apr 2014 03:04:01 +0000 (03:04 +0000)]
Sanitizing source files in Housekeeper-Nightly

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

3 days agoFix artifacts in distance field rendering due to bilerp
commit-bot@chromium.org [Tue, 15 Apr 2014 17:53:21 +0000 (17:53 +0000)]
Fix artifacts in distance field rendering due to bilerp

Because we were using the full distance field glyph rect, there were cases
when a neighboring texel might be set to full value (e.g. we might copy the
glyph over old data after a purge). This was giving artifacts, and insetting
the rect by 1 solves the problem. In doing this, I discovered that removing the
extra 1 texel pad around the glyph meant to handle bilerp, and insetting by 2,
works just as well and saves space in the glyph atlas.

R=bsalomon@google.com

Author: jvanverth@google.com

Review URL: https://codereview.chromium.org/239333002

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

3 days agoFix size of rotated text with FreeType.
bungeman@google.com [Tue, 15 Apr 2014 15:52:07 +0000 (15:52 +0000)]
Fix size of rotated text with FreeType.

This generalizes and shares the solution found for a similar issue with
GDI. The issue is that the text size is applied early, and the rest of
the transformation late. This allows us to isolate and independently
control the text size from the rest of the transformation.

R=reed@google.com

Review URL: https://codereview.chromium.org/213153006

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

3 days agoMake sure SkDrawLooper objects can only be allocated on the heap.
commit-bot@chromium.org [Tue, 15 Apr 2014 15:48:36 +0000 (15:48 +0000)]
Make sure SkDrawLooper objects can only be allocated on the heap.

Make constructors of SkLayerDrawLooper and SkBlurDrawLooper non-public.
Remove addLayer* methods from SkLayerDrawLooper. SkLayerDrawLooper::Builder is
used to create new objects.
Provide factory method for creating SkBlurDrawLooper.

BUG=2141
R=scroggo@google.com, reed@google.com, djsollen@google.com

Author: dominikg@chromium.org

Review URL: https://codereview.chromium.org/232913003

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

3 days agoAdd GL_CHROMIUM_map_sub functions to GrGLInterface and bit to GrGLCaps.
commit-bot@chromium.org [Tue, 15 Apr 2014 15:37:51 +0000 (15:37 +0000)]
Add GL_CHROMIUM_map_sub functions to GrGLInterface and bit to GrGLCaps.

BUG=skia:2402
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/231773003

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

4 days agoSkRecord bug fixes
commit-bot@chromium.org [Tue, 15 Apr 2014 14:27:14 +0000 (14:27 +0000)]
SkRecord bug fixes

Optional arguments to SkCanvas calls leaked refs (but not memory) because we
didn't destruct the optional objects (really, just SkPaint: other optional args
are all POD).  This adds Optional and PODArray, where Optional makes sure to
call the destructor.

I overlooked that SkPictureRecord really does call paint.computeFastBounds().
Do the same in SkRecordDraw.

BUG=skia:2378
R=reed@google.com, mtklein@google.com, tomhudson@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/235983015

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

4 days agoSanitizing source files in Housekeeper-Nightly
skia.committer@gmail.com [Tue, 15 Apr 2014 03:04:18 +0000 (03:04 +0000)]
Sanitizing source files in Housekeeper-Nightly

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

4 days agoMove distance field generation to the glyph cache.
commit-bot@chromium.org [Mon, 14 Apr 2014 22:05:07 +0000 (22:05 +0000)]
Move distance field generation to the glyph cache.

Distance fields are currently created in GrTextStrike, which is the wrong place. This moves that to the glyph cache where it belongs.

As part of my testing, I found that when we fall back to paths in the GrDistanceFieldTextContext it was not scaling them properly, so that's fixed in here too.

R=robertphillips@google.com, reed@google.com

Author: jvanverth@google.com

Review URL: https://codereview.chromium.org/227593010

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

4 days agoSkRecordDraw: use SkCanvas::quickRejectY for text draws
commit-bot@chromium.org [Mon, 14 Apr 2014 20:35:12 +0000 (20:35 +0000)]
SkRecordDraw: use SkCanvas::quickRejectY for text draws

 PS 1) factor apart into canSkip, draw, updateClip
 PS 2) use quickRejectY for text

BUG=skia:2378
R=fmalita@chromium.org, reed@google.com, mtklein@google.com, tomhudson@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/233493004

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

4 days agoSkRecord: turn on cull annotation pass in public API.
commit-bot@chromium.org [Mon, 14 Apr 2014 20:33:05 +0000 (20:33 +0000)]
SkRecord: turn on cull annotation pass in public API.

Also, switch Skia internal tools over to use the public headers where
possible.  Where it's not, the tools -Isrc/record explicitly now, and
if it's not obvious, note why they don't use SkRecording.h.

BUG=skia:2378
R=reed@google.com, mtklein@google.com, fmalita@chromium.org

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/231853006

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

4 days agochange #if SK_DEBUG to #ifdef SK_DEBUG
commit-bot@chromium.org [Mon, 14 Apr 2014 19:49:53 +0000 (19:49 +0000)]
change #if SK_DEBUG to #ifdef SK_DEBUG

fix broken build

change #if DEBUG to #ifdef DEBUG (fixes canary)

NOTRY=true
R=reed@google.com
TBR=reed@google.com

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/237573002

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

4 days agofix broken build
commit-bot@chromium.org [Mon, 14 Apr 2014 18:33:03 +0000 (18:33 +0000)]
fix broken build

change 'char' to 'int8_t'

BUG=skia:

NOTRY=true
TBR=reed@google.com

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/237263004

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

4 days agoRevert "Revert of use templates instead of macros to build blitters (https://coderevi...
reed@google.com [Mon, 14 Apr 2014 18:27:18 +0000 (18:27 +0000)]
Revert "Revert of use templates instead of macros to build blitters (https://codereview.chromium.org/120633004/)"

This reverts commit e9d2798fd37e2fb33b545d142a5baa21a4b747fe.

BUG=skia:

Review URL: https://codereview.chromium.org/236303008

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

4 days agoMike R: please sanity check SkPostConfig.h
commit-bot@chromium.org [Mon, 14 Apr 2014 17:08:59 +0000 (17:08 +0000)]
Mike R: please sanity check SkPostConfig.h
Mike K: please sanity check Test.cpp and skia_test.cpp

Feel free to look at the rest, but I don't expect any in depth review of path ops innards.

Path Ops first iteration used QuickSort to order segments radiating from an intersection to compute the winding rule.

This revision uses a circular sort instead. Breaking out the circular sort into its own long-lived structure (SkOpAngle) allows doing less work and provides a home for caching additional sorting data.

The circle sort is more stable than the former sort, has a robust ordering and fewer exceptions. It finds unsortable ordering less often. It is less reliant on the initial curve  tangent, using convex hulls instead whenever it can.

Additional debug validation makes sure that the computed structures are self-consistent. A new visualization tool helps verify that the angle ordering is correct.

The 70+M tests pass with this change on Windows, Mac, Linux 32 and Linux 64 in debug and release.

R=mtklein@google.com, reed@google.com

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/131103009

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

4 days agoAllow clients to specify an external SkImageFilter cache.
senorblanco@chromium.org [Mon, 14 Apr 2014 15:51:48 +0000 (15:51 +0000)]
Allow clients to specify an external SkImageFilter cache.

This change allows external callers to substitute their own
SkImageFilter cache for the default intra-frame cache in Skia. This
allows the caller to perform inter-frame caching for example, by the
maintaining a persistent cache between frames and doing custom
invalidation.

R=reed@google.com

Review URL: https://codereview.chromium.org/225903010

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

4 days agoRevert of use templates instead of macros to build blitters (https://codereview.chrom...
commit-bot@chromium.org [Mon, 14 Apr 2014 15:45:58 +0000 (15:45 +0000)]
Revert of use templates instead of macros to build blitters (https://codereview.chromium.org/120633004/)

Reason for revert:
Broke build.

Original issue's description:
> use templates instead of macros to build blitters
>
> BUG=
>
> Committed: http://code.google.com/p/skia/source/detail?r=14178

R=mtklein@google.com, reed@google.com
TBR=mtklein@google.com, reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/236593006

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

5 days agoRemove currently unused code
commit-bot@chromium.org [Mon, 14 Apr 2014 15:02:50 +0000 (15:02 +0000)]
Remove currently unused code

This code is currently unused and is contrary to the way in which we seem to be moving towards accomplishing this (i.e., device-specific optimization passes).

This is a partial revert of r13704 (First version of bitmap use tracking in SkPictureRecord - https://codereview.chromium.org/187833003/)

R=reed@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/237013002

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

5 days agouse templates instead of macros to build blitters
commit-bot@chromium.org [Mon, 14 Apr 2014 15:02:35 +0000 (15:02 +0000)]
use templates instead of macros to build blitters

BUG=
R=mtklein@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/120633004

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

5 days agoXfermode: SSE2 implementation of a number of simple transfer modes
commit-bot@chromium.org [Mon, 14 Apr 2014 14:54:22 +0000 (14:54 +0000)]
Xfermode: SSE2 implementation of a number of simple transfer modes

These modes share some common code and not very complex, so group them
together. This CL yields about 50% performance improvement on desktop
i7-3770. Here are the data:
before:
   Xfermode_Screen   8888:  cmsecs =     30.25   565:  cmsecs =     46.81
 Xfermode_Modulate   8888:  cmsecs =     22.48   565:  cmsecs =     40.06
     Xfermode_Plus   8888:  cmsecs =     21.04   565:  cmsecs =     37.51
      Xfermode_Xor   8888:  cmsecs =     37.18   565:  cmsecs =     52.53
  Xfermode_DstATop   8888:  cmsecs =     28.97   565:  cmsecs =     46.42
  Xfermode_SrcATop   8888:  cmsecs =     29.74   565:  cmsecs =     46.25
   Xfermode_DstOut   8888:  cmsecs =      5.34   565:  cmsecs =     24.53
   Xfermode_SrcOut   8888:  cmsecs =     12.25   565:  cmsecs =     24.39
    Xfermode_DstIn   8888:  cmsecs =      5.30   565:  cmsecs =     24.50
    Xfermode_SrcIn   8888:  cmsecs =     12.05   565:  cmsecs =     25.40
  Xfermode_DstOver   8888:  cmsecs =     12.45   565:  cmsecs =      0.15
  Xfermode_SrcOver   8888:  cmsecs =      2.68   565:  cmsecs =      4.42
after:
   Xfermode_Screen   8888:  cmsecs =     13.68   565:  cmsecs =     21.73
 Xfermode_Modulate   8888:  cmsecs =     13.25   565:  cmsecs =     20.97
     Xfermode_Plus   8888:  cmsecs =      9.77   565:  cmsecs =     16.71
      Xfermode_Xor   8888:  cmsecs =     17.64   565:  cmsecs =     25.62
  Xfermode_DstATop   8888:  cmsecs =     15.99   565:  cmsecs =     23.74
  Xfermode_SrcATop   8888:  cmsecs =     15.69   565:  cmsecs =     23.40
   Xfermode_DstOut   8888:  cmsecs =      4.77   565:  cmsecs =     11.85
   Xfermode_SrcOut   8888:  cmsecs =      4.98   565:  cmsecs =     11.84
    Xfermode_DstIn   8888:  cmsecs =      4.68   565:  cmsecs =     11.72
    Xfermode_SrcIn   8888:  cmsecs =      4.93   565:  cmsecs =     11.79
  Xfermode_DstOver   8888:  cmsecs =      5.04   565:  cmsecs =      0.15
  Xfermode_SrcOver   8888:  cmsecs =      2.69   565:  cmsecs =      4.42

BUG=skia:
R=mtklein@google.com

Author: qiankun.miao@intel.com

Review URL: https://codereview.chromium.org/232793002

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

5 days agosplit SkPictureRecorder out of SkPicture
robertphillips@google.com [Sun, 13 Apr 2014 19:09:42 +0000 (19:09 +0000)]
split SkPictureRecorder out of SkPicture

https://codereview.chromium.org/214953003/

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

7 days agoSanitizing source files in Housekeeper-Nightly
skia.committer@gmail.com [Sat, 12 Apr 2014 03:05:59 +0000 (03:05 +0000)]
Sanitizing source files in Housekeeper-Nightly

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

7 days agoremove dead code from SkPicturePlayback
commit-bot@chromium.org [Fri, 11 Apr 2014 19:05:22 +0000 (19:05 +0000)]
remove dead code from SkPicturePlayback

This is from an earlier iteration of the pull-forward task before we switched to doing the majority of the work in SkGpuDevice.

R=jvanverth@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/235473002

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

7 days agoImplement intra-frame cacheing in image filters.
commit-bot@chromium.org [Fri, 11 Apr 2014 18:57:00 +0000 (18:57 +0000)]
Implement intra-frame cacheing in image filters.

When image filters are processed within Skia, they simply do
a blind recursion. This has the side-effect of turning the
DAG into a tree. I.e., nodes visited more than once during
the traversal will be processed more than once.

This change implements a very simple cacheing scheme: a
cache is created before traversing the DAG, and handed
into the processing traversal. Before recursing into a child
in SkImageFilter::filterImage(), the cache is checked for a
hit, and early-out is performed. Otherwise, the node is
processed, and its result bitmap and location (offset) are
cached, but only if it contains two or more children and
thus will be visited again during the traversal.

Currently, the child count is approximated with the
refcount. This is good enough in most cases (and exactly
correct for the Chrome use case). We could add an exact
child count to the image filter, but this will require
violating the immutability of image filters slightly in
order to bump the child count as nodes are connected. I
leave it up to the reviewer to decide which is better.

R=reed@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/230653005

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

7 days agoremove picture-backed surfaces
commit-bot@chromium.org [Fri, 11 Apr 2014 18:34:35 +0000 (18:34 +0000)]
remove picture-backed surfaces

BUG=skia:
R=robertphillips@google.com, mtklein@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/233943002

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

7 days agoMark our territory with (C).
commit-bot@chromium.org [Fri, 11 Apr 2014 18:33:31 +0000 (18:33 +0000)]
Mark our territory with (C).

BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/235253002

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

7 days agoRevert of Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://coderev...
commit-bot@chromium.org [Fri, 11 Apr 2014 17:15:40 +0000 (17:15 +0000)]
Revert of Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromium.org/234243002/)

Reason for revert:
Want to reland the original CL.

Original issue's description:
> Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromium.org/227433009/)
>
> Reason for revert:
> breaking the Chrome deps roll.
> http://build.chromium.org/p/chromium.linux/builders/Linux%20GN%20%28dbg%29/builds/839/steps/compile/logs/stdio
>
> Original issue's description:
> > Rename kPMColor_SkColorType to kN32_SkColorType.
> >
> > The new name better represents what this flag means.
> >
> > BUG=skia:2384
> >
> > Committed: http://code.google.com/p/skia/source/detail?r=14117
>
> TBR=reed@google.com,scroggo@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:2384
>
> Committed: http://code.google.com/p/skia/source/detail?r=14144

R=reed@google.com, bensong@google.com
TBR=bensong@google.com, reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2384

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/235523003

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

7 days agoUpdate bench to be able to preprocess skps
commit-bot@chromium.org [Fri, 11 Apr 2014 15:54:14 +0000 (15:54 +0000)]
Update bench to be able to preprocess skps

This allows benchmarking of optimization improvements and plumbs in the purging API. The purging is necessary so we don't magically get faster because the saveLayers are always pre-generated.

R=jvanverth@google.com, reed@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/233663002

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

7 days agoRename GrAtlasedLayer to GrCachedLayer (since not all cached layers are atlased)
commit-bot@chromium.org [Fri, 11 Apr 2014 15:53:47 +0000 (15:53 +0000)]
Rename GrAtlasedLayer to GrCachedLayer (since not all cached layers are atlased)

This is mainly a renaming CL but it does add a ref-counted ptr  to the backing GrTexture for non-atlased layers (the only kind working right now)

R=jvanverth@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/233703003

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

8 days agoRevert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromi...
commit-bot@chromium.org [Fri, 11 Apr 2014 13:47:30 +0000 (13:47 +0000)]
Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromium.org/227433009/)

Reason for revert:
Chrome's side of define changes not easy to figure out quickly. Reverting this for DEPS roll for now.

Original issue's description:
> Rename kPMColor_SkColorType to kN32_SkColorType.
>
> The new name better represents what this flag means.
>
> BUG=skia:2384
>
> Committed: http://code.google.com/p/skia/source/detail?r=14117

R=reed@google.com, scroggo@google.com
TBR=reed@google.com, scroggo@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2384

Author: bensong@google.com

Review URL: https://codereview.chromium.org/234833003

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

8 days agoSo apparently Chrome has an x86 iOS build...
commit-bot@chromium.org [Fri, 11 Apr 2014 12:52:44 +0000 (12:52 +0000)]
So apparently Chrome has an x86 iOS build...

and for some reason we don't bother to build or link our SSE2 opts
there.  So don't go looking for them when SK_BUILD_FOR_IOS is set.

BUG=skia:
NOTREECHECKS=true
NOTRY=true
R=djsollen@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/225033003

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

8 days agoAdd a focused public API for src/record.
commit-bot@chromium.org [Thu, 10 Apr 2014 23:30:59 +0000 (23:30 +0000)]
Add a focused public API for src/record.

BUG=skia:2378
R=reed@google.com, robertphillips@google.com, mtklein@google.com, fmalita@chromium.org

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/233053005

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

8 days agoRevert of Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://coderev...
commit-bot@chromium.org [Thu, 10 Apr 2014 22:49:20 +0000 (22:49 +0000)]
Revert of Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromium.org/234243002/)

Reason for revert:
fixes on the chrome side are landing (brettw), keep fingers crossed.

Original issue's description:
> Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromium.org/227433009/)
>
> Reason for revert:
> breaking the Chrome deps roll.
> http://build.chromium.org/p/chromium.linux/builders/Linux%20GN%20%28dbg%29/builds/839/steps/compile/logs/stdio
>
> Original issue's description:
> > Rename kPMColor_SkColorType to kN32_SkColorType.
> >
> > The new name better represents what this flag means.
> >
> > BUG=skia:2384
> >
> > Committed: http://code.google.com/p/skia/source/detail?r=14117
>
> TBR=reed@google.com,scroggo@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:2384
>
> Committed: http://code.google.com/p/skia/source/detail?r=14144

R=reed@google.com, scroggo@google.com
TBR=reed@google.com, scroggo@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2384

Author: bensong@google.com

Review URL: https://codereview.chromium.org/233813004

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

8 days agoRevert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromi...
commit-bot@chromium.org [Thu, 10 Apr 2014 22:36:34 +0000 (22:36 +0000)]
Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromium.org/227433009/)

Reason for revert:
breaking the Chrome deps roll.
http://build.chromium.org/p/chromium.linux/builders/Linux%20GN%20%28dbg%29/builds/839/steps/compile/logs/stdio

Original issue's description:
> Rename kPMColor_SkColorType to kN32_SkColorType.
>
> The new name better represents what this flag means.
>
> BUG=skia:2384
>
> Committed: http://code.google.com/p/skia/source/detail?r=14117

R=reed@google.com, scroggo@google.com
TBR=reed@google.com, scroggo@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2384

Author: bensong@google.com

Review URL: https://codereview.chromium.org/234243002

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

8 days agoremove two more effects that are now immutable
commit-bot@chromium.org [Thu, 10 Apr 2014 21:57:32 +0000 (21:57 +0000)]
remove two more effects that are now immutable

BUG=skia:
R=scroggo@google.com, dominikg@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/233753002

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

8 days agoCreate SkLayerRasterizer w/o destroying Builder.
commit-bot@chromium.org [Thu, 10 Apr 2014 20:42:53 +0000 (20:42 +0000)]
Create SkLayerRasterizer w/o destroying Builder.

Add a new method to SkLayerRasterizer::Builder that creates a new
SkLayerRasterizer without destroying the Builder. Necessary to
continue to support Android's API.

Also fix a bug where creating a Builder and never calling
detachRasterizer results in not calling the destructor for any SkPaints
in the Builder.

Add tests.

BUG=b/13729784
R=reed@google.com, dominikg@chromium.org

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/233673002

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

8 days agoFix GPU-less build.
commit-bot@chromium.org [Thu, 10 Apr 2014 16:03:06 +0000 (16:03 +0000)]
Fix GPU-less build.

Do not include GrTBackendEffectFactory.h if SK_SUPPORT_GPU is
undefined.

R=egdaniel@google.com
TBR=egdaniel@google.com
NOTREECHECKS=true
NOTRY=true

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/233093003

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

8 days agoMove build guard to fix Android framework compile.
commit-bot@chromium.org [Thu, 10 Apr 2014 15:37:52 +0000 (15:37 +0000)]
Move build guard to fix Android framework compile.

After merging into the Android tree, this file was not compiling.
It turns out that it was because SK_SUPPORT_GPU was not defined. When
built by GYP, SK_SUPPORT_GPU is defined by GYP. When built by the
Android framework, we depend on SkUserConfig.h, which is included by
other files, to set SK_SUPPORT_GPU. Moving the includes outside of
#if SK_SUPPORT_GPU ensures that the dependency chain defining
SK_SUPPORT_GPU is included, so this code gets compiled as expected.

R=egdaniel@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/228893003

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

9 days agoSkRecordDraw: don't bother clipping an empty clip down further
commit-bot@chromium.org [Thu, 10 Apr 2014 02:26:33 +0000 (02:26 +0000)]
SkRecordDraw: don't bother clipping an empty clip down further

BUG=skia:2378
R=fmalita@chromium.org, mtklein@google.com, fmalita@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/231933003

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

9 days agoRevert of remove sprintf (https://codereview.chromium.org/230413005/)
commit-bot@chromium.org [Wed, 9 Apr 2014 23:38:57 +0000 (23:38 +0000)]
Revert of remove sprintf (https://codereview.chromium.org/230413005/)

Reason for revert:
Boo, hiss, SK_ARRAY_COUNT not defined in skia_launcher.cpp!

Original issue's description:
> remove sprintf
>
> Committed: http://code.google.com/p/skia/source/detail?r=14123

R=halcanary@google.com
TBR=halcanary@google.com
NOTREECHECKS=true
NOTRY=true

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/232323002

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

9 days agoSkRecordDraw: skip draw ops when the clip is empty
commit-bot@chromium.org [Wed, 9 Apr 2014 23:30:28 +0000 (23:30 +0000)]
SkRecordDraw: skip draw ops when the clip is empty

   - Adds tests for SkRecordDraw's two main features: cull- and clip- based skipping.
   - Adds full SkCanvas semantic mode to SkRecorder, so it can be used as a target for SkRecordDraw.

BUG=skia:2378
R=fmalita@chromium.org, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/231653002

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

9 days agoremove sprintf
commit-bot@chromium.org [Wed, 9 Apr 2014 23:22:44 +0000 (23:22 +0000)]
remove sprintf

R=mtklein@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/230413005

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

9 days agoReal fix for SK_API / Windows shared lib problems.
mtklein@google.com [Wed, 9 Apr 2014 22:54:57 +0000 (22:54 +0000)]
Real fix for SK_API / Windows shared lib problems.

Ben reviewed this over my shoulder, and we tested on his machine.

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

9 days agoSK_API for SkXfermode_opts_SSE2 so Chrome can initialize flattenables.
commit-bot@chromium.org [Wed, 9 Apr 2014 21:43:27 +0000 (21:43 +0000)]
SK_API for SkXfermode_opts_SSE2 so Chrome can initialize flattenables.

BUG=skia:2401
R=bungeman@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/231423003

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

9 days agoImplement drawDRRect for GPU
commit-bot@chromium.org [Wed, 9 Apr 2014 21:26:11 +0000 (21:26 +0000)]
Implement drawDRRect for GPU

BUG=skia:2259
R=jvanverth@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/220233011

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

9 days agoRename kPMColor_SkColorType to kN32_SkColorType.
commit-bot@chromium.org [Wed, 9 Apr 2014 20:45:29 +0000 (20:45 +0000)]
Rename kPMColor_SkColorType to kN32_SkColorType.

The new name better represents what this flag means.

BUG=skia:2384
R=reed@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/227433009

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

9 days agoDo div-by-zero check for all gpus in ellipse/rr effects.
commit-bot@chromium.org [Wed, 9 Apr 2014 17:11:09 +0000 (17:11 +0000)]
Do div-by-zero check for all gpus in ellipse/rr effects.

R=jvanverth@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/231093002

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

9 days agoDefine SK_CPU_X86 on x86 machines.
commit-bot@chromium.org [Wed, 9 Apr 2014 16:50:55 +0000 (16:50 +0000)]
Define SK_CPU_X86 on x86 machines.

Use this to only register flattening for SkSSE2ProcCoeffXfermode::CreateProc when it's linked.

BUG=skia:

R=reed@google.com, mtklein@google.com, bsalomon@google.com
TBR=reed@google.com
NOTRY=true
NOTREECHECKS=true

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/231223002

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

9 days agoXfermode: SSE2 implementation of multiply_modeproc
commit-bot@chromium.org [Wed, 9 Apr 2014 15:43:46 +0000 (15:43 +0000)]
Xfermode: SSE2 implementation of multiply_modeproc

This patch implements basics for Xfermode SSE optimization. Based on
these basics, SSE2 implementation of multiply_modeproc is provided. SSE2
implementation for other modes will come in future. With this patch
performance of Xfermode_Multiply will improve about 45%. Here are the
data on desktop i7-3770.
before:
Xfermode_Multiply   8888:  cmsecs =     33.30   565:  cmsecs =     45.65
after:
Xfermode_Multiply   8888:  cmsecs =     17.18   565:  cmsecs =     24.87

BUG=

Committed: http://code.google.com/p/skia/source/detail?r=14006

Committed: http://code.google.com/p/skia/source/detail?r=14050

R=mtklein@google.com, robertphillips@google.com

Author: qiankun.miao@intel.com

Review URL: https://codereview.chromium.org/202903004

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

9 days agoMeasure DirectWrite BW consistently with rendering.
bungeman@google.com [Wed, 9 Apr 2014 15:35:03 +0000 (15:35 +0000)]
Measure DirectWrite BW consistently with rendering.

Also move DirectWrite glyph drawing into the scaler context, as this
reduces duplication.

R=reed@google.com

Review URL: https://codereview.chromium.org/225283021

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

10 days agoARM Skia NEON patches - 22 - S32_D565_Blend
commit-bot@chromium.org [Wed, 9 Apr 2014 09:46:31 +0000 (09:46 +0000)]
ARM Skia NEON patches - 22 - S32_D565_Blend

BlitRow565: new NEON version of S32_D565_Blend

This new implementation brings a good speedup in most cases and
gives exact results (removes one mismatch in gm).

Here are the benchmark results (speedup vs. existing S32A_D565_Blend):

+-------+-----------+------------+
| count | Cortex-A9 | Cortex-A15 |
+-------+-----------+------------+
| 1     | -26,7%    | -27,5%     |
+-------+-----------+------------+
| 2     | 0%        | +53%       |
+-------+-----------+------------+
| 4     | +38,3%    | +26,5%     |
+-------+-----------+------------+
| 8     | +10,9%    |  -4,5%     |
+-------+-----------+------------+
| 16    | +18,2%    | +1,6%      |
+-------+-----------+------------+
| 64    | +22,3%    | +8,75%     |
+-------+-----------+------------+
| 256   | +12,3%    | +11,2%     |
+-------+-----------+------------+
| 1024  | +79,2%    | +10,9%     |
+-------+-----------+------------+

Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
BUG=skia:
R=djsollen@google.com, mtklein@google.com

Author: kevin.petit@arm.com

Review URL: https://codereview.chromium.org/181523002

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

10 days agoSanitizing source files in Housekeeper-Nightly
skia.committer@gmail.com [Wed, 9 Apr 2014 03:04:11 +0000 (03:04 +0000)]
Sanitizing source files in Housekeeper-Nightly

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

10 days agoSkRecord: make culling work if SkRecordAnnotateCullingPairs is called.
commit-bot@chromium.org [Tue, 8 Apr 2014 23:31:35 +0000 (23:31 +0000)]
SkRecord: make culling work if SkRecordAnnotateCullingPairs is called.

  - Allow stateful functors; allow visit()/mutate() at a given index; add count().
  - Annotate cull push/pop pairs on the PushCull records.  (tested)
  - Use those annotations to skip ahead in SkRecordDraw.   (not yet tested beyond dm --skr)
  - Make SkRecordDraw a function, move its implementation to a .cpp.

BUG=skia:2378
R=fmalita@chromium.org, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/229523002

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

10 days agoDon't try to render color fonts using distance fields.
commit-bot@chromium.org [Tue, 8 Apr 2014 20:14:32 +0000 (20:14 +0000)]
Don't try to render color fonts using distance fields.

Adds detection of ARGB mask format, which is only used for color fonts.

BUG=skia:2173
R=bungeman@google.com, reed@google.com, bsalomon@google.com, robertphillips@google.com

Author: jvanverth@google.com

Review URL: https://codereview.chromium.org/224903012

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

10 days agoStart on some unwritten SkRecord TODOs:
commit-bot@chromium.org [Tue, 8 Apr 2014 17:31:08 +0000 (17:31 +0000)]
Start on some unwritten SkRecord TODOs:

  - add SK_OVERRIDE for SkCanvas methods in SkRecorder
  - start on unit tests, here just for SkRecord itself

BUG=skia:2378
R=fmalita@google.com, mtklein@google.com, fmalita@chromium.org

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/228723003

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

10 days agouse default to fix warning (or I will shoot myself)
reed@google.com [Tue, 8 Apr 2014 16:57:05 +0000 (16:57 +0000)]
use default to fix warning (or I will shoot myself)

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

10 days agofix warning for uninitialized count
reed@google.com [Tue, 8 Apr 2014 16:02:45 +0000 (16:02 +0000)]
fix warning for uninitialized count

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

10 days agofix warning about uninitialized typeface_encoding by folding glyph case into switch
reed@google.com [Tue, 8 Apr 2014 15:48:26 +0000 (15:48 +0000)]
fix warning about uninitialized typeface_encoding by folding glyph case into switch

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

10 days agofix warning by removing padding field
reed@google.com [Tue, 8 Apr 2014 15:29:10 +0000 (15:29 +0000)]
fix warning by removing padding field

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

10 days agoInitial picture shader implementation
commit-bot@chromium.org [Tue, 8 Apr 2014 15:19:34 +0000 (15:19 +0000)]
Initial picture shader implementation

This CL adds an SkPictureShader class to support SkPicture-based
patterns.

The implementation renders the picture into an SkBitmap tile and then
delegates to SkBitmapProcShader for the actual operation.

R=bsalomon@google.com, reed@google.com, robertphillips@google.com

Committed: http://code.google.com/p/skia/source/detail?r=14085

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/221923007

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

10 days agoAdd push/pop cull to SkRecord.
commit-bot@chromium.org [Tue, 8 Apr 2014 15:17:17 +0000 (15:17 +0000)]
Add push/pop cull to SkRecord.

BUG=skia:2378
R=fmalita@google.com, mtklein@google.com, fmalita@chromium.org

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/224723026

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

11 days agoWIP -- SkFont
reed@google.com [Tue, 8 Apr 2014 15:04:29 +0000 (15:04 +0000)]
WIP -- SkFont

BUG=skia:
R=bungeman@google.com, fmalita@chromium.org

Review URL: https://codereview.chromium.org/185293018

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

11 days agoRevert of Initial picture shader implementation (https://codereview.chromium.org...
commit-bot@chromium.org [Mon, 7 Apr 2014 23:45:31 +0000 (23:45 +0000)]
Revert of Initial picture shader implementation (https://codereview.chromium.org/221923007/)

Reason for revert:
breaking the buildbots. Subsequent CL only addressed CompareGMs but GenerateGMs are also failing.

Original issue's description:
> Initial picture shader implementation
>
> This CL adds an SkPictureShader class to support SkPicture-based
> patterns.
>
> The implementation renders the picture into an SkBitmap tile and then
> delegates to SkBitmapProcShader for the actual operation.
>
> R=reed@google.com,robertphillips@google.com,bsalomon@google.com
>
> Committed: http://code.google.com/p/skia/source/detail?r=14085

R=bsalomon@google.com, reed@google.com, robertphillips@google.com, fmalita@chromium.org
TBR=bsalomon@google.com, fmalita@chromium.org, reed@google.com, robertphillips@google.com
NOTREECHECKS=true
NOTRY=true

Author: bensong@google.com

Review URL: https://codereview.chromium.org/227553010

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

11 days agoInitial picture shader implementation
commit-bot@chromium.org [Mon, 7 Apr 2014 23:11:45 +0000 (23:11 +0000)]
Initial picture shader implementation

This CL adds an SkPictureShader class to support SkPicture-based
patterns.

The implementation renders the picture into an SkBitmap tile and then
delegates to SkBitmapProcShader for the actual operation.

R=bsalomon@google.com, reed@google.com, robertphillips@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/221923007

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

11 days agoAdd option to SkDecodingImageGenerator to require unpremul.
commit-bot@chromium.org [Mon, 7 Apr 2014 21:37:36 +0000 (21:37 +0000)]
Add option to SkDecodingImageGenerator to require unpremul.

Android needs to be able to set unpremul for purgeable
pixelRefs.

Once Android switches to the new interface, we can delete SkImageRef.

Bug=skia:2389

R=reed@google.com, halcanary@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/223903007

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

11 days agoremove SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG
commit-bot@chromium.org [Mon, 7 Apr 2014 21:33:06 +0000 (21:33 +0000)]
remove SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG
remove SK_SUPPORT_LEGACY_GETDEVICECAPABILITIES

BUG=skia:
R=robertphillips@google.com, bsalomon@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/227643005

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

11 days agoSkNonCopyable should be used with private inheritance.
commit-bot@chromium.org [Mon, 7 Apr 2014 19:34:38 +0000 (19:34 +0000)]
SkNonCopyable should be used with private inheritance.

This is mostly s/public SkNoncopyable/SkNoncopyable/g.

Two classes (SkDrawLooper::Context and SkPicture::OperationList) don't actually work with SkNoncopyable because they introduce a virtual destructor.  I added SkNoncopyableVirtual to make them work as intended.  Sort of questionable whether they really need to be noncopyable in the first place, but I guess it doesn't hurt to keep the behavior the same.

BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/226183018

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

11 days agoFactory methods for heap-allocated SkTypeface objects.
commit-bot@chromium.org [Mon, 7 Apr 2014 19:34:16 +0000 (19:34 +0000)]
Factory methods for heap-allocated SkTypeface objects.

This is part of an effort to ensure that all SkPaint effects can only be
allocated on the heap.

This patch makes the constructors of SkTypeface and its subclasses non-public
and instead provides factory methods for creating these objects on the heap.

BUG=skia:2187
R=scroggo@google.com, bungeman@google.com

Author: dominikg@chromium.org

Review URL: https://codereview.chromium.org/227693003

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

11 days agoConvert SkPicture's generation ID to a unique ID
commit-bot@chromium.org [Mon, 7 Apr 2014 18:26:22 +0000 (18:26 +0000)]
Convert SkPicture's generation ID to a unique ID

This CL addresses linger code review comments on r14037 (Add generation ID to SkPicture https://codereview.chromium.org/222683002/)

R=reed@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/225283014

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

11 days agoRemove SkBitmapShaderTemplate.
commit-bot@chromium.org [Mon, 7 Apr 2014 18:01:09 +0000 (18:01 +0000)]
Remove SkBitmapShaderTemplate.

Remove files that are no longer needed:
src/core/SkBitmapShaderTemplate.h
src/core/SkBitmapShader16BilerpTemplate.h

BUG=skia:1976
R=scroggo@google.com

Author: dominikg@chromium.org

Review URL: https://codereview.chromium.org/225023028

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

11 days agoRevert of Discard scratch render targets before reusing them. (https://codereview...
commit-bot@chromium.org [Mon, 7 Apr 2014 17:43:01 +0000 (17:43 +0000)]
Revert of Discard scratch render targets before reusing them. (https://codereview.chromium.org/225183012/)

Reason for revert:
Asserts in debug.

Original issue's description:
> Discard scratch render targets before reusing them.
>
> R=robertphillips@google.com
>
> Committed: http://code.google.com/p/skia/source/detail?r=14075

R=robertphillips@google.com
TBR=robertphillips@google.com
NOTREECHECKS=true
NOTRY=true

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/224963014

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

11 days agoFix EffectKey for XferEffect
commit-bot@chromium.org [Mon, 7 Apr 2014 17:13:10 +0000 (17:13 +0000)]
Fix EffectKey for XferEffect

R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/227233007

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

11 days agoDiscard scratch render targets before reusing them.
commit-bot@chromium.org [Mon, 7 Apr 2014 17:03:00 +0000 (17:03 +0000)]
Discard scratch render targets before reusing them.

R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/225183012

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

11 days agoRemove SkResizeImageFilter.
commit-bot@chromium.org [Mon, 7 Apr 2014 15:11:08 +0000 (15:11 +0000)]
Remove SkResizeImageFilter.

Its functionality has been subsumed by SkMatrixImageFilter, and it's no longer
used in Blink.

BUG=skia:
R=bsalomon@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/222923005

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

12 days agoFixed Skia compilation error with strict clang.
commit-bot@chromium.org [Mon, 7 Apr 2014 13:12:47 +0000 (13:12 +0000)]
Fixed Skia compilation error with strict clang.

BUG=skia:
R=reed@google.com, sergeyberezin@chromium.org, hcm@google.com

Author: kolczyk@opera.com

Review URL: https://codereview.chromium.org/227043006

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

2 weeks agoSanitizing source files in Housekeeper-Nightly
skia.committer@gmail.com [Sat, 5 Apr 2014 03:05:27 +0000 (03:05 +0000)]
Sanitizing source files in Housekeeper-Nightly

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