This patch uses equal_range instead of linear search to look up a
factory entry by name. This does require a sort, but the expected usage
is that the sort happens once and look ups happen many times.
This improves performance on Chromium's oop deserialization of
flattenables by about 10%
R=reed@chromium.org
Change-Id: I907f457a2ffb7d5b6d8261343099d982260b8415
Reviewed-on: https://skia-review.googlesource.com/96820
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
These don't seem to be used by anyone anymore so lets kill them.
Bug: skia:
Change-Id: I7908a9c9357e9e3b3166af9a14899dab522c3f11
Reviewed-on: https://skia-review.googlesource.com/97144
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Allows coverage counts ultimately to be drawn either to an atlas or
directly to the framebuffer.
Bug: skia:
Change-Id: I6cc07fce562c223381b89586d19ae98298bafe4d
Reviewed-on: https://skia-review.googlesource.com/96083
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:
Change-Id: If110f1716d2ad3b967aadca1c61d3e22386e17b1
Reviewed-on: https://skia-review.googlesource.com/94862
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Bug: b/63909536
Android's ImageDecoder API takes as input an arbitrary width and height
to scale the image to. Internally, this uses SkAndroidCodec to sample,
and then (if not a perfect match) scales to the desired size with
drawing.
computeSampledSize is a modified version of what ImageDecoder currently
does to convert from arbitrary dimensions to a sampleSize. Moving it
here allows it to be shared by SkAnimatedImage. The modified version
also corrects two bugs:
- a client using the dimensions returned by getSampledDimensions
previously may have resulted in ImageDecoder decoding to a larger
size and then scaling it. (example found in tests: dog.jpg is
180 x 180. getSampledDimensions(8) returns 23 x 23, but the old
method resulted in using sampleSize of 7 and downscaling the resulting
25 x 25 image.)
- recompute the sampleSize based on the size returned by
getSampledDimensions.
Change-Id: I022040e8bac31c20988903a0452257f7ae902bc7
Reviewed-on: https://skia-review.googlesource.com/94620
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
It should work on 32 and 64 bit android running M or newer.
Bug: skia:
Change-Id: I7e6d4000f4fee8f2704b84b7174174dd0e68d21c
Reviewed-on: https://skia-review.googlesource.com/93700
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Bug: b/63909536
SkAnimatedImage is a simple drawable for animating a GIF. Thread-safety
is left up to the client. At most two bitmaps are stored in the
drawable; one for the current frame and one for a frame that may need to
be restored. The backup frame prevents some cases where we would
otherwise have to re-decode from the beginning of the image.
The API lets the client set the time value, and decodes to match that
time.
TODO:
- Callback for when the animation is complete
- Ability to use SkAndroidCodec
- Modify the loop count (or leave that up to client?)
- Better and/or client-specific caching
Other changes:
- Add a sample which animates a GIF
- Reenable SK_CODEC_PRINTF for debug builds and Android
Change-Id: I945ffbccdb6008f2a05ed4d9b2af869a261fb300
Reviewed-on: https://skia-review.googlesource.com/93420
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
This reverts commit ef29e42ef3.
Reason for revert: probably not either roll.
Original change's description:
> Revert "fix legacy makeRasterImage()"
>
> This reverts commit 7c4ca04336.
>
> Reason for revert: layout, cereal tests?
>
> Original change's description:
> > fix legacy makeRasterImage()
> >
> > Passing the color space down into SkImage_Lazy ends up triggering a
> > SkTransferFunctionBehavior::kRespect decode (tf(r*a)), where we want
> > ignore (tf(r)*a) to have any hope of working with the legacy backend.
> >
> > This fix in turn needs another little extension of another old hack in
> > SkImage_Gpu for makeNonTextureImage() to keep working there.
> >
> > Bug: skia:7479
> >
> > Change-Id: If48ca68e95d9eee597f6b10434498049981314ba
> > Reviewed-on: https://skia-review.googlesource.com/93380
> > Commit-Queue: Mike Klein <mtklein@chromium.org>
> > Reviewed-by: Brian Osman <brianosman@google.com>
>
> TBR=mtklein@chromium.org,brianosman@google.com
>
> Change-Id: I65092e01d767ef1fd35563f0b79ceded3c12b267
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:7479
> Reviewed-on: https://skia-review.googlesource.com/93820
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>
TBR=mtklein@chromium.org,mtklein@google.com,brianosman@google.com
Change-Id: Ic9b48d311cca152ab2e620363dd4528ed382eb88
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7479
Reviewed-on: https://skia-review.googlesource.com/93960
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit 7c4ca04336.
Reason for revert: layout, cereal tests?
Original change's description:
> fix legacy makeRasterImage()
>
> Passing the color space down into SkImage_Lazy ends up triggering a
> SkTransferFunctionBehavior::kRespect decode (tf(r*a)), where we want
> ignore (tf(r)*a) to have any hope of working with the legacy backend.
>
> This fix in turn needs another little extension of another old hack in
> SkImage_Gpu for makeNonTextureImage() to keep working there.
>
> Bug: skia:7479
>
> Change-Id: If48ca68e95d9eee597f6b10434498049981314ba
> Reviewed-on: https://skia-review.googlesource.com/93380
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=mtklein@chromium.org,brianosman@google.com
Change-Id: I65092e01d767ef1fd35563f0b79ceded3c12b267
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7479
Reviewed-on: https://skia-review.googlesource.com/93820
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Doing so installs packages the resource directory during a 'tests'
build. This lets us run skia_nanobench in the internal test infra,
which doesn't have access to the source tree.
Test: Check that all files in "resources" is packaged during 'make tests
dist' in an Android tree.
Change-Id: Ia547cf09087e5795bdd825d0d48f179086a9ca4a
Reviewed-on: https://skia-review.googlesource.com/93060
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Stephen Hines <srhines@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Passing the color space down into SkImage_Lazy ends up triggering a
SkTransferFunctionBehavior::kRespect decode (tf(r*a)), where we want
ignore (tf(r)*a) to have any hope of working with the legacy backend.
This fix in turn needs another little extension of another old hack in
SkImage_Gpu for makeNonTextureImage() to keep working there.
Bug: skia:7479
Change-Id: If48ca68e95d9eee597f6b10434498049981314ba
Reviewed-on: https://skia-review.googlesource.com/93380
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug introduced when we made isEmpty check for int32_t width/height
Bug:800804
Change-Id: I59799c88fb02f176c1545dd0edae050b510df079
Reviewed-on: https://skia-review.googlesource.com/93302
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
After tinkering with libstdc++ -> libc++, looks like we need this
warning again. We already turn it on in Android's own x86 builds;
see gn_to_bp.py for that.
Change-Id: I7b7a76d1c22dd3f3b7712e9ce89b78d9a229a302
Reviewed-on: https://skia-review.googlesource.com/92360
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
All other options are going away real soon now.
Change-Id: I57051fdabc2b0fd18fd133c9fb345ffa5a46e5db
Reviewed-on: https://skia-review.googlesource.com/92300
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Also runs clang-format on the files that don't have special shader
builder styling.
Bug: skia:
Change-Id: I4a67569a7c8472acfb9200644c913844a92e3b2d
Reviewed-on: https://skia-review.googlesource.com/92083
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This pulls all the proxy tracking & creation functionality out of the GrResourceCache and GrResourceProvider and consolidates it in the GrProxyProvider.
Change-Id: I7256f7c544319a70c1bd93dd5a9ccbe5fa0a544f
Reviewed-on: https://skia-review.googlesource.com/91501
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:7462
Change-Id: Iba0af2f0ff8ef646f93a0e2ced083d99020a38c9
Reviewed-on: https://skia-review.googlesource.com/90842
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
We need to discriminate between nodes whose bounds updates contribute to the dirty
region, and nodes whose bounds changes do not.
E.g. animated shape in a group: the animated shape node bounds should yield damage,
but the ancestor group bounds should not.
To accomplish this, we refine the invalidation state:
1) self invalidation == the node itself was invalidated, and its bounds updates
yield damage.
2) descendant invalidation == the node has some (self-)invalidated descendant,
but its own bounds are not contributing damage.
Also:
* hoist the bounding box invalidation logic into the base class (Node::revalidate)
and update to respect the states described above.
* remove (now-redundant) GeometryNode bbox logic.
* update revalidation methods to return the node bbox instead of void
TBR=
Change-Id: I8023d1793fb501c945a53f2dc2d2983e5b620ade
Reviewed-on: https://skia-review.googlesource.com/90581
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
This change stages SkFloatToDecimal() for possible re-use by pdfium.
Change-Id: Iedc0c78c8a633f0b0973365d2d8b540b5443590d
Reviewed-on: https://skia-review.googlesource.com/90400
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Bug: skia:2679
Change-Id: Ia462af01b9832da90206b9e9be2278cb48c6c502
Reviewed-on: https://skia-review.googlesource.com/86401
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Bug: skia:
Change-Id: I1875e44417a0a583c4f35ee4d46856a34ba55245
Reviewed-on: https://skia-review.googlesource.com/88580
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
and SkPictureAnalyzer
Bug: skia:
Change-Id: I394eca648234b1a69e6f9a0a88c407366a33d079
Reviewed-on: https://skia-review.googlesource.com/87791
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit de71572f65.
Revert "Revert "Transform vertices for distance field glyphs on CPU.""
This reverts commit f226e66d75.
Change-Id: I2545afae3beb1d6b14bba056853ed826ae7a4679
Reviewed-on: https://skia-review.googlesource.com/86603
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Also adds a tonal color GM, a grayscale mode to shadowutils GM,
and animated alpha to SampleAndroidShadows.
Bug: skia:
Change-Id: I1dcb5cab7e53ffa7a3bf1a07b6ebfed38df1a9ed
Reviewed-on: https://skia-review.googlesource.com/85002
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 0215e39d7e.
Reason for revert: break intel 540 and HD2000 intel release bots on gltestthreading gm dftext_blob_pers
Original change's description:
> Transform vertices for distance field glyphs on CPU.
>
> This allows batching of DF draws with different view matrices.
>
> For perspective matrices this means the transformed position vertex
> attribute must have w values. Currently, non-perspective DF draws still
> use 2 component positions, though this could be changed in the future.
> Consequently, perspective draws can batch with other perspective draws
> but not non-perspective draws.
>
> Adds a GM to test batching and reusing the same blobs with both perspective
> and non-perspective matrices.
>
> Change-Id: I0e42c5449ebf3a5a54025dbcdec824d904d5bd9e
> Reviewed-on: https://skia-review.googlesource.com/79900
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,bsalomon@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Idc658d9263976d5b5e00a5026c5d6d3c8f4bdc2d
Reviewed-on: https://skia-review.googlesource.com/86560
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This reverts commit 4f5e1d4ff3.
Reason for revert: Unfortunately, we need this in Chrome for a bit longer. Working on understanding why the new path led to regressions. Will re-land this once the new path sticks.
Original change's description:
> Remove SkImage deferred texture image data APIs.
>
> These APIs existed for Chrome. Chrome is no longer using them.
>
> Change-Id: I15a5e2f88c7e8d1356188748fc68d4658f6f1849
> Reviewed-on: https://skia-review.googlesource.com/81021
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ic9f683f262f2e1d0469156360f5ffaee977ca44a
Reviewed-on: https://skia-review.googlesource.com/86280
Reviewed-by: Eric Karl <ericrk@chromium.org>
Commit-Queue: Eric Karl <ericrk@chromium.org>
This allows batching of DF draws with different view matrices.
For perspective matrices this means the transformed position vertex
attribute must have w values. Currently, non-perspective DF draws still
use 2 component positions, though this could be changed in the future.
Consequently, perspective draws can batch with other perspective draws
but not non-perspective draws.
Adds a GM to test batching and reusing the same blobs with both perspective
and non-perspective matrices.
Change-Id: I0e42c5449ebf3a5a54025dbcdec824d904d5bd9e
Reviewed-on: https://skia-review.googlesource.com/79900
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Some interesting things are starting to fall out already,
like the fact that I needed to add a gamma_dst stage to
be able to draw into gamma-transfer-fn destinations.
I've also had to pass an SkAlphaType through to the linearize
functions so that they can maintain premul invariants. I'm not
sure this is actually a good idea... if you can, please double-
check my logic at SkRasterPipeline.cpp:128?
If it's correct logic, I'm going to need to do it all over the place.
But I imagine you don't do this and somehow get away with it.
Change-Id: I42cd9b161b54287d674225103ad9e19f8b388959
Reviewed-on: https://skia-review.googlesource.com/84680
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>