Commit Graph

25334 Commits

Author SHA1 Message Date
Hal Canary
db6830162e SkImageEncoder: simplify API
(re-land 248ff02 & 2cb6cb7, with changes)

  - Hide SkImageEncoder class in private header.
  - SkImageEncoder::Type becomes SkEncodedImageFormat
  - SkEncodedFormat becomes SkEncodedImageFormat
  - SkImageEncoder static functions replaced with
    single function EncodeImage()
  - utility wrappers for EncodeImage() are in
    sk_tool_utils.h

TODO: remove link-time registration mechanism.
TODO: clean up clients use of API and flip the flag.
TODO: implement EncodeImage() in chromeium/skia/ext

Change-Id: I47d451e50be4d5c6c130869c7fa7c2857243d9f0
Reviewed-on: https://skia-review.googlesource.com/4909
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-on: https://skia-review.googlesource.com/5186
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2016-11-23 16:40:32 +00:00
Brian Osman
45580d3e30 Added GrSurfaceContext and GrTextureContext
This lets copy-to-texture to be treated like copy-to-rt.
To match current behavior, though, copies to texture are
still executed immediately (forcing a flush).

Once MDB is enabled, copies to texture will be deferred.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5093

Change-Id: Icc0ce5435507a5f0a237c22eedef879824952367
Reviewed-on: https://skia-review.googlesource.com/5093
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-11-23 15:52:27 +00:00
Mike Reed
07764cefbb make it illegal to include SkXfermode.h
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5133

Change-Id: I6e8596dcb17cd7e8efa67859bb682bf9bfcac4db
Reviewed-on: https://skia-review.googlesource.com/5133
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-11-23 15:35:45 +00:00
Greg Daniel
3761f85040 Revert "hide xfermode for g3"
This reverts commit a5b2376365.

Reason for revert: breaking google3

Original change's description:
> hide xfermode for g3
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5132
> 
> Change-Id: I374abc04856e27df718145f9ae57cc83a447ba3e
> Reviewed-on: https://skia-review.googlesource.com/5132
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> 

TBR=reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I115bc7814d6c96d897b8ae86a917ce2365c6b0b4
Reviewed-on: https://skia-review.googlesource.com/5185
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2016-11-23 15:32:39 +00:00
Eric Boren
508313064b [nobuildbot] Migrate all Linux GCE bots
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4994

Change-Id: Ib63f36b3803117d5357c8e70c572653afd151abe
Reviewed-on: https://skia-review.googlesource.com/4994
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
2016-11-23 14:49:14 +00:00
Mike Reed
a5b2376365 hide xfermode for g3
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5132

Change-Id: I374abc04856e27df718145f9ae57cc83a447ba3e
Reviewed-on: https://skia-review.googlesource.com/5132
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-11-23 14:14:02 +00:00
Ravi Mistry
badc137e3e Add Gerrit support to RecreateSKPs
Tested by modifying Canary builder to upload a CL: https://task-scheduler.skia.org/job/20161122T163246.824881948Z_00000000000039de
The above uploaded Gerrit CL: https://skia-review.googlesource.com/c/5140/

BUG=skia:5979

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4889

Change-Id: I5527c9d4219b879d5220136949704ea0fc556f85
Reviewed-on: https://skia-review.googlesource.com/4889
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2016-11-23 14:12:05 +00:00
Brian Salomon
59dc41175d Revert "Initial OpenGL Image support."
This reverts commit be34882042.

Reason for revert: Test failures and shader compilation issues on Android.

Original change's description:
> Initial OpenGL Image support.
> 
> This change along with recently landed changes is enough to make the new unit test work and not much else. imageLoad is support but not stores or any other image functions (atomics). Barriers in the shading language or the GL API are not yet hooked up.
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4182
> 
> Change-Id: I5958b7c89e40ae5ee05f7bbaca3b3738162fe5ce
> Reviewed-on: https://skia-review.googlesource.com/4182
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> 

TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I29a2502c296ae39ed9a999957800414ae46e6f0f
Reviewed-on: https://skia-review.googlesource.com/5129
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-11-23 01:02:57 +00:00
Brian Salomon
83a3b390db Revert "Disable error reporting for ImageStorageLoad until it can be debugged"
This reverts commit 7befa711d4.

Reason for revert: Needed to revert earlier CL

Original change's description:
> Disable error reporting for ImageStorageLoad until it can be debugged
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5154
> 
> Change-Id: Ie8c685441c20c85bdff22d2df5c9c4d9718203f3
> Reviewed-on: https://skia-review.googlesource.com/5154
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> 

TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I19815fcec20dc193e9155f446a3bb0be713dac63
Reviewed-on: https://skia-review.googlesource.com/5128
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-11-23 01:02:10 +00:00
Brian Salomon
7befa711d4 Disable error reporting for ImageStorageLoad until it can be debugged
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5154

Change-Id: Ie8c685441c20c85bdff22d2df5c9c4d9718203f3
Reviewed-on: https://skia-review.googlesource.com/5154
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2016-11-22 22:57:42 +00:00
Brian Salomon
be34882042 Initial OpenGL Image support.
This change along with recently landed changes is enough to make the new unit test work and not much else. imageLoad is support but not stores or any other image functions (atomics). Barriers in the shading language or the GL API are not yet hooked up.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4182

Change-Id: I5958b7c89e40ae5ee05f7bbaca3b3738162fe5ce
Reviewed-on: https://skia-review.googlesource.com/4182
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-11-22 21:35:11 +00:00
Matt Sarett
030cbd5f3c Add SkOverdrawColorFilter
Uses the value in the src alpha channel to choose how
to set the dst pixel.

This is a part of a multi-part change to detect and
display gpu overdraw on Android.

CQ_INCLUDE_TRYBOTS=master.client.skia.compile:Build-Ubuntu-GCC-x86_64-Debug-NoGPU-Trybot

BUG:32370375

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5113

Change-Id: I07040929d8a46bbadd499dccec75eebef0e11d11
Reviewed-on: https://skia-review.googlesource.com/5113
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-11-22 21:27:42 +00:00
Hal Canary
a2b4bdce8c Revert 248ff023 & 2cb6cb72
Revert "SkImageEncoder: simplify API"
This reverts commit 248ff02331.
Revert "Fix bug: can't convert nullptr -> bool"
This reverts commit 2cb6cb7218.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5151
NOTRY=true

Change-Id: I5f6414392d6545f74db0b5bb50608d04f053a8ec
Reviewed-on: https://skia-review.googlesource.com/5151
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2016-11-22 21:23:51 +00:00
Mike Klein
6b77f1cf09 4444 and gray 8
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5147
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: Id08804803b2bbeab4fa88538491e99e53d5c2efe
Reviewed-on: https://skia-review.googlesource.com/5147
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-11-22 21:23:15 +00:00
Brian Salomon
6039768963 Move GrShaderVar to an appending model for layout qualifiers
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5144

Change-Id: I05e88961e50bd679cfe5863f413f3ec65bc9fd95
Reviewed-on: https://skia-review.googlesource.com/5144
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-11-22 20:49:02 +00:00
Mike Klein
cb5338cadc Support sRGB 565.
It looks like I'm not going to be able to avoid supporting sRGB G8, I8, 565, 4444, 8888.
(A8 and F16 will always be linear.)  This fixes 565, and lays out the rest of the accum_*.

I did a little reorganization to keep things in ascending bit depth, just for sanity.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5145
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: Ib0508e5a4ee1bab2044a76bcabc367841d634cd2
Reviewed-on: https://skia-review.googlesource.com/5145
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-11-22 20:40:05 +00:00
Hal Canary
2cb6cb7218 Fix bug: can't convert nullptr -> bool
Change-Id: Ib37c46d00b6a3e768e6d8399f2a6afb332d36bff
Reviewed-on: https://skia-review.googlesource.com/5141
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2016-11-22 20:14:50 +00:00
brianosman
818d8a99e8 Handle nullptr from asTextureRef
This can fail, if the special image dimensions are larger than the maximum
allowable render target dimensions.

BUG=chromium:666519
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2520043003

Review-Url: https://codereview.chromium.org/2520043003
2016-11-22 12:03:53 -08:00
Hal Canary
e8eed323ef remove SkPixelRef::refEncodedData()
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5001

Change-Id: I15dba4f44c762ab69a23eb8a77adff5f63763e30
Reviewed-on: https://skia-review.googlesource.com/5001
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-11-22 19:47:21 +00:00
Kevin Lubick
fec1dea809 FuzzDrawFunctions from twsmith
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4979

Change-Id: Ib5cc6ea036538b611d6959c679a276050e145f57
Reviewed-on: https://skia-review.googlesource.com/4979
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-11-22 19:45:22 +00:00
Mike Klein
cb2c12b68f accum_565 and accum_f16
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5125
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: I2e338ae14db0068d9a09e16a0678dd2ee9f97efd
Reviewed-on: https://skia-review.googlesource.com/5125
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2016-11-22 19:15:39 +00:00
raftias
8daef3ebdd Fixed fuzzer issue with lut16Type A2B ICC profiles
There was no check for if a profile had gamma table with 0 elements.
Now it verifies that the table has 2-4096 entries as the ICC specs say.

BUG=667695

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5124

Change-Id: I36de202e398654ce8dd88e765455b4c4577724d2
Reviewed-on: https://skia-review.googlesource.com/5124
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Robert Aftias <raftias@google.com>
2016-11-22 19:15:02 +00:00
Matt Sarett
a16ea18216 Fix NoGPU bot
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5126

Change-Id: I34299845b6d20f219722da6a3135070369010555
Reviewed-on: https://skia-review.googlesource.com/5126
Reviewed-by: Matt Sarett <msarett@google.com>
2016-11-22 18:37:33 +00:00
Matt Sarett
22886c4935 Add SkOverdrawCanvas to detect overdraw
This is the first part of a multi-part change to detect and
display gpu overdraw on Android.

BUG:32370375

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4907

Change-Id: Ibba9d7343f2fd57397fa1168a5a5b1ef6ef91287
Reviewed-on: https://skia-review.googlesource.com/4907
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-11-22 18:27:47 +00:00
Hal Canary
248ff02331 SkImageEncoder: simplify API
- Hide SkImageEncoder class in private header.
  - SkImageEncoder::Type becomes SkEncodedImageFormat
  - SkEncodedFormat becomes SkEncodedImageFormat
  - SkImageEncoder static functions replaced with
    single function EncodeImage()
  - utility wrappers for EncodeImage() are in
    sk_tool_utils.h

TODO: remove link-time registration mechanism.
TODO: clean up clients use of API and flip the flag.
TODO: implement EncodeImage() in chromeium/skia/ext

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4909

Change-Id: Ib48b31fdc05cf23cda7f56ebfd67c841c149ce70
Reviewed-on: https://skia-review.googlesource.com/4909
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2016-11-22 18:25:55 +00:00
Mike Klein
46e66a2bf5 bilerp
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5107

Change-Id: I5c30105501cbdb57896d9ec35737494eabd5998b
Reviewed-on: https://skia-review.googlesource.com/5107
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-11-22 18:16:28 +00:00
ethannicholas
8ac838d978 added support for push_constant layout
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2187433003

Committed: https://skia.googlesource.com/skia/+/fa5f65ac61fd525029aa9dab161ffe4896c10f6d
Review-Url: https://codereview.chromium.org/2187433003
2016-11-22 08:39:36 -08:00
Greg Daniel
64773e6c9f Add support for input attachments in SkSL spirv
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5115

Change-Id: I3e03a465a10c9aff62491d0f6e71105d1b650dab
Reviewed-on: https://skia-review.googlesource.com/5115
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2016-11-22 15:31:02 +00:00
Mike Reed
71fecc32b1 don't memtion SkXfermode in public
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5070

Change-Id: Ia9527bfd0f13146669df5e71098af903e14bae3a
Reviewed-on: https://skia-review.googlesource.com/5070
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-11-22 15:22:00 +00:00
Ethan Nicholas
1fc83b131a removed appendPrecisionModifier
skslc always provides support for precision modifiers (ignoring them if
unsupported on the target platform), so the Skia appendPrecisionModifier
function was redundant.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5117

Change-Id: I4bcbd47ef8d1f4f1b055086d4c9050254584b48c
Reviewed-on: https://skia-review.googlesource.com/5117
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2016-11-22 15:04:03 +00:00
Ethan Nicholas
3605ace7dd sksl programs can now directly query GLSL caps
This adds support for querying "sk_Caps.<cap>" directly from within an SkSL program.
Combined with the existing support for collapsing 'if' statements with constant tests,
this means we can query caps using ordinary 'if' statements and the tests will 
collapse out at compile time.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4795

Change-Id: I24d716a7fe6abf1489760bf08189164264269076
Reviewed-on: https://skia-review.googlesource.com/4795
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
2016-11-22 14:20:27 +00:00
Ravi Mistry
9bcca6a212 Roll recipe DEPS
Looks like slave_build and cwd changed to start_dir in https://bugs.chromium.org/p/chromium/issues/detail?id=662586

BUG=skia:5979

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5104

Change-Id: I46d080b9089ea9b4adc2ed45fc81fdc192bdb2b2
Reviewed-on: https://skia-review.googlesource.com/5104
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2016-11-22 12:36:17 +00:00
Bruce Dawson
759ae5639b Avoid runtime initialization of FLT_EPSILON_SQRT
FLT_EPSILON_SQRT is initialized with a call to sqrt which, in release
builds on Windows, results in an initializer call (on official release
builds this is optimized away). On Windows release (all flavors)
builds this also triggers duplicate instantiations of the variable
(always a risk with non-integral const variables defined in header
files) with 32 copies ending up in both chrome.dll and chrome_child.dll.

This change avoids the run-time initializer and as a side effect it
also avoids most or all of the duplication. Section size savings in a
Windows 32-bit release official build are:

chrome.dll
     .text:   -64 bytes change
    .rdata:   -16 bytes change
     .data:  -256 bytes change
    .reloc:  -116 bytes change
Total change:  -452 bytes

chrome_child.dll
     .text:   160 bytes change
    .rdata:  -144 bytes change
     .data:  -256 bytes change
    .reloc:   -60 bytes change
Total change:  -300 bytes

A more complete fix would include using extern const to declare these
constants in the header file but define them once in a .cc file, but
it's not clear that this is necessary.

The size savings on non-official builds are greater. The increase in
the .text segment is odd, but harmless since those bytes are shared.

BUG=630755

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5061

Change-Id: I53d0cdc38e022039646df491d824a1aaf11def80
Reviewed-on: https://skia-review.googlesource.com/5061
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Bruce Dawson <brucedawson@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2016-11-21 22:48:12 +00:00
Jim Van Verth
c590341458 Add shadowrrect geometry processor
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4233

Change-Id: I637099709cfe30f7d3c1883e23840a47a7a25c10
Reviewed-on: https://skia-review.googlesource.com/4233
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-11-21 21:44:20 +00:00
raftias
71de072f99 Implemented parsing of lut8/lut16Type A2B ICC tags
SkColorSpace::NewICC() can now successfully parse lut8Type/lut16Type
A2B0 tags instead of just A2B0Type ones. It will store the resulting
information in a SkColorSpace_A2B which allows color-correct decoding
of some images which previously were not supported.

BUG=138556
BUG=574209

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4770

Change-Id: I83b565af3f39f12a4bc37e0e7968f7d41e553291
Reviewed-on: https://skia-review.googlesource.com/4770
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Robert Aftias <raftias@google.com>
2016-11-21 20:56:01 +00:00
Mike Klein
f7f883b09d Rearrange NN sampling to more naturally support bilerp.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5105

Change-Id: Ic692b5faf2d33fee31b119ff8d3653118b25b7c2
Reviewed-on: https://skia-review.googlesource.com/5105
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-11-21 20:35:10 +00:00
Greg Daniel
ab1c3a0a88 Fix include of GrGLSLCaps in SkGradientShader
NOTRY=True

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5103

Change-Id: Iff3cfa3f5e4266d85f5113de3113fdcd858ed054
Reviewed-on: https://skia-review.googlesource.com/5103
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2016-11-21 19:51:50 +00:00
csmartdalton
276cc4113a Revive geometry shaders
Fixes the bit rot that has set in for geometry shaders. They're to a
point now that we can use them again for GL experiments. Since SkSL
does not support geometry shaders yet, we pass the shader string
directly to the GL compiler for now.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5080

Change-Id: Ie3864e5559c810c682cf5f1709bdab87f033c43b
Reviewed-on: https://skia-review.googlesource.com/5080
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2016-11-21 19:29:40 +00:00
Brian Salomon
99938a8ef2 Merge GrGLSLShaderVar and GrShaderVar
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5087

Change-Id: Ib8943a1da1ea495554feaf5b0992b94fbb9539ab
Reviewed-on: https://skia-review.googlesource.com/5087
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2016-11-21 19:13:43 +00:00
robertphillips
d728f0c1a9 Defer more renderTargetContexts in the GPU image filter paths - take 2
This is a reland of https://skia-review.googlesource.com/c/4767/ (Defer more renderTargetContexts in the GPU image filter paths).
The addition of guards on instantiation && accessRenderTarget failure should prevent a reoccurence of this Nexus7 failures.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2514543002

TBR=bsalomon@google.com

Review-Url: https://codereview.chromium.org/2514543002
2016-11-21 11:05:03 -08:00
Mike Klein
43c847b7f2 Simplify shader paint alpha modulation.
We don't need to do any of this funky swap, load, srcin nonsense.  We've got a perfectly good scale_constant_float stage just perfect to be used instead.

While we're at it, we only need to modulate by paint alpha if the paint's not opaque.  x*1== x...

This puts the (x,y) inputs to shaders in (r,g) where they expect them.  It also frees (dr,dg,db,da) for use by the shader.  Might be handy for bilerp.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5100

Change-Id: Ief60c469ecac8300798b67cc68817cc1d127cf17
Reviewed-on: https://skia-review.googlesource.com/5100
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-11-21 18:52:47 +00:00
raftias
14d2899145 Fixed issue with some A2B0 images being too dark
The issue was with the A2B0 matrix not being scaled by its encoding
factor when it needed to be (for A2B0 matrices only).

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5003

Change-Id: I3f202323e137e1b014e564bd96d87c601c4748ab
Reviewed-on: https://skia-review.googlesource.com/5003
Commit-Queue: Robert Aftias <raftias@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2016-11-21 18:49:45 +00:00
Herb Derby
b44efa5120 Remove testing code for not fitting in the Footer.
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5098

Change-Id: I48df20600de302656869c4b5bd53c1105222b897
Reviewed-on: https://skia-review.googlesource.com/5098
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
2016-11-21 18:27:40 +00:00
Brian Salomon
101b844d6b Remove GrGLSLSampler type and subclasses
GrGLSLUniformManager and GrGLSLProgramDataManager subclasses handle sampler variation across GPU backends.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5002

Change-Id: I968b006bab978c2fa209d1f7eda710c298d1212f
Reviewed-on: https://skia-review.googlesource.com/5002
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-11-21 18:01:43 +00:00
Herb Derby
3502c5cc73 Use ptr diff to encode function and padding.
This drops allocation overhead from 16 bytes down to 4 bytes.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5066

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Debug-Trybot;master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-GN-Trybot

Change-Id: Id4665fd914dfb679996cefaf36fce6ef225fafb5
Reviewed-on: https://skia-review.googlesource.com/5066
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
2016-11-21 17:41:43 +00:00
Ethan Nicholas
9e1138d566 re-land of switched skslc from std::string to SkString
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5084

Change-Id: Ib21c30afc0d8483392b417e660b7fecfcc30e617
Reviewed-on: https://skia-review.googlesource.com/5084
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2016-11-21 17:14:43 +00:00
Brian Osman
e54d4cefb7 VS script: Handle variation among configurations
The script now emits a meta-solution that include all projects across
all configurations. For example, third party libraries may not be in
all configurations, or certain targets are only present in some.

Additionally, the ItemDefinitionGroup (which includes preprocessor
definitions) is included from every configuration's project file, so
syntax highlighting of inactive code works correctly.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5085

Change-Id: I241d83aea3f076365811965161fc941f82c9714c
Reviewed-on: https://skia-review.googlesource.com/5085
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-11-21 16:35:39 +00:00
Brian Salomon
8d5f9cb5e7 Add an extra pixel to the distance field path renderer bounds.
BUG=chromium:663701
BUG=skia:5989

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5086

Change-Id: Ie97f46b108f54c711c5928b11a9921be38356f8d
Reviewed-on: https://skia-review.googlesource.com/5086
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-11-21 16:23:34 +00:00
Yuqian Li
99bba9ea82 Add missing virtual functions for SkRectClipCheckBlitter
This CL is related to the issue that we tried to fix in
https://skia-review.googlesource.com/c/5078/

Specifically, SkARGB32_Blitter overrides blitAntiH2 and blitAntiV2 and
they're different from blitAntiRuns. Therefore, if
SkRectClipCheckBlitter does not override those two functions, we're
going to get different results in debug and release build.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5082

Change-Id: I7f9565d494f0a6c45ab5a06fbedb73ef233b9a1f
Reviewed-on: https://skia-review.googlesource.com/5082
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2016-11-21 15:18:37 +00:00
Brian Osman
7992da32f0 Support decoding images to multiple formats, depending on usage
Our codec generator will now preserve any asked-for color space, and
convert the encoded data to that representation. Cacherator now
allows decoding an image to both legacy (nullptr color space), and
color-correct formats. In color-correct mode, we choose the best
decoded format, based on the original properties, and our backend's
capabilities. Preference is given to the native format, when it's
already texturable (sRGB 8888 or F16 linear). Otherwise, we prefer
linear F16, and fall back to sRGB when that's not an option.

Re-land (and fix) of:
https://skia-review.googlesource.com/c/4438/
https://skia-review.googlesource.com/c/4796/

BUG=skia:5907

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4838

Change-Id: I20ff972ffe1c7e6535ddc501e2a8ab8c246e4061
Reviewed-on: https://skia-review.googlesource.com/4838
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2016-11-21 14:58:32 +00:00