This is enough to run the bench SkRasterPipeline_compile.
$ ninja -C out monobench; and out/monobench SkRasterPipeline_compile 300
Before: 300 SkRasterPipeline_compile 48.4858ns
After: 300 SkRasterPipeline_compile 37.5801ns
Change-Id: Icb80348908dfb016826700a44566222c9f7a853c
Reviewed-on: https://skia-review.googlesource.com/18595
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
We can use 2 pshufb to replace 4 unpacks when deinterlacing the colors.
Change-Id: I713fbbc94f5cb9eaf14f85323b0ec76dc2246e98
Reviewed-on: https://skia-review.googlesource.com/18531
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Bug: skia:5777
Change-Id: I3cee2ffaf1b2858e660ca5d550d25f4a312395e6
Reviewed-on: https://skia-review.googlesource.com/18589
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
It's not meant to be built as part of Skia,
only by build_stages.py into SkJumper_generated.S.
Change-Id: Id028c42355f99415fe2bc0710c2292ea949f6eec
Reviewed-on: https://skia-review.googlesource.com/18593
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
When we made start_pipeline() return void, the call into the tail!=0 run
of the pipeline became eligble to be a tail-call, and Clang made that
choice. This had the side effect of not going through vzeroupper on
those tails.
We now mark start_pipeline() as inelligible for tail calls when
targeting AVX+. All paths go through the vzeroupper at the end.
BUG=chromium:729237
Change-Id: I2099931284214f24c67b38979b3ad4b4d10e8bba
Reviewed-on: https://skia-review.googlesource.com/18591
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
The content rect was always identical to the window rect,
so most of the related code did nothing. The translation
limit code is always useful (to avoid dragging the slide
way off-screen with the mouse), so always include it.
The auto-scaling to fit the screen is also still useful,
but just base it on the window rect.
The zoom code has four state variables, only used two of
them, and one was a trivially derived computation. Fold
most of that work into computeMatrix. (The translation
was always zero -- we never changed the zoom center.)
Include fDefaultMatrix in the matrix from computeMatrix,
rather than needing to apply it specially to the canvas.
Don't apply the inverse default matrix to touch or mouse
points. The absolute positions of those touch points is
not important, but because that matrix includes scale
(and sometimes very large or very small scale), it just
had the effect of greatly amplifying or damping the drag
speed. Without it, the slide always pans at the speed of
the touch/mouse drag -- which seems more desirable.
The use of the inverse default matrix was a clever trick,
but it caused the translation (applied to the global mtx)
to be scaled, so the slide was always pinned incorrectly.
Instead, supply the unmodified window rect and the default
matrix, so the trans limit code can do the obvious correct
thing: xform the slide bounds completely, then limit the
translation that will be applied after that. Slides are
now correctly pinned to screen edge regardless of how
much zoom is present in the default matrix.
Note: There are still several bugs related to all of this
code, but given the web of xform state, it's hard to
unravel. The touch gesture still doesn't know about
viewer's zoom, so that's ignored when doing the pinning.
Beyond that, it doesn't even know about window resize -
it only configures the translation limit when setting up
a slide. I had a fix for all of this (doing the
translation limiting in computeMatrix), but then the touch
gesture doesn't know about it, and can accumulate drag
motion that needs to be un-dragged to get back on-screen,
even though the slide is never really translated that far.
SkTouchGesture is in include. No one uses it except viewer:
TBR=bsalomon@google.com
Bug: skia:
Change-Id: I460cc07c3de6d36e63826f57d359faf1facf5ab3
Reviewed-on: https://skia-review.googlesource.com/18524
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: 729352
Change-Id: I5ad5e2121ce87dc154528bfd9ec0f3e9253ed792
Reviewed-on: https://skia-review.googlesource.com/18590
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
A BMP can have an arbitrarily large width. We typically read a row
into a block of memory before swizzling it to the output. Rather
than calling new to create that block of memory, which may crash
when we run out of memory, call malloc, and return null if malloc
fails.
Add a common base class for Mask and Standard BMP codecs. This class
handles allocating and freeing the buffer.
Bug: b/37623797
Change-Id: I0510b76d688d030865faa481bb2fb1351dac2c97
Reviewed-on: https://skia-review.googlesource.com/18400
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Local testing says this has been fixed by some series of SKSL changes over
the past month or so
Bug: skia:6037
Change-Id: Iffc8b63e495016ac9565459ddaf44db4049a33c0
Reviewed-on: https://skia-review.googlesource.com/14530
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
I think that I've mis-used out/Debug multiple times to build Android
viewer. Maybe this message would help me and others in the future.
No-Try: true
Docs-Preview: https://skia.org/?cl=18587
Bug: skia:
Change-Id: I810920a0ca4aa8a46dd58b35966e08513520953c
Reviewed-on: https://skia-review.googlesource.com/18587
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
For streams that are memory backed (stream->getMemoryBase() returns
a non-null ptr and hasLength() returns true), handle the stream
with skjpeg_mem_source_mgr, which directly assigns memory base to
the source manager. For other non memory backed streams, handle the
stream with skjpeg_buffered_source_mgr, which is renamed from
the old skjpeg_source_mgr with no implementation change.
Signed-off-by: cjbao <cathy.bao@intel.com>
Bug: skia:
Change-Id: I748de0bdba726bbb318922c08497135e73e37329
Reviewed-on: https://skia-review.googlesource.com/17296
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
In addition to allowing the user to supply a directory, allow them
to supply a file. Simplifies my typical use case of testing a single
file.
Change-Id: I4f268cfb33fc70ff3121135941693023b6840cd3
Reviewed-on: https://skia-review.googlesource.com/18586
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
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>
This is spooky.
I don't quite yet understand why, but this makes things much faster.
Performance regressed across the board when we no longer needed the
value and changed it to return void:
https://perf.skia.org/e/?begin=1496176469&keys=6994&xbaroffset=28513
You can see similar regressions following this Chromium bug link.
BUG=chromium:729237
Change-Id: I68371b0456014f909acf819aca52aa4f4f187460
Reviewed-on: https://skia-review.googlesource.com/18580
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
The default blitAntiH2() calls blitAntiH() with two length-1 runs, but
for this blitter creating a small mask is better. We can stamp both
pixels out with a single pipeline invocation.
Change-Id: If356975e85310a4545e54f2231a142d6e537944d
Reviewed-on: https://skia-review.googlesource.com/18581
Reviewed-by: Mike Reed <reed@google.com>
Since the ANGLE-side fix has landed & been rolled into Skia we no longer need this workaround.
Change-Id: I9e6296976d53fc1c87232f918a5c0257201744bf
Reviewed-on: https://skia-review.googlesource.com/18583
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Moving raw pointers does the same job as copying, but is more verbose and also
more confusing: e.g., is the supposed pointer meant to be a smart one?
This instance was flagged by the tool from
https://codereview.chromium.org/2919243002/.
BUG=chromium:729393
Change-Id: I4c89e9d80fab9f6d14ab7db53e8b9b6e7cf966dc
Reviewed-on: https://skia-review.googlesource.com/18540
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
CQ_INCLUDE_TRYBOTS=skia.primary:Build-Ubuntu-Clang-x86_64-Debug-MSAN
Change-Id: I50bcb3a3d8138ce94e3741cac8ceacc9e7e28a20
Reviewed-on: https://skia-review.googlesource.com/18532
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Just 3 stages implemented so far:
load_8888
swap_rb
store_8888
That's enough to make the shortest non-trivial pipeline
that you see in the new unit test.
Change-Id: Iabf90866ab452f7183d8c8dec1405ece2db695dc
Reviewed-on: https://skia-review.googlesource.com/18458
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Also, remvoes SkNormalBevelSource as this was the last use case for the distance vector field.
Change-Id: Ib0176c78e500e6b5130310934253a75860245812
Reviewed-on: https://skia-review.googlesource.com/18482
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
In the split-opList world the full screen clear optimization no longer relies on the rendertarget ID.
Change-Id: Ifc7bf10753355a18507998e30f9de7e8c1eb57c1
Reviewed-on: https://skia-review.googlesource.com/18497
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
this is approximately a revert of https://skia-review.googlesource.com/c/17768/
I propose if/when we want to experiment with a fast-path for coherent shaders
(e.g. 2-color linear gradients, up-scaling images) that we just create a new
mechanism for shaders to opt into that, knowing that it will be driven by
the rasterpipeline (and never by the old context convention).
This CL now makes it legal/clear that a new shader subclass can *just* implement
stages for raster, and never needs to make a context.
Bug: skia:
Change-Id: I525a8b1cece100f0993f75e28128e0927a4ea35c
Reviewed-on: https://skia-review.googlesource.com/18481
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
This is a no-op refator that'll help keep the interesting diff more
focused in the lowp CL. The lowp stages will use these unaltered, so
SkJumper_misc.h is a good place for them.
Change-Id: I7fb6327ade29ac884194517d94ac4303ed1079e0
Reviewed-on: https://skia-review.googlesource.com/18484
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Create a new SkImage public API to make an image from an Android
hardware buffer. Implementation is using a SkImageGenerator
derived class GrAndroidBufferImageGenerator.
A new EGLImage texture is created, which is then wrapped with
GrTextureProxy.
Bug: skia:
Change-Id: I610a4c5a58198686ce7c03e9a0adad3f9d2342e0
Reviewed-on: https://skia-review.googlesource.com/17789
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
This reverts commit 88bd8edcff.
Reason for revert: unhappy bots
Original change's description:
> Fixed an issue with sksl variable declarations
>
> There was an issue where multiple variables defined in the same
> declaration were not being sequenced appropriately during analysis, so
> 'int x = 0, y = x + 1' would report that x was undefined.
>
> Bug: skia:
> Change-Id: I882f7e216467306f6a6013a0a34aac30a4c60744
> Reviewed-on: https://skia-review.googlesource.com/18313
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
>
TBR=csmartdalton@google.com,ethannicholas@google.com
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Change-Id: Ibc68674289dce70b6173a347a0e78bb0f1e6db1b
Reviewed-on: https://skia-review.googlesource.com/18457
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
I don't see any reason to have it be static...
Change-Id: I0fdc9c0629e2194c469f7c9c696d1bb55ffbc98a
Reviewed-on: https://skia-review.googlesource.com/18455
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
There was an issue where multiple variables defined in the same
declaration were not being sequenced appropriately during analysis, so
'int x = 0, y = x + 1' would report that x was undefined.
Bug: skia:
Change-Id: I882f7e216467306f6a6013a0a34aac30a4c60744
Reviewed-on: https://skia-review.googlesource.com/18313
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Use a buffer on the stack to avoid the cost of new/delete.
Change-Id: I5c9208ec283e8345c34553343925097926274978
Reviewed-on: https://skia-review.googlesource.com/18402
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Don't allow creation of mip-mapped textures when caps says we don't
support mip-mapping.
Skip testing of mip-mapped resources in the resource size test,
when creation will fail.
For iOS devices with ES2, the APPLE BGRA8888 extension is more
trouble than it's worth. Even though it lets the internal and
external formats not match, it appears that the driver remembers
the first external format, so subsequent attempts to upload with
the other swizzle will fail. Up until now, creation of these
textures was failing anyway, so now just make it more explicit
that we don't support BGRA in this situation.
Now that we're testing our TexStorage path, fix a few other problems
that showed up:
- Command Buffer doesn't like extension formats.
- X86 PowerVR and Adreno devices don't like BGRA.
Re-land of : https://skia-review.googlesource.com/18382
Re-re-land of: https://skia-review.googlesource.com/18261
BUG=skia:
Change-Id: Ie12793549a6807300d6ece68cd6b92495e85c3fe
Reviewed-on: https://skia-review.googlesource.com/18403
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Also fix command flags to use skps instead of svgs
Bug: skia:6706
Change-Id: Ie099abac738e6eb8808db9aef513a51940c5ccb1
Reviewed-on: https://skia-review.googlesource.com/18441
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
`example.py` is going away; examples folder can now hold multiple
example recipes.
R=borenet@google.com
Bug: skia:
Change-Id: Ib28910987342217bc52040d4d966444174ce27a3
Reviewed-on: https://skia-review.googlesource.com/18432
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Eric Boren <borenet@google.com>