Commit Graph

17 Commits

Author SHA1 Message Date
Robert Phillips
fde67e4997 Add HW-filtered masks to thread-safe cache
Bug: 1108408
Change-Id: Iace1cea1c79a1f505a5b4da3a4d4c1a713e142ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323505
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-08 13:03:18 +00:00
Robert Phillips
b1807129a6 Centralize CreateLazyView helper in GrThreadSafeUniquelyKeyedProxyViewCache
We'll also be needing this helper for HW-generated blur mask caching

Bug: 1108408
Change-Id: I60d91ae8864239f0cf68830d0a5b4266d27545d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323109
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-07 15:09:20 +00:00
Robert Phillips
6e17ffe829 Add customData capability to the thread-safe proxy cache ...
and begin using it for cached SW-generated blur masks.

This is needed to begin mixing and matching HW & SW-generated blur
masks since they have different draw-rects.

It will also be useful if/when we add support for triangulated paths
to the thread-safe cache.

Bug: 1108408
Change-Id: I085ad1127dc2deb98b35d704b06e50b27c72fd1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322657
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-07 14:18:00 +00:00
Greg Daniel
0eca74cd2c Move bytesPerPixel query off of GrCaps and add bytesPerBlock query.
Part of this change is to move some of this static format information
off of GrCaps since it is not cap dependent in anyway. This allows us
to the need for caps in many places. Also changes the low level format
query to be based off of bytes per block so it can be shared for
compressed and non compressed formats.

This change will also make it easier to add stencil/depth formats in
follow on change since we don't have to fill in a whole caps
FormatInfo block just so we can get the bytesPerPixel which is all
they need.

Bug: skia:10727
Change-Id: I2e6fdabf3ed699b4145ef9e6f0a73078d32a0444
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321463
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-10-01 20:10:12 +00:00
Robert Phillips
aac5728a82 Make GrRRectBlurEffect use the thread-safe uniquely-keyed view cache (take 2)
This yields a ~8% performance improvement on OOP-R/DDL-like rendering of the simpleblurroundrect GM.

Bug: 1108408
Change-Id: I710c75b73a395b2280abf0c5af528e0f6731326d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311720
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320917
2020-09-30 15:54:43 +00:00
Brian Osman
55b69f543c Revert "Make GrRRectBlurEffect use the thread-safe uniquely-keyed view cache"
This reverts commit 4cf00a814f.

Reason for revert: ANGLE and Mali 400 unhappy.

Original change's description:
> Make GrRRectBlurEffect use the thread-safe uniquely-keyed view cache
>
> This yields a ~8% performance improvement on OOP-R/DDL-like rendering of the simpleblurroundrect GM.
>
> Bug: 1108408
> Change-Id: I1ec9477dffe870e5973f8a334a65b1013a4ca3dd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311720
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,robertphillips@google.com,adlai@google.com

Change-Id: Ib7135a2244b956d1a5d06c12a2b4c2ce398b9db2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1108408
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320817
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-09-30 11:23:00 +00:00
Robert Phillips
4cf00a814f Make GrRRectBlurEffect use the thread-safe uniquely-keyed view cache
This yields a ~8% performance improvement on OOP-R/DDL-like rendering of the simpleblurroundrect GM.

Bug: 1108408
Change-Id: I1ec9477dffe870e5973f8a334a65b1013a4ca3dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311720
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-29 23:41:18 +00:00
Robert Phillips
defd223d40 Add correctness checks to GrThreadSafeViewCache tests
Bug: 1108408
Change-Id: I8e815003808624fcd767e5e9a579d3f17e7ddb46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319781
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-28 15:43:53 +00:00
Robert Phillips
3380be9588 Fix creation of gpu resources in GrThreadSafeViewCache tests
This CL implements and exercises the preference for gpu-generated content.

This CL also switches to drawing a rect (vs. an arrow) since drawing
a concave path on the gpu can be fraught.

Bug: 1108408
Change-Id: Ieec1619b5357ffb31aa74b471ea09c061bd8f74e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319416
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-25 17:32:23 +00:00
Robert Phillips
c2fe1644db Add time-based purging to the GrThreadSafeUniquelyKeyedProxyViewCache
Bug: 1108408
Change-Id: I7dd4a3b1b20f3267903dd7f303a2d639b562d84a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318761
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-23 13:07:50 +00:00
Robert Phillips
331699c9ea Yet more GrThreadSafeUniquelyKeyedProxyViewCache purging tests
This CL also renames dropAllUniqueRefs

Bug: 1108408
Change-Id: Ic39ccfc5efafd60d53524562dd308102fb134d94
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318737
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-22 20:02:40 +00:00
Robert Phillips
c61c895393 Fix a GrThreadSafeUniquelyKeyedProxyViewCache test
I broke this when I switched over to the SkTDynamicHash

Bug: 1108408
Change-Id: I906b41330440d084ba2e97c0162af38a79da0529
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318696
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-22 19:08:49 +00:00
Robert Phillips
187b04b357 Increase testing of GrThreadSafeUniquelyKeyedProxyViewCache wrt GrResourceCache purging
Bug: 1108408
Change-Id: I2d6f89ce71b8d94be22b1ff38b9e205df94ca765
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318205
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-09-22 16:54:39 +00:00
Robert Phillips
4559368cc4 Add MRU to GrThreadSafeUniquelyKeyedProxyViewCache
Bug: 1108408
Change-Id: I54ae1512340408e61c2fb2f408b006d6f7697cf7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317860
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-21 13:31:40 +00:00
Robert Phillips
f3e2b3cba3 Switch the thread-safe proxy cache over to using an arena for its entries
Bug: 1108408
Change-Id: Ib0260f72be3ac04fc1cf82c857bf4e99ec4ea239
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317770
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-18 19:42:32 +00:00
Robert Phillips
752f7e1692 Actually test the direct-context's thread-safe proxy cache
This CL:
  connects the tests to the live cache
  switches the cache over to using an SkTDynamicHash

Bug: 1108408
Change-Id: I1876baf13a8d12a1ec398f49e2b2d51f434d6d0e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317764
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-18 18:00:08 +00:00
Robert Phillips
26f3aebf01 Add initial GrThreadSafeUniquelyKeyedProxyViewCache implementation
This is by no means perfect or complete but does break up the review.

Bug: 1108408
Change-Id: Ib1826cd40975c7e84b5fdfc16d1ecbec97dab237
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317201
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-16 16:07:27 +00:00