This reverts commit 837c6c7c0c.
Bug: skia:
Change-Id: I1821f1b2b772c67f1b749692b398eb757d8073c9
Reviewed-on: https://skia-review.googlesource.com/52744
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: Id2ae524f765414e4c3d990066fcd3ebcea693657
Reviewed-on: https://skia-review.googlesource.com/52781
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This reverts commit 742f3d02a1.
Reason for revert: Aaah!
Original change's description:
> Make threaded proxy generation MDB-friendly, and defer instantiation
>
> Replaces GrPrepareCallback with GrDeferredProxyUploader, stored directly
> on GrTextureProxy. Op lists now store a list of referenced proxies that
> are being generated by worker threads. At flush time, iterate over those
> proxies, and invoke their uploader.
>
> Lifetime of the uploader object is now tied to the proxy, but the ASAP
> upload function will free the proxy's uploader, if it's called.
>
> Bug: skia:
> Change-Id: Ieb2c6a805d19990012839a8e103c3ca5b8d3dfc6
> Reviewed-on: https://skia-review.googlesource.com/49904
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com
Change-Id: I8f76a67044dc4159f903097d8b1ef19ffb48c730
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/52760
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Replaces GrPrepareCallback with GrDeferredProxyUploader, stored directly
on GrTextureProxy. Op lists now store a list of referenced proxies that
are being generated by worker threads. At flush time, iterate over those
proxies, and invoke their uploader.
Lifetime of the uploader object is now tied to the proxy, but the ASAP
upload function will free the proxy's uploader, if it's called.
Bug: skia:
Change-Id: Ieb2c6a805d19990012839a8e103c3ca5b8d3dfc6
Reviewed-on: https://skia-review.googlesource.com/49904
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Several upcoming additions should go in here
Change-Id: I642f3c7cc36b1e6512ee0170640449e88a666d2c
Reviewed-on: https://skia-review.googlesource.com/52661
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 88757dacd4.
Reason for revert: Still seems to be failing Chromium "telemetry_perf_unittests (with patch) on Android" on android_n5x_swarming_rel.
Original change's description:
> guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
>
> Now with legacy behavior for allocpixels
>
> This was reverted, so the current CL is a "fix" on top of ...
> https://skia-review.googlesource.com/c/skia/+/50980
>
> Related update to Chrome (in preparation for this change)
> https://chromium-review.googlesource.com/c/chromium/src/+/685719
>
> Bug: skia:
> Change-Id: I4b370ee7e95083ab27421f008132219c9c7b86e9
> Reviewed-on: https://skia-review.googlesource.com/51341
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=fmalita@chromium.org,reed@google.com
Change-Id: I827a0ca1d1e3909e648fde3342cdb8601d34da8d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/52381
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 98a6216b18.
Reason for revert: breaking the chrome roll. Looks like they may be writing data to create an image across all the row bytes and thus writing to unalloced data on the last row. Link to example failing bot:
https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/539960
Original change's description:
> guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
>
> Previously we had size_t and uint64_t variations.
>
> The new (simpler) API always..
> - returns size_t, or 0 if the calculation overflowed
> - returns the trimmed size (does not include rowBytes padding for the last row)
>
> Bug: skia:
> Change-Id: I05173e877918327c7b207d2f7f1ab0db36892e2e
> Reviewed-on: https://skia-review.googlesource.com/50980
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
TBR=mtklein@google.com,herb@google.com,scroggo@google.com,fmalita@chromium.org,reed@google.com
Change-Id: I726f6ab1b36b14979ba6f37105e0a469b3f0dbc0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/51262
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Previously we had size_t and uint64_t variations.
The new (simpler) API always..
- returns size_t, or 0 if the calculation overflowed
- returns the trimmed size (does not include rowBytes padding for the last row)
Bug: skia:
Change-Id: I05173e877918327c7b207d2f7f1ab0db36892e2e
Reviewed-on: https://skia-review.googlesource.com/50980
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
For this to work, we need access to the "original" path,
before any style was applied. To that end, add an original
path to GrShape (and unit tests of that functionality).
Then add a version of addGenIDChangeListener to GrShape,
that propagates to the original path, and use that in
tessellating path renderer.
Includes unit tests of caching behavior in the PR, all
of which failed without this change.
Bug: skia:
Change-Id: I98bb505f521e8ff07184f5c3fbd3c5fd1a22d3d5
Reviewed-on: https://skia-review.googlesource.com/50300
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: chromium:712455
Change-Id: Ic9bb9b862abe01f112cc41d28589733460b15bc1
Reviewed-on: https://skia-review.googlesource.com/50181
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This CL will enable Android to statically link libskia into libhwui
while still exposing the symbols needed by other components of the
system.
Bug: b/31971097
Change-Id: Ib6c87331dbe456e247b46a34c38da4863dfe02f0
Reviewed-on: https://skia-review.googlesource.com/49766
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
The GN->Android.bp script runs with target_cpu="none",
but Android needs SkJumper_generated.S. Just skip it
explicitly for WASM.
Change-Id: I07b9761c591d48198460ce6300ed3bc9fd02a487
Reviewed-on: https://skia-review.googlesource.com/49903
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Fix core.gni to use not use Assembler for none cpu.
Right now, there are no outputs because we aren't compiling
dm or nanobench. However, this still compiles the skia
library and creates two executables, so it's a good canary
for a real WASM build.
Additional note: the two executables in question don't draw
anything to the screen via GL, which is still not possible with
Skia+WASM.
Bug: skia:
Change-Id: I0d767467e94e40d01070e34223dd90e96f1c96f2
Reviewed-on: https://skia-review.googlesource.com/49540
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Eric Boren <borenet@google.com>
Bug: chromium:762167
Change-Id: Ia23f6dbfc0466aef4ca9d1a5b9ff343d79dc83bb
Reviewed-on: https://skia-review.googlesource.com/47460
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
I have text_16_AA_FF -> 8888 (forcing RP) faster than head now on my
laptop. I'm feeling confident that we can make this perform well.
After looking at performance a bit more today, it looks like everything
is within what I'd consider comparable in performance, especially on
ARM. On x86-64 it looks like big bulk blits get a little slower and
small mask blits get a little faster.
Quality looks good, and maybe improved for 565.
There are fewer platform-specific differences now in _lowp, and I think
they're few enough now that we could even consider completing the
unification by folding the 8-bit and float code together. Rename
"div255()" to "rebias()", slap on a few coats of paint...
Guarded for Chrome with SK_JUMPER_LEGACY_LOWP.
Change-Id: I36309c07cf736f3cb31952cca66030ad56026318
Reviewed-on: https://skia-review.googlesource.com/45982
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
All of the published coefficients assume math is being done on bytes, and
that 128 is the encoding of 0 (in the biased Cb and Cr values). When
sampling an A8 texture, though, GPUs typically decode as byte/255. Thus,
128 ends up slightly larger than 0.5. To fix this, just adjust the bias
terms to be scaled by 128/255, rather than 0.5.
I also changed some of the other coefficients to be higher precision,
based on the values in ITU-T T.871.
This originally surfaced as a Chromium bug where an all-black JPG decoded
to (1/255, 0, 1/255) on GPU. I've added a GM that encodes a color cube to
JPG, then draws from the encoded data. GPU and CPU (libjpeg) still
disagree in many cases, but the newer version performs much better
(diffing gl and 8888 configs):
Previously: 95.2% of pixels differ, max diff of 2, avg diff of 1
Now : 65.4% of pixels differ, max diff of 1, avg diff of 0
Bug: skia:7038 chromium:763605
Change-Id: I4801db9f6e2fc4d4109eb5e27c9499f214084d38
Reviewed-on: https://skia-review.googlesource.com/45842
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Also refactor the prepare callback stuff to share logic
between software path rendering and clip mask generation.
Bug: skia:
Change-Id: I0c56c6df8703eb59d2d49a4c3985bd4f5ef20f01
Reviewed-on: https://skia-review.googlesource.com/44421
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This reverts commit c576e93d17.
Reason for revert: ASAN failures
Original change's description:
> Switch to the new SkSL lexer.
>
> This completely replaces flex with a new in-house lexical analyzer generator,
> which we have done for performance and memory usage reasons. Flex requires us
> to copy strings every time we need the text of a token, whereas this new lexer
> allows us to handle strings as a (non-null-terminated) pointer and length
> everywhere, eliminating most string copies.
>
> Bug: skia:
> Change-Id: I2add26efc9e20cb699520e82abcf713af3968aca
> Reviewed-on: https://skia-review.googlesource.com/39780
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=bsalomon@google.com,ethannicholas@google.com
Change-Id: If27b750a5f696d06a6bcffed12fe9f0598e084a6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/44881
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This completely replaces flex with a new in-house lexical analyzer generator,
which we have done for performance and memory usage reasons. Flex requires us
to copy strings every time we need the text of a token, whereas this new lexer
allows us to handle strings as a (non-null-terminated) pointer and length
everywhere, eliminating most string copies.
Bug: skia:
Change-Id: I2add26efc9e20cb699520e82abcf713af3968aca
Reviewed-on: https://skia-review.googlesource.com/39780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Disable some new warning flags to get us building.
Change-Id: I10299d667b06fb61d03e52329883c634bd42f45c
Reviewed-on: https://skia-review.googlesource.com/44341
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
The main change is to make GrSamplerParams smaller by making its enums have byte-sized underlying types. The rest is cosmetic.
Change-Id: Ib71ea50612d24619a85e463826c6b8dfb9b445e3
Reviewed-on: https://skia-review.googlesource.com/43200
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Creates a GrCCPRGeometry class that chops contours up into simple
segments that ccpr can render, and rewrites the GPU buffer creation to
be able to handle arbitrary lengths of ccpr geometry.
Bug: skia:
Change-Id: Iaa173a02729e177b0ed7ef7fbb9195d349be689d
Reviewed-on: https://skia-review.googlesource.com/41963
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Change-Id: I06e6b63c2742da069f48ff5d7defafc63a485af7
Reviewed-on: https://skia-review.googlesource.com/41842
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:
Change-Id: Ic8b25ca2ecf51cfc190ac01bc9282396905a33b3
Reviewed-on: https://skia-review.googlesource.com/40862
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Chrome would like to perform cpu-side preprocessing for gpu draws in parallel.
They do not want to go through a picture (since they have their own display list format).
The general idea is that we add a new SkDeferredDisplayListRecorder class to
perform all of Ganesh's cpu-side preprocessing ahead of time and in parallel.
The SkDDLRecorder operates like SkPictureRecorder. The user can get an SkCanvas
from the SkDDLRecorder and feed it draw operations. Once finished, the user
calls 'detach' to get an SkDeferredDisplayList. All the work up to and
including the 'detach' call can be done in parallel and will not touch
the GPU. To actually get pixels the client must call SkSurface::draw(SkDDL)
on an SkSurface that is "compatible" with the surface characterization
initially given to the SkDDLMaker.
The surface characterization contains the minimum amount of information Ganesh needs
to know about the ultimate destination in order to perform its cpu-side work
(i.e., caps, width, height, config).
Change-Id: I75faa483ab5a6b779c8de56ea56b9d90b990f43a
Reviewed-on: https://skia-review.googlesource.com/30140
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: Ib8f4d6c41356cf0fe2e14b7bff7713d107eaa01f
Reviewed-on: https://skia-review.googlesource.com/40687
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This adds a fallback backtracer for use on Android where <execinfo.h>
ins't present, instead using <unwind.h> to unwind and <dlfcn.h> to
lookup function names and addresses.
lockf() wasn't available until NDK API 24, so I've just no-op'd file
locking on older targets. I tried switching from lockf() to flock(),
but flock() didn't see to _do_ anything, neither on Android nor on my
Mac laptop. I think I should be able to use the lower-level fcntl()
APIs to restore file locking uniformly in a follow-up. The upshot is
until then, we'll have interlaced logs and stack traces on Android
devices unless you set ndk_api=24 in GN.
We need to add a couple build flags to make backtraces useful:
* -funwind-tables makes the call to _Unwind_Backtrace() actually
traverse the call stack. This is a small extra binary size cost.
* -rdynamic makes symbols linked into the main executable visible
to dladdr(). We do this on Linux already for the same reason.
Here's an example where I made aaxfermodes call SK_ABORT():
650 ok, 1 crashed
caught signal SIGABRT while running 'aaxfermodes'
0x76ed936288 [unknown]+308
0x76eec014e0 [unknown]+510811706592
0x76ed367b2c tgkill+8
0x76ed364f50 pthread_kill+68
0x76ed31ff5c raise+28
0x76ed318814 abort+56
0x76edebd070 sk_out_of_memory()+12
0x76ed99f664 AAXfermodesGM::draw_pass(SkCanvas*, AAXfermodesGM::DrawingPass)+96
0x76ed99f4e4 AAXfermodesGM::onDraw(SkCanvas*)+36
0x76ed9e8550 skiagm::GM::drawContent(SkCanvas*)+224
0x76ed9e82ac skiagm::GM::draw(SkCanvas*)+288
0x76ed93b10c GMStream::GMSrc::draw(SkCanvas*)+96
0x76ed937b08 SWDst::draw(Src*)+284
0x76ed936ca0 [unknown]+112
0x76ed939b4c ForkEngine::spawn(std::function<Status ()>)+88
0x76ed934d00 main+2200
0x76ed316598 __libc_init+92
0x76ed93434c [unknown]+510791992140
Change-Id: Ica4849d99a3b97f48d778f4c15a7fa36275b8133
Reviewed-on: https://skia-review.googlesource.com/40802
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This reverts commit 6d13575108.
Now with guards for "errors" like this:
external/skia/src/jumper/SkJumper_stages_8bit.cpp:240:50: error:
'memcpy' called with size bigger than buffer
case 12: memcpy(&v, src, 12*sizeof(T)); break;
This code is unreachable and generally removed by Clang's optimizer
anyway... as far as I can tell the code generation diff is arbitrary.
Change-Id: I6216567caaa6166f71258bd25343a09e93892a10
Reviewed-on: https://skia-review.googlesource.com/39961
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This reverts commit 08133583d5.
Reason for revert: Blocking Android Autoroller on compile error.
Original change's description:
> 8-bit jumper on armv8
>
> The GM diffs are all minor and what you'd expect.
>
> I did a quick performance sanity check, which also looks fine.
>
> $ out/ok bench rp filter:search=Modulate
> [blendmode_rect_Modulate] 30.2ms @0 32ms @95 32ms @100
> [blendmode_mask_Modulate] 12.6ms @0 12.6ms @95 14.5ms @100
> ~~~>
> [blendmode_rect_Modulate] 11.2ms @0 11.7ms @95 12.4ms @100
> [blendmode_mask_Modulate] 10.5ms @0 23.6ms @95 23.9ms @100
>
> This isn't even really the fastest we can make 8-bit go on ARMv8;
> it's actually much more natural to work de-interlaced there. Lots
> of room to follow up.
>
> Change-Id: I86b1099f6742bcb0b8b4fa153e85eaba9567cbf7
> Reviewed-on: https://skia-review.googlesource.com/39740
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
TBR=mtklein@chromium.org,herb@google.com,fmalita@chromium.org,reed@google.com
Change-Id: I71425d8b7fbb66be5cb50025871dd81358111da4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/39980
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
The GM diffs are all minor and what you'd expect.
I did a quick performance sanity check, which also looks fine.
$ out/ok bench rp filter:search=Modulate
[blendmode_rect_Modulate] 30.2ms @0 32ms @95 32ms @100
[blendmode_mask_Modulate] 12.6ms @0 12.6ms @95 14.5ms @100
~~~>
[blendmode_rect_Modulate] 11.2ms @0 11.7ms @95 12.4ms @100
[blendmode_mask_Modulate] 10.5ms @0 23.6ms @95 23.9ms @100
This isn't even really the fastest we can make 8-bit go on ARMv8;
it's actually much more natural to work de-interlaced there. Lots
of room to follow up.
Change-Id: I86b1099f6742bcb0b8b4fa153e85eaba9567cbf7
Reviewed-on: https://skia-review.googlesource.com/39740
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Enough ccpr-specific geometry code is in flight that it feels like it
should have its own file.
Bug: skia:
Change-Id: I99ef620a7dc35178cf774b3a4ec6159d46f401c7
Reviewed-on: https://skia-review.googlesource.com/39162
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 20af6d12ee.
Performance regressions on Android and Flutter
Change-Id: If70edbe85aa251f298eddf18a89ba2cf56ed94fb
Reviewed-on: https://skia-review.googlesource.com/37340
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
The SkiaRenderer in chromium is going to use the overdraw canvas and
filter for measuring overdraw. Move these headers out of src/ into
include/.
Bug: chromium:704285
Change-Id: I2abb1671b73e3d26552462cf700340a7e3b874f0
Reviewed-on: https://skia-review.googlesource.com/36160
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Adds basic support for creating non-msaa pure render targets.
Bug: skia:
Change-Id: I63d2d474b86fc0ff5d8ee7757c08abbfd5e6c6ef
Reviewed-on: https://skia-review.googlesource.com/31980
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This reverts commit 3fd295550f.
Reason for revert: breaking things
Original change's description:
> Add GrTextureOp and use to implement SkGpuDevice::drawImage[Rect]() when possible
>
> This op draws a texture rectangle in src over blending with no edge antialiasing. It less powerful than NonAAFillRectOp/GrPaint but has less CPU overhead.
>
> Change-Id: Ia6107bb67c1c2a83de14c665aff64b0de2750fba
> Reviewed-on: https://skia-review.googlesource.com/33802
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=djsollen@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com
Change-Id: I9cdbeeac15b17d2d6b3385560ed826397c0373c6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/36220
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This op draws a texture rectangle in src over blending with no edge antialiasing. It less powerful than NonAAFillRectOp/GrPaint but has less CPU overhead.
Change-Id: Ia6107bb67c1c2a83de14c665aff64b0de2750fba
Reviewed-on: https://skia-review.googlesource.com/33802
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>