Commit Graph

1883 Commits

Author SHA1 Message Date
Brian Osman
0d9dfe981e Supply random dst color space to asFP in unit tests
TBR=bsalomon@google.com (Testing-only API change)

BUG=skia:

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

Change-Id: I0ca26da0307848cdfc8ffaac2d042601663ab00b
Reviewed-on: https://skia-review.googlesource.com/2876
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-10-03 20:23:07 +00:00
Mike Reed
70cdb396eb Revert "Revert "replace SkXfermode obj with SkBlendMode enum in paints""
This reverts commit ce02e71758.

BUG=skia:

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

Change-Id: I86875511a13497112827cbaed1dbd7639e9e3d10
Reviewed-on: https://skia-review.googlesource.com/2878
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-03 20:02:20 +00:00
Brian Osman
e2f732f475 Start supplying random color space xforms to FP tests
Added helper to create random GrColorSpaceXforms in unit tests, and
hooked it up for the FPs that currently accept one.

BUG=skia:

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

Change-Id: Iaf93e379e405fbf745f5e0fd23b4daf017355966
Reviewed-on: https://skia-review.googlesource.com/2873
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-10-03 18:47:42 +00:00
Mike Reed
ce02e71758 Revert "replace SkXfermode obj with SkBlendMode enum in paints"
This reverts commit I4fb489ba6b3f77b458f7e4a99f79c7ad10859135.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> replace SkXfermode obj with SkBlendMode enum in paints
> 
> BUG=skia:5814
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2714
> 
> Change-Id: I4fb489ba6b3f77b458f7e4a99f79c7ad10859135
> Reviewed-on: https://skia-review.googlesource.com/2714
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> 

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

Change-Id: I3e43f79ef5c1709929663fe63cc1f67cd78270b7
Reviewed-on: https://skia-review.googlesource.com/2871
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-03 18:03:29 +00:00
Mike Reed
0591897548 replace SkXfermode obj with SkBlendMode enum in paints
BUG=skia:5814

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

Change-Id: I4fb489ba6b3f77b458f7e4a99f79c7ad10859135
Reviewed-on: https://skia-review.googlesource.com/2714
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-03 17:17:10 +00:00
Brian Osman
c68d4aa4ea Helper functions to do SkColor -> GrColor4f
I started fixing more effects and realized I needed something like this.
Wanted to land it separately. After this, I'll add the DC's cached xform
from sRGB to AsFPArgs, so that we can easily leverage this code in more
places (mostly GrConstColorProcessor, or any effect that falls back to
that based on invariants, etc...)

BUG=skia:

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

Change-Id: I335546f02a6c49620494d736140a72c14441b35d
Reviewed-on: https://skia-review.googlesource.com/2844
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-09-30 17:33:45 +00:00
jvanverth
84741b3084 Add fence support for TransferBuffers
BUG=skia:4604
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2384463003

Review-Url: https://codereview.chromium.org/2384463003
2016-09-30 08:39:03 -07:00
Mike Klein
fc6c37b981 Remove stray semicolons.
Turns out function declarations don't end in semicolons...

BUG=skia:

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

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

Change-Id: I72b56d52e1ff7fa6e89c295b0de8c46599791ebb
Reviewed-on: https://skia-review.googlesource.com/2720
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-09-27 14:04:26 +00:00
bsalomon
b58a2b4919 Stop aggregating texture/buffer access objects in GrFragmentProcessor parents.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2349243002

Review-Url: https://codereview.chromium.org/2365943003
2016-09-26 06:55:02 -07:00
bsalomon
e2e87f3484 Change implementation of flush-count based GrGpuResource purging
Change default to approx 30seconds (given some API usage assumptions)
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2361093002

Review-Url: https://codereview.chromium.org/2361093002
2016-09-22 12:42:11 -07:00
bsalomon
39ef7fb885 Add optional sw generated path coverage mask caching
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2335343008

All the bots except the painfully slow windows compiler have finished so,
NOTRY=true

Review-Url: https://codereview.chromium.org/2335343008
2016-09-21 11:16:05 -07:00
jvanverth
9d54afc38b Support use of non-coherent memory allocations in Vulkan.
BUG=skia:5034
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2348523002

Review-Url: https://codereview.chromium.org/2348523002
2016-09-20 09:20:03 -07:00
bsalomon
a624bf3d1c Stop flattening GrCoordTransforms in parent GrFragmentProcessors.
This changes moves to a model that iterates over GrCTs in a GrFP hierarchy when inserting transformations by GrGLSLPrimitiveProcessors.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339203002

Committed: https://skia.googlesource.com/skia/+/d91237ee051523f439238042674ade99207fe4a6
Review-Url: https://codereview.chromium.org/2339203002
2016-09-20 09:12:47 -07:00
reed
73603f3c52 abstract name of clipping ops, to transtion to a more restricted set
SkRegion::Op --> SkCanvas::ClipOp (alias) --> SkClipOp

pre-CL needed in chrome : https://codereview.chromium.org/2355583002/

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

Review-Url: https://codereview.chromium.org/2355483002
2016-09-20 08:42:39 -07:00
bsalomon
56b7dc476b Revert of Stop flattening GrCoordTransforms in parent GrFragmentProcessors. (patchset #3 id:40001 of https://codereview.chromium.org/2339203002/ )
Reason for revert:
Crashing blink
 https://codereview.chromium.org/2351743002/

Original issue's description:
> Stop flattening GrCoordTransforms in parent GrFragmentProcessors.
>
> This changes moves to a model that iterates over GrCTs in a GrFP hierarchy when inserting transformations by GrGLSLPrimitiveProcessors.
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339203002
>
> Committed: https://skia.googlesource.com/skia/+/d91237ee051523f439238042674ade99207fe4a6

TBR=egdaniel@google.com,robertphillips@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2351753002
2016-09-19 09:26:40 -07:00
bsalomon
d91237ee05 Stop flattening GrCoordTransforms in parent GrFragmentProcessors.
This changes moves to a model that iterates over GrCTs in a GrFP hierarchy when inserting transformations by GrGLSLPrimitiveProcessors.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339203002

Review-Url: https://codereview.chromium.org/2339203002
2016-09-19 08:36:58 -07:00
msarett
c71a9b7f53 Revert of Support Float32 output from SkColorSpaceXform (patchset #7 id:140001 of https://codereview.chromium.org/2339233003/ )
Reason for revert:
Hitting an assert

Original issue's description:
> Support Float32 output from SkColorSpaceXform
>
> * Adds Float32 support to SkColorSpaceXform
> * Changes API to allows clients to ask for F32, updates clients to
>   new API
> * Adds Sk4f_load4 and Sk4f_store4 to SkNx
> * Make use of new xform in SkGr.cpp
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339233003
> CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/43d6651111374b5d1e4ddd9030dcf079b448ec47

TBR=brianosman@google.com,mtklein@google.com,scroggo@google.com,mtklein@chromium.org,bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2347473007
2016-09-16 11:01:27 -07:00
bsalomon
faf8203ea7 Allow GrCaps access from GrDrawContext
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2348923002

Review-Url: https://codereview.chromium.org/2348923002
2016-09-16 09:53:28 -07:00
msarett
43d6651111 Support Float32 output from SkColorSpaceXform
* Adds Float32 support to SkColorSpaceXform
* Changes API to allows clients to ask for F32, updates clients to
  new API
* Adds Sk4f_load4 and Sk4f_store4 to SkNx
* Make use of new xform in SkGr.cpp

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

Review-Url: https://codereview.chromium.org/2339233003
2016-09-16 09:51:12 -07:00
bsalomon
6b2552f109 Add GrContextOptions flag to disable distance field path renderer.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339213002

Review-Url: https://codereview.chromium.org/2339213002
2016-09-15 13:50:26 -07:00
brianosman
b9c5137a1c Add storage and computation of SkColor4f version of gradient stops.
For now, we still only have the SkColor factory, but the Descriptor can
now carry either an SkColor or SkColor4f specified gradient. Base class
constructor automatically populates both forms of color, so that legacy
raster backend will continue to work, and new backend work can operate
directly from the float4 version.

On the GPU side, we have similar logic, but GrGradientEffect only
keeps one version of colors around: SkColor if the destination is
legacy, and SkColor4f (with an optional gamut xform) if the destination
is gamma correct. The 4f colors are already linear, and we gamut xform
them in setData, so gradients are now fully color-correct in sRGB and
F16 modes...

... unless there are more than three stops. Then we use a texture, and
that code path isn't handled yet. We have a few choices here (do we
use an 8-bit sRGB atlas, or just always use F16 linear atlas so we can
share it among both sRGB and wide-gamut rendering). In any case, I'd
like to defer that to a second CL.

This change does fix the non-texture gradients in the gamut GM.

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

Review-Url: https://codereview.chromium.org/2337313002
2016-09-15 11:09:45 -07:00
brianosman
5a7ae7e337 Gamut transformation of the paint color in Ganesh
Conversion from sRGB to destination gamut is going to be very common,
so I'm caching that xform (if there is one) on the draw context.

Results verified in the gamut GM (two more boxes correct).

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

Review-Url: https://codereview.chromium.org/2330553003
2016-09-12 12:07:25 -07:00
bsalomon
7312ff87f6 Remove ability to skip coord transform comparison in pipeline comparison.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2316413003

Review-Url: https://codereview.chromium.org/2316413003
2016-09-12 08:55:38 -07:00
brianosman
5192475bd8 Two changes:
1. Remove special premul handling from gamut xform code

Alpha is a constant, so the gamut transformation results remain unchanged
(it distributes across the linear matrix multiply).

2. Use SkMatrix44 rather than array of floats

Preserves semantic intention, and makes upcoming code (where we transform
colors on the CPU by that matrix) simpler.

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

Review-Url: https://codereview.chromium.org/2329553002
2016-09-12 08:50:19 -07:00
brianosman
4cea3b9e9d Push usage of GrColor4f into OverrideInput
Just a change to preserve precision.

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

Review-Url: https://codereview.chromium.org/2324553002
2016-09-08 09:33:50 -07:00
bsalomon
b77a907c2f Restructure flushing relationship between GrContext, GrDrawingManager, and GrResourceCache.
Consolidates all flush actions into GrDrawingManager and makes GrContext::flush a passthrough.

Removes the unused and untested discard flush variation.

Replaces the indirect overbudget callback mechanism of GrResourceCache with a flag set by resource cache when it wants to flush that is checked after each draw by GrDrawContext.

Modifies GrResourceCache::notifyFlushOccurred() to take a param indicating whether it triggered the
flush that just occurred.

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

Committed: https://skia.googlesource.com/skia/+/1dbb207babecdae8f1f74ed9d9900c73064df744
Review-Url: https://codereview.chromium.org/2307053002
2016-09-07 10:02:04 -07:00
brianosman
77320dbabc Add color gamut xform helpers to GrGLSLShaderBuilder
New helper functions inject the necessary shader
function. Texture lookup functions can now insert
the gamut xform at the appropriate place, too.

As written, could be used to transform non-texture
colors (e.g. vertex colors) as well.

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

Review-Url: https://codereview.chromium.org/2180803005
2016-09-07 08:09:10 -07:00
bsalomon
54dd2e244c Add Vulkan docs
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2318603002
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=2318603002

Review-Url: https://codereview.chromium.org/2318603002
2016-09-06 14:18:13 -07:00
bsalomon
5eb41fdf94 Revert of Restructure flushing relationship between GrContext, GrDrawingManager, and GrResourceCache. (patchset #4 id:60001 of https://codereview.chromium.org/2307053002/ )
Reason for revert:
Causing assertions on bots

Original issue's description:
> Restructure flushing relationship between GrContext, GrDrawingManager, and GrResourceCache.
>
> Consolidates all flush actions into GrDrawingManager and makes GrContext::flush a passthrough.
>
> Removes the unused and untested discard flush variation.
>
> Replaces the indirect overbudget callback mechanism of GrResourceCache with a flag set by resource cache when it wants to flush that is checked after each draw by GrDrawContext.
>
> Modifies GrResourceCache::notifyFlushOccurred() to take a param indicating whether it triggered the
> flush that just occurred.
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2307053002
>
> Committed: https://skia.googlesource.com/skia/+/1dbb207babecdae8f1f74ed9d9900c73064df744

TBR=robertphillips@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2312123003
2016-09-06 13:49:32 -07:00
bsalomon
1dbb207bab Restructure flushing relationship between GrContext, GrDrawingManager, and GrResourceCache.
Consolidates all flush actions into GrDrawingManager and makes GrContext::flush a passthrough.

Removes the unused and untested discard flush variation.

Replaces the indirect overbudget callback mechanism of GrResourceCache with a flag set by resource cache when it wants to flush that is checked after each draw by GrDrawContext.

Modifies GrResourceCache::notifyFlushOccurred() to take a param indicating whether it triggered the
flush that just occurred.

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

Review-Url: https://codereview.chromium.org/2307053002
2016-09-06 12:38:00 -07:00
csmartdalton
bf4a8f90c8 Improve usage of window rectangles
* Skips non-AA diff rect elements and replaces them with window
  rectangles.
* Places window rectangles in the interiors of antialiased diff rects.
* Arranges two overlapping window rectangles in a plus shape inside of
  diff rounded rects.
* Enables window rectangles when clearing and generating clip masks.

GTX 960 perf result (with vs. without window rectangles):

                              glinst4                msaa16                 gpu
keymobi_pinterest.skp         0.48 -> 0.17 [ 35%]    2.77 -> 1.49 [ 54%]    0.22 -> 0.16 [ 70%]
keymobi_digg_com.skp          0.42 -> 0.23 [ 55%]    2.34 -> 1.08 [ 46%]    0.25 -> 0.21 [ 83%]
desk_jsfiddlebigcar.skp       0.28 -> 0.16 [ 59%]    1.70 -> 0.96 [ 57%]    0.19 -> 0.14 [ 70%]
top25desk_wordpress.skp       0.45 -> 0.18 [ 40%]    2.78 -> 1.53 [ 55%]    0.21 -> 0.19 [ 94%]
top25desk_weather_com.skp     2.01 -> 1.93 [ 96%]    23.5 -> 2.54 [ 11%]    1.90 -> 1.68 [ 88%]
keymobi_blogger.skp           0.57 -> 0.37 [ 65%]    2.87 -> 1.54 [ 54%]    0.43 -> 0.33 [ 77%]
keymobi_linkedin.skp          0.32 -> 0.17 [ 51%]    1.93 -> 1.04 [ 54%]    0.17 -> 0.15 [ 91%]
keymobi_bing_com_search_...   0.29 -> 0.25 [ 83%]    1.85 -> 1.23 [ 66%]    0.50 -> 0.24 [ 48%]
keymobi_theverge_com_201...   1.00 -> 0.67 [ 68%]    9.46 -> 3.84 [ 41%]    0.72 -> 0.65 [ 90%]
keymobi_sfgate_com_.skp       1.56 -> 1.13 [ 72%]    4.49 -> 2.86 [ 64%]    1.54 -> 1.11 [ 72%]
...
GEOMEAN (All 79 blink skps)   1.04 -> 0.90 [ 86%]    4.22 -> 2.81 [ 67%]    0.95 -> 0.89 [ 94%]

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

Committed: https://skia.googlesource.com/skia/+/db42be9a326c747ff92ed1da8c3536c5b3e8e22b
Review-Url: https://codereview.chromium.org/2289363005
2016-09-06 10:01:07 -07:00
caryclark
c3bfcb803a Revert of Improve usage of window rectangles (patchset #9 id:160001 of https://codereview.chromium.org/2289363005/ )
Reason for revert:
broke build. See

https://build.chromium.org/p/client.skia/builders/Perf-Win8-MSVC-ShuttleA-GPU-GTX960-x86_64-Debug/builds/186

Original issue's description:
> Improve usage of window rectangles
>
> * Skips non-AA diff rect elements and replaces them with window
>   rectangles.
> * Places window rectangles in the interiors of antialiased diff rects.
> * Arranges two overlapping window rectangles in a plus shape inside of
>   diff rounded rects.
> * Enables window rectangles when clearing and generating clip masks.
>
> GTX 960 perf result (with vs. without window rectangles):
>
>                               glinst4                msaa16                 gpu
> keymobi_pinterest.skp         0.48 -> 0.17 [ 35%]    2.77 -> 1.49 [ 54%]    0.22 -> 0.16 [ 70%]
> keymobi_digg_com.skp          0.42 -> 0.23 [ 55%]    2.34 -> 1.08 [ 46%]    0.25 -> 0.21 [ 83%]
> desk_jsfiddlebigcar.skp       0.28 -> 0.16 [ 59%]    1.70 -> 0.96 [ 57%]    0.19 -> 0.14 [ 70%]
> top25desk_wordpress.skp       0.45 -> 0.18 [ 40%]    2.78 -> 1.53 [ 55%]    0.21 -> 0.19 [ 94%]
> top25desk_weather_com.skp     2.01 -> 1.93 [ 96%]    23.5 -> 2.54 [ 11%]    1.90 -> 1.68 [ 88%]
> keymobi_blogger.skp           0.57 -> 0.37 [ 65%]    2.87 -> 1.54 [ 54%]    0.43 -> 0.33 [ 77%]
> keymobi_linkedin.skp          0.32 -> 0.17 [ 51%]    1.93 -> 1.04 [ 54%]    0.17 -> 0.15 [ 91%]
> keymobi_bing_com_search_...   0.29 -> 0.25 [ 83%]    1.85 -> 1.23 [ 66%]    0.50 -> 0.24 [ 48%]
> keymobi_theverge_com_201...   1.00 -> 0.67 [ 68%]    9.46 -> 3.84 [ 41%]    0.72 -> 0.65 [ 90%]
> keymobi_sfgate_com_.skp       1.56 -> 1.13 [ 72%]    4.49 -> 2.86 [ 64%]    1.54 -> 1.11 [ 72%]
> keymobi_ftw_usatoday_com...   0.59 -> 0.34 [ 57%]    2.80 -> 1.54 [ 55%]    1.21 -> 1.20 [ 99%]
> keymobi_shop_mobileweb_e...   0.46 -> 0.32 [ 70%]    2.60 -> 1.26 [ 48%]    0.35 -> 0.34 [ 97%]
> keymobi_cnn_com.skp           0.68 -> 0.42 [ 63%]    3.40 -> 2.10 [ 62%]    0.49 -> 0.45 [ 93%]
> keymobi_plus_google_com_...   0.77 -> 0.46 [ 60%]    4.83 -> 3.56 [ 74%]    0.52 -> 0.46 [ 89%]
> keymobi_wordpress.skp         0.50 -> 0.40 [ 81%]    2.60 -> 1.31 [ 50%]    0.40 -> 0.37 [ 91%]
> keymobi_androidpolice_co...   0.84 -> 0.73 [ 87%]    4.15 -> 2.05 [ 49%]    0.77 -> 0.67 [ 87%]
> keymobi_online_wsj_com_h...   0.55 -> 0.43 [ 78%]    2.91 -> 1.66 [ 57%]    0.45 -> 0.41 [ 90%]
> keymobi_iphone_capitolvo...   1.18 -> 0.96 [ 81%]    6.26 -> 4.96 [ 79%]    0.95 -> 0.92 [ 97%]
> keymobi_wikipedia__1_tab...   0.46 -> 0.41 [ 89%]    2.51 -> 1.24 [ 49%]    0.40 -> 0.38 [ 95%]
> keymobi_wikipedia__1_tab...   0.46 -> 0.42 [ 90%]    2.52 -> 1.25 [ 50%]    0.40 -> 0.38 [ 96%]
> keymobi_boingboing_net.skp    0.62 -> 0.56 [ 90%]    3.15 -> 1.80 [ 57%]    0.61 -> 0.56 [ 92%]
> keymobi_cnn_com_2012_10_...   0.86 -> 0.82 [ 95%]    2.81 -> 1.50 [ 53%]    0.91 -> 0.83 [ 91%]
> top25desk_techcrunch_com...   0.61 -> 0.56 [ 92%]    3.03 -> 1.76 [ 58%]    0.62 -> 0.56 [ 91%]
> top25desk_ebay_com.skp        1.18 -> 1.08 [ 92%]    2.23 -> 1.24 [ 56%]    1.14 -> 1.09 [ 96%]
> desk_css3gradients.skp        0.64 -> 0.61 [ 95%]    2.99 -> 1.54 [ 52%]    0.62 -> 0.61 [ 99%]
> top25desk_blogger.skp         0.61 -> 0.59 [ 96%]    2.50 -> 1.37 [ 55%]    0.60 -> 0.57 [ 95%]
> keymobi_nytimes_com_.skp      0.65 -> 0.64 [ 98%]    2.69 -> 1.42 [ 53%]    0.62 -> 0.59 [ 96%]
> keymobi_wowwiki_com_worl...   0.99 -> 0.92 [ 92%]    3.46 -> 2.06 [ 60%]    0.98 -> 0.95 [ 96%]
> keymobi_cuteoverload_com...   1.37 -> 1.26 [ 92%]    3.24 -> 2.45 [ 76%]    1.38 -> 1.35 [ 98%]
> keymobi_mobile_news_sand...   0.88 -> 0.81 [ 93%]    3.50 -> 2.07 [ 59%]    0.82 -> 0.81 [100%]
> top25desk_linkedin.skp        0.87 -> 0.87 [100%]    2.92 -> 1.73 [ 59%]    0.94 -> 0.86 [ 91%]
> top25desk_docs___1_open_...   1.43 -> 1.36 [ 95%]    1.87 -> 1.42 [ 76%]    0.73 -> 0.66 [ 91%]
> keymobi_reddit_com_r_pro...   0.68 -> 0.66 [ 96%]    2.49 -> 1.23 [ 49%]    0.65 -> 0.66 [102%]
> ...
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2289363005
>
> Committed: https://skia.googlesource.com/skia/+/db42be9a326c747ff92ed1da8c3536c5b3e8e22b

TBR=bsalomon@google.com,egdaniel@google.com,robertphillips@google.com,csmartdalton@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=skia:

Review-Url: https://codereview.chromium.org/2312173002
2016-09-06 07:09:54 -07:00
robertphillips
48fde9c412 Add a makeDrawContextWithFallback that handles config fallback
This fixes a bug in find_or_create_rrect_blur_mask where an A8-based drawContext was desired but creation was failing b.c. A8 wasn't renderable.

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

Review-Url: https://codereview.chromium.org/2296193005
2016-09-06 05:20:20 -07:00
csmartdalton
db42be9a32 Improve usage of window rectangles
* Skips non-AA diff rect elements and replaces them with window
  rectangles.
* Places window rectangles in the interiors of antialiased diff rects.
* Arranges two overlapping window rectangles in a plus shape inside of
  diff rounded rects.
* Enables window rectangles when clearing and generating clip masks.

GTX 960 perf result (with vs. without window rectangles):

                              glinst4                msaa16                 gpu
keymobi_pinterest.skp         0.48 -> 0.17 [ 35%]    2.77 -> 1.49 [ 54%]    0.22 -> 0.16 [ 70%]
keymobi_digg_com.skp          0.42 -> 0.23 [ 55%]    2.34 -> 1.08 [ 46%]    0.25 -> 0.21 [ 83%]
desk_jsfiddlebigcar.skp       0.28 -> 0.16 [ 59%]    1.70 -> 0.96 [ 57%]    0.19 -> 0.14 [ 70%]
top25desk_wordpress.skp       0.45 -> 0.18 [ 40%]    2.78 -> 1.53 [ 55%]    0.21 -> 0.19 [ 94%]
top25desk_weather_com.skp     2.01 -> 1.93 [ 96%]    23.5 -> 2.54 [ 11%]    1.90 -> 1.68 [ 88%]
keymobi_blogger.skp           0.57 -> 0.37 [ 65%]    2.87 -> 1.54 [ 54%]    0.43 -> 0.33 [ 77%]
keymobi_linkedin.skp          0.32 -> 0.17 [ 51%]    1.93 -> 1.04 [ 54%]    0.17 -> 0.15 [ 91%]
keymobi_bing_com_search_...   0.29 -> 0.25 [ 83%]    1.85 -> 1.23 [ 66%]    0.50 -> 0.24 [ 48%]
keymobi_theverge_com_201...   1.00 -> 0.67 [ 68%]    9.46 -> 3.84 [ 41%]    0.72 -> 0.65 [ 90%]
keymobi_sfgate_com_.skp       1.56 -> 1.13 [ 72%]    4.49 -> 2.86 [ 64%]    1.54 -> 1.11 [ 72%]
keymobi_ftw_usatoday_com...   0.59 -> 0.34 [ 57%]    2.80 -> 1.54 [ 55%]    1.21 -> 1.20 [ 99%]
keymobi_shop_mobileweb_e...   0.46 -> 0.32 [ 70%]    2.60 -> 1.26 [ 48%]    0.35 -> 0.34 [ 97%]
keymobi_cnn_com.skp           0.68 -> 0.42 [ 63%]    3.40 -> 2.10 [ 62%]    0.49 -> 0.45 [ 93%]
keymobi_plus_google_com_...   0.77 -> 0.46 [ 60%]    4.83 -> 3.56 [ 74%]    0.52 -> 0.46 [ 89%]
keymobi_wordpress.skp         0.50 -> 0.40 [ 81%]    2.60 -> 1.31 [ 50%]    0.40 -> 0.37 [ 91%]
keymobi_androidpolice_co...   0.84 -> 0.73 [ 87%]    4.15 -> 2.05 [ 49%]    0.77 -> 0.67 [ 87%]
keymobi_online_wsj_com_h...   0.55 -> 0.43 [ 78%]    2.91 -> 1.66 [ 57%]    0.45 -> 0.41 [ 90%]
keymobi_iphone_capitolvo...   1.18 -> 0.96 [ 81%]    6.26 -> 4.96 [ 79%]    0.95 -> 0.92 [ 97%]
keymobi_wikipedia__1_tab...   0.46 -> 0.41 [ 89%]    2.51 -> 1.24 [ 49%]    0.40 -> 0.38 [ 95%]
keymobi_wikipedia__1_tab...   0.46 -> 0.42 [ 90%]    2.52 -> 1.25 [ 50%]    0.40 -> 0.38 [ 96%]
keymobi_boingboing_net.skp    0.62 -> 0.56 [ 90%]    3.15 -> 1.80 [ 57%]    0.61 -> 0.56 [ 92%]
keymobi_cnn_com_2012_10_...   0.86 -> 0.82 [ 95%]    2.81 -> 1.50 [ 53%]    0.91 -> 0.83 [ 91%]
top25desk_techcrunch_com...   0.61 -> 0.56 [ 92%]    3.03 -> 1.76 [ 58%]    0.62 -> 0.56 [ 91%]
top25desk_ebay_com.skp        1.18 -> 1.08 [ 92%]    2.23 -> 1.24 [ 56%]    1.14 -> 1.09 [ 96%]
desk_css3gradients.skp        0.64 -> 0.61 [ 95%]    2.99 -> 1.54 [ 52%]    0.62 -> 0.61 [ 99%]
top25desk_blogger.skp         0.61 -> 0.59 [ 96%]    2.50 -> 1.37 [ 55%]    0.60 -> 0.57 [ 95%]
keymobi_nytimes_com_.skp      0.65 -> 0.64 [ 98%]    2.69 -> 1.42 [ 53%]    0.62 -> 0.59 [ 96%]
keymobi_wowwiki_com_worl...   0.99 -> 0.92 [ 92%]    3.46 -> 2.06 [ 60%]    0.98 -> 0.95 [ 96%]
keymobi_cuteoverload_com...   1.37 -> 1.26 [ 92%]    3.24 -> 2.45 [ 76%]    1.38 -> 1.35 [ 98%]
keymobi_mobile_news_sand...   0.88 -> 0.81 [ 93%]    3.50 -> 2.07 [ 59%]    0.82 -> 0.81 [100%]
top25desk_linkedin.skp        0.87 -> 0.87 [100%]    2.92 -> 1.73 [ 59%]    0.94 -> 0.86 [ 91%]
top25desk_docs___1_open_...   1.43 -> 1.36 [ 95%]    1.87 -> 1.42 [ 76%]    0.73 -> 0.66 [ 91%]
keymobi_reddit_com_r_pro...   0.68 -> 0.66 [ 96%]    2.49 -> 1.23 [ 49%]    0.65 -> 0.66 [102%]
...

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

Review-Url: https://codereview.chromium.org/2289363005
2016-09-02 11:36:25 -07:00
robertphillips
13a7eee250 Flush some non-substantive Ganesh changes
Split out of: https://codereview.chromium.org/2215323003/ (Start using RenderTargetProxy (omnibus))

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

Review-Url: https://codereview.chromium.org/2299523004
2016-08-31 15:06:24 -07:00
robertphillips
1da3ecd078 Add read/write-Pixels to GrDrawContext
Although not absolutely required this does remove another case where the drawContext's backing store is accessed.

Broken out of: https://codereview.chromium.org/2215323003/ (Start using RenderTargetProxy (omnibus))

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

Review-Url: https://codereview.chromium.org/2298253002
2016-08-31 14:54:15 -07:00
robertphillips
8abb370aca Have GrSurfaceProxys and GrGpuResources draw from the same pool of unique ids
The idea here is that, for wrapped Proxy objects, we want the uniqueID to reflect that of the wrapped object. For this to work the IDs for the non-wrapped versions can't conflict with GrGpuResource's pool of IDs.

Split off of: https://codereview.chromium.org/2215323003/ (Start using RenderTargetProxy (omnibus))

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

Review-Url: https://codereview.chromium.org/2301523003
2016-08-31 14:04:06 -07:00
csmartdalton
bde96c6263 Move clip mask generation into GrReducedClip
This is a temporary solution to facilitate window rectangles and make
clip mask generation more accessible for testing. The eventual goal is
to simplify clips and merge GrReducedClip into GrClipStackClip.

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

Review-Url: https://codereview.chromium.org/2263343002
2016-08-31 12:54:46 -07:00
csmartdalton
29df76096f Define clear regions in terms of GrFixedClip
Updates clear APIs to take GrFixedClip instead of a rectangle. This
will allow us to use window rectangles with clears. Removes stencil
knobs from GrFixedClip.

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

Review-Url: https://codereview.chromium.org/2262473003
2016-08-31 11:55:52 -07:00
bsalomon
9a44565e99 Remove custom data from GrGpuResource
Chrome is no longer relying on this feature to track mailboxes for textures.

BUG=skia:4134

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

Review-Url: https://codereview.chromium.org/2291203002
2016-08-30 09:42:30 -07:00
bsalomon
fc9527a0df Add support for glDrawRangeElements
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2287003002

Review-Url: https://codereview.chromium.org/2287003002
2016-08-29 09:18:39 -07:00
bsalomon
cb31e51d93 Converts a drawPaint through a rrect clip to a drawRRect in GrDrawContext.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2271053004

Review-Url: https://codereview.chromium.org/2271053004
2016-08-26 10:48:19 -07:00
msarett
cc319b95a5 GPU implementation of drawRegion()
Nexus 6P drawregion Bench Performance
Before 48.0ms
After  3.57ms

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

Review-Url: https://codereview.chromium.org/2267273006
2016-08-25 18:07:18 -07:00
ajuma
95243ebb68 Make GrTextureStripAtlas flush pending IO on newly acquired texture
GrTextureStripAtlas uses its own lock counts to protect against
overwriting its own earlier writes, but that doesn't protect against
IO that was pending when a texture was first acquired.

BUG=chromium:637678
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2262233002

Review-Url: https://codereview.chromium.org/2262233002
2016-08-24 08:19:03 -07:00
bsalomon
4f3a0ca85d GPU implementation of drawArc.
This adds analytic shaders for filled arcs and butt-cap stroked arcs where the center point is not used.

BUG=skia:5227
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2259323003

Review-Url: https://codereview.chromium.org/2259323003
2016-08-22 13:14:26 -07:00
csmartdalton
02fa32c6d1 Move GrFixedClip into src directory
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2254343003

Review-Url: https://codereview.chromium.org/2254343003
2016-08-19 13:29:27 -07:00
msarett
10e3d9bf59 Batched implementation of drawLattice() for GPU
Bechmarks (Nexus 6P):

Src=100x100, Dst=250x250, NumRects=9
Android              77.7us
Skia (without patch) 57.2us
Skia (with patch)    30.9us

Src=100x100, Dst=500x500, NumRects=9
Android              77.0us
Skia (without patch) 56.9us
Skia (with patch)    31.8us

Src=100x100, Dst=1000x1000, NumRects=9
Android              180us
Skia (without patch) 96.8us
Skia (with patch)    70.5us

Src=100x100, Dst=250x250, NumRects=15
Android              208us
Skia (without patch) 155us
Skia (with patch)    38.2us

Src=100x100, Dst=500x500, NumRects=15
Android              207us
Skia (without patch) 152us
Skia (with patch)    38.4us

Src=100x100, Dst=1000x1000, NumRects=15
Android              233us
Skia (without patch) 156us
Skia (with patch)    99.9us

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

Committed: https://skia.googlesource.com/skia/+/93242c4ae50dfcc0d922cdb3ba80bbc7b4bbe93d
Review-Url: https://codereview.chromium.org/2255963002
2016-08-18 15:46:03 -07:00
msarett
7fc08585d0 Revert of Batched implementation of drawLattice() for GPU (patchset #7 id:180001 of https://codereview.chromium.org/2255963002/ )
Reason for revert:
Things drawing weird.

Original issue's description:
> Batched implementation of drawLattice() for GPU
>
> Bechmarks (Nexus 6P):
>
> Src=100x100, Dst=250x250, NumRects=9
> Android              77.7us
> Skia (without patch) 57.2us
> Skia (with patch)    34.7us
>
> Src=100x100, Dst=500x500, NumRects=9
> Android              77.0us
> Skia (without patch) 56.9us
> Skia (with patch)    44.5us
>
> Src=100x100, Dst=1000x1000, NumRects=9
> Android              180us
> Skia (without patch) 96.8us
> Skia (with patch)    70.5us
>
> Src=100x100, Dst=250x250, NumRects=15
> Android              208us
> Skia (without patch) 155us
> Skia (with patch)    55.9us
>
> Src=100x100, Dst=500x500, NumRects=15
> Android              207us
> Skia (without patch) 152us
> Skia (with patch)    63.0us
>
> Src=100x100, Dst=1000x1000, NumRects=15
> Android              233us
> Skia (without patch) 156us
> Skia (with patch)    99.9us
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255963002
>
> Committed: https://skia.googlesource.com/skia/+/93242c4ae50dfcc0d922cdb3ba80bbc7b4bbe93d

TBR=bsalomon@google.com,reed@google.com,djsollen@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2255683004
2016-08-18 14:29:22 -07:00
msarett
93242c4ae5 Batched implementation of drawLattice() for GPU
Bechmarks (Nexus 6P):

Src=100x100, Dst=250x250, NumRects=9
Android              77.7us
Skia (without patch) 57.2us
Skia (with patch)    34.7us

Src=100x100, Dst=500x500, NumRects=9
Android              77.0us
Skia (without patch) 56.9us
Skia (with patch)    44.5us

Src=100x100, Dst=1000x1000, NumRects=9
Android              180us
Skia (without patch) 96.8us
Skia (with patch)    70.5us

Src=100x100, Dst=250x250, NumRects=15
Android              208us
Skia (without patch) 155us
Skia (with patch)    55.9us

Src=100x100, Dst=500x500, NumRects=15
Android              207us
Skia (without patch) 152us
Skia (with patch)    63.0us

Src=100x100, Dst=1000x1000, NumRects=15
Android              233us
Skia (without patch) 156us
Skia (with patch)    99.9us

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

Review-Url: https://codereview.chromium.org/2255963002
2016-08-18 13:11:48 -07:00
robertphillips
f1c6cd7603 Rename WorseCaseSize to WorstCasSize
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2259863002

Review-Url: https://codereview.chromium.org/2259863002
2016-08-18 07:11:13 -07:00
csmartdalton
28341fad84 Implement difference clip rects with window rectangles
Plumbs the pipeline for window rectangles and uses them for a very
basic implementation of difference clip rects. This puts a common
Blink pattern on fast path, but we will still eventually need to make
more comprehensive use of window rectangles during clipping.

GTX 960 perf result:
                              gpu                     glinst4                 glinst16
desk_jsfiddlebigcar.skp       0.254 -> 0.177 [70%]    0.279 -> 0.197 [71%]    0.577 -> 0.196 [34%]
keymobi_sfgate_com_.skp       0.697 -> 0.513 [74%]    0.766 -> 0.451 [59%]    0.769 -> 0.597 [78%]
keymobi_blogger.skp           0.406 -> 0.314 [77%]    0.436 -> 0.292 [67%]    0.696 -> 0.319 [46%]
desk_pokemonwiki.skp          0.121 -> 0.098 [81%]     0.13 -> 0.105 [81%]    0.216 -> 0.097 [45%]
desk_wikipedia.skp            0.121 -> 0.098 [81%]     0.13 -> 0.104 [80%]    0.199 -> 0.104 [52%]
keymobi_androidpolice_co...   0.443 -> 0.382 [86%]    0.447 -> 0.398 [89%]    0.444 -> 0.396 [89%]
keymobi_booking_com_sear...   1 .15 ->  1.03 [90%]     1.17 ->  1.06 [91%]     1.17 ->  1.05 [90%]
keymobi_theverge_com.skp      0.417 -> 0.396 [95%]    0.426 -> 0.405 [95%]    0.429 ->   0.4 [93%]

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

Review-Url: https://codereview.chromium.org/2251573002
2016-08-17 10:00:22 -07:00
bsalomon
7f0d9f3920 Attempt to throw away rrect clips of rrects.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2241273003

Review-Url: https://codereview.chromium.org/2241273003
2016-08-15 14:49:10 -07:00
csmartdalton
d211e7875d Convert GrAppliedClip interface to builder style
GrAppliedClip was about at its limit for how many "make" functions it
could have. Window rectangles would push it over the edge. This change
makes it so GrDrawTarget supplies the original draw bounds to the
constructor, and then GrClip adds the various required clipping
techniques.

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

Review-Url: https://codereview.chromium.org/2246113002
2016-08-15 11:17:19 -07:00
brianosman
86e7626f08 Move GrAtlasTextContext to GrDrawingManager, so we only have one.
Ultimately, avoids wasteful redundant computation and storage of distance
field fake-gamma tables.

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

Review-Url: https://codereview.chromium.org/2240623002
2016-08-11 12:17:32 -07:00
bsalomon
198ca42c67 Inline fast path for GrPaint::isConstantBlendedColor when no color FPs and src-over blend.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2236423002

Review-Url: https://codereview.chromium.org/2236423002
2016-08-11 07:39:33 -07:00
csmartdalton
f9635999a4 Add flag for window rectangles to GrRenderTarget
Adds a flag to GrRenderTarget that indicates whether it can be used
with window rectangles. Also attempts to clean up some of the mixed
samples API.

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

Review-Url: https://codereview.chromium.org/2225303002
2016-08-10 11:09:07 -07:00
mtklein
3d96cb8db7 Default GR_GL_FUNCTION_TYPE to __stdcall on Windows.
Why is this configurable if we can't work without it?

Just to confirm, this is a Windows constraint, not an MSVC constraint, right?
Clang on Windows also needs __stdcall?

BUG=skia:5617
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2233883002

Review-Url: https://codereview.chromium.org/2233883002
2016-08-10 07:30:21 -07:00
csmartdalton
9bc1187249 Include EXT_window_rectangles API
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2221393004

Review-Url: https://codereview.chromium.org/2221393004
2016-08-09 12:42:47 -07:00
csmartdalton
77f2fae49e Encapsulate GrReducedClip result in class members
Updates GrReducedClip to store its result in class members instead of
various pointer arguments. This helps clean up calling code and will
make it easier to reduce the clip higher in the stack.

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

Review-Url: https://codereview.chromium.org/2222873002
2016-08-08 09:55:06 -07:00
csmartdalton
c6f411e72b Merge GrClipMaskManager into GrClipStackClip
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2196393007

Review-Url: https://codereview.chromium.org/2196393007
2016-08-05 22:32:12 -07:00
robertphillips
4fd74aec9f Move GrContext::makeDrawContext to new GrContextPriv object
We don't want external clients to be able to call the wrapping makeDrawContext. The "creating" makeDrawContext needs to be public for external image filters.

The 3 specialized drawContext creators on GrContextPriv (to wrap backend objects) are also to be kept from public use and will be used to remove SkSurface::MakeRenderTargetDirect.

Split out of: https://codereview.chromium.org/2176333002/ (Remove SkSurface::MakeRenderTargetDirect)

TBR=bsalomon@google.com

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

Review-Url: https://codereview.chromium.org/2211473002
2016-08-03 14:26:53 -07:00
bungeman
38d909ec28 Move off SK_SUPPORT_LEGACY_DATA_FACTORIES.
This moves Skia code off of SK_SUPPORT_LEGACY_DATA_FACTORIES.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2206633004

Review-Url: https://codereview.chromium.org/2206633004
2016-08-02 14:40:46 -07:00
dvonbeck
9b03e7b29d GrFP can express distance vector field req., program builder declares variable for it
This update allows fragment processors to require a field of vectors to the nearest edge. This requirement propagates:

- from child FPs to their parent
- from parent FPs to the GrPaint
- from GrPaint through the PipelineBuilder into GrPipeline
- acessed from GrPipeline by GrGLSLProgramBuilder

GrGLSL generates a variable for the distance vector and passes it down to the GeometryProcessor->emitCode() method.

This CL's base is the CL for adding the BevelNormalSource API: https://codereview.chromium.org/2080993002

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

Committed: https://skia.googlesource.com/skia/+/4ef6dfa7089c092c67b0d5ec34e89c1e319af196
Review-Url: https://codereview.chromium.org/2114993002
2016-08-01 11:01:56 -07:00
mtklein
02aed95f9c Revert of GrFP can express distance vector field req., program builder declares variable for it (patchset #20 id:370001 of https://codereview.chromium.org/2114993002/ )
Reason for revert:
UBSAN says we're reading a bad bool here:
bool usesDistanceVectorField() const { return fUsesDistanceVectorField; }

../../../include/gpu/GrPaint.h:83:51: runtime error: load of value 239, which is not a valid value for type 'bool'
SUMMARY: AddressSanitizer: undefined-behavior ../../../include/gpu/GrPaint.h:83:51 in

Seems likely also the root of Valgrind failure:
https://luci-milo.appspot.com/swarming/task/30522e4f2241cb10

Original issue's description:
> GrFP can express distance vector field req.,  program builder declares variable for it
>
> This update allows fragment processors to require a field of vectors to the nearest edge. This requirement propagates:
>
> - from child FPs to their parent
> - from parent FPs to the GrPaint
> - from GrPaint through the PipelineBuilder into GrPipeline
> - acessed from GrPipeline by GrGLSLProgramBuilder
>
> GrGLSL generates a variable for the distance vector and passes it down to the GeometryProcessor->emitCode() method.
>
> This CL's base is the CL for adding the BevelNormalSource API: https://codereview.chromium.org/2080993002
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2114993002
>
> Committed: https://skia.googlesource.com/skia/+/4ef6dfa7089c092c67b0d5ec34e89c1e319af196

TBR=egdaniel@google.com,robertphillips@google.com,bsalomon@google.com,dvonbeck@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=skia:

Review-Url: https://codereview.chromium.org/2201613002
2016-07-30 14:21:10 -07:00
csmartdalton
4c18b62a00 Add ES 3.0 fallback for instanced rendering
Adds the ability for GLInstancedRendering to use
glDrawElementsInstanced when glDrawElementsIndirect is not supported.

The only remaining 3.1 dependency now is EXT_texture_buffer.

Also moves the cap for glDraw*Instanced out of GrCaps and into
GrGLCaps.

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

Review-Url: https://codereview.chromium.org/2193303002
2016-07-29 12:19:28 -07:00
dvonbeck
4ef6dfa708 GrFP can express distance vector field req., program builder declares variable for it
This update allows fragment processors to require a field of vectors to the nearest edge. This requirement propagates:

- from child FPs to their parent
- from parent FPs to the GrPaint
- from GrPaint through the PipelineBuilder into GrPipeline
- acessed from GrPipeline by GrGLSLProgramBuilder

GrGLSL generates a variable for the distance vector and passes it down to the GeometryProcessor->emitCode() method.

This CL's base is the CL for adding the BevelNormalSource API: https://codereview.chromium.org/2080993002

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

Review-Url: https://codereview.chromium.org/2114993002
2016-07-29 09:53:56 -07:00
robertphillips
1e8761809d Remove GrContext::applyGamma
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2191323002

Review-Url: https://codereview.chromium.org/2191323002
2016-07-29 08:28:25 -07:00
csmartdalton
e0d362929d Add test configs for instanced rendering
Adds the following configs and enables them on select bots:

  glinst, glinst4, glinstdit4, glinst16, glinstdit16,
  esinst, esinst4, esinstdit4

Makes general changes to GrContextOptions, GrCaps, etc. to facilitate
this.

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

Review-Url: https://codereview.chromium.org/2182783004
2016-07-29 08:14:20 -07:00
csmartdalton
34ee0c950e Fix GrDrawContextPriv::stencilRect
Updates stencilRect to call drawNonAAFilledRect instead of
drawFilledRect. drawFilledRect can use coverage AA, which isn't
appropriate for stencil draws. Also modifies drawNonAAFilledRect to
take a "useHWAA" argument instead of trying to deduce whether it
should be used.

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

Review-Url: https://codereview.chromium.org/2187583002
2016-07-27 13:22:27 -07:00
robertphillips
6738c70242 Rename GrContext's newDrawContext & drawContext to makeDrawContext
These both return sk_sp.

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

Review-Url: https://codereview.chromium.org/2186073002
2016-07-27 12:13:51 -07:00
caryclark
d6562000ef require semi at the end of SkASSERT and friends
R=bungeman@google.com
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2185063002

Review-Url: https://codereview.chromium.org/2185063002
2016-07-27 12:02:07 -07:00
egdaniel
735109c248 Add gyp define to enable vulkan debug layers
On Debug vulkan bots, running with the debug layers on seems to be adding
more than an hour to the total running time. Since we suppress any output
on the bots anyways the debug layers are serving no purpose. Thus I am
adding a gyp define to disable the layers on the bot.

With this change, by default when running vulkan in Debug, the debug_layers
will be enabled. The bots should disable the layers. Android framework
should also have them disabled by default.

TBR=djsollen@google.com

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

Review-Url: https://codereview.chromium.org/2185953003
2016-07-27 08:03:57 -07:00
brianosman
9f97882322 Simplify color space xform storage and usage (float[] vs. SkMatrix44)
Public API is really just internal.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2185533005
TBR=bsalomon@google.com

Review-Url: https://codereview.chromium.org/2185533005
2016-07-27 05:25:26 -07:00
bsalomon
d1bdd1fcbd Use Windowing system-specific WindowContext factories.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2169543002

Review-Url: https://codereview.chromium.org/2169543002
2016-07-26 12:02:51 -07:00
robertphillips
7e92276554 Reduce usage of MakeRenderTargetDirect
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2187573002

Review-Url: https://codereview.chromium.org/2187573002
2016-07-26 11:38:17 -07:00
brianosman
9dc935fa11 Remove all usage of SkSurfaceProps::isGammaCorrect()
DrawContext's isGammaCorrect now just based on presence of color space.
Next change will remove the function and flag entirely, but I wanted to
land this separately. This alters a few GMs in srgb/f16 mode, generally
those that are creating off-screen surfaces in ways that were somewhat
lossy before. No unexplained changes.

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

Review-Url: https://codereview.chromium.org/2186633002
2016-07-26 10:21:55 -07:00
robertphillips
8c523e0f3f Move prepareForExternalIO from GrRenderTarget to GrDrawContext
This is part of the push to remove GrRenderTarget from SkGpuDevice

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

Review-Url: https://codereview.chromium.org/2182543003
2016-07-26 07:41:01 -07:00
brianosman
8fe485b793 Just pass the draw context to paint conversion
Concentrate on using draw context functionality to answer gamma and color
related queries in more places.

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

Review-Url: https://codereview.chromium.org/2182603003
2016-07-25 12:31:51 -07:00
reed
c7ec7c9cab remove/deprecate SkBitmap::getTexture, as it now always returns false
oh happy day

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

Review-Url: https://codereview.chromium.org/2175873002
2016-07-25 08:29:10 -07:00
csmartdalton
cbecb082d1 Allow GrReducedClip to take non-integer query bounds
Fixes places where AA bloat was being conflated with geometric
boundaries and updates GrReducedClip to work with non-integer query
bounds. This allows for better clip reduction with AA shared edges.

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

Review-Url: https://codereview.chromium.org/2160093002
2016-07-22 08:59:08 -07:00
bsalomon
bb24383abb Revert of Retract PipelineBuilder some more (patchset #9 id:160001 of https://codereview.chromium.org/2092893003/ )
Reason for revert:
skbug.com/5559

Original issue's description:
> Retract PipelineBuilder some more
>
> The main part of this CL is widening SkDrawContext::drawBatch's API to accept the userStencilSettings & drawFace
>
> There is some ancillary spookiness related to expanding the should_apply_coverage_aa & mustUseHWAA methods to encompass mixedSamples
>
> Calved off:
> https://codereview.chromium.org/2165283002/ (Remove DrawFace enum from GrPipelineBuilder)
> https://codereview.chromium.org/2167183002/ (Minor change to Ganesh path renderers)
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2092893003
>
> Committed: https://skia.googlesource.com/skia/+/2895eeb11a9f0d9c0018d49dd4bc45f6c6fc062c

TBR=robertphillips@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2175573004
2016-07-22 07:10:20 -07:00
brianosman
396fcdba14 Cleanup of code that converts from GPU-backed resources to SkImageInfo
Functions like GrMakeInfoFromTexture encouraged incorrect code to be
written. Similarly, the ability to construct an info from any GrSurface
was never going to be correct. Luckily, the only client of that had all
of the correct parameters much higher on the stack (and dictated or
replaced most of the properties of the returned info anyway).

With this, I can finally remove the color space as an output of the
pixel config -> color type conversion, which was never going to be
correct.

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

Review-Url: https://codereview.chromium.org/2173513002
2016-07-22 06:26:11 -07:00
brianosman
dfe4f2e4fe Add SkColorSpace to GrDrawContext
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2164363002

Review-Url: https://codereview.chromium.org/2164363002
2016-07-21 13:28:36 -07:00
robertphillips
2895eeb11a Retract PipelineBuilder some more
The main part of this CL is widening SkDrawContext::drawBatch's API to accept the userStencilSettings & drawFace

There is some ancillary spookiness related to expanding the should_apply_coverage_aa & mustUseHWAA methods to encompass mixedSamples

Calved off:
https://codereview.chromium.org/2165283002/ (Remove DrawFace enum from GrPipelineBuilder)
https://codereview.chromium.org/2167183002/ (Minor change to Ganesh path renderers)

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

Review-Url: https://codereview.chromium.org/2092893003
2016-07-21 12:04:08 -07:00
robertphillips
5fa7f30331 Remove DrawFace enum from GrPipelineBuilder
This gets GrPipelineBuilder.h out of the headers

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

Committed: https://skia.googlesource.com/skia/+/da152ebb032c61bb2561bbb3e9a78037ad174d34
Review-Url: https://codereview.chromium.org/2165283002
2016-07-21 09:21:04 -07:00
robertphillips
5d1676c751 Revert of Remove DrawFace enum from GrPipelineBuilder (patchset #2 id:20001 of https://codereview.chromium.org/2165283002/ )
Reason for revert:
No Vulkan bot in CQ :(

Original issue's description:
> Remove DrawFace enum from GrPipelineBuilder
>
> This gets GrPipelineBuilder.h out of the headers
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2165283002
>
> Committed: https://skia.googlesource.com/skia/+/da152ebb032c61bb2561bbb3e9a78037ad174d34

TBR=bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2167193002
2016-07-21 08:18:05 -07:00
robertphillips
da152ebb03 Remove DrawFace enum from GrPipelineBuilder
This gets GrPipelineBuilder.h out of the headers

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

Review-Url: https://codereview.chromium.org/2165283002
2016-07-21 07:58:41 -07:00
brianosman
dddbe380b0 Adding an SkColorSpace to SkImage_Gpu
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2165703003

Review-Url: https://codereview.chromium.org/2165703003
2016-07-20 13:55:39 -07:00
dvonbeck
c526da94e4 SkLS now accepting nullptr for diffuse shader and normal source, now accurately handling alpha
This CL's base is the CL for taking in a diffuse shader into SkLS on the API side: https://codereview.chromium.org/2064153002

BUG=skia:5502,skia:5517
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2132113002

Review-Url: https://codereview.chromium.org/2132113002
2016-07-20 11:20:30 -07:00
brianosman
54f30c13fc Introduce GrColorSpaceXform, for gamut conversion on textures
GrTextureAccess optionally includes an instance, computed from the src
and dst color spaces. In all common cases (no color space for either src
or dst, or same color space for both), no object is allocated.

This change is orthogonal to my attempts to get color space attached to
render targets - regardless of how we choose to do that, this will give
us the source color space at all points where we are connecting src to
dst.

There are many dangling injection points where I've been inserting
nullptr, but I have a record of all of them. Additionally, there are now
three places (the most common simple paths for bitmap/image rendering)
where things are plumbed enough that I expect to have access to the dst
color space (all marked with XFORMTODO).

In addition to getting the dst color space, I need to inject shader code
and uniform uploading for appendTextureLookup and friends.

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

Review-Url: https://codereview.chromium.org/2154753003
2016-07-18 10:53:52 -07:00
dvonbeck
cfc79fe9a3 Added premulFourChannelColor to GrInvariantOutput
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2148273002

Review-Url: https://codereview.chromium.org/2148273002
2016-07-14 09:02:18 -07:00
bsalomon
614d8f9a3c Remove GrWrapTextureInBitmap from public API
BUG=skia:5531
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2147053002

Review-Url: https://codereview.chromium.org/2147053002
2016-07-13 15:42:40 -07:00
egdaniel
990dbc8879 Add Texture2D and Sampler GrSLTypes
These two new types are in support of Vulkan and the ability to send
separate texture and sampler uniforms to the shader. They don't really fit
well in the current system, since the current system ties together to idea
of intended use and how to emit shader code into the same GrSLType enum.

In vulkan, I want the GrGLSLSampler object to be used as a Sampler2D, but
when appending its declaration it will emit a Texture2D and sampler object.

Our query for GrSLTypeIsSamplerType refers more to the combination of texture
and sampler and not just the sampler part. The GrSLTypeIs2DTextureType query
is for is a a SamplerType that uses Texture2Ds. My new types don't really fit
into either these categories as they are just half of the whole.

In some refactoring down the road (possibly connected with SkSL), I suggest we
split apart the concept of how we intend to use a GrGLSLSampler (Sampler2D, SamplerBuffer,
etc.), from how we actually add it to the code (sampler, texture2D, sampler2D, etc.).

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

Review-Url: https://codereview.chromium.org/2143143002
2016-07-13 14:09:31 -07:00
reed
9f01276464 move GrPixelRef headers to private (as we work to eliminate them)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2150693002

Review-Url: https://codereview.chromium.org/2150693002
2016-07-13 13:43:49 -07:00
csmartdalton
97f6cd5d0f Pre-crop filled rects to avoid scissor
Updates GrDrawContext to crop filled rects to the clip bounds before
creating batches for them. Also adds clipping logic to ignore scissor
when the draw falls completely inside. These two changes combined
reduce API traffic and improve batching.

In the future this can and should be improved by switching to floating
point clip boundaries, thus allowing us to throw out non pixel aligned
rectangle clips as well.

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

Committed: https://skia.googlesource.com/skia/+/7969838702135b9f127bd738728da61bc49b050a
Committed: https://skia.googlesource.com/skia/+/86de59f4a99b5f54be0483c60ff0335be55b2bdf
Review-Url: https://codereview.chromium.org/2132073002
2016-07-13 13:37:08 -07:00
robertphillips
dda54455a2 Remove GrLayerHoister
This relies on https://codereview.chromium.org/1944013002/ (Add legacy flag to allow Skia to remove Ganesh layer hoister) landing first so as to not break the DEPS roll.

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1950523002

Review-Url: https://codereview.chromium.org/1950523002
2016-07-13 13:27:16 -07:00
csmartdalton
485a12003a Add resource provider flag to avoid client-side buffers
On some platforms, a newly-created buffer was liable to be CPU backed.
This would break code that expected a VBO (aka instanced rendering).
This change adds an optional flag to GrResourceProvider that requires
a buffer to be created in GPU memory.

It also moves the CPU backing logic into Gr land in order to properly
cache real VBOs on platforms that prefer client-side buffers.

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

Review-Url: https://codereview.chromium.org/2143333002
2016-07-13 10:16:32 -07:00
robertphillips
59cf61ab03 Retract PipelineBuilder from GrClip::apply
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2147443004

Review-Url: https://codereview.chromium.org/2147443004
2016-07-13 09:18:21 -07:00
msarett
ba3880fa6d Revert of Pre-crop filled rects to avoid scissor (patchset #6 id:100001 of https://codereview.chromium.org/2132073002/ )
Reason for revert:
I think this is still causing a test failure on Chrome windows bots.

https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/243928/steps/cc_unittests%20%28with%20patch%29%20on%20Windows-7-SP1/logs/stdio

Original issue's description:
> Pre-crop filled rects to avoid scissor
>
> Updates GrDrawContext to crop filled rects to the clip bounds before
> creating batches for them. Also adds clipping logic to ignore scissor
> when the draw falls completely inside. These two changes combined
> reduce API traffic and improve batching.
>
> In the future this can and should be improved by switching to floating
> point clip boundaries, thus allowing us to throw out non pixel aligned
> rectangle clips as well.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2132073002
>
> Committed: https://skia.googlesource.com/skia/+/7969838702135b9f127bd738728da61bc49b050a
> Committed: https://skia.googlesource.com/skia/+/86de59f4a99b5f54be0483c60ff0335be55b2bdf

TBR=bsalomon@google.com,robertphillips@google.com,csmartdalton@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2140253004
2016-07-12 18:48:21 -07:00
csmartdalton
86de59f4a9 Pre-crop filled rects to avoid scissor
Updates GrDrawContext to crop filled rects to the clip bounds before
creating batches for them. Also adds clipping logic to ignore scissor
when the draw falls completely inside. These two changes combined
reduce API traffic and improve batching.

In the future this can and should be improved by switching to floating
point clip boundaries, thus allowing us to throw out non pixel aligned
rectangle clips as well.

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

Committed: https://skia.googlesource.com/skia/+/7969838702135b9f127bd738728da61bc49b050a
Review-Url: https://codereview.chromium.org/2132073002
2016-07-12 14:45:23 -07:00
msarett
aeadcdfbf2 Revert of Pre-crop filled rects to avoid scissor (patchset #6 id:100001 of https://codereview.chromium.org/2132073002/ )
Reason for revert:
I believe that this is breaking the roll.

https://codereview.chromium.org/2141923002

https://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/258434/steps/cc_unittests%20%28with%20patch%29%20on%20Mac-10.9/logs/stdio

Original issue's description:
> Pre-crop filled rects to avoid scissor
>
> Updates GrDrawContext to crop filled rects to the clip bounds before
> creating batches for them. Also adds clipping logic to ignore scissor
> when the draw falls completely inside. These two changes combined
> reduce API traffic and improve batching.
>
> In the future this can and should be improved by switching to floating
> point clip boundaries, thus allowing us to throw out non pixel aligned
> rectangle clips as well.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2132073002
>
> Committed: https://skia.googlesource.com/skia/+/7969838702135b9f127bd738728da61bc49b050a

TBR=bsalomon@google.com,robertphillips@google.com,csmartdalton@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2145573002
2016-07-12 05:40:39 -07:00
csmartdalton
7969838702 Pre-crop filled rects to avoid scissor
Updates GrDrawContext to crop filled rects to the clip bounds before
creating batches for them. Also adds clipping logic to ignore scissor
when the draw falls completely inside. These two changes combined
reduce API traffic and improve batching.

In the future this can and should be improved by switching to floating
point clip boundaries, thus allowing us to throw out non pixel aligned
rectangle clips as well.

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

Review-Url: https://codereview.chromium.org/2132073002
2016-07-11 14:34:12 -07:00
robertphillips
443023975e Add choke point for modifying non-AA rect draws (e.g., applying clipping)
NOTREECHECKS=true
NOPRESUBMIT=true

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

Committed: https://skia.googlesource.com/skia/+/e5e3a7a5203f256083d015c923cc9c662877aba9
Review-Url: https://codereview.chromium.org/2125333002
2016-07-08 14:43:04 -07:00
robertphillips
9a4cfa81de Revert of Add choke point for modifying non-AA rect draws (e.g., applying clipping) (patchset #6 id:100001 of https://codereview.chromium.org/2125333002/ )
Reason for revert:
problems

Original issue's description:
> Add choke point for modifying non-AA rect draws (e.g., applying clipping)
>
> NOTREECHECKS=true
> NOPRESUBMIT=true
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2125333002
>
> Committed: https://skia.googlesource.com/skia/+/e5e3a7a5203f256083d015c923cc9c662877aba9

TBR=bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2136643002
2016-07-08 13:30:04 -07:00
robertphillips
e5e3a7a520 Add choke point for modifying non-AA rect draws (e.g., applying clipping)
NOTREECHECKS=true
NOPRESUBMIT=true

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

Review-Url: https://codereview.chromium.org/2125333002
2016-07-08 12:00:07 -07:00
bsalomon
6cc9006a90 Use clipped bounds for reordering decisions
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2137543002

NOTREECHECKS=true
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2137543002
2016-07-08 11:31:23 -07:00
bsalomon
bd2bbe4a17 Don't scissor draws overlapping the render target's edges
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2135673002

Review-Url: https://codereview.chromium.org/2135673002
2016-07-08 07:36:42 -07:00
csmartdalton
a7f29640f6 Begin instanced rendering for simple shapes
Adds a module that performs instanced rendering and starts using it
for a select subset of draws on Mac GL platforms. The instance
processor can currently handle rects, ovals, round rects, and double
round rects. It can generalize shapes as round rects in order to
improve batching. The instance processor also employs new drawing
algorithms, irrespective of instanced rendering, that improve GPU-side
performance (e.g. sample mask, different triangle layouts, etc.).

This change only scratches the surface of instanced rendering. The
majority of draws still only have one instance. Future work may
include:

 * Passing coord transforms through the texel buffer.
 * Sending FP uniforms through instanced vertex attribs.
 * Using instanced rendering for more draws (stencil writes,
   drawAtlas, etc.).
 * Adding more shapes to the instance processor’s repertoire.
 * Batching draws that have mismatched scissors (analyzing draw
   bounds, inserting clip planes, etc.).
 * Bindless textures.
 * Uber shaders.

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

Committed: https://skia.googlesource.com/skia/+/42eafa4bc00354b132ad114d22ed6b95d8849891
Review-Url: https://codereview.chromium.org/2066993003
2016-07-07 08:49:11 -07:00
csmartdalton
0d28e574ac Fix caching of sample locations
The original caching logic for sample locations wishfully assumed that
the GPU would always use the same sample pattern for render targets
that had the same number of samples. It turns out we can't rely on
that. This change improves the caching logic to handle mismatched
simple patterns with the same count, and adds a unit test that
emulates different sample patterns observed on real hardware.

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

Committed: https://skia.googlesource.com/skia/+/09d49a3bfe2d1e652a648ce1ea0962b38d10d166
Review-Url: https://codereview.chromium.org/2111423002
2016-07-06 09:59:43 -07:00
robertphillips
01a19504c4 Move GrNonAAFillRectPerspectiveBatch to its own file
Get this out of the way of the upcoming changes (and add a test for it)

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

Review-Url: https://codereview.chromium.org/2108403005
2016-07-06 09:58:57 -07:00
ksakamoto
ec7f2ac728 Revert of Begin instanced rendering for simple shapes (patchset #20 id:380001 of https://codereview.chromium.org/2066993003/ )
Reason for revert:
This caused static initializer regressions in Chromium (crbug.com/625728).

Relevant build logs here:
Linux:
https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/21849

Mac:
https://build.chromium.org/p/chromium/builders/Mac/builds/17350

Relevant lines from the error log:
Linux:
# InstanceProcessor.cpp GrUniqueKey::GenerateDomain()
# InstanceProcessor.cpp gr_instanced::kShapeBufferDomain
FAILED linux-release-64/sizes/nacl_helper-si/initializers: actual 8, expected 7, better lower
FAILED linux-release-64/sizes/chrome-si/initializers: actual 8, expected 7, better lower

Mac:
FAILED mac-release/sizes/chrome-si/initializers: actual 2, expected 0, better lower

Original issue's description:
> Begin instanced rendering for simple shapes
>
> Adds a module that performs instanced rendering and starts using it
> for a select subset of draws on Mac GL platforms. The instance
> processor can currently handle rects, ovals, round rects, and double
> round rects. It can generalize shapes as round rects in order to
> improve batching. The instance processor also employs new drawing
> algorithms, irrespective of instanced rendering, that improve GPU-side
> performance (e.g. sample mask, different triangle layouts, etc.).
>
> This change only scratches the surface of instanced rendering. The
> majority of draws still only have one instance. Future work may
> include:
>
>  * Passing coord transforms through the texel buffer.
>  * Sending FP uniforms through instanced vertex attribs.
>  * Using instanced rendering for more draws (stencil writes,
>    drawAtlas, etc.).
>  * Adding more shapes to the instance processor’s repertoire.
>  * Batching draws that have mismatched scissors (analyzing draw
>    bounds, inserting clip planes, etc.).
>  * Bindless textures.
>  * Uber shaders.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2066993003
>
> Committed: https://skia.googlesource.com/skia/+/42eafa4bc00354b132ad114d22ed6b95d8849891

NOTREECHECKS=true
TBR=bsalomon@google.com,egdaniel@google.com,robertphillips@google.com,csmartdalton@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=skia:

Review-Url: https://codereview.chromium.org/2123693002
2016-07-05 03:54:53 -07:00
rmistry
42e6798696 Revert of Fix caching of sample locations (patchset #3 id:40001 of https://codereview.chromium.org/2111423002/ )
Reason for revert:
Seems to be causing Chromium roll failures:
* https://codereview.chromium.org/2120373003
* https://codereview.chromium.org/2117193002
* https://codereview.chromium.org/2124653002

Original issue's description:
> Fix caching of sample locations
>
> The original caching logic for sample locations wishfully assumed that
> the GPU would always use the same sample pattern for render targets
> that had the same number of samples. It turns out we can't rely on
> that. This change improves the caching logic to handle mismatched
> simple patterns with the same count, and adds a unit test that
> emulates different sample patterns observed on real hardware.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2111423002
>
> Committed: https://skia.googlesource.com/skia/+/09d49a3bfe2d1e652a648ce1ea0962b38d10d166

TBR=bsalomon@google.com,csmartdalton@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2120403002
2016-07-04 17:45:06 -07:00
csmartdalton
09d49a3bfe Fix caching of sample locations
The original caching logic for sample locations wishfully assumed that
the GPU would always use the same sample pattern for render targets
that had the same number of samples. It turns out we can't rely on
that. This change improves the caching logic to handle mismatched
simple patterns with the same count, and adds a unit test that
emulates different sample patterns observed on real hardware.

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

Review-Url: https://codereview.chromium.org/2111423002
2016-07-04 15:55:17 -07:00
csmartdalton
42eafa4bc0 Begin instanced rendering for simple shapes
Adds a module that performs instanced rendering and starts using it
for a select subset of draws on Mac GL platforms. The instance
processor can currently handle rects, ovals, round rects, and double
round rects. It can generalize shapes as round rects in order to
improve batching. The instance processor also employs new drawing
algorithms, irrespective of instanced rendering, that improve GPU-side
performance (e.g. sample mask, different triangle layouts, etc.).

This change only scratches the surface of instanced rendering. The
majority of draws still only have one instance. Future work may
include:

 * Passing coord transforms through the texel buffer.
 * Sending FP uniforms through instanced vertex attribs.
 * Using instanced rendering for more draws (stencil writes,
   drawAtlas, etc.).
 * Adding more shapes to the instance processor’s repertoire.
 * Batching draws that have mismatched scissors (analyzing draw
   bounds, inserting clip planes, etc.).
 * Bindless textures.
 * Uber shaders.

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

Review-Url: https://codereview.chromium.org/2066993003
2016-06-30 12:15:49 -07:00
egdaniel
ab527a5bbf Enable many more tests for Vulkan
BUG=skia:5461
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2103133002

Review-Url: https://codereview.chromium.org/2103133002
2016-06-28 08:07:26 -07:00
csmartdalton
c411f2d963 Add a GL cap for instanced rendering to floating point
We have observed on OS X that instanced draws don't always behave
correctly when the framebuffer is floating point.

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

Review-Url: https://codereview.chromium.org/2095183002
2016-06-27 09:29:07 -07:00
brianosman
a4535a34d1 GrColor4f is yet another 4f color type, unfortunately.
- Sk4f would be my choice, but it's not allowed in include/
- SkColor4f and SkPM4f are specified to be unpremultiplied/premultiplied, whereas GrColor (and GrColor4f) are either, depending on context.

This adds 12 bytes to GrPaint. Not sure if we want to pay that price. The precision loss for a single value (vs. in a gradient, etc...) may not justify changing the storage type here. Easy enough to back that part out, while still keeping the 4f intermediate type for the helper math that it adds, and for storage and parameter passing in other locations.

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

Review-Url: https://codereview.chromium.org/2088303002
2016-06-24 12:50:19 -07:00
brianosman
b109b8c5ec Lots of progress on switching to SkColorSpace rather than SkColorProfileType
Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld).

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

Committed: https://skia.googlesource.com/skia/+/6a61a875467646f8dbc37cfecf49e12d1f475170
Review-Url: https://codereview.chromium.org/2069173002
2016-06-16 13:03:24 -07:00
brianosman
ab8241880d Revert of Lots of progress switching to SkColorSpace rather than SkColorProfileType (patchset #10 id:180001 of https://codereview.chromium.org/2069173002/ )
Reason for revert:
Mac crashes in GrUploadPixmapToTexture

Original issue's description:
> Lots of progress on switching to SkColorSpace rather than SkColorProfileType
>
> Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld).
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2069173002
>
> Committed: https://skia.googlesource.com/skia/+/6a61a875467646f8dbc37cfecf49e12d1f475170

TBR=reed@google.com,herb@google.com,msarett@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2072813002
2016-06-16 11:41:44 -07:00
brianosman
6a61a87546 Lots of progress on switching to SkColorSpace rather than SkColorProfileType
Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld).

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

Review-Url: https://codereview.chromium.org/2069173002
2016-06-16 11:10:04 -07:00
jvanverth
6b6ffc4ab6 Create free list heap for suballocation
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2029763002

Review-Url: https://codereview.chromium.org/2029763002
2016-06-13 14:28:07 -07:00
brianosman
fe19987e54 Better (?) interface for controlling sRGB-ness of mipmaps on GrTexture
Switch to new SkSourceGammaTreatment type. Move to a separate setter,
rather than an optional argument to dirty. Set the flag correctly after
uploading CPU-built mips.

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

Review-Url: https://codereview.chromium.org/2058143002
2016-06-13 07:59:48 -07:00
csmartdalton
2b5f2cbf0d Move multisampleDisableSupport into GrCaps
Non-platform code needs this information in order to make rendering
decisions.

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

Review-Url: https://codereview.chromium.org/2062443002
2016-06-10 14:06:32 -07:00
csmartdalton
739bbb2dad Fix glDraw*Indirect prototypes
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2050403002

Review-Url: https://codereview.chromium.org/2050403002
2016-06-09 19:42:38 -07:00
brianosman
9a3fbf7e55 Add control of manual mipmapping to GrContextOptions
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2054623003

Committed: https://skia.googlesource.com/skia/+/97e398d98928f9497063594ebe633efe2d0f4968
Review-Url: https://codereview.chromium.org/2054623003
2016-06-09 13:11:08 -07:00
mtklein
e239547269 Revert of Add control of manual mipmapping to GrContextOptions (patchset #2 id:20001 of https://codereview.chromium.org/2054623003/ )
Reason for revert:
https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Debug-ASAN/builds/3481/steps/test_skia%20on%20Ubuntu/logs/stdio

../../../src/gpu/gl/GrGLCaps.cpp:554:25: runtime error: load of value 187, which is not a valid value for type 'bool'
SUMMARY: AddressSanitizer: undefined-behavior ../../../src/gpu/gl/GrGLCaps.cpp:554:25 in
step returned non-zero exit code: 1

Original issue's description:
> Add control of manual mipmapping to GrContextOptions
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2054623003
>
> Committed: https://skia.googlesource.com/skia/+/97e398d98928f9497063594ebe633efe2d0f4968

TBR=bsalomon@google.com,brianosman@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2050373002
2016-06-09 12:20:10 -07:00
brianosman
97e398d989 Add control of manual mipmapping to GrContextOptions
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2054623003

Review-Url: https://codereview.chromium.org/2054623003
2016-06-09 09:39:58 -07:00
bungeman
06ca8ec87c sk_sp for Ganesh.
Convert use of GrFragmentProcessor, GrGeometryProcessor, and
GrXPFactory to sk_sp. This clarifies ownership and should
reduce reference count churn by moving ownership.

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

Review-Url: https://codereview.chromium.org/2041113004
2016-06-09 08:01:03 -07:00
csmartdalton
ecbc12b1c1 Replace targetHasUnifiedMultisampling in GrPB constructor
Replaces targetHasUnifiedMultisampling with a simpler "useHWAA". Now
the code that creates a pipeline builder needs to decide on its own
whether it should enable multisampling, rather than relying on the
builder to try and guess.

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

Review-Url: https://codereview.chromium.org/2041283002
2016-06-08 10:08:43 -07:00
halcanary
4dbbd04314 SkLeanWindows.h: #include "Windows.h" fewer places
$ git grep -l '<windows.h>' include src
    include/private/SkLeanWindows.h

    $ git grep -l SkLeanWindows.h | grep '\.h$'
    include/ports/SkTypeface_win.h
    include/utils/win/SkHRESULT.h
    include/utils/win/SkTScopedComPtr.h
    include/views/SkEvent.h
    src/core/SkMathPriv.h
    src/ports/SkTypeface_win_dw.h
    src/utils/SkThreadUtils_win.h
    src/utils/win/SkWGL.h

The same for  `#include <intrin.h>` that was found in SkMath.h.
Those functions that needed it are moved to SkMathPriv.h.

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

CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_chromium_compile_dbg_ng,win_chromium_compile_rel_ng

Review-Url: https://codereview.chromium.org/2041943002
2016-06-07 17:21:10 -07:00
brianosman
982eb7f377 Add new SkSourceGammaTreatment enum, used in situations like mipmap construction, where we need to know if we should respect (vs. ignore) the gamma encoding of sRGB tagged images. Plumb that extensively.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2037413002

Review-Url: https://codereview.chromium.org/2037413002
2016-06-06 13:10:58 -07:00
robertphillips
55fdcccf01 Remove GrRenderTarget from GrPipelineBuilder
This used to be "Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder"

but has been split into:
https://codereview.chromium.org/1993263002/ (Make GrAppliedClip friendless)
https://codereview.chromium.org/1997773002/ (Retract GrRenderTarget from GLProgramsTest)
https://codereview.chromium.org/1993403002/ (GrSWMaskHelper and GrSoftwarePathRenderer only need the textureProvider (not GrContext))
https://codereview.chromium.org/2004433002/ (Retract GrRenderTarget from GrTestTarget)
https://codereview.chromium.org/2015333002/ (Change parameters to GrPipelineBuilder's ctor)
https://codereview.chromium.org/2035823002/ (Make GrClipMaskManager stateless and push GrPipelineBuilder construction downstack)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1988923002

Review-Url: https://codereview.chromium.org/1988923002
2016-06-06 06:16:21 -07:00
robertphillips
976f5f0dc5 Make GrClipMaskManager stateless and push GrPipelineBuilder construction downstack
This will be followed up with a CL to remove the GrRenderTarget from the GrPipelineBuilder.

Split out of:
https://codereview.chromium.org/1988923002/ (Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder)

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

Review-Url: https://codereview.chromium.org/2035823002
2016-06-03 10:59:20 -07:00
csmartdalton
1897cfd7a6 Abandon offset support with texel buffers
We don't seem to require nonzero offsets for texel buffers at this
point in time, and requiring this feature greatly reduces the number
of desktop clients that can use texel buffers. If we find a use for
offsets later we can always add it back as a separate feature.

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

Review-Url: https://codereview.chromium.org/2036953002
2016-06-03 08:50:54 -07:00
csmartdalton
5cebf8c82d Support ARB extensions for indirect drawing
Adds support for the ARB extensions and fixes incorrect logic that was
being used on the GL version for indirect drawing.

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

Review-Url: https://codereview.chromium.org/2038743002
2016-06-03 08:28:47 -07:00
brianosman
33f6b3f6ee Manually generated sRGB mipmaps, with successively smaller draws.
Dirty GL-generated mipmaps whenever an sRGB texture is used with a new
value for TEXTURE_SRGB_DECODE. Add a new test rectangle to the gamma GM
that tests that textures are correctly converted to linear before
filtering when generating mipmaps.

Added a new unit test that alternates how a texture is interpreted (sRGB
or not), to verify that we rebuild mipmaps when needed, and that we get
the correct results out in both modes.

This test originally failed on four of our bots producing incorrect mips
in three different ways. I'm not real surprised, but it looks like
we can't rely on glGenerateMipmap to do the right thing, in conjunction
with TEXTURE_SRGB_DECODE.

Instead, actually create mip-chains using a series of draw calls.
(My first attempt used glBlitFramebuffer, and that still had bugs on
several bots). This approach appears to work correctly on any device
that fully supports sRGB.

Because the mipmap draws are fairly destructive to state, I had to
hoist them out of bindTexture. That means adding a second pass over
the texture accesses in the processor, at the very beginning of flush.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1840473002

Review-Url: https://codereview.chromium.org/2007973002
2016-06-02 05:49:21 -07:00
jvanverth
1e305ba0d6 Add offset to memory allocations
This is setting up for suballocations within one large
allocation

BUG=skia:5031
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2018933004
TBR=bsalomon@google.com

Review-Url: https://codereview.chromium.org/2018933004
2016-06-01 09:39:15 -07:00
brianosman
a167e74b4b Remove sRGB overrides on GrTextureParams. Use GrPaint flags instead.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2002253002

Review-Url: https://codereview.chromium.org/2002253002
2016-05-24 06:18:48 -07:00
jvanverth
1d15596200 Add Xlib support to viewer
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=1999213002

Review-Url: https://codereview.chromium.org/1999213002
2016-05-23 13:13:36 -07:00
robertphillips
87f15c8ff1 Retract GrRenderTarget from GrTestTarget
Split out of: https://codereview.chromium.org/1988923002/ (Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=2004433002

Review-Url: https://codereview.chromium.org/2004433002
2016-05-20 11:14:33 -07:00
robertphillips
82ec6e59b8 Retract GrRenderTarget from GLProgramsTest
Split out of https://codereview.chromium.org/1988923002/ (Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1997773002

Review-Url: https://codereview.chromium.org/1997773002
2016-05-19 14:01:05 -07:00
robertphillips
5f2fa47a6e Make GrAppliedClip friendless
GrAppliedClip is a pretty amiable class but not so good about setting boundaries. It is probably for the best that it breaks things off with GrClipMaskManager before the drama of https://codereview.chromium.org/1988923002/ (Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder) begins.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1993263002

Review-Url: https://codereview.chromium.org/1993263002
2016-05-19 11:36:25 -07:00
brianosman
7888f780d8 Set the "mutable format" bit on sRGB images at creation time.
This allows us to later create an image view with a linear format, for
legacy-mode non-sRGB access.

No actual API change (just a comment change in public header).

TBR=bsalomon@google.com
BUG=skia:5308
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1981333004

Review-Url: https://codereview.chromium.org/1981333004
2016-05-17 11:47:32 -07:00
robertphillips
ca6eafc0f7 (Mostly) Retract GrRenderTarget from SkGpuDevice
This gets us most of the way to having SkGpuDevice exclusively use a GrDrawContext instead of a GrRenderTarget. There are a few other refactorings (e.g., rm need for fLegacyBitmap and accessRenderTarget) before the GrRenderTarget can be completely removed.

Has calved off:
https://codereview.chromium.org/1925313002/ (Tighten up SkSpecialSurface factory functions)
https://codereview.chromium.org/1925803004/ (Add sk_sp to SkSurface_Gpu and SkGpuDevice)
https://codereview.chromium.org/1956473002/ (Retract GrRenderTarget a bit within SkGpuDevice)
https://codereview.chromium.org/1979913002/ (Rename GrDrawingMgr::abandon to wasAbandoned & add a matching entry point to GrDrawingContext)
https://codereview.chromium.org/1982583002/ (Add isUnifiedMultisampled entry point to GrDrawContext)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1930013002

Review-Url: https://codereview.chromium.org/1930013002
2016-05-17 09:57:46 -07:00
robertphillips
071457b7fc Add isUnifiedMultisampled entry point to GrDrawContext
GrRenderTargetProxy supports the isUnifiedMultisampled call so GrDrawContext will be able to support it even when GrRenderTargetProxy-backed.

This is split out of: https://codereview.chromium.org/1930013002/ ((Mostly) Retract GrRenderTarget from SkGpuDevice)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1982583002

Review-Url: https://codereview.chromium.org/1982583002
2016-05-16 09:50:03 -07:00
robertphillips
7761d61876 Rename GrDrawingMgr::abandon to wasAbandoned & add a matching entry point to GrDrawingContext
Since GrDrawingContext is generally replacing GrRenderTarget, this is to provide functionality similar to GrRenderTarget::wasDestroyed.

This is split out of https://codereview.chromium.org/1930013002/ ((Mostly) Retract GrRenderTarget from SkGpuDevice)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1979913002

Review-Url: https://codereview.chromium.org/1979913002
2016-05-16 09:14:53 -07:00
egdaniel
b2df0c2702 Refactor Vulkan image, texture, RTs so that create and getter handles match.
This allows allows us to track and notify clients when either side changes
and image layout.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1974983002

Review-Url: https://codereview.chromium.org/1974983002
2016-05-13 11:30:37 -07:00
robertphillips
e576874b16 Retract GrRenderTarget a bit within SkGpuDevice
Split off of: https://codereview.chromium.org/1930013002/ ((Mostly) Retract GrRenderTarget from SkGpuDevice)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1956473002

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

Review-Url: https://codereview.chromium.org/1956473002
2016-05-13 11:20:46 -07:00
cdalton
846c051a48 Convert GrClip to an abstract base class
Converts GrClip to an abstract base class and adds a "GrFixedClip"
implementation. GrFixedClip denotes a clip implemented with fixed-
function hardware. GrFixedClip allows us to remove the stateful
"fClipMode" member from GrClipMaskManager, and in the future will
be able to nicely encapsulate window rectangles.

After this change GrClipMaskManager is just a wrapper around
GrDrawTarget. We may want to consider removing it altogether.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1971343002

Review-Url: https://codereview.chromium.org/1971343002
2016-05-13 10:25:00 -07:00
robertphillips
9837740dd5 Simplify GrSWMaskHelper
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1974943002

Review-Url: https://codereview.chromium.org/1974943002
2016-05-13 05:47:23 -07:00