Commit Graph

3703 Commits

Author SHA1 Message Date
bsalomon
f2765410ba Last round of effect->processor (for now)
R=joshualitt@google.com

Review URL: https://codereview.chromium.org/659803005
2014-10-15 18:34:46 -07:00
bungeman
8dfdfff98d Don't use 'defined' in macro expansion.
A careful reading of the preprocessor specification indicates that
any use of the 'defined' operator outside the form of 'defined X' or
'defined ( X )' directly in the constant expression of a '#if' or
'#elif' may cause undefined behavior.

In particular, msvc is very unpredictable. The 'defined X' and
'defined ( X )' forms behave differently when created from marco
expansion, with 'defined ( X )' generally evaluating to '0L'. The
'defined X' form generally behaves more the way one would expect,
but still has a number of quirks which should simply be considered
undefined behavior.

BUG=chromium:419245

Review URL: https://codereview.chromium.org/657183002
2014-10-15 13:53:55 -07:00
egdaniel
9e4d6d180f Move willUseInputColor check to computeInvariantOutput
BUG=skia:

Review URL: https://codereview.chromium.org/656503002
2014-10-15 13:49:02 -07:00
rmistry
3ac569b37a Revert of JPEG YUV Decoding (patchset #5 id:180001 of https://codereview.chromium.org/399683007/)
Reason for revert:
Caused many test bots to go red:
http://build.chromium.org/p/client.skia/builders/Test-ChromeOS-Alex-GMA3150-x86-Release/builds/22/steps/dm/logs/stdio
http://build.chromium.org/p/client.skia/builders/Test-ChromeOS-Link-HD4000-x86_64-Debug/builds/168/steps/dm/logs/stdio
http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX660-x86-Release/builds/38/steps/dm/logs/stdio

Original issue's description:
> JPEG YUV Decoding
>
> Enabling JPEG YUV Decoding in Skia
>
> BUG=skia:3005, skia:1674
>
> Committed: https://skia.googlesource.com/skia/+/8e6c3b93a39e19111662a760ede97df55e51d39f

TBR=reed@google.com,scroggo@google.com,sugoi@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:3005, skia:1674

Review URL: https://codereview.chromium.org/656163002
2014-10-15 13:15:58 -07:00
bsalomon
b762cb548b More effect->processor cleanup
R=joshualitt@google.com

Review URL: https://codereview.chromium.org/660563003
2014-10-15 11:25:21 -07:00
bsalomon
98b33ebe6f Some cleanup in processor header files.
R=joshualitt@google.com

Review URL: https://codereview.chromium.org/659803004
2014-10-15 11:05:26 -07:00
sugoi
8e6c3b93a3 JPEG YUV Decoding
Enabling JPEG YUV Decoding in Skia

BUG=skia:3005, skia:1674

Review URL: https://codereview.chromium.org/399683007
2014-10-15 11:04:18 -07:00
bsalomon
6251d17dfa Split GrFragmentProcessor into its own header
Review URL: https://codereview.chromium.org/660573002
2014-10-15 10:50:36 -07:00
bsalomon
0e08fc17e4 Push isEqual/onIsEqual down from GrProcessor to subclasses.
R=joshualitt@google.com

Review URL: https://codereview.chromium.org/654273002
2014-10-15 08:19:04 -07:00
reed
157f36d358 add tests for large cordinates bounds when building aaclip
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/658753002
2014-10-15 07:05:09 -07:00
bsalomon
e30597375c Remove uses of GrAutoScratchTexture.
Rename GrContext::lockAndRefScratchTexture to refScratchTexture.

GrSurface::writePixels returns bool instead of void.

BUG=skia:2889

Review URL: https://codereview.chromium.org/638403003
2014-10-14 11:47:22 -07:00
egdaniel
ab84fae29f Track if all stages modulate inputColor in computeInvariantOutput
BUG=skia:

Review URL: https://codereview.chromium.org/647863002
2014-10-14 06:48:46 -07:00
mtklein
148ec59001 Require SK_DECLARE_STATIC_LAZY_PTR is used in global scope.
Function- or method- local scope isn't threadsafe; the pointer is generally
zero-initialized on first use in function scope (i.e. lazily... we have to go
deeper), but for globals we can be pretty sure the linker will do that for us.

BUG=skia:

No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/651723003
2014-10-13 13:17:56 -07:00
egdaniel
ccb2e384a0 Create helper functions to use in computeInvariantOutput calls
BUG=skia:

Review URL: https://codereview.chromium.org/643743003
2014-10-13 12:53:46 -07:00
bsalomon
81beccc4fb Devirtualize read/write pixels on surface.
Consolidate read/write funcs in context.

Remove support for reading pixels from a surface that's not a target. It's currently broken and neither used nor tested.

Review URL: https://codereview.chromium.org/648863002
2014-10-13 12:32:55 -07:00
joshualitt
a5305a110a Opt state takes a GP instead of a GeometryStage
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/71856d520461ae025a0332aa0ce9735a096d9baf

Review URL: https://codereview.chromium.org/637003003
2014-10-10 17:47:00 -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
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
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
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
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
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
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
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
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
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
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
bsalomon
ac211af359 call derived ~ from GrIORef
TBR=mtklein@google.com
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/641813002
2014-10-08 12:36:54 -07:00
bsalomon
81e64484ff Remove ~GrIORef since last remaining virtual and now all inline
TBR=reed@google.com
NOTRY=true

Review URL: https://codereview.chromium.org/638003003
2014-10-08 11:42:10 -07:00
bsalomon
0f9e8a720c Revert of Use presence of a content key as non-scratch indicator (patchset #5 id:80001 of https://codereview.chromium.org/639873002/)
Reason for revert:
breaking nanobench on ubuntu

Original issue's description:
> Use presence of a content key as non-scratch indicator
>
> BUG=skia:2889
>
> Committed: https://skia.googlesource.com/skia/+/9eefe0851eeaa8ded05b4774ebcb38ed201d5dbf

TBR=robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2889

Review URL: https://codereview.chromium.org/642493003
2014-10-08 11:21:33 -07:00
bsalomon
9eefe0851e Use presence of a content key as non-scratch indicator
BUG=skia:2889

Review URL: https://codereview.chromium.org/639873002
2014-10-08 10:48:15 -07:00
bsalomon
544fe2338f Add SK_API to GrGpuResource
TBR=reed@google.com

Review URL: https://codereview.chromium.org/638963003
2014-10-08 10:24:07 -07:00
bsalomon
bcf0a52d4f GrResourceCache2 manages scratch texture.
BUG=skia:2889

Review URL: https://codereview.chromium.org/608883003
2014-10-08 08:40:09 -07:00
reed
3d7d410ce5 remove dead code from SK_SUPPORT_LEGACY_IMAGECACHE_NAME
TBR=

Review URL: https://codereview.chromium.org/638903002
2014-10-08 06:23:29 -07:00
bsalomon
10805961ce Revert of Make the Sk GL context class an abstract base class (patchset #4 id:60001 of https://codereview.chromium.org/630843002/)
Reason for revert:
nanobech failing on Android

Original issue's description:
> 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

TBR=kkinnunen@nvidia.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2992

Review URL: https://codereview.chromium.org/639793002
2014-10-08 04:45:10 -07:00
kkinnunen
a90ed4e838 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

Review URL: https://codereview.chromium.org/630843002
2014-10-08 04:14:24 -07:00
joshualitt
47bb382830 Cleanup of shader building system
this is a huge refactor and cleanup of the gl shader building system in
Skia.  The entire shader building pipeline is now part of
GrGLProgramCreator, which takes a gp, and some fps, and creates a
program.  I added some subclasses of GrGLProgram to handle the
eccentricities of Nvpr/Nvpres.  Outside of the builders folder
and GrGLPrograms, this change is basically just a rename

solo gp

BUG=skia:

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

Review URL: https://codereview.chromium.org/611653002
2014-10-07 16:43:25 -07:00
joshualitt
db0d3ca070 Revert of Cleanup of shader building system (patchset #25 id:470001 of https://codereview.chromium.org/611653002/)
Reason for revert:
Seems to have messed up windows 7 gms

Original issue's description:
> Cleanup of shader building system
>
> this is a huge refactor and cleanup of the gl shader building system in
> Skia.  The entire shader building pipeline is now part of
> GrGLProgramCreator, which takes a gp, and some fps, and creates a
> program.  I added some subclasses of GrGLProgram to handle the
> eccentricities of Nvpr/Nvpres.  Outside of the builders folder
> and GrGLPrograms, this change is basically just a rename
>
>
> solo gp
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/fe1233c3f12f81bb675718516bbb32f72af726ec

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

Review URL: https://codereview.chromium.org/635533005
2014-10-07 12:42:26 -07:00
joshualitt
fe1233c3f1 Cleanup of shader building system
this is a huge refactor and cleanup of the gl shader building system in
Skia.  The entire shader building pipeline is now part of
GrGLProgramCreator, which takes a gp, and some fps, and creates a
program.  I added some subclasses of GrGLProgram to handle the
eccentricities of Nvpr/Nvpres.  Outside of the builders folder
and GrGLPrograms, this change is basically just a rename

solo gp

BUG=skia:

Review URL: https://codereview.chromium.org/611653002
2014-10-07 12:16:36 -07:00
Brian Salomon
9323b8b8e1 Revert "GrResourceCache2 manages scratch texture."
This reverts commit d14e1a2764.
2014-10-07 15:07:38 -04:00
mtklein
fb1fe4f518 Add SkPaint::getHash().
BUG=skia:

Review URL: https://codereview.chromium.org/637583002
2014-10-07 09:26:10 -07:00
joshualitt
d909759832 Revert of gl programs rewrite (patchset #10 id:180001 of https://codereview.chromium.org/628633003/)
Reason for revert:
breaks angle bot

Original issue's description:
> gl programs rewrite
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/07a255310aca9f3e83bf741dc663a58818ad681c

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

Review URL: https://codereview.chromium.org/631183003
2014-10-07 08:37:36 -07:00
joshualitt
07a255310a gl programs rewrite
BUG=skia:

Review URL: https://codereview.chromium.org/628633003
2014-10-07 08:05:21 -07:00
bsalomon
d14e1a2764 GrResourceCache2 manages scratch texture.
BUG=skia:2889

Review URL: https://codereview.chromium.org/608883003
2014-10-07 07:27:07 -07:00
bsalomon
f80bfedc42 GrContext::copyTexture->GrContext::copySurface.
Add a flush writes pixel ops flag.

Add an explicit flush writes for GrSurface.

BUG=skia:2977

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

Review URL: https://codereview.chromium.org/622663002
2014-10-07 05:56:02 -07:00