Commit Graph

14280 Commits

Author SHA1 Message Date
reed
ba5fb932a1 add drawImageRect to lua, update sample
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/642353005
2014-10-10 15:28:19 -07:00
joshualitt
89c7a2ec3e Revert of Opt state takes a GP instead of a GeometryStage (patchset #18 id:1500001 of https://codereview.chromium.org/637003003/)
Reason for revert:
Revert because this may be causing a break in a chrome gpu test

Original issue's description:
> Opt state takes a GP instead of a GeometryStage
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/71856d520461ae025a0332aa0ce9735a096d9baf

TBR=bsalomon@google.com,egdaniel@google.com,danakj@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/647183002
2014-10-10 14:11:59 -07:00
tfarina
93bee71a41 Remove empty recordy.gypi file.
Fixes the TODO in that file.

BUG=None
TEST=None
R=mtklein@google.com

Review URL: https://codereview.chromium.org/643543002
2014-10-10 13:34:25 -07:00
jvanverth
75e926a1b1 Update coloremoji expectations
TBR=reed@google.com
BUG=skia:2887

Review URL: https://codereview.chromium.org/649753003
2014-10-10 12:58:46 -07:00
robertphillips
7bb9ed756e Fix bug in GrCachedLayer reuse
In the new MultiPictureDraw tests a single hoisted layer is reused multiple times. The previous plot locking scheme allowed GrCachedLayer objects to be aggressively deleted prematurely leaving the reusing GrHoistedLayer objects with dangling pointers.

This CL changes adds a new pseudo-ref to GrCachedLayer. (It can't be a real ref since the cached layers aren't deleted when it goes to 0).

NOTRY=true

Committed: https://skia.googlesource.com/skia/+/5c481666c9678f43e039ad605457be3854cf8de3

Review URL: https://codereview.chromium.org/640323002
2014-10-10 11:38:29 -07:00
jvanverth
294c32612d Fix color emoji.
Removes the GrMaskFormat and single atlas in GrTextStrike.
Replaces it by storing the GrMaskFormat in each GrGlyph, and
doing a lookup for the correct atlas based on that.

Disables color glyph rendering in GrDistanceFieldTextContext
for now.

BUG=skia:2887

Committed: https://skia.googlesource.com/skia/+/bc92163ddfe957ad6ffbb02ac40e0ba75ff82216

Review URL: https://codereview.chromium.org/636183005
2014-10-10 11:36:12 -07:00
joshualitt
71856d5204 Opt state takes a GP instead of a GeometryStage
BUG=skia:

Review URL: https://codereview.chromium.org/637003003
2014-10-10 09:56:55 -07:00
reed
5324978a88 detect --loops is < 0 and interpret that as running forever (mostly)
BUG=skia:

Review URL: https://codereview.chromium.org/643143002
2014-10-10 09:09:52 -07:00
jvanverth
e817dbb889 Revert of Fix color emoji. (patchset #11 id:320001 of https://codereview.chromium.org/636183005/)
Reason for revert:
Crashing the Windows bots.

Original issue's description:
> Fix color emoji.
>
> Removes the GrMaskFormat and single atlas in GrTextStrike.
> Replaces it by storing the GrMaskFormat in each GrGlyph, and
> doing a lookup for the correct atlas based on that.
>
> Disables color glyph rendering in GrDistanceFieldTextContext
> for now.
>
> BUG=skia:2887
>
> Committed: https://skia.googlesource.com/skia/+/bc92163ddfe957ad6ffbb02ac40e0ba75ff82216

TBR=robertphillips@google.com,bungeman@google.com,reed@google.com,bsalomon@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2887

Review URL: https://codereview.chromium.org/640413004
2014-10-10 08:52:03 -07:00
jvanverth
bc92163ddf Fix color emoji.
Removes the GrMaskFormat and single atlas in GrTextStrike.
Replaces it by storing the GrMaskFormat in each GrGlyph, and
doing a lookup for the correct atlas based on that.

Disables color glyph rendering in GrDistanceFieldTextContext
for now.

BUG=skia:2887

Review URL: https://codereview.chromium.org/636183005
2014-10-10 08:21:29 -07:00
jvanverth
6cb35fa467 Ignore complexclip_path_aa on Win7-HD2000 for the moment.
TBR=reed@google.com
BUG=skia:3006

Review URL: https://codereview.chromium.org/643103002
2014-10-10 07:14:55 -07:00
joshualitt
d8088f846f updating expectations
TBR=
BUG=skia:

Review URL: https://codereview.chromium.org/646963002
2014-10-10 06:48:48 -07:00
tfarina
a5414c4a8e Turn SkCanvasStateUtils into a class with static functions.
That simplifies the way to declare it a friend, as needed in SkCanvas.

BUG=skia:2914
TEST=make most
R=reed@google.com

Review URL: https://codereview.chromium.org/645773002
2014-10-10 06:19:09 -07:00
reed
40636a5303 faster SkRect::sort
BUG=skia:

Review URL: https://codereview.chromium.org/646863002
2014-10-10 05:50:15 -07:00
tfarina
0ad24bee47 Add template.cpp to gitignore.
It is generated experimental/webtry/build script, not checked-in the
source tree.

BUG=None
TEST=git status do not show it anymore as untracked file.
R=humper@google.com

Review URL: https://codereview.chromium.org/647633002
2014-10-10 05:20:52 -07:00
borenet
494f910aa0 Update SKP version to 122
Automatic commit by the RecreateSKPs bot.

TBR=

Review URL: https://codereview.chromium.org/647663002
2014-10-09 21:26:14 -07:00
Thiago Farina
8f1f7f821c Use the function recently added to common in svndiff.py
GetModifiedFiles() function was added to common repo in
https://skia.googlesource.com/common/+/af1de867422c42855ae54ed3838c62ea445ea6b4

BUG=None
TEST=None
R=borenet@google.com

Review URL: https://codereview.chromium.org/634313006
2014-10-10 00:25:29 -03:00
mtklein
092dab9822 Use BBH reserve hook to preallocate space for tiles.
Before getting too far into changing how SkTileGrid stores its tiles, I figured I'd
better see how much I can tweak out the existing format.  Cleverly, that way
any improvements I make by changing the format will look that much less
impressive.

This CL looks like it will be a 5-15% win in time spent recording, with no effect
on playback.

This CL also shrinks the tiles to fit exactly when we're done inserting,
using newly added SkTDArray::shrinkToFit().  It's quite cheap to run (maybe
taking back 1-2% from those 5-15% wins), and means we'll lug around about 15%
fewer bytes in the tile grids.  Note though this strategy temporarily uses up to
30% more memory while building the tile grid.  For our largest SKPs, that's
maybe 75-100K extra.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/52455cbc02d7f480d988ae7cdacc11ad69078c2c

CQ_EXTRA_TRYBOTS=tryserver.skia:Canary-Chrome-Ubuntu13.10-Ninja-x86_64-ToT-Trybot

Review URL: https://codereview.chromium.org/639823005
2014-10-09 18:22:41 -07:00
robertphillips
232f6b0f90 Remove unused SaveLayerInfo::fValid field
Minor code cleanup

Review URL: https://codereview.chromium.org/643713002
2014-10-09 16:43:42 -07:00
robertphillips
cbe80caedd Refactor GrLayerHoister::FindLayersToHoist to prep for adding clip to cache key
NOTRY=true

Committed: https://skia.googlesource.com/skia/+/27415b71bd529456165945e19b5b7efbebf6fb51

Review URL: https://codereview.chromium.org/640373002
2014-10-09 15:36:06 -07:00
joshualitt
1598899975 FPs now use the correct builder types(just a rename)
BUG=skia:

Review URL: https://codereview.chromium.org/648463003
2014-10-09 15:04:05 -07:00
reed
1119c87065 cleanup and optimize rect intersect routines
BUG=skia:

Review URL: https://codereview.chromium.org/640723004
2014-10-09 14:29:01 -07:00
mtklein
7062a262e2 Revert of Use BBH reserve hook to preallocate space for tiles. (patchset #2 id:80001 of https://codereview.chromium.org/639823005/)
Reason for revert:
failed assertion "fXTiles * fYTiles != 0"

Original issue's description:
> Use BBH reserve hook to preallocate space for tiles.
>
> Before getting too far into changing how SkTileGrid stores its tiles, I figured I'd
> better see how much I can tweak out the existing format.  Cleverly, that way
> any improvements I make by changing the format will look that much less
> impressive.
>
> This CL looks like it will be a 5-15% win in time spent recording, with no effect
> on playback.
>
> This CL also shrinks the tiles to fit exactly when we're done inserting,
> using newly added SkTDArray::shrinkToFit().  It's quite cheap to run (maybe
> taking back 1-2% from those 5-15% wins), and means we'll lug around about 15%
> fewer bytes in the tile grids.  Note though this strategy temporarily uses up to
> 30% more memory while building the tile grid.  For our largest SKPs, that's
> maybe 75-100K extra.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/52455cbc02d7f480d988ae7cdacc11ad69078c2c

TBR=reed@google.com,robertphillips@google.com,mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/642933002
2014-10-09 13:55:20 -07:00
egdaniel
d9aa218e81 Store color and coverage stages in a single array in GrOptDrawState.
BUG=skia:

Review URL: https://codereview.chromium.org/641223002
2014-10-09 13:47:05 -07:00
joshualitt
9e87fa7c0e Force linking of static member variables for GLPrograms
BUG=skia:

Review URL: https://codereview.chromium.org/614163002
2014-10-09 13:12:35 -07:00
robertphillips
00878a1f36 Revert of Refactor GrLayerHoister::FindLayersToHoist to prep for adding clip to cache key (patchset #1 id:1 of https://codereview.chromium.org/640373002/)
Reason for revert:
Failing unit tests

Original issue's description:
> Refactor GrLayerHoister::FindLayersToHoist to prep for adding clip to cache key
>
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/27415b71bd529456165945e19b5b7efbebf6fb51

TBR=jvanverth@google.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/644823003
2014-10-09 12:47:08 -07:00
robertphillips
a32c6bce1b Revert of Fix bug in plot locking system (patchset #3 id:80001 of https://codereview.chromium.org/640323002/)
Reason for revert:
Failing unit tests

Original issue's description:
> Fix bug in plot locking system
>
> In the new MultiPictureDraw tests a single hoisted layer is reused multiple times. The previous plot locking scheme allowed GrCachedLayer objects to be aggressively deleted prematurely leaving the reusing GrHoistedLayer objects with dangling pointers.
>
> This CL changes the plot locking system to add a pseudo-ref for each GrHoistedLayer.
>
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/5c481666c9678f43e039ad605457be3854cf8de3

TBR=jvanverth@google.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/643673004
2014-10-09 12:47:01 -07:00
jvanverth
e01844540a Update expectations for distance field path rendering.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/641203002
2014-10-09 12:37:36 -07:00
mtklein
52455cbc02 Use BBH reserve hook to preallocate space for tiles.
Before getting too far into changing how SkTileGrid stores its tiles, I figured I'd
better see how much I can tweak out the existing format.  Cleverly, that way
any improvements I make by changing the format will look that much less
impressive.

This CL looks like it will be a 5-15% win in time spent recording, with no effect
on playback.

This CL also shrinks the tiles to fit exactly when we're done inserting,
using newly added SkTDArray::shrinkToFit().  It's quite cheap to run (maybe
taking back 1-2% from those 5-15% wins), and means we'll lug around about 15%
fewer bytes in the tile grids.  Note though this strategy temporarily uses up to
30% more memory while building the tile grid.  For our largest SKPs, that's
maybe 75-100K extra.

BUG=skia:

Review URL: https://codereview.chromium.org/639823005
2014-10-09 12:36:48 -07:00
robertphillips
5c481666c9 Fix bug in plot locking system
In the new MultiPictureDraw tests a single hoisted layer is reused multiple times. The previous plot locking scheme allowed GrCachedLayer objects to be aggressively deleted prematurely leaving the reusing GrHoistedLayer objects with dangling pointers.

This CL changes the plot locking system to add a pseudo-ref for each GrHoistedLayer.

NOTRY=true

Review URL: https://codereview.chromium.org/640323002
2014-10-09 12:30:10 -07:00
robertphillips
27415b71bd Refactor GrLayerHoister::FindLayersToHoist to prep for adding clip to cache key
NOTRY=true

Review URL: https://codereview.chromium.org/640373002
2014-10-09 12:29:24 -07:00
egdaniel
acd3e6d342 Fix restore in AVMR to have correct coverage count.
BUG=skia:

Review URL: https://codereview.chromium.org/638173003
2014-10-09 12:07:21 -07:00
mtklein
e099dd73df Small improvements to SkBitSet:
- implement O(1) operations in SkBitSet.h so they can inline away
  - use calloc to allocate empty bitsets instead of malloc then clear
  - little style things

BUG=skia:

Review URL: https://codereview.chromium.org/640243003
2014-10-09 11:49:30 -07:00
jmuizelaar
60e4ad7b29 Improve SkARGB32_A8_BlitMask_SSE2
With clang this:

-       movzbl  -3(%rbx), %edx
-       pxor    %xmm5, %xmm5
-       pinsrw  $0, %edx, %xmm5
-       pinsrw  $1, %edx, %xmm5
-       movzbl  -2(%rbx), %edx
-       pinsrw  $2, %edx, %xmm5
-       pinsrw  $3, %edx, %xmm5
-       movzbl  -1(%rbx), %edx
-       pinsrw  $4, %edx, %xmm5
-       pinsrw  $5, %edx, %xmm5
-       movzbl  (%rbx), %edx
-       pinsrw  $6, %edx, %xmm5
-       pinsrw  $7, %edx, %xmm5

becomes:

+       movd    (%rbx), %xmm4
+       punpcklbw       %xmm9, %xmm4
+       punpcklwd       %xmm4, %xmm4

And clang already does better codegen than msvc 2013 on this.

BUG=skia:

Review URL: https://codereview.chromium.org/609823003
2014-10-09 11:43:02 -07:00
sugoi
12b1831ea4 Attempt at fixing color cube bench
The original bench was hitting the cache since it was using the same color filter for all loops. By creating a new color filter within the loop, at least this part of it is solved. I'm not 100% sure this is the right way, but at least the numbers are a bit more reasonable and are affected by the output resolution.

BUG=skia:

Review URL: https://codereview.chromium.org/648483002
2014-10-09 11:35:09 -07:00
rmistry
8db6f23d90 Whitespace change to test CQ's trybots
(SkipBuildbotRuns)
TBR=
BUG=skia:

Review URL: https://codereview.chromium.org/646663002
2014-10-09 11:10:33 -07:00
egdaniel
089f8de82d Remove tab parameter from GrGLSLMulVarBy4f function
With pretty printing of shader code, there is no longer a need to explictily
have tabs in our code.

BUG=skia:

Review URL: https://codereview.chromium.org/648463002
2014-10-09 10:34:59 -07:00
bsalomon
1e2530babb Use presence of a content key as non-scratch indicator
BUG=skia:2889

Committed: https://skia.googlesource.com/skia/+/9eefe0851eeaa8ded05b4774ebcb38ed201d5dbf

Review URL: https://codereview.chromium.org/639873002
2014-10-09 09:57:18 -07:00
tfarina
cf9b87389f Clarify what DM means in the README file.
It took me a while to figure out what this acronym meant. ;)
Googling for it lead me to gyp/dm.gyp.

BUG=None
TEST=None
R=mtklein@google.com

Review URL: https://codereview.chromium.org/638083003
2014-10-09 09:00:30 -07:00
tfarina
e37ecd7666 Remove references to out/Debug/tests executable.
This target does not exists anymore, it was folded into out/Debug/dm.
You can't do `ninja -C out/Debug tests` either anymore.

BUG=None
TEST=None
R=mtklein@google.com

Review URL: https://codereview.chromium.org/638913005
2014-10-09 08:56:55 -07:00
sugoi
9a7f29ee5e Leak fixed
BUG=skia:

Review URL: https://codereview.chromium.org/639423002
2014-10-09 08:09:04 -07:00
joshualitt
651713408c gl programs rewrite
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/07a255310aca9f3e83bf741dc663a58818ad681c

Review URL: https://codereview.chromium.org/628633003
2014-10-09 07:25:36 -07:00
caryclark
99d5915a02 rename command line flag to avoid conflict, use very verbose
TBR=
NOTRY=true
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/645573003
2014-10-09 07:08:59 -07:00
mtklein
208d1704c2 Add SkBBoxHierarchy::reserve() as an optional size hint.
I want to play around with how SkTileGrid stores its tiles.  Having a
cap on the number of insert() calls can be pretty handy.

While I'm at it, I gave flush() a default empty impl.  Like reserve(),
it's really an optional hook for subclasses.

BUG=skia:

Review URL: https://codereview.chromium.org/639933003
2014-10-09 06:49:47 -07:00
caryclark
a9c56525f3 try again to fix ios build
TBR=
NOTRY=true
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/638403002
2014-10-09 06:37:50 -07:00
caryclark
ff9fc4e4c9 fix ios build
NOTREECHECKS=true
NOTRY=true
TBR=

Review URL: https://codereview.chromium.org/641063002
2014-10-09 06:13:50 -07:00
caryclark
feff7d2d77 Draw more accurate thick-stroked Beziers (disabled)
Draw thick-stroked Beziers by computing the outset quadratic, measuring the error, and subdividing until the error is within a predetermined limit.

To try this CL out, change src/core/SkStroke.h:18 to

  #define QUAD_STROKE_APPROXIMATION 1

or from the command line: CPPFLAGS="-D QUAD_STROKE_APPROXIMATION=1" ./gyp_skia

Here's what's in this CL:

bench/BezierBench.cpp : a microbench for examining where the time is going
gm/beziers.cpp        : random Beziers with various thicknesses
gm/smallarc.cpp       : a distillation of bug skia:2769
samplecode/SampleRotateCircles.cpp : controls added for error, limit, width
src/core/SkStroke.cpp : the new stroke implementation (disabled)
tests/StrokerTest.cpp : a stroke torture test that checks normal and extreme values

The new stroke algorithm has a tweakable parameter:

  stroker.setError(1);  (SkStrokeRec.cpp:112)

The stroke error is the allowable gap between the midpoint of the stroke quadratic and the center Bezier. As the projection from the quadratic approaches the endpoints, the error is decreased proportionally so that it is always inside the quadratic curve.

An overview of how this works:
- For a given T range of a Bezier, compute the perpendiculars and find the points outset and inset for some radius.
- Construct tangents for the quadratic stroke.
- If the tangent don't intersect between them (may happen with cubics), subdivide.
- If the quadratic stroke end points are close (again, may happen with cubics), draw a line between them.
- Compute the quadratic formed by the intersecting tangents.
- If the midpoint of the quadratic is close to the midpoint of the Bezier perpendicular, return the quadratic.
- If the end of the stroke at the Bezier midpoint doesn't intersect the quad's bounds, subdivide.
- Find where the Bezier midpoint ray intersects the quadratic.
- If the intersection is too close to the quad's endpoints, subdivide.
- If the error is large proportional to the intersection's distance to the quad's endpoints, subdivide.

BUG=skia:723,skia:2769

Review URL: https://codereview.chromium.org/558163005
2014-10-09 05:36:04 -07:00
reed
5867736b08 use real pdfdevice behind SkDocument
BUG=skia:
TBR=bungeman@google.com

Review URL: https://codereview.chromium.org/645563002
2014-10-09 05:30:10 -07:00
sugoi
ce686270f5 Adding 3D lut color filter
Included in this cl is support for 3D textures.

BUG=skia:

Review URL: https://codereview.chromium.org/580863004
2014-10-09 05:27:23 -07:00
kkinnunen
9e61bb7815 Make the Sk GL context class an abstract base class
Make the Sk GL context class, SkGLNativeContext, an abstract base class. Before,
it depended on ifdefs to implement the platform dependent polymorphism.  Move
the logic to subclasses of the various platform implementations.

This a step to enable Skia embedders to compile dm and bench_pictures. The
concrete goal is to support running these test apps with Chromium command buffer.

With this change, Chromium can implement its own version of SkGLNativeContext
that uses command buffer, and host the implementation in its own repository.

Implements the above by renaming the SkGLContextHelper to SkGLContext and
removing the unneeded SkGLNativeContext. Also removes
SkGLNativeContext::AutoRestoreContext functionality, it appeared to be unused:
no use in Skia code, and no tests.

BUG=skia:2992

Committed: https://skia.googlesource.com/skia/+/a90ed4e83897b45d6331ee4c54e1edd4054de9a8

Review URL: https://codereview.chromium.org/630843002
2014-10-09 05:24:15 -07:00