Commit Graph

9742 Commits

Author SHA1 Message Date
Brian Osman
e8820d45ce Remove legacy flag: GrContextOptions::fDisallowGLSLBinaryCaching
Subsumed by fShaderCacheStrategy, clients have switched over.

Change-Id: I70b6ade4ccab2f48f2ef9437ae65c78cf458cfe4
Bug: skia:9402
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239928
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-09 13:43:51 +00:00
Brian Osman
ed58e004e0 Add support for pre-compiling cached SkSL shaders
The client can do a test run of their application with
a persistent cache set to SkSL mode. They store the key
and data blobs that are produced.

Ship those blobs with the application. At startup, call
GrContext::precompileShader for each key/data pair. This
compiles the shaders, and stores the GL program ID, plus
a small amount of metadata in our runtime program cache.

Caveats:
* Currently only implemented for the GL backend. Other
  backends will require more metadata to do any useful
  amount of work. Metal may need a more drastic workflow
  change, involving offline compilation of the shaders.
* Currently only implemented for cached SkSL (not GLSL
  or program binaries). Supporting other formats again
  requires more metadata, and the cached shaders become
  increasingly specialized to GPU and driver versions.
* Reusing the cached SkSL on different hardware is not
  supported. Many driver workarounds are implemented in
  the SkSL -> GLSL transformation, but some are higher
  level. Limiting device variance by artificially hiding
  extensions may help, but there are no guarantees.

* The 'gltestprecompile' DM config exercises this code
  similarly to 'gltestpersistentcache', ensuring that
  results are visually identical when precompiling, and
  that no cache misses occur after precompiling.

Change-Id: Id314c5d5f5a58fe503a0505a613bd4a540cc3589
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239438
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-06 19:45:09 +00:00
Robert Phillips
aee18c95b1 Cleanup after removal of IORefs from GrSurface
The removal of IORefs from GrSurface makes a lot of other cruft obsolete.

Change-Id: I0e02d680a17dc4f4ec705cb6ee4c294738271e28
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239919
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-09-06 17:55:45 +00:00
Robert Phillips
d470e1b905 Add kRG_88_SkColorType
Bug: skia:9121

Change-Id: Id2a12a5d607b84ce393d2b58233bf8e23f646059
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235797
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-09-06 17:55:26 +00:00
Heather Miller
4655534302 Update Skia milestone to 79
Change-Id: I248831c58b3c01d356942cd0de61447292720ccb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239446
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
Auto-Submit: Heather Miller <hcm@google.com>
2019-09-06 17:17:06 +00:00
Brian Osman
172bb44f2d Make the size of program/pipeline caches configurable in GrContextOptions
Change-Id: I988fd8cc7e78e2124f20b7d8a815f160bb166756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239756
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-06 14:43:05 +00:00
Robert Phillips
bf8bf83642 Remove IORefs from GrSurface
Change-Id: Ib52b54acbf91e3993a6791b83c759fa768c3fdd1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236339
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-09-06 12:41:35 +00:00
Mike Reed
8fda88ed6d reverse/restore order of verbs in path to be forward (normal)
As part of this (clean up), also removed support for serialized-paths
older than version-4, which was introduced Feb 2018.

Change-Id: I2dc74a52bb8bdd7ea0cb2d8a78b644ca783eb31f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239102
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-09-05 21:14:08 +00:00
Brian Osman
a66081d943 Move SkSL caching out of GR_TEST_UTILS, trim persistent cache options
Combines the two boolean options into a single tri-state enum. Old GLSL
option is still present (temporarily) until Chrome is switched over.

Also add a type tag for cached program binaries, so we can safely
detect cache entries of the wrong type.

Change-Id: I0ddeefa9180b27bc2c46e2e7b77e6c9cdf4a730a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238856
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-03 20:18:48 +00:00
Robert Phillips
cf39f375d1 Remove maxCount resource cache limit
Change-Id: I0f1064c8433d69e24ca3d5b970c99d539dc1dadd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238442
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-03 14:59:51 +00:00
Mike Reed
6e637472eb remove legacy flag SK_SUPPORT_LEGACY_RECT_PARAMS
Change-Id: If44832593bfb3877e1fe7c68ec64c70f0d595ed5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238176
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-08-31 12:12:19 +00:00
Chris Dalton
4ece96d76d Reland "Initiate MSAA resolves during DAG generation"
This is a reland of 804f6a0fe7

Original change's description:
> Initiate MSAA resolves during DAG generation
> 
> Adds an "fIsMSAADirty" flag to GrRenderTargetProxy and switches to
> resolving MSAA in GrTextureResolveRenderTask. This completes our push
> to resolve textures outside of render passes.
> 
> For the time being, we only store a dirty flag on the proxy and still
> rely on the GrRenderTarget itself to track the actual dirty rect. This
> will be followed by a CL that moves the dirty rect out of
> GrRenderTarget and into the proxy.
> 
> Bug: skia:
> Change-Id: I21219a58028bdb4590940210e565133093cd34b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235672
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Bug: skia:
Change-Id: I805b3af1404eb7919ae937cff3dfa97921e32c69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237482
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-30 17:54:10 +00:00
Peng Huang
21d726de0b Add SkSurfaceProp::operator!=.
Bug: skia: None
Change-Id: Iead86585ecb2151a91e5e81da7d75d74a86819ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237444
Commit-Queue: Peng Huang <penghuang@chromium.org>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Peng Huang <penghuang@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-08-30 15:27:33 +00:00
Brian Salomon
a036f0d54e Make GrSurfaceProxy derive from GrNonAtomicRef and remove GrIORefProxy.
Also, expose GrNonAtomicRef's ref count. Since it's non-atomic and not
thread-safe it seems fine.

Change-Id: I5cf48e60d32094354955b2614cfeebbb4c1ecf2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238059
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-29 19:03:33 +00:00
Hal Canary
b1f411ac05 tools/skui: put all enums in a common namespace
Change-Id: Icd331e8946d80652750b8b6ea0db65f5f676ac3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238058
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-08-29 15:39:32 +00:00
Michael Ludwig
6c580f3cc1 Revert "Fix flutter roll"
This reverts commit 7be971fa3a.

Reason for revert: Flutter has been updated to new API, these patches
should not be necessary.

Original change's description:
> Fix flutter roll
>
> Flutter extends from the SkCanvasVirtualEnforcer, so the prior change
> to onDrawEdgeAAQuad to accept an SkColor4f instead of SkColor broke
> their build, the flutter roller, and--transitively--the G3 roller.
>
> This keeps the old onDrawEdgeAAQuad around as a no-op so their
> canvas_spy class can extend from it.
>
> TBR=bsalomon@google.com, stani@google.com
>
> Bug: skia:
> Change-Id: I3798ec60a21e90c3d3f5d59f19f7dbe62e37cbec
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237590
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,stani@google.com,michaelludwig@google.com

Change-Id: I2946043dbddfdfc8c853e68853a8a349db0b5ab1
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237901
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-08-28 19:50:56 +00:00
Jim Van Verth
066ceb15b6 Implement fences and semaphores for Metal.
GrFence is implemented by a single MTLSharedEvent where we increase the
value with each new invocation. GrSemaphore uses a MTLEvent (the
assumption here is that we are signaling and waiting on the same device)
with an associated value that defaults to 1. For generating a large
number of GrSemaphores at once it should be possible to use the same
MTLEvent but with different assigned values.

Bug: skia:8243
Change-Id: Ic7de2d9d295fbe51e67bc7c3c4354257cb0774d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233416
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-08-28 19:38:56 +00:00
Michael Ludwig
7be971fa3a Fix flutter roll
Flutter extends from the SkCanvasVirtualEnforcer, so the prior change
to onDrawEdgeAAQuad to accept an SkColor4f instead of SkColor broke
their build, the flutter roller, and--transitively--the G3 roller.

This keeps the old onDrawEdgeAAQuad around as a no-op so their
canvas_spy class can extend from it.

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

Bug: skia:
Change-Id: I3798ec60a21e90c3d3f5d59f19f7dbe62e37cbec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237590
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-08-28 02:33:22 +00:00
Michael Ludwig
a595f86428 Add Color4f variant for DrawEdgeAAQuad
Bug: chromium:795132,chromium:985500
Change-Id: Idbb4d45b29d2c0d0fd54b05b807086ecf0b8cf26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237492
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-08-27 23:22:32 +00:00
Ben Wagner
c17de1d2b7 Add a way to disable baseline snapping.
Skia has traditionally snapped horizontal and vertical baslines to
pixels as a kind of baseline hinting. This is a feature which cannot
reliably be implemented from the outside and tends to make static text
better looking by ensuring the baselines are consistent. However, with
animation like scrolling or flying and resizing text the animation
suffers. Allow the user to disable the baseline snapping.

Change-Id: I6ee1c12a07242d10c08ae4b75c73e4e28c860790
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237124
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-08-27 19:54:29 +00:00
Mike Klein
334a642b20 remove unused sk_sp comparison operators
These unused comparison operators are the only users of
<functional> in SkRefCnt.h, for std::less.  <functional>
is an expensive header to compile, and SkRefCnt.h is popular,
so it helps to cut dependencies like this.

Mostly we just need to add #include <functional> in a few
places that were picking it up via SkRefCnt.h.

In SkPixmapPriv.h, it looked simpler to template the argument,
since everything was inline anyway.

Change-Id: I7c125bb26a04199847357c729a1b178256c6ef8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236942
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-08-27 14:52:01 +00:00
Mike Klein
48e08aa973 <ostream> -> <iosfwd>
<ostream> is one of the more expensive headers to include
and that's amplified by SkRefCnt.h's popularity.

We've been including <ostream> for sk_sp's operator<<.  That's only
used by Chromium and while we could just sprinkle in a bunch of .get()
calls and remove operator<<, when I started going through and actually
doing that I got the feeling I was making things pointlessly harder to
read and write, and wanted to find a way to make it actually work.

My next instinct was to template it without mentioning ostreams,

    template <typename OS, typename T>
    auto operator<<(OS& os, const sk_sp<T>& sp) -> decltype(os << sp.get()) {
        return os << sp.get();
    }

but that makes this operator<< ambiguous with some other templated operator<<
in GTest.  They got in first, so they win...

So ultimately, switch <ostream> to <iosfwd>.   Anyone using our
operator<<() presumably has <ostream> included already, and the #include
cost for <iosfwd> is small enough that I don't think we'll mind keeping
this around indefinitely.

To repro, look at before/after of -ftime-trace:

    ~/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang++ -I. -Os -c src/core/SkCanvas.cpp -ftime-trace

I have tested locally that Chromium builds with this change.

Change-Id: I9decc2e65b5cc8fd07d8106a5eff81901aedd7d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237190
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-08-27 13:08:56 +00:00
Herb Derby
30cd12e814 Track RemoteStrikes to send using pointers instead of descriptors
This reduces the number of map lookups that need to happen.

Change-Id: I068819f2576bf644a5c3550d48e69413e19179d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237217
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
2019-08-26 22:10:20 +00:00
Chris Dalton
6f31cc3882 Revert "Initiate MSAA resolves during DAG generation"
This reverts commit 804f6a0fe7.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Initiate MSAA resolves during DAG generation
> 
> Adds an "fIsMSAADirty" flag to GrRenderTargetProxy and switches to
> resolving MSAA in GrTextureResolveRenderTask. This completes our push
> to resolve textures outside of render passes.
> 
> For the time being, we only store a dirty flag on the proxy and still
> rely on the GrRenderTarget itself to track the actual dirty rect. This
> will be followed by a CL that moves the dirty rect out of
> GrRenderTarget and into the proxy.
> 
> Bug: skia:
> Change-Id: I21219a58028bdb4590940210e565133093cd34b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235672
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: Ife557caa840edfb64cbcafc272dc3012cfb43702
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237242
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-08-26 20:18:57 +00:00
Chris Dalton
804f6a0fe7 Initiate MSAA resolves during DAG generation
Adds an "fIsMSAADirty" flag to GrRenderTargetProxy and switches to
resolving MSAA in GrTextureResolveRenderTask. This completes our push
to resolve textures outside of render passes.

For the time being, we only store a dirty flag on the proxy and still
rely on the GrRenderTarget itself to track the actual dirty rect. This
will be followed by a CL that moves the dirty rect out of
GrRenderTarget and into the proxy.

Bug: skia:
Change-Id: I21219a58028bdb4590940210e565133093cd34b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235672
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-26 18:36:53 +00:00
Greg Daniel
2d41d0d363 Remove GrGpuTextureCommandBuffer class and rename to GrOpsRenderPass.
Change-Id: Ia6e666a7bb986bb3dc769d25919580bca17b4748
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236556
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-26 15:34:14 +00:00
Mike Reed
3012cbaa20 remove unneeded noemptycheck variants of intersect
The existing intersect logic already fails if either argument is empty,
without performing any extra checks.

Change-Id: I4cc4f1e63af7efbed4e1084284c1607c104ff361
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237142
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-08-26 15:03:44 +00:00
Mike Reed
92b33354dd more rect api simplifications
set --> setLTRB
set(pts, count) --> setBounds

Bug: skia:9328
Change-Id: I807c0598a8b23b2f721db118ec41c1607114205a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237038
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-08-25 10:12:57 +00:00
Greg Daniel
9313874349 Rename GrContextOption fReduceOpListSplitting to fReduceOpsTaskSplitting.
Change-Id: Ieba56fa4c4926fc0a118d84950fa1eb78a48a29e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236576
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2019-08-23 18:43:27 +00:00
Mike Klein
359f61b101 track SkNoPixelsDevice's origin
Today we do a fairly decent job of tracking device bounds as an SkIRect,
with a little more of that plumbed through here, but that gets foiled in
SkNoPixelsDevice's constructor where we only look at bounds.width() and
bounds.height().

I think the idea was to follow the usual constraint that a "base" layer
has an origin at (0,0) and only temporary "save" layers on top might be
offset, but for a device without any pixels it's pretty reasonable for
the base layer to be offset too.

This makes picture_cull_rect draw correctly in serialize-8888 mode.

Bug: skia:9334
Change-Id: I845e74779bb21cbfd4051b0ef07381e684176eac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236859
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-08-23 17:52:18 +00:00
Mike Reed
9ea6315692 remove redundant rect methods
Bug: skia:9328
Change-Id: Idc20e125a4a4725c88e291b49e33cc56805836ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235832
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-08-23 17:49:27 +00:00
Greg Daniel
f41b2bd449 Reland "Merge GrOpList and GrRTOpList and rename to GrOpsTask."
This reverts commit f21bf9e50b.

Reason for revert: relanding with infra fix

Original change's description:
> Revert "Merge GrOpList and GrRTOpList and rename to GrOpsTask."
>
> This reverts commit 2a5954140b.
>
> Reason for revert: breaking everything
>
> Original change's description:
> > Merge GrOpList and GrRTOpList and rename to GrOpsTask.
> >
> > Change-Id: I8f4f2218a30fd0541a8f79f7bb9850f9500cd243
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236343
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: I27840ea0343e8e6b388556afb7bd2e76386d611d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236349
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ibd3a06e4a91dbb1f225dcc8d17d0db3967b6f85f
No-Presubmit: true
No-Tree-Checks: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236350
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-08-22 20:52:09 +00:00
Greg Daniel
f21bf9e50b Revert "Merge GrOpList and GrRTOpList and rename to GrOpsTask."
This reverts commit 2a5954140b.

Reason for revert: breaking everything

Original change's description:
> Merge GrOpList and GrRTOpList and rename to GrOpsTask.
> 
> Change-Id: I8f4f2218a30fd0541a8f79f7bb9850f9500cd243
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236343
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I27840ea0343e8e6b388556afb7bd2e76386d611d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236349
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-08-22 20:12:38 +00:00
Greg Daniel
2a5954140b Merge GrOpList and GrRTOpList and rename to GrOpsTask.
Change-Id: I8f4f2218a30fd0541a8f79f7bb9850f9500cd243
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236343
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-22 19:33:01 +00:00
Brian Osman
068af9e416 Revert "Temporary Lua hook to measure impact of conservative convexity"
This reverts commit e67133b8e5.

Removing testing code that's no longer needed.

Change-Id: I27bc5c77d1bc1b928d5cdb89daf82ab5fd3878c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236338
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-22 15:07:20 +00:00
Brian Salomon
197c586471 limit SK_API exposure on GrTexture
Change-Id: I28ba40546cd5e16af95fa02344d7887bae80c79c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236218
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-22 14:03:28 +00:00
Brian Salomon
57f211b56a SK_API in src/gpu cleanup
Change-Id: I14d6f7ef06c3cfcefd0813dd5013e4185b12d8cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235804
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-22 02:00:07 +00:00
Florin Malita
49d140dbad [svgcanvas] Add flag to suppress newlines and tabs in XML
Bug: skia:9343
Change-Id: Id82f998ac57fc787aeb4435a6907047ea680d2fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236157
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-08-21 20:17:37 +00:00
Chris Dalton
30eea6c87c Convert GrManyDependentsMipMappedTest to a mock gpu test
This allows us to test with fReduceOpListSplitting both enabled and
disabled.

This CL also requires adding basic mipmap support to GrMockGpu.

Bug: skia:
Change-Id: I97ba912a9e5f3b90756c027ac19c003c99c15902
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235996
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-21 16:55:23 +00:00
Brian Salomon
bf6b9795f6 GrSurfaceContext not ref counted.
Also don't specify redundant width/height to SkGpuDevice.

Change-Id: I389df5c4b073c2c05632ba6b7c95b02a22dfaf98
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235824
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-21 15:31:23 +00:00
Ben Wagner
0b9801eadc Use void(void*) instead of decltype with sk_free.
Unfortunately, boringssl also declares a function named sk_free making
decltype give an error since the function is overloaded if both Skia and
BoringSSL headers are included in the same TU (as happens in ChromeOS
builds). In theory one can use decltype and specify which overload to
use, but this is far more verbose than just specifying the type.

Change-Id: I7dfefbce0a75c7ff6791b58287f26f2cc47c8eca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235828
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-08-20 22:28:42 +00:00
Ben Wagner
723a877d0c Make SkFunctionWrapper a better wrapper.
SkFunctionWrapper was made to be a simple abstraction over existing
resource release functions which generally follow a specific pattern of
returning void and taking a pointer to the underlying type. However,
this has been observed to be an unnecessary limit. This makes it more
generic while also making the call sites a little less brittle.

This change also uncovered an issue in msvc v19.20 to v19.22, see
https://developercommunity.visualstudio.com/content/problem/698192/in-templateusing-decltype-is-void.html
To work around this, several otherwise redundant '&' are used.

There was an attempt to take references to functions instead of pointers
to functions which greatly simplifies the intermediate wrappers.
However, that uncovered another issue in msvc, see
https://developercommunity.visualstudio.com/content/problem/699878/function-to-pointer.html

Change-Id: I54ab945ed9d9cfd0204d4d6650c2fde47cc9e175
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235105
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-08-20 20:31:36 +00:00
Brian Osman
e53f7ff95f Reland "Remove old version of MakeCrossContextFromPixmap"
This reverts commit a0c9d43c20.

Reason for revert: G3 references should all be updated.

Original change's description:
> Revert "Remove old version of MakeCrossContextFromPixmap"
> 
> This reverts commit 237a95fe7b.
> 
> Reason for revert: Flutter in Google 3.
> 
> Original change's description:
> > Remove old version of MakeCrossContextFromPixmap
> > 
> > Client code has been updated
> > 
> > Change-Id: Ic6102effc63c0f4f00a47b8876107aa0b2306e32
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235296
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> 
> TBR=brianosman@google.com,reed@google.com
> 
> Change-Id: I0a290030e55987c690b51470a381aca2b6faab2f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235397
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=brianosman@google.com,reed@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I778bccf7b1c085413a3d119169686e68777bc344
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235856
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-20 14:49:59 +00:00
Mike Reed
5f152f0745 add path-edger; lightweight Iter for edges
4.07  	pathiter_edge	nonrendering
      6.74  	pathiter_raw	nonrendering
      9.16  	pathiter_iter	nonrendering

Change-Id: Id711b342fbac6b4efd62ce918cf440b04973545c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235476
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-08-19 21:58:37 +00:00
Brian Osman
e67133b8e5 Temporary Lua hook to measure impact of conservative convexity
Change-Id: I3be1a4d402a3a7adc6a28d716302d3c9f9316b14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235676
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-19 19:45:37 +00:00
Robert Phillips
eb3eb98eb6 Add textureReleaseProc and releaseContext to SkImage factory functions
Specifically:
 MakeFromYUVATexturesCopyWithExternalBackend
 MakeFromNV12TexturesCopyWithExternalBackend

Change-Id: I41c16eb87e1a8fe9ec1fb4b7e6995e07374bb62c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235600
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-08-19 19:08:07 +00:00
Greg Daniel
212dada392 Remove some unused GrPixelConfig functions.
Bug: skia:6718
Change-Id: I729eb1cff28c42fae548f0217f97b3b9fda02656
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235598
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-19 15:47:34 +00:00
Chris Dalton
3f7932e733 Add kRequiresManualMSAAResolve to GrInternalSurfaceFlags
We will use this flag to check whether a proxy needs manual msaa
resolve, and if so, install a render task to do just that when it is
dirty and about to be read from.

For the time being, we are leaving GrRenderTarget::getResovleType in
place. This will allow us to assert that requiresManualMSAAResolve
works as expected. Long term, we plan to delete the former in favor of
the latter.

Bug: skia:
Change-Id: I155fa2a6d876edd339232c7c8208015d5da2c8ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234436
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-19 15:04:30 +00:00
Brian Osman
a0c9d43c20 Revert "Remove old version of MakeCrossContextFromPixmap"
This reverts commit 237a95fe7b.

Reason for revert: Flutter in Google 3.

Original change's description:
> Remove old version of MakeCrossContextFromPixmap
> 
> Client code has been updated
> 
> Change-Id: Ic6102effc63c0f4f00a47b8876107aa0b2306e32
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235296
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=brianosman@google.com,reed@google.com

Change-Id: I0a290030e55987c690b51470a381aca2b6faab2f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235397
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-16 20:52:09 +00:00
Mike Reed
ba7e9a6365 never check for degenerates in path::iter
This does not appear to be used externally, and only internally in 3
sites in GPU, which we can handle explicitly.

For now you can still pass bools to Iter::next() but they are ignored.
After this lands, I will update the callers to remove those.

FWIW: none of our other tests or gms seem to notice this change...

Bug: skia:9339
Change-Id: If40077b1ebb3d47cfce0ec43996ff272318e4a62
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235104
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-08-16 20:39:05 +00:00