Commit Graph

631 Commits

Author SHA1 Message Date
Robert Phillips
96be9df130 Revert "Reduce dependence on GrSurface's origin field"
This reverts commit 467022b186.

Reason for revert: GrAHardwareBufferImageGenerator.cpp

Original change's description:
> Reduce dependence on GrSurface's origin field
> 
> Unfortunately, GrGPU and its ilk are still using the GrSurface's origin a lot. I will clean that up in a second CL.
> 
> Change-Id: Iba729440ce8ea8d24bb7f4e5de55ed576a0f176d
> Reviewed-on: https://skia-review.googlesource.com/24700
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: I1b3f5c3b82d250ac164beb1d5c83abb6c3c6ab3b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/25620
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-07-21 14:17:54 +00:00
Robert Phillips
467022b186 Reduce dependence on GrSurface's origin field
Unfortunately, GrGPU and its ilk are still using the GrSurface's origin a lot. I will clean that up in a second CL.

Change-Id: Iba729440ce8ea8d24bb7f4e5de55ed576a0f176d
Reviewed-on: https://skia-review.googlesource.com/24700
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-07-21 14:05:33 +00:00
Robert Phillips
39f1a9589b Revert "Add initial version of GrResourceAllocator's free pool"
This reverts commit 6ec9a4ffe4.

Reason for revert: Maybe breaking iOS bots

Original change's description:
> Add initial version of GrResourceAllocator's free pool
> 
> Change-Id: Ibd60303ffb1d3ea814dad0cee3a521f94da63ca8
> Reviewed-on: https://skia-review.googlesource.com/24262
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: I0195f64503a6f2f7b416f75b57fb9141e5b9f796
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/25540
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-07-21 12:15:14 +00:00
Robert Phillips
6ec9a4ffe4 Add initial version of GrResourceAllocator's free pool
Change-Id: Ibd60303ffb1d3ea814dad0cee3a521f94da63ca8
Reviewed-on: https://skia-review.googlesource.com/24262
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-07-21 11:37:23 +00:00
Brian Salomon
c5886036cb Move GrTypesPriv.h to include/private
Bug: skia:
Change-Id: I68610fed67a70454a815229c47b78ea6d9463a43
Reviewed-on: https://skia-review.googlesource.com/24624
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-19 17:16:14 +00:00
Robert Phillips
5af44defbd Add GrResourceAllocator class + unit test
Change-Id: I2700e8cb4213479b680519ba67f078cc3fb71376
Reviewed-on: https://skia-review.googlesource.com/23661
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-07-19 11:43:54 +00:00
Robert Phillips
590533f066 Plumb raw GrMipLevel* down instead of SkTArray<GrMipLevel> in GrGpu
Change-Id: I34033b6ecb469458eb820cbc01aad8c7bb876312
Reviewed-on: https://skia-review.googlesource.com/22212
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-07-12 11:40:15 +00:00
Robert Phillips
8e8c755f56 Move GrResourceProvider::createMipMappedTexture to GrSurfaceProxy::MakeDeferredMipMap
Although this adds a new method to GrResourceProvider, it is a slight improvement in that it removes some GrProxy stuff from GrResourceProvider (which arguably should only deal in GrSurface-derived classes).

Bug: skia:
Change-Id: I6d097ed178cd2aa5662770a164135bf2553b80e6
Reviewed-on: https://skia-review.googlesource.com/22023
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-07-11 13:23:41 +00:00
Brian Salomon
8fe24272fa Add mock config to tools and run through gms and benchs without crashing.
Change-Id: I7e2474129ef2b15899ad2baeb8d18f39d05da98c
Reviewed-on: https://skia-review.googlesource.com/21820
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-07-07 20:47:38 +00:00
Robert Phillips
159e3c6c92 Fix MDB regression
This CL: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler)) introduced a perf regression.

Cached textures can appear in different GrSurfaceProxies but have the same underlying GrTexture. 

Bug: 729233

Change-Id: Ifd7a9260a8a4535e8440c0d837bfdc445a921aa4
Reviewed-on: https://skia-review.googlesource.com/20223
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-19 16:40:43 +00:00
Brian Salomon
610842af9e Make SkTArray maintain reserve count
Bug: skia:6690
Change-Id: I01f5bb56c654f513365d6ce9f19712d9be07a08d
Reviewed-on: https://skia-review.googlesource.com/20055
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
2017-06-16 12:17:19 +00:00
Robert Phillips
c4f0a8245c Move Flags from GrRenderTarget to GrTypesPriv.h & rename
The motivation for this is to prevent GrRenderTarget.h appearing in GrRenderTargetProxy.h

Change-Id: I4ef126972c0780cbacb35fa2aa6290777c66eddf
Reviewed-on: https://skia-review.googlesource.com/19521
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-13 13:12:17 +00:00
Robert Phillips
db4062038c Re-enable deferred proxies in Chrome
Change-Id: I6dad0c1d3ff9f81e13625988b00c3f844128d7e7
Reviewed-on: https://skia-review.googlesource.com/19446
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-12 15:59:47 +00:00
Robert Phillips
d9d84858bf Retract GrTexture.h a bit
This began as cleaning up SkSpecialImage.h & spiraled out of control from there.

Change-Id: I9a570ecd2a7af9ee724ebfebe4e9185748f38bbc
Reviewed-on: https://skia-review.googlesource.com/19290
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-09 17:29:09 +00:00
Jim Van Verth
34d6e4b09f Add tonal color support for shadows.
Bug: skia:
Change-Id: Ib9bd9083da1d8a9fa90ae7c710386e6903541fd5
Reviewed-on: https://skia-review.googlesource.com/18148
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-06-09 17:18:58 +00:00
Mike Reed
89c8fecb62 move SkPathRef.h into private
Bug: skia:
Change-Id: I3370c594301ae833ec1fe3cb16ac544e5b2128e8
Reviewed-on: https://skia-review.googlesource.com/18982
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-07 15:24:46 +00:00
Robert Phillips
eee4d6e4e8 Make instantiate return a Boolean
From an off-line conversation:
The longer term idea will be to create a helper class isolates the
ability to instantiate proxies until flush time. The peek* methods
could then be moved to GrSurfaceProxy.

Change-Id: I8e8c02c098475b77d515791c0d6b81f7e4a327dd
Reviewed-on: https://skia-review.googlesource.com/18076
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-05 14:03:10 +00:00
Robert Phillips
8bf1f9ffcf Disable deferred proxies for M60 branch
Bug: 720325
Change-Id: I0529bbcd592bdc5d5a741731af8a66971e485649
Reviewed-on: https://skia-review.googlesource.com/18239
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-31 23:12:39 +00:00
Brian Salomon
d17b4a678b Revert "Revert "Add a flag to GrSurfaceFlags that requires the texture to be cleared upon creation. ""
This reverts commit a9e795eab5.

Bug: skia:
Change-Id: Ibfc51497ae99f332f8f72a799393a1b2996f7f3f
Reviewed-on: https://skia-review.googlesource.com/17767
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-23 21:38:38 +00:00
Brian Salomon
a9e795eab5 Revert "Add a flag to GrSurfaceFlags that requires the texture to be cleared upon creation. "
This reverts commit 45e5068a6d.

Reason for revert: :'(

Original change's description:
> Add a flag to GrSurfaceFlags that requires the texture to be cleared upon creation. 
> 
> Bug: chromium:656320
> 
> Change-Id: I940bfa24540516ab83a2ed52f761b96eb6ad19f1
> Reviewed-on: https://skia-review.googlesource.com/17391
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> 

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Bug: chromium:656320

Change-Id: I8a4f71537e45f3c4cf37b10b2dc8ee38fe6959ba
Reviewed-on: https://skia-review.googlesource.com/17765
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-23 19:03:01 +00:00
Brian Salomon
45e5068a6d Add a flag to GrSurfaceFlags that requires the texture to be cleared upon creation.
Bug: chromium:656320

Change-Id: I940bfa24540516ab83a2ed52f761b96eb6ad19f1
Reviewed-on: https://skia-review.googlesource.com/17391
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-23 18:07:25 +00:00
Brian Salomon
081e0e6a32 Move MIP color mode from GrSurfaceProxy to GrTextureProxy
Change-Id: I76bc7f551ea4052fc611cf01e0ce81102c9c3395
Reviewed-on: https://skia-review.googlesource.com/17263
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-18 14:38:03 +00:00
Brian Salomon
bb5711a5e4 Remove GrSurfaceDesc member from GrSurfaceProxy.
Stores the config, origin, and dimensions in GrSurfaceProxy, sample count in GrRenderTargetProxy, and "was constructed with mip maps" in GrTextureProxy.

Change-Id: Iee058674dce49107a991cca9d083cd33e3572809
Reviewed-on: https://skia-review.googlesource.com/17209
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-05-17 18:17:50 +00:00
Robert Phillips
318c419d3e Remove RenderTarget pointer from GrRenderTargetOpList::RecordedOp
Change-Id: I08afe531cd9c65af4b3f6b6006bc3eaf7071cfec

Change-Id: I08afe531cd9c65af4b3f6b6006bc3eaf7071cfec
Reviewed-on: https://skia-review.googlesource.com/17117
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-17 14:19:40 +00:00
Brian Salomon
63e7973d1f Remove GrSurfaceProxy::desc()
Adds a numStencilSamples() getter.

Bug: skia:
Change-Id: I1e57f19b3cb490a6214ea436622ed8128a5a9303
Reviewed-on: https://skia-review.googlesource.com/16994
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-05-17 13:27:12 +00:00
Mike Reed
c090c647e4 move files out of private, and fix up callers to IWYU
Realized that a pending CL needed to add (yet another) private type to SkRecords.h, but w/o this CL I'd be forced to move that header also into private. This change frees us up to not have transitive exposure for types that need to be recorded.

Bug: skia:
Change-Id: Id79f1c2e44ba85e063c1360cf96c92de6397ca2b
Reviewed-on: https://skia-review.googlesource.com/17031
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-05-16 21:29:03 +00:00
Mike Reed
74564b40bc check for no_paint and remove some drawdrawable special-casing
Bug: skia:
Change-Id: I824980a47ddd7c8c7627dabb5efd40f8f0889b67
Reviewed-on: https://skia-review.googlesource.com/16900
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-05-15 19:03:11 +00:00
Robert Phillips
8a02f65c5c Switch ImageStorageAccess over to GrTextureProxies
Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler))

Change-Id: I341de6ae121620d30e50bff21450878a18bdf4f2
Reviewed-on: https://skia-review.googlesource.com/16714
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-12 19:20:22 +00:00
Brian Salomon
7c8460e101 Make GrRenderTarget[(Proxy)|(Context)]? advertise a "full scene aa type".
Bug: skia:
Change-Id: I24549604e8305028e34e0022bfef992a8e8c33f7
Reviewed-on: https://skia-review.googlesource.com/16230
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-05-12 16:32:57 +00:00
Robert Phillips
6cdc22cde8 Split up opLists (take 3)
Reland of: https://skia-review.googlesource.com/c/11581/ (Split up opLists)

https://skia-review.googlesource.com/c/13860/ (Make InstancedRendering more opList-splitting friendly) has landed so this should be good for another attempt.

TBR=egdaniel@google.com
Change-Id: I2a09729342bb035af3a16807c1895adbae432ade
Reviewed-on: https://skia-review.googlesource.com/14186
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-12 12:10:31 +00:00
Robert Phillips
b6deea8f0e Setup for another attempt to split up opLists
Split out of: https://skia-review.googlesource.com/c/14186 (Split up opLists (take 3))

Change-Id: Ifa600c88fb9185991d3197c7776c820f54c9bf0f
Reviewed-on: https://skia-review.googlesource.com/16540
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-11 19:44:39 +00:00
Robert Phillips
b37208f11a Revert "Revert "Re-enable deferred proxies in Chrome""
This reverts commit 05814de6ba.

Reason for revert: Chrome layout test suppressions have landed

Original change's description:
> Revert "Re-enable deferred proxies in Chrome"
> 
> This reverts commit 555c49c347.
> 
> Reason for revert: layout tests
> 
> Original change's description:
> > Re-enable deferred proxies in Chrome
> > 
> > Now that https://skia-review.googlesource.com/c/14605/ (Allow TextureSamplers to have null GrTexture pointer) has landed we should be able to re-enable deferred proxies in Chrome.
> > 
> > Bug: 715488
> > Change-Id: Ibd38e5ddf0558b94f09e29f17837e6abfd22fa34
> > Reviewed-on: https://skia-review.googlesource.com/15252
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> > 
> 
> TBR=bsalomon@google.com,robertphillips@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Change-Id: Ie90e64a2e4d5efc4b6909a04f8a862dd3a708d97
> Reviewed-on: https://skia-review.googlesource.com/15809
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

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

Change-Id: I957e8e59af2b2f441c75bae2eda4dcd5ed82b34d
Reviewed-on: https://skia-review.googlesource.com/15876
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-08 18:10:02 +00:00
Robert Phillips
49081d13ba Expand GrTextureProxy to handle highestFilterMode
Once TextureProxies aren't instantiated in the TextureSamplers, the they will need to be able to supply this information.

split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler))
Change-Id: I66555c0746131f565862f7a30d54ff1d458d2062
Reviewed-on: https://skia-review.googlesource.com/15819
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-08 18:07:07 +00:00
Ethan Nicholas
2983f4022d Re-land of "eliminated GrGLSLExpr".
This change is exactly the same as the last time it was landed; I believe the
underlying optimizer bug that was causing this to cause problems has been
fixed by a prior CL.
Bug: skia:
Change-Id: I5436422f094ea758caa3cd69e9338db31b1f93fa
Reviewed-on: https://skia-review.googlesource.com/15768
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-05-08 16:08:44 +00:00
Robert Phillips
05814de6ba Revert "Re-enable deferred proxies in Chrome"
This reverts commit 555c49c347.

Reason for revert: layout tests

Original change's description:
> Re-enable deferred proxies in Chrome
> 
> Now that https://skia-review.googlesource.com/c/14605/ (Allow TextureSamplers to have null GrTexture pointer) has landed we should be able to re-enable deferred proxies in Chrome.
> 
> Bug: 715488
> Change-Id: Ibd38e5ddf0558b94f09e29f17837e6abfd22fa34
> Reviewed-on: https://skia-review.googlesource.com/15252
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

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

Change-Id: Ie90e64a2e4d5efc4b6909a04f8a862dd3a708d97
Reviewed-on: https://skia-review.googlesource.com/15809
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-08 15:18:53 +00:00
Robert Phillips
555c49c347 Re-enable deferred proxies in Chrome
Now that https://skia-review.googlesource.com/c/14605/ (Allow TextureSamplers to have null GrTexture pointer) has landed we should be able to re-enable deferred proxies in Chrome.

Bug: 715488
Change-Id: Ibd38e5ddf0558b94f09e29f17837e6abfd22fa34
Reviewed-on: https://skia-review.googlesource.com/15252
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-08 11:49:54 +00:00
Jim Van Verth
060d982036 Combine the ambient and spot alphas into the base color
for geometric shadows. 

This matches the analytic shadow approach better, and
is color space invariant.
Also includes cleanup in SampleAndroidShadows.

Bug: skia:6546
Change-Id: I7a7cd060420dae741f967334c8b19542a14f0bcf
Reviewed-on: https://skia-review.googlesource.com/15228
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-05-04 14:28:28 +00:00
Robert Phillips
952a2435f7 Add GrGpuTextureProxyRef
Basically a GrTextureProxified clone of GrGpuResourceRef

Change-Id: I8772550bb867ef2cf2d53efef0a0346bb7c90eb6
Reviewed-on: https://skia-review.googlesource.com/15221
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-04 13:29:29 +00:00
Ethan Nicholas
421fe443f8 Revert "Revert "Revert "eliminated GrGLSLExpr"""
This reverts commit 796001c82e.

Reason for revert: looks to be causing problems in Chrome (https://storage.googleapis.com/chromium-layout-test-archives/WebKit_Linux_Trusty__dbg_/1553/layout-test-results/results.html)

Original change's description:
> Revert "Revert "eliminated GrGLSLExpr""
> 
> This reverts commit 5e550ab57e.
> 
> Bug: skia:
> Change-Id: I4705e47dbd209aa8f43db3d28c856bd3aa9e49ab
> Reviewed-on: https://skia-review.googlesource.com/15187
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> 

TBR=ethannicholas@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I6455a4f16b2dc0d6d1265541f7117e0cfb8dd91c
Reviewed-on: https://skia-review.googlesource.com/15309
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-05-04 13:11:09 +00:00
Florin Malita
ab244f045a Revert "Revert "Reland: Remove SkLights include from SkCanvas.h""
This reverts commit 9d5f66d9c2.

Reason for revert: Leon landed Android fixes.

Original change's description:
> Revert "Reland: Remove SkLights include from SkCanvas.h"
> 
> This reverts commit fed00319c9.
> 
> Reason for revert: breaking the Android roll.
> 
> Original change's description:
> > Reland: Remove SkLights include from SkCanvas.h
> > 
> > SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
> > works fine).
> > 
> > Change-Id: I3ed97cd7861e51dcb7cfa7950a97b420dbc6fbfb
> > TBR=reed@google.com
> > Reviewed-on: https://skia-review.googlesource.com/15143
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > 
> 
> TBR=fmalita@chromium.org,reed@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Change-Id: I3b0e69f1d04d160f16a5567b09982d35cc9ca84e
> Reviewed-on: https://skia-review.googlesource.com/15195
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> 

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

Change-Id: I0a1c2f9df61f16987ab72dfb4f3a205fbcc37667
Reviewed-on: https://skia-review.googlesource.com/15229
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-03 19:17:11 +00:00
Florin Malita
9d5f66d9c2 Revert "Reland: Remove SkLights include from SkCanvas.h"
This reverts commit fed00319c9.

Reason for revert: breaking the Android roll.

Original change's description:
> Reland: Remove SkLights include from SkCanvas.h
> 
> SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
> works fine).
> 
> Change-Id: I3ed97cd7861e51dcb7cfa7950a97b420dbc6fbfb
> TBR=reed@google.com
> Reviewed-on: https://skia-review.googlesource.com/15143
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> 

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

Change-Id: I3b0e69f1d04d160f16a5567b09982d35cc9ca84e
Reviewed-on: https://skia-review.googlesource.com/15195
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-03 15:41:07 +00:00
Ethan Nicholas
796001c82e Revert "Revert "eliminated GrGLSLExpr""
This reverts commit 5e550ab57e.

Bug: skia:
Change-Id: I4705e47dbd209aa8f43db3d28c856bd3aa9e49ab
Reviewed-on: https://skia-review.googlesource.com/15187
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-05-03 14:13:41 +00:00
Florin Malita
fed00319c9 Reland: Remove SkLights include from SkCanvas.h
SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
works fine).

Change-Id: I3ed97cd7861e51dcb7cfa7950a97b420dbc6fbfb
TBR=reed@google.com
Reviewed-on: https://skia-review.googlesource.com/15143
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-05-03 13:22:28 +00:00
Jim Van Verth
343fe49b82 Remove translateZ and lights from SkCanvas
Bug: skia:6557
Change-Id: I0dbf70c4131ab59e7fc6c674a6587767af98e13a
Reviewed-on: https://skia-review.googlesource.com/15151
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-05-02 21:17:01 +00:00
Brian Salomon
5e550ab57e Revert "eliminated GrGLSLExpr"
This reverts commit 93f20f5629.

Reason for revert: Mismerge readded deleted files.

Original change's description:
> eliminated GrGLSLExpr
> 
> Now that skslc performs all of the optimizations (and then some) that
> GrGLSLExpr is responsible for, it's just extra work for no benefit.
> 
> Bug: skia:
> Change-Id: I40b0629e00a33873ed9fc6c0a9f41d8350221f9a
> Reviewed-on: https://skia-review.googlesource.com/14560
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

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

Change-Id: Ia8b723594527afe34489fc78a4b49039081b6390
Reviewed-on: https://skia-review.googlesource.com/15154
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-02 21:07:32 +00:00
Ethan Nicholas
93f20f5629 eliminated GrGLSLExpr
Now that skslc performs all of the optimizations (and then some) that
GrGLSLExpr is responsible for, it's just extra work for no benefit.

Bug: skia:
Change-Id: I40b0629e00a33873ed9fc6c0a9f41d8350221f9a
Reviewed-on: https://skia-review.googlesource.com/14560
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-02 20:05:56 +00:00
Jim Van Verth
4c9155bd66 Remove EXPERIMENTAL_SHADOWING, Part 1
Bug: skia:6557
Change-Id: I6482d74be7b360c93141a73dd80c67854530c7a1
Reviewed-on: https://skia-review.googlesource.com/15101
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-02 17:22:44 +00:00
Florin Malita
38aad81a54 Revert "Remove SkLights include from SkCanvas.h"
This reverts commit 9ff301bf91.

Reason for revert: need to update G3, Flutter.

Original change's description:
> Remove SkLights include from SkCanvas.h
> 
> SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
> works fine).
> 
> Change-Id: Id2d7176eb3bf4609f72f46d513eebf59318f542f
> Reviewed-on: https://skia-review.googlesource.com/14904
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> 

TBR=mtklein@google.com,fmalita@chromium.org,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I4799ad5b31aaeaf529c8b912bbe09aa8869a5e6c
Reviewed-on: https://skia-review.googlesource.com/15107
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-02 15:42:07 +00:00
Florin Malita
9ff301bf91 Remove SkLights include from SkCanvas.h
SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
works fine).

Change-Id: Id2d7176eb3bf4609f72f46d513eebf59318f542f
Reviewed-on: https://skia-review.googlesource.com/14904
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-02 14:50:38 +00:00
Mike Klein
b34ab04884 Revert "Revert "SaveLayerRec::fClipMask -> raw pointer""
This reverts commit 3354969a4a.

Reason for revert: not the problem?

Original change's description:
> Revert "SaveLayerRec::fClipMask -> raw pointer"
> 
> This reverts commit a6b72cb572.
> 
> Reason for revert: red bots
> 
> Original change's description:
> > SaveLayerRec::fClipMask -> raw pointer
> > 
> > Use raw pointers for optional clip mask plumbing, to match the backdrop
> > API.
> > 
> > Change-Id: I7eb0ee5896faf34cc05789ba0703f35a4ab6a4f2
> > Reviewed-on: https://skia-review.googlesource.com/14901
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> > 
> 
> TBR=fmalita@chromium.org,reed@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Change-Id: I4387620cdc3410018af9cef221e5cf8d09015380
> Reviewed-on: https://skia-review.googlesource.com/14955
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> 

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

Change-Id: I6dde9e0441928f7a7423139a5c39f520f892f4b5
Reviewed-on: https://skia-review.googlesource.com/14958
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-01 21:36:43 +00:00
Mike Klein
3354969a4a Revert "SaveLayerRec::fClipMask -> raw pointer"
This reverts commit a6b72cb572.

Reason for revert: red bots

Original change's description:
> SaveLayerRec::fClipMask -> raw pointer
> 
> Use raw pointers for optional clip mask plumbing, to match the backdrop
> API.
> 
> Change-Id: I7eb0ee5896faf34cc05789ba0703f35a4ab6a4f2
> Reviewed-on: https://skia-review.googlesource.com/14901
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> 

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

Change-Id: I4387620cdc3410018af9cef221e5cf8d09015380
Reviewed-on: https://skia-review.googlesource.com/14955
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-01 21:31:40 +00:00
Florin Malita
a6b72cb572 SaveLayerRec::fClipMask -> raw pointer
Use raw pointers for optional clip mask plumbing, to match the backdrop
API.

Change-Id: I7eb0ee5896faf34cc05789ba0703f35a4ab6a4f2
Reviewed-on: https://skia-review.googlesource.com/14901
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-01 21:26:01 +00:00
Florin Malita
53f77bd4fd Initial clip-mask-layer support
SkBitmapDevice-only implementation.

Will add A8 fast path specializations in a follow-up.

Change-Id: I2ccb1ffba3689e92ac90a23e94737471dfb121a1
BUG=skia:6005

Change-Id: I2ccb1ffba3689e92ac90a23e94737471dfb121a1
Reviewed-on: https://skia-review.googlesource.com/14183
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-01 14:07:10 +00:00
Jim Van Verth
57061eea44 Optimizations for analytic shadows.
Lots of changes here:
* Batch circle shadows with rrect shadows
* Avoid checking matrix and path conditions twice
* Remove lots of checks for 1/2 pixel radii
  (needed before to force the rrect through the
   regular GPU path)
* Fix scaling effect on ambient blur width
* Remove unused flags

Bug: skia:6119
Change-Id: If0eb78ec4d19d9f978b19bdbc3a7e558a4db2ed9
Reviewed-on: https://skia-review.googlesource.com/14654
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-05-01 14:03:10 +00:00
Robert Phillips
cd901046ea Disable deferred proxies in Chrome
We will re-enable once the proxy instantiation is moved past the TextureSamplers

Bug: 715488
Change-Id: I4f0dee18fc191d7fffb6a2f4fedd825729ebb057
Reviewed-on: https://skia-review.googlesource.com/14520
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-27 21:26:29 +00:00
Amaury Le Leyzour
ac0e705af1 Fix new IT blocks ARMv8
ARMv8 specifies that an IT block should be followed by only one 16-bit instruction.
* SkFloatToFix is back to a C implementation that mirrors the assembly code.

* S32A_D565_Opaque_neon switched the usage of the temporary 'ip' register to let
the compiler choose what is best in the context of the IT block. And replaced
'keep_dst' by 'ip' where low register or high register does not matter.

BUG=skia:

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: If587110a0c74b637ae99460419d46cf969c694fc
Reviewed-on: https://skia-review.googlesource.com/9346
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-04-26 22:45:15 +00:00
Robert Phillips
4a395049a9 Revert "Split up opLists (take 2)"
This reverts commit df2bf21364.

Reason for revert: Maybe AndroidOne timing out

Original change's description:
> Split up opLists (take 2)
> 
> Reland of: https://skia-review.googlesource.com/c/11581/ (Split up opLists)
> 
> https://skia-review.googlesource.com/c/13860/ (Make InstancedRendering more opList-splitting friendly) has landed so this should be good for another attempt.
> 
> Change-Id: Icc9998196587510328e0a9ca1b2ce42013a86c6c
> Reviewed-on: https://skia-review.googlesource.com/13802
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

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

Change-Id: I744f2a3145b294e5911862bb39d57ca33a1b9a5a
Reviewed-on: https://skia-review.googlesource.com/14184
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-24 16:27:23 +00:00
Robert Phillips
df2bf21364 Split up opLists (take 2)
Reland of: https://skia-review.googlesource.com/c/11581/ (Split up opLists)

https://skia-review.googlesource.com/c/13860/ (Make InstancedRendering more opList-splitting friendly) has landed so this should be good for another attempt.

Change-Id: Icc9998196587510328e0a9ca1b2ce42013a86c6c
Reviewed-on: https://skia-review.googlesource.com/13802
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-24 13:54:59 +00:00
Robert Phillips
7fbb7d3d90 Remove two more gpu headers from include/*
This is probably it until GrTexture.h can be hidden.

TBR=bsalomon@google.com

Change-Id: Ie743c937f72aa0dc9f5e84def572f655f0abe041
Reviewed-on: https://skia-review.googlesource.com/14143
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-24 12:57:31 +00:00
Greg Daniel
7ef28f35a2 Revert "Revert "Plumb GrBackendTexture throughout skia.""
This reverts commit 7fa5c31c2c.

Reason for revert: Relanding this change now that other fixes have landed.

Original change's description:
> Revert "Plumb GrBackendTexture throughout skia."
> 
> This reverts commit 7da62b9059.
> 
> Reason for revert: fix android roll
> 
> Original change's description:
> > Plumb GrBackendTexture throughout skia.
> > 
> > Bug: skia:
> > Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875
> > Reviewed-on: https://skia-review.googlesource.com/13645
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > 
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org,stani@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Change-Id: I5cb8763cc837c83ebc6d10366fe2dd3efe35fb89
> Reviewed-on: https://skia-review.googlesource.com/13773
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>
> 

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,stani@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I92bc074e4fe37fa5c83186afadc472c03802e8f2
Reviewed-on: https://skia-review.googlesource.com/13975
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-04-20 17:17:43 +00:00
Mike Klein
26eb16f1e3 calculate cull rects for SkMiniPictures
This is the other half of https://skia-review.googlesource.com/c/7874/,
adding the cull-shrinking feature of SkBigPictures to SkMiniPictures.

Like SkBigPictures, shrink only when we're asked to build an R-tree.
(We don't actually build a tree for one rect, of course.)

We could do unconditionally, but SkPictureImageFilter uses the cull rect
as its crop.  It's unclear to me what this image filter unit test I've
changed here was intending... had it had two draws we would have shrunk
its cull, but because it was hitting the 1-draw SkMiniPicture path it
kept the larger user-supplied cull.

As the test doesn't appear to have been written with cull shrinking in
mind, I've removed its SkRTreeFactory to keep that feature explicitly
disabled there.

BUG=skia:5974

Change-Id: I4118d2e85f2a69adef2e7a7fa9b9b8c17607a94f
Reviewed-on: https://skia-review.googlesource.com/12624
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-04-20 15:02:19 +00:00
Stan Iliev
7fa5c31c2c Revert "Plumb GrBackendTexture throughout skia."
This reverts commit 7da62b9059.

Reason for revert: fix android roll

Original change's description:
> Plumb GrBackendTexture throughout skia.
> 
> Bug: skia:
> Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875
> Reviewed-on: https://skia-review.googlesource.com/13645
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> 

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

Change-Id: I5cb8763cc837c83ebc6d10366fe2dd3efe35fb89
Reviewed-on: https://skia-review.googlesource.com/13773
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
2017-04-19 00:23:50 +00:00
Greg Daniel
7da62b9059 Plumb GrBackendTexture throughout skia.
Bug: skia:
Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875
Reviewed-on: https://skia-review.googlesource.com/13645
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-04-18 21:55:10 +00:00
Robert Phillips
7ce67db564 Revert "Split up opLists"
This reverts commit bc8ee52d46.

Reason for revert: Instanced rendering is broken

Original change's description:
> Split up opLists
> 
> Split into:
>    https://skia-review.googlesource.com/c/11793/ (Remove lastProxy capability from GrSurface)
> 
> Change-Id: I903ba30e17de4aab8cb0d2cc3281ae5c262142f9
> Reviewed-on: https://skia-review.googlesource.com/11581
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> 

TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ic3ae650630a09730d40da4a9587d9e25a9dd5e6c
Reviewed-on: https://skia-review.googlesource.com/13725
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-18 17:10:22 +00:00
Robert Phillips
bc8ee52d46 Split up opLists
Split into:
   https://skia-review.googlesource.com/c/11793/ (Remove lastProxy capability from GrSurface)

Change-Id: I903ba30e17de4aab8cb0d2cc3281ae5c262142f9
Reviewed-on: https://skia-review.googlesource.com/11581
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-04-18 15:59:45 +00:00
Robert Phillips
7a17b2ffab Re-enable deferred proxies in Chrome
Chrome has branched.

TBR=bsalomon@google.com

Change-Id: I578deafd63af9e86ff8f7cf8f8ccad6a901c1b21
Reviewed-on: https://skia-review.googlesource.com/13687
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-18 13:28:05 +00:00
Robert Phillips
f5442bb4c1 Split cleanup changes out of bigger CL (take 2)
This are split out of: https://skia-review.googlesource.com/c/11581/ (Split up opLists)

This is a reland of: https://skia-review.googlesource.com/c/13585/ (Split cleanup changes out of bigger CL)

TBR=bsalomon@google.com

Change-Id: Id0d5c764953230412e78ae6aa654f8dfae998c60
Reviewed-on: https://skia-review.googlesource.com/13643
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-04-18 11:43:17 +00:00
Mike Klein
e186cfd15f Revert "Split cleanup changes out of bigger CL"
This reverts commit cd11c809f2.

Reason for revert: assert(rtp->getLastOpList())

Original change's description:
> Split cleanup changes out of bigger CL
> 
> This are split out of: https://skia-review.googlesource.com/c/11581/ (Split up opLists)
> 
> TBR=bsalomon@google.com
> 
> Change-Id: I1239e806a30a93d3c17ad933f118b98a5077dd3a
> Reviewed-on: https://skia-review.googlesource.com/13585
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> 

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

Change-Id: Ia3ef7322fe830a6a4dc29226ce931d35d181c6e0
Reviewed-on: https://skia-review.googlesource.com/13641
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2017-04-17 18:04:46 +00:00
Robert Phillips
cd11c809f2 Split cleanup changes out of bigger CL
This are split out of: https://skia-review.googlesource.com/c/11581/ (Split up opLists)

TBR=bsalomon@google.com

Change-Id: I1239e806a30a93d3c17ad933f118b98a5077dd3a
Reviewed-on: https://skia-review.googlesource.com/13585
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-04-17 17:25:32 +00:00
Robert Phillips
c589b0b5c0 Remove lastOpList capability from GrSurface
This is split out of: https://skia-review.googlesource.com/c/11581/ (Split up opLists)

TBR=bsalomon@google.com

Change-Id: I80d589b42918ddd77538484c808b069576691da4
Reviewed-on: https://skia-review.googlesource.com/11793
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-04-17 12:41:59 +00:00
Robert Phillips
123b7b8ebd Disable deferred proxies for Chrome branch
Chrome is branching again and Proxy instantiation is still occurring at a bad spot in Skia.

Change-Id: I2f6bed7f1833737aa9bb7fd819ff108cffaeaf1d
Reviewed-on: https://skia-review.googlesource.com/13133
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-12 11:14:31 +00:00
Mike Klein
149e42ed19 make SkAutoTMalloc self-move safe
We were just combing through possible changes that might have affected
the attached bug, this popped out as pretty obviously unsafe.

This doesn't explain the Chrome bug... 
SkAutoTMalloc and SKAutoSTMalloc are separate types.  :(

The new test fails and crashes before, passes after.

Change-Id: I033f488a7f644b7a70e612c8535fedfac35c76db
Reviewed-on: https://skia-review.googlesource.com/11797
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2017-04-07 19:06:12 +00:00
Brian Osman
33aa2c7b5c Allow FPs to elevate default precision for the entire fragment program
Currently, GrConfigConversionEffect is able to round-trip on many
mobile GPUs because it uses highp for all intermediate variables
(including the texture fetch result). Separating the texture sample
into a different processor breaks that.

This is a blunt instrument, not to be used lightly.

This reverts commit dffe9827b1.

Bug: skia:
Change-Id: I940af3256c47e6672a008d516db9e55669672ca3
Reviewed-on: https://skia-review.googlesource.com/11345
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-04-05 14:00:50 +00:00
Brian Osman
dffe9827b1 Revert "Revert "Revert "Allow FPs to elevate default precision for the entire fragment program"""
This reverts commit ec53c636b7.

Reason for revert: Mali GMs look bad.

Original change's description:
> Revert "Revert "Allow FPs to elevate default precision for the entire fragment program""
> 
> This reverts commit 903c3f7040.
> 
> Reason for revert: Vulkan issue fixed in compiler.
> 
> Original change's description:
> > Revert "Allow FPs to elevate default precision for the entire fragment program"
> > 
> > This reverts commit 92d7ccafdf.
> > 
> > Reason for revert: Vulkan errors.
> > 
> > Original change's description:
> > > Allow FPs to elevate default precision for the entire fragment program
> > > 
> > > Currently, GrConfigConversionEffect is able to round-trip on many mobile
> > > GPUs because it uses highp for all intermediate variables (including the
> > > texture fetch result). Separating the texture sample into a different
> > > processor breaks that.
> > > 
> > > This is a blunt instrument, not to be used lightly.
> > > 
> > > Bug: skia:
> > > Change-Id: I2ab365e3da79628069e2eb727c43c2bf45bfd789
> > > Reviewed-on: https://skia-review.googlesource.com/10162
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Brian Osman <brianosman@google.com>
> > > 
> > 
> > TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,ethannicholas@google.com,reviews@skia.org
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > 
> > Change-Id: Iee5bb409f86a9cabecc76bd1273a5b3cef6af179
> > Reviewed-on: https://skia-review.googlesource.com/10967
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > 
> 
> TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,ethannicholas@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Change-Id: I733a0ecc40b58d8727f0259b5498c8e6610cedce
> Reviewed-on: https://skia-review.googlesource.com/11010
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,ethannicholas@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ic3274a0a8b776e811354c3441391ffdc80678292
Reviewed-on: https://skia-review.googlesource.com/11061
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-04-03 14:34:21 +00:00
Brian Osman
ec53c636b7 Revert "Revert "Allow FPs to elevate default precision for the entire fragment program""
This reverts commit 903c3f7040.

Reason for revert: Vulkan issue fixed in compiler.

Original change's description:
> Revert "Allow FPs to elevate default precision for the entire fragment program"
> 
> This reverts commit 92d7ccafdf.
> 
> Reason for revert: Vulkan errors.
> 
> Original change's description:
> > Allow FPs to elevate default precision for the entire fragment program
> > 
> > Currently, GrConfigConversionEffect is able to round-trip on many mobile
> > GPUs because it uses highp for all intermediate variables (including the
> > texture fetch result). Separating the texture sample into a different
> > processor breaks that.
> > 
> > This is a blunt instrument, not to be used lightly.
> > 
> > Bug: skia:
> > Change-Id: I2ab365e3da79628069e2eb727c43c2bf45bfd789
> > Reviewed-on: https://skia-review.googlesource.com/10162
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > 
> 
> TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,ethannicholas@google.com,reviews@skia.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Change-Id: Iee5bb409f86a9cabecc76bd1273a5b3cef6af179
> Reviewed-on: https://skia-review.googlesource.com/10967
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,ethannicholas@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I733a0ecc40b58d8727f0259b5498c8e6610cedce
Reviewed-on: https://skia-review.googlesource.com/11010
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-03-31 20:40:05 +00:00
Brian Osman
903c3f7040 Revert "Allow FPs to elevate default precision for the entire fragment program"
This reverts commit 92d7ccafdf.

Reason for revert: Vulkan errors.

Original change's description:
> Allow FPs to elevate default precision for the entire fragment program
> 
> Currently, GrConfigConversionEffect is able to round-trip on many mobile
> GPUs because it uses highp for all intermediate variables (including the
> texture fetch result). Separating the texture sample into a different
> processor breaks that.
> 
> This is a blunt instrument, not to be used lightly.
> 
> Bug: skia:
> Change-Id: I2ab365e3da79628069e2eb727c43c2bf45bfd789
> Reviewed-on: https://skia-review.googlesource.com/10162
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,ethannicholas@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Iee5bb409f86a9cabecc76bd1273a5b3cef6af179
Reviewed-on: https://skia-review.googlesource.com/10967
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-03-31 16:55:39 +00:00
Robert Phillips
f7a7261b4a Add tracking of unique proxyID beside unique renderTargetID in auditTrail and clearOp
Split out of: https://skia-review.googlesource.com/c/10284/ (Omnibus: Remove GrSurface-derived classes from ops)

Change-Id: I5845a47d94decc455ec3b1f0a5876b1c82aa32e8
Reviewed-on: https://skia-review.googlesource.com/10750
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-31 16:11:30 +00:00
Brian Osman
92d7ccafdf Allow FPs to elevate default precision for the entire fragment program
Currently, GrConfigConversionEffect is able to round-trip on many mobile
GPUs because it uses highp for all intermediate variables (including the
texture fetch result). Separating the texture sample into a different
processor breaks that.

This is a blunt instrument, not to be used lightly.

Bug: skia:
Change-Id: I2ab365e3da79628069e2eb727c43c2bf45bfd789
Reviewed-on: https://skia-review.googlesource.com/10162
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-03-31 15:43:51 +00:00
Robert Phillips
7ee385e1dc Add GrSurfaceProxy* parameter to GrContext::flush
Split out of: https://skia-review.googlesource.com/c/10284/ (Omnibus: Remove GrSurface-derived classes from ops)

Change-Id: I12c66a6fa826c2363b21ece56391fb352d12d6b3
Reviewed-on: https://skia-review.googlesource.com/10541
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-30 12:55:37 +00:00
Herb Derby
b549cc38c8 Change SkMemory to the more accurately named SkMalloc.
Change-Id: I6b08a74234b99bac866bad71014b94f7ec2d4bc8
Reviewed-on: https://skia-review.googlesource.com/10188
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-03-27 18:13:07 +00:00
Brian Osman
ce425510a0 Add Swizzle FP, and remove swizzle logic from GrConfigConversionEffect
Trying to decompose read/writePixels into some reusable chunks.

BUG=skia:5853

Change-Id: If08b004b008e8ca7d464d9dc47068e487bae850a
Reviewed-on: https://skia-review.googlesource.com/10015
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-03-22 19:16:30 +00:00
Greg Daniel
70131b97f9 Fix SkTArray operator= to work with self assignment
BUG=skia:

Change-Id: I2a403a7ccbb87a030757f3e57d2ea53503f72512
Reviewed-on: https://skia-review.googlesource.com/10012
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-03-22 18:33:19 +00:00
Brian Salomon
d3b65972aa Mark overridden destructors with 'override' and remove 'virtual'
This silences a new warning in clang 5.0

Change-Id: Ieb5b75a6ffed60107c3fd16075d2ecfd515b55e8
Reviewed-on: https://skia-review.googlesource.com/10006
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-03-22 16:06:18 +00:00
Robert Phillips
0ae6faa34d Make SkImage_Gpu be deferred (take 2)
This CL removes the GrTexture-based ctor forcing everyone to create deferred SkImage_Gpus.

relanding of: https://skia-review.googlesource.com/c/6680/ (Make SkImage_Gpu be deferred)

split out into:
https://skia-review.googlesource.com/c/9106/ (Remove atlas creation from GrResourceProvider)

Change-Id: I834ede430b9706cf9b675bdfdddf1c8c624c2f14
Reviewed-on: https://skia-review.googlesource.com/9965
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-22 11:52:16 +00:00
Hal Canary
271d495a68 check-headers-self-sufficient: update
* Translate to python, use multiprocessing to make it wun in reasonanble time.
  * Fix three headers.
  * Move one header.

Change-Id: I0b26f912bb8086ec158d1c0bae76b923ec6121a4
Reviewed-on: https://skia-review.googlesource.com/8490
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-03-21 15:28:12 +00:00
Robert Phillips
eaa78c4500 Revert "Make SkImage_Gpu be deferred"
This reverts commit 0db235bc02.

Reason for revert: cc_unittests failing

Original change's description:
> Make SkImage_Gpu be deferred
> 
> This CL removes the GrTexture-based ctor forcing everyone to create deferred SkImage_Gpus.
> 
> split out into:
> https://skia-review.googlesource.com/c/9106/ (Remove atlas creation from GrResourceProvider)
> 
> Change-Id: I266bbe089c242fe54d5b7adcc7895aa5a39440a0
> Reviewed-on: https://skia-review.googlesource.com/6680
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

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

Change-Id: Ia15590a1fae04b52723713760fdbf0492ad36286
Reviewed-on: https://skia-review.googlesource.com/9962
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-21 13:26:22 +00:00
Robert Phillips
0db235bc02 Make SkImage_Gpu be deferred
This CL removes the GrTexture-based ctor forcing everyone to create deferred SkImage_Gpus.

split out into:
https://skia-review.googlesource.com/c/9106/ (Remove atlas creation from GrResourceProvider)

Change-Id: I266bbe089c242fe54d5b7adcc7895aa5a39440a0
Reviewed-on: https://skia-review.googlesource.com/6680
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-03-21 11:39:41 +00:00
Herb Derby
d7b34a5ca0 Make SkMemory.h and adjust all files for usage.
This will be rolled out in three stages:
1) make SkMemory.h and have SkTypes.h include it.
2) Adjust chromium and android.
3) no long include SkMemory.h in SkTypes.h

Change-Id: If360ef5e1164d88f50b03f279e2e963ca2f57d5d
Reviewed-on: https://skia-review.googlesource.com/9874
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-03-20 18:40:49 +00:00
Mike Reed
e88a1cb20e Revert[2] "More SkVertices implementation work""
The fix was to release the array of vertices in the picturerecorder
destructor (where we also release textblobs etc.

This reverts commit 1eb3fef136.

BUG=skia:

Change-Id: I3bf4acd6ad209205b0832a3cb7f94cd89dfcefc5
Reviewed-on: https://skia-review.googlesource.com/9826
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-03-17 14:27:33 +00:00
Mike Reed
1eb3fef136 Revert "More SkVertices implementation work"
This reverts commit 14583e11fd.

Reason for revert: leaking

Direct leak of 499104 byte(s) in 2112 object(s) allocated from:
    #0 0x1e195f0 in operator new(unsigned long) (/b/swarm_slave/w/irazbR79/out/Debug/dm+0x1e195f0)
    #1 0x3142b0a in SkVertices::Builder::init(SkCanvas::VertexMode, int, int, SkVertices::Sizes const&) (/b/swarm_slave/w/irazbR79/out/Debug/dm+0x3142b0a)


Original change's description:
> More SkVertices implementation work
> 
> - change virtuals to take const SkVertices*, as we do for TextBobs and Images
> - override onDrawVerticesObject in recording canvases
> - deserialize raw-vertices into SkVertices object
> 
> Possibly a follow-on would intercept the raw-form directly in canvas,
> and remove the virtual, and only support the object form.
> 
> BUG=skia:6366
> 
> Change-Id: I57a932667ccb3b3b004beb802ac3ae6898e3c6e0
> Reviewed-on: https://skia-review.googlesource.com/9633
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

TBR=bsalomon@google.com,reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:6366

Change-Id: I40bb7a20698ef6aa0a9ef71a3d6ac4c1473e081c
Reviewed-on: https://skia-review.googlesource.com/9825
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-03-17 13:09:52 +00:00
Mike Reed
14583e11fd More SkVertices implementation work
- change virtuals to take const SkVertices*, as we do for TextBobs and Images
- override onDrawVerticesObject in recording canvases
- deserialize raw-vertices into SkVertices object

Possibly a follow-on would intercept the raw-form directly in canvas,
and remove the virtual, and only support the object form.

BUG=skia:6366

Change-Id: I57a932667ccb3b3b004beb802ac3ae6898e3c6e0
Reviewed-on: https://skia-review.googlesource.com/9633
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-03-17 11:03:38 +00:00
Brian Salomon
69225d0250 Make SkTArray not allocate unless reserve or initial count > 0
This also makes it so that it doesn't shrink back into preallocated storage and therefore doesn't need to store the reserve count.

Change-Id: Ia320fed04c329641a5494947db39cefd2fb6d80f
Reviewed-on: https://skia-review.googlesource.com/9531
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-03-16 13:08:04 +00:00
Robert Phillips
a4c41b3e83 Push setMipColorMode calls further down-stack & add to GrTextureProxy
setMipColorMode seems like an odd call. 

Change-Id: I24a1ac3883d52499f3be27282d006144d15b26f1
Reviewed-on: https://skia-review.googlesource.com/9725
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-15 18:34:32 +00:00
Robert Phillips
26c90e0479 Add GrRenderTargetContext::resourceProvider & GrResourceProvider::caps
and retract GrSurfaceContextPriv a bit

Change-Id: Id47af1052f9bda4fe7c85b3ce46b3ebe37797524
Reviewed-on: https://skia-review.googlesource.com/9647
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-14 21:23:44 +00:00
Robert Phillips
d3749485db Consolidate Proxy caching code in GrResourceProvider
This doesn't implement the GrSurfaceProxy-based caching but just carves out a space for it.

Split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors)

Change-Id: Iec87b45e3264b349d7804f63e361e970b925e335
Reviewed-on: https://skia-review.googlesource.com/9626
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-14 14:09:12 +00:00
Robert Phillips
4f7062378e Restore deferred GPU resources in Chrome
Change-Id: Ib52668b46e7d077175dcba12a3ccc8abc1f0c7a9
Reviewed-on: https://skia-review.googlesource.com/9552
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-13 16:25:45 +00:00
Florin Malita
d54639f768 Add SkSTArray move assignment operators
Change-Id: Ib655a8a4d62c27dee4f92fcb644237f6fbbdb75b
Reviewed-on: https://skia-review.googlesource.com/9510
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2017-03-12 15:15:14 +00:00
Florin Malita
053730de73 Fix SkTHashTable dangling values
The element rearrange logic in SkTHashTable::remove() marks empty slots
as such, but does not reset their value.

When breaking out of the rearrange loop, we must also reset the last empty
slot value to avoid retaining unwanted copies.

Change-Id: I8ba2a25088c0aa5210277124e0917224cb295691
Reviewed-on: https://skia-review.googlesource.com/9533
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-03-10 17:28:04 +00:00
Robert Phillips
b726d58efc Partially defer SkImage_Gpu
One of SkImageCacherator, GrBitmapTextureMaker, GrImageTextureMaker, GrTextureAdjuster, GrTextureProducer or SkImage has to take the first step. This is probably the least odd of the options.

Change-Id: Ie167034553451f4b3633a5a1548dbd4d75839b3d
Reviewed-on: https://skia-review.googlesource.com/9488
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-10 15:02:11 +00:00
Mike Reed
6c14c8db4b take fast case in swap() if we're using malloc OR we're empty
This avoids taking the (more expensive) copy case when we don't need to.
The old behavior only took this fast case if we were "actively" using
a dynamically allocated array.

BUG=skia:

Change-Id: I0f606ba83ff4aff3a8fc282db7a3ce1b0191fb1a
Reviewed-on: https://skia-review.googlesource.com/9521
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-03-09 22:26:12 +00:00
Brian Osman
383dd9dc58 Remove unused ownership argument to GrSurfaceProxy::MakeWrappedBackend
This is the last public reference to GrWrapOwnership, so removal paves
the way for moving it to somewhere internal.

BUG=skia:

Change-Id: I876298642ff812452a644c1d2b9519691eac44b9
Reviewed-on: https://skia-review.googlesource.com/9492
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-03-09 19:21:22 +00:00
Florin Malita
c2d5bd0117 Fix SkTArray copy construction
We can't use memcpy for copy construction, even when MEM_COPY == true.

Change-Id: I50eb369f0fbf77e8f0ad5a148c67d46df0d3ab0e
Reviewed-on: https://skia-review.googlesource.com/9487
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2017-03-09 19:17:16 +00:00
Florin Malita
b1d800dc22 SkSTArray move ctor
Change-Id: Ice90a229e1ca5959b365c678e8df332cd6ed4a03
Reviewed-on: https://skia-review.googlesource.com/9489
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-03-09 18:21:09 +00:00
Herb Derby
3139de39d7 Remove SkChunckAlloc
Change-Id: Ia400dd2d8aa398cf53852acd71c4a45228752496
Reviewed-on: https://skia-review.googlesource.com/9328
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-03-08 20:06:15 +00:00
Mike Klein
4b19b40394 Revert "Fix new IT blocks ARMv8"
This reverts commit 90165c2269.

Reason for revert: Skia and Chrome iOS builds broken.

../../third_party/skia/include/private/SkFixed.h:106:41: error: invalid output constraint '+t' in asm
        asm("vcvt.s32.f32 %0, %0, #16": "+t"(x));


Original change's description:
> Fix new IT blocks ARMv8
> 
> ARMv8 specifies that an IT block should be followed by only one 16-bit instruction.
> * SkFloatToFix is back to a C implementation that mirrors the assembly code.
> 
> * S32A_D565_Opaque_neon switched the usage of the temporary 'ip' register to let
> the compiler choose what is best in the context of the IT block. And replaced
> 'keep_dst' by 'ip' where low register or high register does not matter.
> 
> BUG=skia:
> 
> CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
> 
> Change-Id: I096759841c972e9300c1d0293bc80d3c3ff2747b
> Reviewed-on: https://skia-review.googlesource.com/9340
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> 

TBR=mtklein@chromium.org,amaury.leleyzour@arm.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: Idbcbda88039066153e1c34233d43366ab114fd01
Reviewed-on: https://skia-review.googlesource.com/9332
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-03-07 00:55:02 +00:00
Amaury Le Leyzour
90165c2269 Fix new IT blocks ARMv8
ARMv8 specifies that an IT block should be followed by only one 16-bit instruction.
* SkFloatToFix is back to a C implementation that mirrors the assembly code.

* S32A_D565_Opaque_neon switched the usage of the temporary 'ip' register to let
the compiler choose what is best in the context of the IT block. And replaced
'keep_dst' by 'ip' where low register or high register does not matter.

BUG=skia:

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I096759841c972e9300c1d0293bc80d3c3ff2747b
Reviewed-on: https://skia-review.googlesource.com/9340
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-03-06 22:16:17 +00:00
Brian Osman
32342f032e Rebase and fix chromium
Combine texture provider and resource provider

Largely mechanical. Only three places that were calling createApprox
via texture provider (ie without flags), so that was simple.

BUG=skia:

Change-Id: I876367bcdc6a8db736deedab1028de1972015509
Reviewed-on: https://skia-review.googlesource.com/9176
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-03-04 13:49:47 +00:00
Robert Phillips
2f49314227 Make GrSurface::MakeDeferred return sk_sp<GrTextureProxy>
This should make upcoming changes less tedious

Change-Id: I313ae9df724f109a64cf5708a974e8bfeb963025
Reviewed-on: https://skia-review.googlesource.com/9183
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-03 12:35:27 +00:00
Brian Salomon
5ff3a5c13e Remove stencil related flags from GrInstancedPipelineInfo.
Change-Id: Ieeb8ada92b5196473d5cea77350fd994bfff8916
Reviewed-on: https://skia-review.googlesource.com/9086
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-03-01 20:16:45 +00:00
Robert Phillips
7928e76872 Disable deferred gpu resources for Chrome branch
Chrome's branch is coming up and it seems unlikely that I will be able to push instantiation all the way to flush time (where failure will be easier to deal with) before then. This CL should silence the P1 bug but could introduce layout test diffs.

Ideally this wouldn't land until after: https://codereview.chromium.org/2718353004/ (Add flag for upcoming Skia change) so the layout test differences will be visible on the DEPS roll

BUG=688811

Change-Id: I86c42ee02e6672834353aa7126b00ed4f3521948
Reviewed-on: https://skia-review.googlesource.com/9064
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-01 12:30:02 +00:00
Brian Salomon
dac5f6bcbe Fix -Wshadow-field warnings
BUG=skia:

Change-Id: I44f1e11787eab88bdc5ed25c34ea802e9001d427
Reviewed-on: https://skia-review.googlesource.com/9083
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-02-28 21:49:28 +00:00
Robert Phillips
c787e495e2 Allow GrSurfaceProxy-derived classes to use flags when instantiating (take 2)
In some instances proxies must be created that, when instantiated, have no pending IO.

This is split out of:

https://skia-review.googlesource.com/c/8679/ (Add per-Flush callback to GrDrawingManager)

and is a reland of:

https://skia-review.googlesource.com/c/8988/ ( Allow GrSurfaceProxy-derived classes to use flags when instantiating)

Change-Id: I36f52a6d249e762bdfc1f0d7528aba6d4071e492
Reviewed-on: https://skia-review.googlesource.com/9070
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-02-28 17:21:55 +00:00
Robert Phillips
2411c1112e Revert "Allow GrSurfaceProxy-derived classes to use flags when instantiating"
This reverts commit c8f1e3a5c0.

Reason for revert: check on ANGLE failure
Original change's description:
> Allow GrSurfaceProxy-derived classes to use flags when instantiating
> 
> In some instances proxies must be created that, when instantiated, have no pending IO.
> 
> This is split out of: (Add per-Flush callback to GrDrawingManager)
> 
> https://skia-review.googlesource.com/c/8679/
> 
> Change-Id: I68b5504d35ad436a4ae737ac4bb3c171fc9a5826
> Reviewed-on: https://skia-review.googlesource.com/8988
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

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

Change-Id: I157417c443028b2148ee355ce69c946a96bb9407
Reviewed-on: https://skia-review.googlesource.com/9066
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-02-28 15:06:07 +00:00
Robert Phillips
c8f1e3a5c0 Allow GrSurfaceProxy-derived classes to use flags when instantiating
In some instances proxies must be created that, when instantiated, have no pending IO.

This is split out of: (Add per-Flush callback to GrDrawingManager)

https://skia-review.googlesource.com/c/8679/

Change-Id: I68b5504d35ad436a4ae737ac4bb3c171fc9a5826
Reviewed-on: https://skia-review.googlesource.com/8988
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-02-28 13:40:19 +00:00
Robert Phillips
30f9bc69cf Switch GrTextureStripAtlas over to GrTextureProxies
This is split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors)

Change-Id: I9f602985b6010fc58b595e2be6d4e67e50179747
Reviewed-on: https://skia-review.googlesource.com/8881
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-02-23 15:01:42 +00:00
Mike Klein
19eec39c90 Fix SkSemaphore comments.
Change-Id: I14fc03fcb73bad61daed7c4cd3ed12bfae6b1217
Reviewed-on: https://skia-review.googlesource.com/8880
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-02-22 20:11:54 +00:00
Mike Klein
384b90af5c SkExecutor
Refactoring to refamiliarize myself with SkTaskGroup and SkThreadPool.

This adds an SkExecutor interface to describe how we use SkThreadPool,
with a global setter and getter for a default instance.  Then I rewrote
SkTaskGroup to work with any executor, the global default by default.

I also think I've made the SkTaskGroup::wait() borrow logic clearer
with the addition of SkSemaphore::try_wait().  This lets me keep the
semaphore count and actual count of work in perfect sync.

Change-Id: I6bbdfaeb0e2c3a43daff6192d34bc4a3f7210178
Reviewed-on: https://skia-review.googlesource.com/8836
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-02-22 16:17:39 +00:00
Robert Phillips
63c67461ed Tighten up GrSurfaceProxy typing
This may reduce the number of "why not GrTextureProxy" issues

Change-Id: I9e0e5042f5801ba9a933b697a380cb0cb54b4522
Reviewed-on: https://skia-review.googlesource.com/8510
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-02-15 20:17:29 +00:00
csmartdalton
320ade43f5 Make SkAutoTMalloc movable
BUG=skia:

Change-Id: I683407659c252656445b92734484170587c2f75a
Reviewed-on: https://skia-review.googlesource.com/8360
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-02-13 19:46:35 +00:00
Mike Reed
267be7fbc3 Revert "Revert "IWYU""
This reverts commit 3c727d2386.

BUG=skia:

Change-Id: I72e9b40fec96d044e0ac12906669a52529e77882
Reviewed-on: https://skia-review.googlesource.com/8356
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-02-13 15:59:35 +00:00
Robert Phillips
3c727d2386 Revert "IWYU"
This reverts commit 2aeae78a2c.

Reason for revert: It looks like this is breaking the android roll

out/target/product/angler/obj/SHARED_LIBRARIES/libandroid_runtime_intermediates/android_graphics_Canvas.o frameworks/base/core/jni/android_graphics_Canvas.cpp"
frameworks/base/core/jni/android_graphics_Canvas.cpp:178:15: error: incomplete type 'SkRegion' named in nested name specifier



Original change's description:
> IWYU
> 
> BUG=skia:
> 
> Change-Id: Ib6b4d52841dbe3fa69a86ddb6b97d6a5d0f004ee
> Reviewed-on: https://skia-review.googlesource.com/8231
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
> 

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

Change-Id: If979c3dd9dc3fe08ac450ced113b3d1e9a86f02a
Reviewed-on: https://skia-review.googlesource.com/8346
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-02-11 01:25:19 +00:00
Mike Reed
2aeae78a2c IWYU
BUG=skia:

Change-Id: Ib6b4d52841dbe3fa69a86ddb6b97d6a5d0f004ee
Reviewed-on: https://skia-review.googlesource.com/8231
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-02-10 19:43:03 +00:00
Florin Malita
63b6156273 Fixed3232 overflow in LinearGradientContext::shadeSpan()
Speculative fix for TAP ubsan failures.

Change-Id: Id3a78adbfab04ba3404a23059cbd8c162d812c2e
Reviewed-on: https://skia-review.googlesource.com/8315
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-02-10 16:17:35 +00:00
Hal Canary
6b20a55996 Make header files self-sufficient
Change-Id: Ice7d761b1023da77e50e5d6aa597964f7d9aa1d8
Reviewed-on: https://skia-review.googlesource.com/8302
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-02-10 01:19:52 +00:00
csmartdalton
b37cb236c3 Add integer vectors to GrSLType
BUG=skia:

Change-Id: I4a4a50e214f2240d83f6f0b02cf43e695c067933
Reviewed-on: https://skia-review.googlesource.com/8122
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-02-08 21:37:22 +00:00
Ben Wagner
3c5cfb0d15 Remove exec bit from source files.
Ran:
find src include \( -name '*.cpp' -o -name '*.h' \) -executable -exec chmod -x {} \;

BUG=skia:

Change-Id: I04a4adbfcea9fd9860ab83d43734dc5158d3a884
Reviewed-on: https://skia-review.googlesource.com/8220
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2017-02-08 20:21:18 +00:00
Hal Canary
529bcd6db7 Revert "Revert "SkScalar: delete code that doesn't compile.""
This reverts commit 8233fc82b0.

Change-Id: Ia32ccdb3b385ed28e1b41e553c7d80cf803522cc
Reviewed-on: https://skia-review.googlesource.com/7899
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-02-02 15:43:08 +00:00
Leon Scroggins
8233fc82b0 Revert "SkScalar: delete code thqat doesn't compile."
This reverts commit 565da18f6e.

Reason for revert:  breaking android roll:

https://googleplex-android-review.git.corp.google.com/#/c/1853481/-1..1

Some code in Android references SK_SCALAR_IS_FLOAT:
https://cs.corp.google.com/android/frameworks/base/core/jni/android/graphics/Interpolator.cpp?q=frameworks/base/core/jni/android/graphics/Interpolator.cpp&sq=package:android&l=30

Original change's description:
> SkScalar: delete code thqat doesn't compile.
> 
> Change-Id: I8a5c404d6151fca79af5c5a98d4b44924c0ade52
> Reviewed-on: https://skia-review.googlesource.com/7882
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>
> 

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

Change-Id: I4df06c4593abaa3ac3877b270a41aec7a9c3fc8f
Reviewed-on: https://skia-review.googlesource.com/7888
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-02-02 13:12:36 +00:00
Hal Canary
565da18f6e SkScalar: delete code thqat doesn't compile.
Change-Id: I8a5c404d6151fca79af5c5a98d4b44924c0ade52
Reviewed-on: https://skia-review.googlesource.com/7882
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-02-02 12:21:33 +00:00
Brian Salomon
958fbc460a Make SkShadowUtils tessellations ref counted in preparation for caching them.
Change-Id: I60133fcc4101a27bcc3e7ad38e7348ad9147b8a9
Reviewed-on: https://skia-review.googlesource.com/7784
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-31 14:42:29 +00:00
Robert Phillips
26caf898f1 Add utilities to create GrSurfaceProxy & GrSurfaceContext from backend descs
Change-Id: Iff2278de8ddd6c0dff74e5cf1996702bad31217b
Reviewed-on: https://skia-review.googlesource.com/7647
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-01-27 17:00:38 +00:00
Robert Phillips
757914d26b Switch GrConfigConversionEffect over to taking GrTextureProxies
Change-Id: Ic8be773e210e1ac05dcb9aad6c89dcd63e9e4ba2
Reviewed-on: https://skia-review.googlesource.com/7521
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-01-25 21:23:28 +00:00
Robert Phillips
d46697ac36 Use GrSurfaceContext::read/write-Pixels more
Change-Id: I04bcaf91aa7a43e0563e332c1fe2836d762a04d4
Reviewed-on: https://skia-review.googlesource.com/7520
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-01-25 17:53:10 +00:00
Herb Derby
5d72f7deb1 Remove SkTDict and calls from SkView.
R=reed@google.com

Change-Id: Iebfddf752a2ac210a3f5c69de8decd06d0c35617
Reviewed-on: https://skia-review.googlesource.com/7436
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-01-24 17:24:50 +00:00
Herb Derby
2a0daee1af Update SkTDict to use SkArenaAlloc.
Change-Id: I7ac33faa59bcad25b0580193af965a8525eb18e7
Reviewed-on: https://skia-review.googlesource.com/7360
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-01-23 19:07:01 +00:00
Brian Salomon
92ce594685 Add class GrProcessorSet which represents color and coverage FPs and a XPFactory.
Eventually ops can use this to hold their ops and create GrPipelines at flush time.

For now it is used by GrPipelineBuilder.

Change-Id: I0db3892032f2d07238e4c847a790678b3aab456f
Reviewed-on: https://skia-review.googlesource.com/7132
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-18 16:48:41 +00:00
Jim Van Verth
2103cf0ff0 Split ShadowMaskFilter into separate ambient and spot mask filters
This does not change the public API.

BUG=skia:6119

Change-Id: Ibdcd2f8611bc2eec332d8a65e5d51246b89a0a90
Reviewed-on: https://skia-review.googlesource.com/7083
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-01-16 18:40:59 +00:00
Herb Derby
4fa20cea81 Fix syntax error for adjusting old stdc++ headers.
Change-Id: Ibc99ae943b275b770e8767b80400b8e1520e70a5
Reviewed-on: https://skia-review.googlesource.com/7035
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2017-01-13 21:26:03 +00:00
Herb Derby
0497f088bb Introduce SkArenaAlloc - should be fast for POD types and RAII for types with dtors.
- Implementation.
- Use in SkLinearPipeline.

TBR=mtklein@google.com

Change-Id: Ie014184469b217132b0307b5a9ae40c0c60e5fc9
Reviewed-on: https://skia-review.googlesource.com/6921
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-01-13 18:45:19 +00:00
Hal Canary
5aedd6d5a3 cleanup after 95e3c05
Change-Id: Ifd194fd009196b8bee2dd83328bbe698586d72f4
Reviewed-on: https://skia-review.googlesource.com/6965
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-01-12 19:49:46 +00:00
Hal Canary
95e3c058ef SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h
* SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr).

  * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h

  * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);"

Revert "Revert 'SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h'"
This reverts commit c456b73fef.

Change-Id: Ie2c1a17c20134b8ceab85a68b3ae3e61c24fbaab
Reviewed-on: https://skia-review.googlesource.com/6886
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-01-11 18:55:34 +00:00
Kevin Lubick
c456b73fef Revert "SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h"
This reverts commit a5494f1170.

Reason for revert: Broke Google3

Original change's description:
> SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h
> 
>   * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr).
> 
>   * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h
> 
>   * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);"
> 
> Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88
> Reviewed-on: https://skia-review.googlesource.com/4543
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>
> 

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

Change-Id: Ie8bd176121c3ee83c110d66c0d0ac65e09bfc9c5
Reviewed-on: https://skia-review.googlesource.com/6884
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2017-01-11 17:22:12 +00:00
Hal Canary
a5494f1170 SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h
* SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr).

  * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h

  * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);"

Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88
Reviewed-on: https://skia-review.googlesource.com/4543
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-01-11 15:36:45 +00:00
Brian Osman
986563bcff Add Gray8 pixel config
This is still just linear (non-sRGB), but adding sRGB will
be the next step. I've verified that this is really making
R8 textures when uploading Gray8 bitmaps. Tests pass, and
the all_bitmap_configs GM still renders correctly (unlike
when we just mapped Gray8 to Alpha8).

This adds another pixel config, which could grow our cache
footprint, but the benefits of not using 4bpp for 1bpp data
should outweigh that?

Re-land of https://skia-review.googlesource.com/c/6817/,
with fixes for Vulkan.

BUG=skia:6110

Change-Id: Ia763c276808be28027ed0005ee4b88637306583f
Reviewed-on: https://skia-review.googlesource.com/6839
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-01-10 20:37:09 +00:00
Brian Osman
4641d7d055 Revert "Add Gray8 pixel config"
This reverts commit f2956459f7.

Reason for revert: GM and image failures on some bots (rendering red, not gray).

Original change's description:
> Add Gray8 pixel config
> 
> This is still just linear (non-sRGB), but adding sRGB will
> be the next step. I've verified that this is really making
> R8 textures when uploading Gray8 bitmaps. Tests pass, and
> the all_bitmap_configs GM still renders correctly (unlike
> when we just mapped Gray8 to Alpha8).
> 
> This adds another pixel config, which could grow our cache
> footprint, but the benefits of not using 4bpp for 1bpp data
> should outweigh that?
> 
> BUG=skia:6110
> 
> Change-Id: I4fc4c2479fc25f1d278e174a9bb5b542a0cb184c
> Reviewed-on: https://skia-review.googlesource.com/6817
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org
BUG=skia:6110
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I95a4fc0450a569d5791f6bceb7fae61c7e5eba61
Reviewed-on: https://skia-review.googlesource.com/6838
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-01-10 18:47:38 +00:00
Brian Osman
f2956459f7 Add Gray8 pixel config
This is still just linear (non-sRGB), but adding sRGB will
be the next step. I've verified that this is really making
R8 textures when uploading Gray8 bitmaps. Tests pass, and
the all_bitmap_configs GM still renders correctly (unlike
when we just mapped Gray8 to Alpha8).

This adds another pixel config, which could grow our cache
footprint, but the benefits of not using 4bpp for 1bpp data
should outweigh that?

BUG=skia:6110

Change-Id: I4fc4c2479fc25f1d278e174a9bb5b542a0cb184c
Reviewed-on: https://skia-review.googlesource.com/6817
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-01-10 16:20:03 +00:00
Brian Salomon
19f0ed5b83 Purge clip masks when they are no longer findable.
This improves memory usage when the content contains frequently changing clips implemented as masks.

BUG=chromium:676459

Change-Id: I06ea5f9fe1cff9564ea136bad9fe97f6ecd77ad9
Reviewed-on: https://skia-review.googlesource.com/6629
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-01-06 19:42:08 +00:00
Brian Salomon
69868af684 Remove render target unique ID virtual from GrOp.
GrRenderTargetOpList now stores the IDs along side each op.

This should put us closer to using proxy IDs and not forcing early render target instantiation as many comments point towards.

Change-Id: I1ee82b01a0818a80d2bcac39fdf3a4ee7dccecc9
Reviewed-on: https://skia-review.googlesource.com/6403
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2016-12-22 21:10:48 +00:00
Brian Salomon
42ad83ac19 Rename batch->op in GrAuditTrail.
Change-Id: I68670e5ceb06716e9928ee58485d63e157c7aca7
Reviewed-on: https://skia-review.googlesource.com/6345
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-12-20 21:50:09 +00:00
Lee Salzman
ee1c73fc1b tweak SkOnce.h header to work around issues with std::atomic::compare_exchange_strong
BUG=skia:

Change-Id: Id29c47cb4bec6a6d70d6514d18fa4ab9bd31b1e2
Reviewed-on: https://skia-review.googlesource.com/6200
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-12-16 22:21:27 +00:00
Mike Klein
6b00a07d4f simplify SkTHash* move support
Don't know why I thought this had to be so complicated before.

BUG=skia:6053

Change-Id: Ie714fed1cb47e9add166d4227d3d31f95eba2411
Reviewed-on: https://skia-review.googlesource.com/6121
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-12-15 21:31:26 +00:00
Robert Phillips
e2f7d1899d Add a deferred copy surface (take 3)
This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).

There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.

This is a reland of https://skia-review.googlesource.com/c/5773/ (Add a deferred copy surface)

Change-Id: Ib8fd96d0569274ef781366eb900ed8ee839ae9bd
Reviewed-on: https://skia-review.googlesource.com/6109
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-12-15 15:07:39 +00:00
Herb Derby
acef51fdd8 Remove tombstones from SkTHash.
* Switch to linear probing - this allows delete to rearrange elements to fill in empty slots
* NULL -> nullptr


Change-Id: I741c2f3bb2734bf638d0c0a78c6cc549f563a5d9
Reviewed-on: https://skia-review.googlesource.com/5980
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-12-14 20:07:15 +00:00
Robert Phillips
d316e77c1e Revert "Add a deferred copy surface (take 2)"
This reverts commit 398487a850.

Reason for revert: See if this is causing the roll failure

Original change's description:
> Add a deferred copy surface (take 2)
> 
> This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).
> 
> There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.
> 
> This is a reland of https://skia-review.googlesource.com/c/5773/ (Add a deferred copy surface)
> 
> Change-Id: Ide560f569aede5e622420dc2f30eef76357d69f4
> Reviewed-on: https://skia-review.googlesource.com/5939
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I1ef40f0d5fb0bca62031f94f10eb18acd753e913
Reviewed-on: https://skia-review.googlesource.com/6024
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-12-14 12:05:06 +00:00
Robert Phillips
398487a850 Add a deferred copy surface (take 2)
This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).

There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.

This is a reland of https://skia-review.googlesource.com/c/5773/ (Add a deferred copy surface)

Change-Id: Ide560f569aede5e622420dc2f30eef76357d69f4
Reviewed-on: https://skia-review.googlesource.com/5939
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-12-13 22:01:58 +00:00
Robert Phillips
293d696fcf Revert "Add a deferred copy surface"
This reverts commit 4431de6af9.

Reason for revert: ANGLE errors (at the very least)

Original change's description:
> Add a deferred copy surface
> 
> This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).
> 
> There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.
> 
> Change-Id: Iab1867668d8146a766201158a251b9174438ee2b
> Reviewed-on: https://skia-review.googlesource.com/5773
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I61408d9e306b9b1ab32f93ab086e95184e12857f
Reviewed-on: https://skia-review.googlesource.com/5938
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-12-13 18:48:20 +00:00
Mike Klein
db402cab8b add move semantics to SkTHash*
The more I look at std::unordered_map and co., the less I like them.
I think we might want to bet on SkTHash*.

As a simple first improvement, add move support.
Next comes shrinking, and then I'll start moving over SkTDynamicHash users.

BUG=skia:6053

Change-Id: Ifdb5d713aab66434ca271c7f18a0cbbb0720099c
Reviewed-on: https://skia-review.googlesource.com/5943
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2016-12-13 18:18:47 +00:00
Robert Phillips
4431de6af9 Add a deferred copy surface
This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).

There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.

Change-Id: Iab1867668d8146a766201158a251b9174438ee2b
Reviewed-on: https://skia-review.googlesource.com/5773
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-12-13 17:57:13 +00:00
Mike Reed
ebfce6d9b4 change SkClipOp to a class enum
BUG=skia:

Change-Id: I25dbe6d6b8666a2a0a7be7bdd2ae0b067868d14e
Reviewed-on: https://skia-review.googlesource.com/5718
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-12-12 15:38:31 +00:00
Robert Phillips
784b7bf493 Different approach to fixing gpu blurs on platforms that "useDrawInsteadOfClear"
This CL reverts https://skia-review.googlesource.com/c/5148/ (Fix gpu blurring on platforms that "useDrawInsteadOfClear") (all the worstCaseWidth/Height stuff) and adds a new GrRenderTargetContext entry point (absClear) to specify clears that can't be discarded or altered.

BUG=skia:

Change-Id: I18b1373ecf4a153ca8c0f290ab8b1d00770426da
Reviewed-on: https://skia-review.googlesource.com/5484
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-12-09 19:29:38 +00:00
Mike Reed
c1f7774e8d Revert[2] "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"
This reverts commit a129dfef2a.

BUG=skia:

Change-Id: I717de6e5fcd4516aa684b014b1414b0f82ac2b91
Reviewed-on: https://skia-review.googlesource.com/5722
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2016-12-09 14:33:41 +00:00
Mike Reed
a129dfef2a Revert "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"
This reverts commit 8e7432b7f9.

Reason for revert: <INSERT REASONING HERE>

external/skia/bench/../tools/android/SkAndroidSDKCanvas.h:103:36: error: C++ requires a type specifier for all declarations
    void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;

Original change's description:
> remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS
> 
> 
> switch over to SkClipOps now that SK_SUPPORT_LEGACY_CLIP_REGIONOPS is gone
> 
> BUG=skia:
> 
> Change-Id: Ifdc8b3746d508348a40cc009a4e529a1cb3c405d
> Reviewed-on: https://skia-review.googlesource.com/5714
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> 

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

Change-Id: If26ea91d7464615e43c1d3d2f726e337ff56b55c
Reviewed-on: https://skia-review.googlesource.com/5721
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-12-09 13:14:41 +00:00
Mike Reed
8e7432b7f9 remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS
switch over to SkClipOps now that SK_SUPPORT_LEGACY_CLIP_REGIONOPS is gone

BUG=skia:

Change-Id: Ifdc8b3746d508348a40cc009a4e529a1cb3c405d
Reviewed-on: https://skia-review.googlesource.com/5714
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-12-08 21:45:27 +00:00
Brian Salomon
25a880960a Rename GrBatch to GrOp
Change-Id: I27b6324f8040899fafeda23ca524bc54a4dbf090
Reviewed-on: https://skia-review.googlesource.com/5392
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2016-12-01 15:12:53 +00:00
Brian Salomon
94efbf51f5 Merge GrGLSLCaps into GrShaderCaps
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5121

Change-Id: If8d13638f80f42161cbc766a2666c5789e5772c8
Reviewed-on: https://skia-review.googlesource.com/5121
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-11-29 19:32:31 +00:00
Mike Klein
e9f78b41c6 Guard against buggy ucrt\math.h.
BUG=666707

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

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: I3bebfdf635d541d92fb84236f0f6fae2da39d691
Reviewed-on: https://skia-review.googlesource.com/5089
Reviewed-by: Bruce Dawson <brucedawson@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-11-28 15:40:23 +00:00
Robert Phillips
93f1633abc Fix gpu blurring on platforms that "useDrawInsteadOfClear"
Platforms that "useDrawInsteadOfClear" take a different path in
GrRenderTargetContext::internalClear. The different path involves
a lot of comparisons of the drawn rect with the bounds of the RenderTarget. Since the RenderTargets are now deferred (and the instantiated version might be larger than the proxied size) case must be taken in prematurely optimizing away clears and draws.

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

TBR=bsalomon@google.com

Change-Id: If63b6393fb66328175bc92de211e7242e903f25e
Reviewed-on: https://skia-review.googlesource.com/5148
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-11-25 21:36:00 +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
robertphillips
1125a030c7 Add IORef capability to GrSurfaceProxy objects - take 2
Re-landing of https://skia-review.googlesource.com/c/4734/ (Add IORef capability to GrSurfaceProxy objects) with fixes for:
 platforms that don't support discards.
 memory leak due to copying over of GrSurfaceProxy's creation ref to instantiated GrSurface in instantiate()

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

Change-Id: If0b695d5cafc5ef3fdd251c38262849d09e5d27f
Review-Url: https://codereview.chromium.org/2502923003
2016-11-16 11:17:17 -08:00
Robert Phillips
f27bab207a Revert "Add IORef capability to GrSurfaceProxy objects"
This reverts commit 286b96f876.

Reason for revert: 

Failure on Mac Mini:

FAILURE: ../../../tests/ProxyRefTest.cpp:59	proxy->getPendingWriteCnt_TestOnly() == expectedNumWrites

../../../tests/ProxyRefTest.cpp:64: fatal error: "assert(proxy->getPendingWriteCnt_TestOnly() == expectedNumWrites)"


Original change's description:
> Add IORef capability to GrSurfaceProxy objects
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4734
> 
> Change-Id: If10fbe555e9fa3331bfa01065028e1afe82adb78
> Reviewed-on: https://skia-review.googlesource.com/4734
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

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

Change-Id: I5e1c201e027d4e9687b01f28a418b1884d3f9ece
Reviewed-on: https://skia-review.googlesource.com/4776
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-11-14 19:29:39 +00:00
Robert Phillips
286b96f876 Add IORef capability to GrSurfaceProxy objects
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4734

Change-Id: If10fbe555e9fa3331bfa01065028e1afe82adb78
Reviewed-on: https://skia-review.googlesource.com/4734
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-11-14 19:04:47 +00:00
Robert Phillips
294870ff11 Add explicit UniqueID classes for GrGpuResource & GrSurfaceProxy
This sets the stage for using the Proxy's/RenderTargetContext's ID above the flush and the RenderTarget's/GrGpuResource's below the flush.

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

Change-Id: I9f1e6b00c02a0691d90b58c49e1d8c60684884c1
Reviewed-on: https://skia-review.googlesource.com/4650
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-11-11 18:24:56 +00:00
Robert Phillips
ec2249fc73 Move GrRenderTargetPriv::maxWindowRectangles to GrRenderTargetContextPriv & GrRenderTargetProxy
This removes a reason to call accessRenderTarget on the GrRenderTargetContext

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

Change-Id: I6e8a53ffd5c1fea80f542b70e05744e2991f70f8
Reviewed-on: https://skia-review.googlesource.com/4583
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-11-09 15:10:37 +00:00
Robert Phillips
3743013f75 Consolidate GrSurfaceProxy Make methods
I think GrSurfaceDesc is still the most compact way to communicate the deferred GrSurface's settings to the Proxy but this CL, at least, reduces where it is used.

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

Change-Id: Ica599c28a5aef1ed4094f47a4ac119e2d204d652
Reviewed-on: https://skia-review.googlesource.com/4559
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-11-09 12:20:50 +00:00
Robert Phillips
eaa862569d Revert "Revert "Add GrRenderTargetContext instantiate & asTextureProxy""
This reverts commit 7d7d7d1946.

Reason for revert: Reverting this to see if it really was crashing on SVGs or if that was cross talk.

Original change's description:
> Revert "Add GrRenderTargetContext instantiate & asTextureProxy"
> 
> This reverts commit 9113edfff8.
> 
> Reason for revert: Looks to be causing EXCEPTION_ACCESS_VIOLATION:
> 
> https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-NUC-GPU-IntelIris6100-x86_64-Debug/builds/121/steps/test_skia%20on%20Windows/logs/stdio
> https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-GCE-CPU-AVX2-x86-Debug/builds/2384/steps/test_skia%20on%20Windows-2008ServerR2-SP1/logs/stdio
> https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-ShuttleC-GPU-iHD530-x86_64-Debug/builds/785/steps/test_skia%20on%20Windows/logs/stdio
> 
> Original change's description:
> > Add GrRenderTargetContext instantiate & asTextureProxy
> > 
> > This CL also centralizes the instantiation code in GrSurfaceProxy and adds a test.
> > 
> > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4494
> > 
> > Change-Id: I0081d9a216dc0af293179f23bcb88acf6a822324
> > Reviewed-on: https://skia-review.googlesource.com/4494
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> > 
> 
> TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Change-Id: I225ce7867ebd445067e5ea55ebbfd587f7fe782a
> Reviewed-on: https://skia-review.googlesource.com/4528
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,scroggo@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ifc3b9ac343009a3808f5f47500eef50df438e3d9
Reviewed-on: https://skia-review.googlesource.com/4537
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-11-08 13:49:49 +00:00
Leon Scroggins
7d7d7d1946 Revert "Add GrRenderTargetContext instantiate & asTextureProxy"
This reverts commit 9113edfff8.

Reason for revert: Looks to be causing EXCEPTION_ACCESS_VIOLATION:

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-NUC-GPU-IntelIris6100-x86_64-Debug/builds/121/steps/test_skia%20on%20Windows/logs/stdio
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-GCE-CPU-AVX2-x86-Debug/builds/2384/steps/test_skia%20on%20Windows-2008ServerR2-SP1/logs/stdio
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-ShuttleC-GPU-iHD530-x86_64-Debug/builds/785/steps/test_skia%20on%20Windows/logs/stdio

Original change's description:
> Add GrRenderTargetContext instantiate & asTextureProxy
> 
> This CL also centralizes the instantiation code in GrSurfaceProxy and adds a test.
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4494
> 
> Change-Id: I0081d9a216dc0af293179f23bcb88acf6a822324
> Reviewed-on: https://skia-review.googlesource.com/4494
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

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

Change-Id: I225ce7867ebd445067e5ea55ebbfd587f7fe782a
Reviewed-on: https://skia-review.googlesource.com/4528
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2016-11-07 21:26:46 +00:00
Robert Phillips
9113edfff8 Add GrRenderTargetContext instantiate & asTextureProxy
This CL also centralizes the instantiation code in GrSurfaceProxy and adds a test.

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

Change-Id: I0081d9a216dc0af293179f23bcb88acf6a822324
Reviewed-on: https://skia-review.googlesource.com/4494
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-11-07 20:28:13 +00:00
Ben Wagner
260d9b3152 Move SkChunkAlloc.h to include/private.
This class does not appear to have any external users, and Skia probably
does not want anyone depending on it. It also clutters up include/core
with an 'uninteresting' utility class.

Change-Id: I7de9468500ecffd0b722f222932e4f8b6637925b
Reviewed-on: https://skia-review.googlesource.com/4522
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2016-11-07 20:16:56 +00:00
Robert Phillips
84a812061f Add GrTextureRenderTargetProxy and support switching between RT & Tex Proxies
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4427

Change-Id: Ie7662299953592f564bb27a4df4ea101f743403e
Reviewed-on: https://skia-review.googlesource.com/4427
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-11-07 15:56:19 +00:00
Ben Wagner
145dbcd165 Remove SkAutoTDelete.
Replace with std::unique_ptr.

Change-Id: I5806cfbb30515fcb20e5e66ce13fb5f3b8728176
Reviewed-on: https://skia-review.googlesource.com/4381
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-11-03 19:03:40 +00:00
Robert Phillips
29e52f13f6 Centralize computation of GrRenderTarget & GrTexture VRAM consumption
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4310

Change-Id: I676749ecf1e489f825799b619a15a45fc7dcd219
Reviewed-on: https://skia-review.googlesource.com/4310
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-11-03 16:44:50 +00:00
Ben Wagner
7ecc59610d Remove SkAutoTDeleteArray
This class is already just an alias for std::unique_ptr<T[]>, so replace
all uses with that and delete the class.

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot,Test-Ubuntu-Clang-Golo-GPU-GT610-x86_64-Debug-ASAN-Trybot

Change-Id: I40668d398356a22da071ee791666c7f728b59266
Reviewed-on: https://skia-review.googlesource.com/4362
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-11-02 21:30:38 +00:00
Robert Phillips
abacf0978f Update ProxyTests
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4306

Change-Id: I0753047eeda71a22b6126f932fc14dd242c5a2e7
Reviewed-on: https://skia-review.googlesource.com/4306
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-11-02 16:06:25 +00:00
Robert Phillips
8bc06d07f5 Back SkSpecialImage_Gpu with a GrTextureProxy
This is split out of https://codereview.chromium.org/2215323003/ (Start using RenderTargetProxy (omnibus))

The addition of the gpuMemorySize methods is for the SkSpecialImage cache.

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

Change-Id: Ia9b9d42fb2a0caf61bbfa3ebcc84308c56f541fc
Reviewed-on: https://skia-review.googlesource.com/4227
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-11-02 15:32:04 +00:00
Mike Reed
7d954ad797 remove xfermode from public api
BUG=skia:

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

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: I19cd056f2af778f10e8c6c2b7b2735593b43dbac
Reviewed-on: https://skia-review.googlesource.com/4020
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-28 20:06:17 +00:00
Robert Phillips
c7635fa374 Make GrDrawContext be GrRenderTargetProxy-backed
This is split out of https://codereview.chromium.org/2215323003/ (Start using RenderTargetProxy (omnibus))

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

CQ_INCLUDE_TRYBOTS=master.client.skia.android:Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-GN_Android-Trybot

Change-Id: I1a47f19ed1ac0c249e6ccac8db74095d7f456db4
Reviewed-on: https://skia-review.googlesource.com/3841
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-10-28 18:35:06 +00:00
Brian Osman
1105224f97 Rename GrDrawContext to GrRenderTargetContext
This is in preparation for GrTextureContext and GrSurfaceContext

BUG=skia:

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

Change-Id: Ie58c93052e68f3f1f5fe8d15d63760de274a6fbd
Reviewed-on: https://skia-review.googlesource.com/4030
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-10-27 19:14:09 +00:00
bungeman
6bd5284415 Remove SkAutoTUnref and SkAutoTDelete from public includes.
This also makes the required changed to src, tests, and tools. The few
public APIs modified by this change appear to be unused outside of Skia.

Removing these from the public API makes it easier to ensure users are
no longer using them.

This also updates GrGpu::wrapBackendXXX and the
::onWrapBackendXXX methods to clarify ownership.

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

Review-Url: https://codereview.chromium.org/2448593002
2016-10-27 09:30:08 -07:00
Robert Phillips
f2361d2d93 Add GrOpList and rename GrDrawTarget to GrRenderTargetOpList
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3910

Change-Id: I026aa26ecc61a0d002e98892dca728536259e8b1
Reviewed-on: https://skia-review.googlesource.com/3910
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-10-26 00:48:37 +00:00
Brian Osman
7c2114fc2f Cache GrColorSpaceXforms
Even with a modest cache, we're going to get nearly 100% hit rate
for typical usage scenarios. I'm hoping to avoid the special case
caching of sRGB -> destination, and just rely on the more general
mechanism.

Yes, this is yet-another cache class. I wanted to use one of many
that are laying around, but couldn't find a good fit. On the plus
side, it's not much code.

BUG=skia:

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

Change-Id: I943be5c99f0d691a87ffe8c5bc3067a8eb491fc2
Reviewed-on: https://skia-review.googlesource.com/3726
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-10-20 20:47:33 +00:00
liyuqian
3f490cc642 Make SkFixedRound/Ceil/FloorToFixed as inline func
The macros that we were using will return unsigned int32 instead of
signed int32 because of the last 0xFFFF0000 mask. That may bring
problems if we right shift that result.

Special thanks to mtklein@google.com for helping me find out this issue.

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

Review-Url: https://chromiumcodereview.appspot.com/2433233003
2016-10-20 11:23:10 -07:00
csmartdalton
421a3c1cc1 Move GPU fences into sk_gpu_test
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2383383002

Review-Url: https://codereview.chromium.org/2383383002
2016-10-04 11:08:45 -07:00
msarett
71df2d7bc1 Add a src rect to drawImageLattice() API
This will allow us to draw ninepatches directly from an asset
texture without having to upload them individually.

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

Review-Url: https://codereview.chromium.org/2382893002
2016-09-30 12:41:42 -07:00
Mike Klein
1e114f1368 *SkTCast<int*>(float*) -> memcpy
In some build configurations (I think, GN, GCC 6, Debug) I get a warning that i is used unintialized.  This likely has something to do with GCC correctly seeing that the SkTCast construction there is illegal aliasing, and perhaps thus "doesn't happen".  Might be that if the SkTCast gets inlined, it decides its implementation is secretly kosher, and so Release builds don't see this.  None of this happens with the GCCs we have on the bots... too old?

Instead use memcpy() here, which is well defined to do what we intended.

BUG=skia:

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

Change-Id: Iaf5c75fbd852193b0b861bf5e71450502511d102
Reviewed-on: https://skia-review.googlesource.com/2758
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2016-09-29 15:48:04 +00: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
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
csmartdalton
4b5179b74c skpbench
skpbench is a benchmarking suite for skps that aims to generate 100%
repeatable results. The initial commit consists of three parts:

skpbench

A minimalist program whose sole purpose is to open an skp file,
benchmark it on a single config, and exit. No tiling, looping, or
other fanciness is used; it just draws the skp whole into a size-
matched render target and syncs the GPU after each draw.

Limiting the entire process to a single config/skp pair helps to keep
the results repeatable.

skpbench.py

A wrapper to execute the skpbench binary with various configs and skps.
It also monitors the output in order to filter out and re-run results
with an unacceptable stddev.

In the future this script will lock down and monitor clocks and
temperatures.

parseskpbench.py

A utility for parsing skpbench output into a spreadsheet.

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

Review-Url: https://codereview.chromium.org/2341823002
2016-09-19 11:03:58 -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
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
msarett
0764efe6a9 Add option to skip rects to drawImageLattice()
HWUI skips transparent rects when drawing.

When skia draws using bilerp, we will blend
transparent rects with neighboring rects and might
draw a bit of a smudge.

This CL adds the option to skip rects, allowing us
to have compatible behavior with the framework.

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

Review-Url: https://codereview.chromium.org/2305433002
2016-09-02 11:24:30 -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
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
reed
22b2af1dc4 dedup images/blobs/pictures by ID in old serialization format
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2289783002

Review-Url: https://codereview.chromium.org/2289783002
2016-08-29 07:52:13 -07:00
msarett
44df651ebe Add drawRegion() API to SkCanvas
This will allow us to optimize for the RectGrid macrobench.
Currently, SkiaGL is much slower than OpenGL.
SkiaGL  12 items/s
OpenGL 160 items/s

This contains everything except for the fast implementation on GPU.

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

Review-Url: https://codereview.chromium.org/2277053002
2016-08-25 13:54:30 -07:00
vjiaoblack
e6f5d56231 Made shadows blurry (thru implementing variance mapping)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2224163005

Review-Url: https://codereview.chromium.org/2224163005
2016-08-25 06:30:23 -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
ac3aa245ac Plumb drawArc to SkDevice.
Plumbs the drawArc canvas method down to SkDevice without converting to a path. Plumbs through the various recording canvas classes.

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

Review-Url: https://codereview.chromium.org/2257023003
2016-08-19 11:25:20 -07:00
mtklein
cbdf007bc2 Fast path translate() in SkCanvas and SkLiteDL.
This adds didTranslate() so that SkLiteDL (and other canvas recorders)
can record the translate rather than the full concat.

It also adds a case to SkMatrix::preTranslate() to fast path
translate x translate -> translate (i.e. +=).

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

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

Misc bots failing in pictureimagefilter replay modes.
https://luci-milo.appspot.com/swarming/task/30b8e53f3a1f4f10/steps/dm/0/stdout

Problem is FMA vs. not.

CQ_INCLUDE_TRYBOTS=master.client.skia:
Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Fast-Trybot

Review-Url: https://codereview.chromium.org/2255283002
2016-08-19 09:05: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
halcanary
3287588a46 SkPDF: SkPDFFont class changes
SkPDFFont:
  * inline some one-line methdods.
      - SkPDFFont::typeface()
      - SkPDFFont::fontInfo()
      - SkPDFFont::firstGlyphID()
      - SkPDFFont::lastGlyphID()
      - SkPDFFont::getFontDescriptor()
  * de-virtualize some methods:
      - SkPDFFont::getType()
      - SkPDFFont::multiByteGlyphs()
  * Constructor takes more arguments:
    fontType, multiByteGlyphs
  * re-order fields (pointers before shorts)
  * use sk_sp<T> more, T* less

SkAdvancedTypefaceMetrics:
  * SkAdvancedTypefaceMetrics::fFont now a uint8_t
  * other enumes are sized.
  * SkAdvancedTypefaceMetrics::fStyle now big enough.
  * remove use of SkTBitOr, replaced with fancy templates

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

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

Review-Url: https://codereview.chromium.org/2246903002
2016-08-16 09:36:23 -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
3ff2cc81a5 constexpr NaN,+Inf,-Inf
Reading extern values meant these couldn't be compile-time constants.

math.h has INFINITY, which is macro that is supposed to expand to float +inf.
On MSVC it seems it's natively a double, so we cast just to make sure.

There's nan(const char*) in math.h for NaN too, but I don't trust that
to be compile-time evaluated.  So instead, we keep reinterpreting a bit pattern.

I did try to write

    static constexpr float float_nan() { ... }

and completely failed.  constexpr seems a bit too restrictive in C++11 to make
it work, but Clang kept telling me, you'll be able to do this with C++14.

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

Review-Url: https://codereview.chromium.org/2233853002
2016-08-10 08:31:42 -07:00
mtklein
4e97607d9a Use sse4.2 CRC32 instructions to hash when available.
About 9x faster than Murmur3 for long inputs.

Most of this is a mechanical change from SkChecksum::Murmur3(...) to SkOpts::hash(...).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2208903002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot;master.client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot

Review-Url: https://codereview.chromium.org/2208903002
2016-08-08 09:06:28 -07:00
halcanary
9be372041e std::move(SkTDArray)
Since we don't support MSVC2013 anymore, we can be more
succinct when defining move constructors of compound types.

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

Review-Url: https://codereview.chromium.org/2227673002
2016-08-08 07:21:42 -07:00
msarett
c573a40ed5 Add drawImageLattice() and drawBitmapLattice() APIs
The specified image/bitmap is divided into rects, which
can be draw stretched, shrunk, or at a fixed size.  Will be
used by Android to draw 9patch (which are acutally N-patch)
images.

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

Review-Url: https://codereview.chromium.org/1992283002
2016-08-02 08:05:56 -07:00
mtklein
1bb5fecbea Sketch SkPictureRecorder::optimizeFor(GrContext*).
I'm open to API suggestions.
We can pass this in finishAs(), up front, whatever.

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

Review-Url: https://codereview.chromium.org/2203453002
2016-08-01 13:17:47 -07:00
mtklein
da574d17f8 Replace old SkRecords RefBox with sk_sp.
The main differences are that RefBox's constructor reffed and sk_sp's doesn't,
and that RefBox auto-casts to the underlying pointer while sk_sp doesn't.

I've added a bunch of sk_ref_sp() and .get() to compensate.

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

Review-Url: https://codereview.chromium.org/2197243003
2016-08-01 11:24:03 -07:00
reed
9b84f8c812 turn bitmaps into images during recording
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2185563003

Review-Url: https://codereview.chromium.org/2185563003
2016-07-28 14:26:13 -07:00
mtklein
570c868b38 Clean up some unused atomic routines.
AtomicTest was the only use of sk_atomic_add().
AtomicInc64 bench was the only use of sk_atomic_inc(int64_t*).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2183473005
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN-Trybot,Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Release-TSAN-Trybot

Review-Url: https://codereview.chromium.org/2183473005
2016-07-27 08:40:45 -07:00
reed
e93393b311 don't specialize drawBitmapRect for minirecorder; no longer called by blink
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2183193002

Review-Url: https://codereview.chromium.org/2183193002
2016-07-26 12:21:10 -07:00
vjiaoblack
95302da19d Creating framework for drawShadowedPicture
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146073003

Committed: https://skia.googlesource.com/skia/+/0ae097d116f4332be02a135ffc99c162473dee6a
Review-Url: https://codereview.chromium.org/2146073003
2016-07-21 10:25:54 -07:00
vjiaoblack
33d325890e Revert of Creating framework for drawShadowedPicture (patchset #14 id:260001 of https://codereview.chromium.org/2146073003/ )
Reason for revert:
Decided to re-wait for a final LGTM.

Already found a bug in variable naming to fix.

Original issue's description:
> Creating framework for drawShadowedPicture
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146073003
>
> Committed: https://skia.googlesource.com/skia/+/0ae097d116f4332be02a135ffc99c162473dee6a

TBR=reed@google.com,robertphillips@google.com,bsalomon@google.com,jvanverth@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/2167223002
2016-07-21 09:24:16 -07:00
vjiaoblack
0ae097d116 Creating framework for drawShadowedPicture
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146073003

Review-Url: https://codereview.chromium.org/2146073003
2016-07-21 09:10:23 -07:00
vjiaoblack
e5de130788 Added the framework for having canvas/recorder/picture record depth_set's.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2127233002

Committed: https://skia.googlesource.com/skia/+/6d3fb898d5f73a82e36f11c712a633c3921ed518
Committed: https://skia.googlesource.com/skia/+/1185d90c785f743364cc9113d7007a59af07470c
Review-Url: https://codereview.chromium.org/2127233002
2016-07-13 14:05:28 -07:00
liyuqian
0d2c234e44 Fix SkFixedDiv macro
Previously, the macro won't pass the unit test that I just added in this
CL.

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

Review-Url: https://codereview.chromium.org/2149733002
2016-07-13 13:34:46 -07:00
mtklein
6e998e6137 Revert "Added the framework for having canvas/recorder/picture record depth_set's."
1-click revert failed again.
This reverts commit 1185d90c78.

BUG=skia:

TBR=
NOTRY=true

Review-Url: https://codereview.chromium.org/2147963002
2016-07-13 09:03:48 -07:00
vjiaoblack
1185d90c78 Added the framework for having canvas/recorder/picture record depth_set's.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2127233002

Committed: https://skia.googlesource.com/skia/+/6d3fb898d5f73a82e36f11c712a633c3921ed518
Review-Url: https://codereview.chromium.org/2127233002
2016-07-13 08:35:41 -07:00
mtklein
e504dbc092 Revert "Added the framework for having canvas/recorder/picture record depth_set's."
1-click revert failed.
This reverts commit 6d3fb898d5.

TBR=

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

Review-Url: https://codereview.chromium.org/2148543002
2016-07-12 15:41:08 -07:00
vjiaoblack
6d3fb898d5 Added the framework for having canvas/recorder/picture record depth_set's.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2127233002

Review-Url: https://codereview.chromium.org/2127233002
2016-07-12 14:50:41 -07:00
msarett
afb8539f62 Revert of try to speed-up maprect + round2i + contains (patchset #8 id:140001 of https://codereview.chromium.org/2133413002/ )
Reason for revert:
Breaking the roll...
https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/253294/steps/compile%20%28with%20patch%29/logs/stdio

Original issue's description:
> try to speed-up maprect + round2i + contains
>
> We call roundOut in a few places. If we can get SkNx::Ceil we could efficiently implement that as well.
>
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2133413002
> CQ_INCLUDE_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/b42b785d1cbc98bd34aceae338060831b974f9c5

TBR=mtklein@google.com,reed@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/2136343002
2016-07-11 14:57:26 -07:00
reed
b42b785d1c try to speed-up maprect + round2i + contains
We call roundOut in a few places. If we can get SkNx::Ceil we could efficiently implement that as well.

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

Review-Url: https://codereview.chromium.org/2133413002
2016-07-11 13:17:35 -07:00
reed
45561a0b15 drawTextRSXform
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2130643004

Review-Url: https://codereview.chromium.org/2130643004
2016-07-07 12:47:17 -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
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
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
csmartdalton
d0e402f999 Make container classes in SkTemplates.h more consistent
Ensures that ".get()" always returns null when a container is empty.
Also ensures consistent assert behavior for array counts.

There are still differences in that the malloc variants take a size_t
and the arrays take an int, and that SkAutoSTMalloc defaults to the
stack-allocated buffer wheras the other containers default to null.

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

Review-Url: https://codereview.chromium.org/2084213003
2016-06-23 12:55:14 -07:00
brianosman
52ede1d905 More removal of SkColorProfileType...
Scrub GMs. Remove the gDefaultProfile thing (it's unused now), along with
the command line flag that was setting it in DM and nanobench.

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

Committed: https://skia.googlesource.com/skia/+/944876f2745a62a839e49275daf93a0329372e67
Review-Url: https://codereview.chromium.org/2071393002
2016-06-20 08:25:02 -07:00
egdaniel
802acec187 Revert of More removal of SkColorProfileType... (patchset #2 id:20001 of https://codereview.chromium.org/2071393002/ )
Reason for revert:
This was still used in chrome

Original issue's description:
> More removal of SkColorProfileType...
>
> Scrub GMs. Remove the gDefaultProfile thing (it's unused now), along with
> the command line flag that was setting it in DM and nanobench.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2071393002
>
> Committed: https://skia.googlesource.com/skia/+/944876f2745a62a839e49275daf93a0329372e67

TBR=msarett@google.com,reed@google.com,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/2074103004
2016-06-17 15:11:46 -07:00
brianosman
944876f274 More removal of SkColorProfileType...
Scrub GMs. Remove the gDefaultProfile thing (it's unused now), along with
the command line flag that was setting it in DM and nanobench.

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

Review-Url: https://codereview.chromium.org/2071393002
2016-06-17 13:43:27 -07:00
mtklein
f10637f279 Type-erase SkAutoMutexAcquire and SkAutoExclusive.
This is purely for convenience, to not need to write the lock type
in the guard anymore.  This should all inline away.

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

Review-Url: https://codereview.chromium.org/2055023003
2016-06-10 13:56:35 -07:00
reed
6644d9353f respect srgb gamma when building mips
Proposed policy:
- If the target is *legacy* (e.g. L32/PMColor) ignore gamma
- If the target is S32/F16 respect gamma

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

Review-Url: https://codereview.chromium.org/2029373004
2016-06-10 11:41:47 -07:00
mtklein
e18fa440e7 Move immintrin/arm_neon includes to where they are used.
On my Mac (so, immintrin), this improves compile time, both wall and cpu,
by about 16%.  To test I ran this on an SSD with files hot in their caches:

  $ env CC=/usr/bin/clang CXX=/usr/bin/clang++ ./gyp_skia && \
    ninja -C out/Release -t clean && \
    time ninja -C out/Release

  Before: 159 wall / 3367 cpu
          159 wall / 3368 cpu

  After:  137 wall / 2860 cpu
          136 wall / 2863 cpu

I also tried further refining immintrin down to emmintrin / tmmintrin / smmintrin etc.
That made no signficant difference, so I've kept immintrin for its simplicity.

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

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

Committed: https://skia.googlesource.com/skia/+/12dfaaa53c23f3d03050bde8f64136ac1f44164a
Review-Url: https://codereview.chromium.org/2045633002
2016-06-09 13:40:56 -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
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
mtklein
50bcb189f8 Revert of Move immintrin/arm_neon includes to where they are used. (patchset #2 id:20001 of https://codereview.chromium.org/2045633002/ )
Reason for revert:
Appears to have broken the ARMv7 aspect of the Google3 roll in bizarre seemingly-unrelated ways.

Original issue's description:
> Move immintrin/arm_neon includes to where they are used.
>
> On my Mac (so, immintrin), this improves compile time, both wall and cpu,
> by about 16%.  To test I ran this on an SSD with files hot in their caches:
>
>   $ env CC=/usr/bin/clang CXX=/usr/bin/clang++ ./gyp_skia && \
>     ninja -C out/Release -t clean && \
>     time ninja -C out/Release
>
>   Before: 159 wall / 3367 cpu
>           159 wall / 3368 cpu
>
>   After:  137 wall / 2860 cpu
>           136 wall / 2863 cpu
>
> I also tried further refining immintrin down to emmintrin / tmmintrin / smmintrin etc.
> That made no signficant difference, so I've kept immintrin for its simplicity.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2045633002
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> TBR=reed@google.com
> No public API changes.
>
> Committed: https://skia.googlesource.com/skia/+/12dfaaa53c23f3d03050bde8f64136ac1f44164a

TBR=herb@google.com,mtklein@chromium.org
# 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/2046213002
2016-06-07 16:46:39 -07:00
mtklein
12dfaaa53c Move immintrin/arm_neon includes to where they are used.
On my Mac (so, immintrin), this improves compile time, both wall and cpu,
by about 16%.  To test I ran this on an SSD with files hot in their caches:

  $ env CC=/usr/bin/clang CXX=/usr/bin/clang++ ./gyp_skia && \
    ninja -C out/Release -t clean && \
    time ninja -C out/Release

  Before: 159 wall / 3367 cpu
          159 wall / 3368 cpu

  After:  137 wall / 2860 cpu
          136 wall / 2863 cpu

I also tried further refining immintrin down to emmintrin / tmmintrin / smmintrin etc.
That made no signficant difference, so I've kept immintrin for its simplicity.

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

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

Review-Url: https://codereview.chromium.org/2045633002
2016-06-07 09:35:28 -07:00
mtklein
785a5b941a Clean up SkFloatBits
- remove dead code
- rewrite float -> int converters

The strategy for the new converters is:
   - convert input to double
   - floor/ceil/round in double space
   - pin that double to [SK_MinS32, SK_MaxS32]
   - truncate that double to int32_t

This simpler strategy does not work:
   - floor/ceil/round in float space
   - pin that float to [SK_MinS32, SK_MaxS32]
   - truncate that float to int32_t

SK_MinS32 and SK_MaxS32 are not representable as floats:
they round to the nearest float, ±2^31, which makes the
pin insufficient for floats near SK_MinS32 (-2^31+1) or
SK_MaxS32 (+2^31-1).

float only has 24 bits of precision, and we need 31.
double can represent all integers up to 50-something bits.

An alternative is to pin in float to ±2147483520, the last
exactly representable float before SK_MaxS32 (127 too small).

Our tests test that we round as floor(x+0.5), which can
return different numbers than round(x) for negative x.
So this CL explicitly uses floor(x+0.5).

I've updated the tests with ±inf and ±NaN, and tried to
make them a little clearer, especially using SK_MinS32
instead of -SK_MaxS32.

I have not timed anything here.  I have never seen any of these
methods in a profile.

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

Review-Url: https://codereview.chromium.org/2012333003
2016-05-27 10:47:32 -07:00