Currently, when startRadius > endRadius conical gradients are inverting their data
(start/end points and radii, colors and positions) to guarantee r0 < r1 at raster time.
But the radii ordering is only mildly interesting to the impl: it controls which of the
two quadratic solutions we select for the inside case, but doesn't fundamentally change
the algorithm.
Furthermore, for the "outside" case, inverting the order is already inconvenient and
needs to be taken into account (both CPU/GPU impls are already tracking this bit of
info).
Instead of transforming the gradient definition, we can detect the inverted case and
adjust the quadratic solution selector.
In practice this means:
* |edge| case - no change, the equation is linear
* |inside| case - select the smaller root instead of largest
* |outside| case - [gpu-only] invert the clamp/limiting function
Change-Id: Ie3106464e39a4dd3848dc43671d973f7e1958e63
Reviewed-on: https://skia-review.googlesource.com/61660
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
This introduces skstd::index_sequence and skstd::make_index_sequence so
that these can be used in C++11. These are mostly equivalent to their
std:: counterparts. This also introduces SkMakeArray<N, C>
which is constexpr and creates a std::array with N elements with each
element being initialized with the value of C(i) where i is the index of
the element.
These are then used to create inverse gamma table at compile time. This
avoids threading issues.
BUG=skia:7187
Change-Id: I61fb10a778898652e546d54c104a08d6e6bf88d3
Reviewed-on: https://skia-review.googlesource.com/61380
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
It is now used by SkPixmap and will soon be in SkJpegEncoder. No need
for those to depend on SkCodec.
Bug: 768878
TBR=reed@google.com
(reed@ already approved the API change in
https://skia-review.googlesource.com/60721)
Change-Id: If1a6e1d5b60a7a3d8c97818e15a48d28ba804668
Reviewed-on: https://skia-review.googlesource.com/61680
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
This reverts commit 5411a60e0d.
Reason for revert: ASAN and Coverage failing: https://chromium-swarm.appspot.com/task?id=394978f3b7d44610
Flutter_Android failing.
Original change's description:
> Add an Option for orientation on JPEG encodes
>
> Move Origin to its own header so that SkPixmap and SkJpegEncoder need
> not depend on SkCodec.
>
> Add libexif, which is already used by Android, and use it to write the
> orientation. Write a makefile based on the Android.bp in Android, minus
> warnings. (libexif has an LGPL license.)
>
> Add a test that verifies all the orientations work.
>
> Optionally enable writing the orientation (and therefore including
> libexif). Chromium does not currently need it, and Android does not
> expose an API that would allow using it. Disable on Windows, where we
> still have build errors to fix.
>
> Bug: skia:7138
> Change-Id: Iaeff44c36aebe0e639666979dc00e1b7594bbeb1
> Reviewed-on: https://skia-review.googlesource.com/60721
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Mike Reed <reed@google.com>
TBR=mtklein@chromium.org,mtklein@google.com,scroggo@google.com,reed@google.com
Change-Id: I05b7ae8d1c5bbd1de1642d9ef024943500256273
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7138
Reviewed-on: https://skia-review.googlesource.com/61620
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Move Origin to its own header so that SkPixmap and SkJpegEncoder need
not depend on SkCodec.
Add libexif, which is already used by Android, and use it to write the
orientation. Write a makefile based on the Android.bp in Android, minus
warnings. (libexif has an LGPL license.)
Add a test that verifies all the orientations work.
Optionally enable writing the orientation (and therefore including
libexif). Chromium does not currently need it, and Android does not
expose an API that would allow using it. Disable on Windows, where we
still have build errors to fix.
Bug: skia:7138
Change-Id: Iaeff44c36aebe0e639666979dc00e1b7594bbeb1
Reviewed-on: https://skia-review.googlesource.com/60721
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
SkMatrix::mapHomogeneousPoints takes an array of SkScalar,
but expects essentially SkPoint3, so make it so.
R: robertphillips@google.com, reed@google.com
Bug: skia:6898
Change-Id: Ibaf8b05c08b7df16c67d6a77d914667ace9a70da
Reviewed-on: https://skia-review.googlesource.com/58380
Commit-Queue: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This reverts commit 62563deb6b.
Reason for revert: change that affected similar set of GMs reverted, relanding now that this is more easily triagable.
Original change's description:
> Revert "Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans."
>
> This reverts commit fa2d604a7d.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans.
> >
> > Right now when we turn rects into quads we use a vertex order compatible with a tri fan rather than a tri strip.
> >
> > I wanted it to be the case that the same code could be used to generate a non-indexed mesh for a single rect or indexed using the quad index buffer when batching. Triangle fanning is not available in all APIS (e.g. is emulated in ANGLE and not supported in Metal) so it seems better to use a triangle strip over a fan in the single rect case.
> >
> >
> > Change-Id: I31eebd794e7328f4b39e3ec3377bf2ec556360ca
> > Reviewed-on: https://skia-review.googlesource.com/60081
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com
>
> Change-Id: I7c4c23aa418da09c9708b28cce64ab58e282dd3a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/60683
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,robertphillips@google.com
Change-Id: Iefcd16676a7617d32e89fc84206cd4e88e9a06e1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/61160
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Because what can be better than marking things that can be constexpr as
constexpr. Also, I have a change where this would be nice to have.
Change-Id: Ie313b19d1930b98ddcd60cc17a320971625f18e3
Reviewed-on: https://skia-review.googlesource.com/60862
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
This reverts commit fa2d604a7d.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans.
>
> Right now when we turn rects into quads we use a vertex order compatible with a tri fan rather than a tri strip.
>
> I wanted it to be the case that the same code could be used to generate a non-indexed mesh for a single rect or indexed using the quad index buffer when batching. Triangle fanning is not available in all APIS (e.g. is emulated in ANGLE and not supported in Metal) so it seems better to use a triangle strip over a fan in the single rect case.
>
>
> Change-Id: I31eebd794e7328f4b39e3ec3377bf2ec556360ca
> Reviewed-on: https://skia-review.googlesource.com/60081
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=bsalomon@google.com,robertphillips@google.com
Change-Id: I7c4c23aa418da09c9708b28cce64ab58e282dd3a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/60683
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Enables for volatile paths and when path mask caching is disabled.
Bug: skia:
Change-Id: I644b17f2a4f77a4ddf85265f520599499c0800cf
Reviewed-on: https://skia-review.googlesource.com/60481
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Right now when we turn rects into quads we use a vertex order compatible with a tri fan rather than a tri strip.
I wanted it to be the case that the same code could be used to generate a non-indexed mesh for a single rect or indexed using the quad index buffer when batching. Triangle fanning is not available in all APIS (e.g. is emulated in ANGLE and not supported in Metal) so it seems better to use a triangle strip over a fan in the single rect case.
Change-Id: I31eebd794e7328f4b39e3ec3377bf2ec556360ca
Reviewed-on: https://skia-review.googlesource.com/60081
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
These are no longer used outside of Skia, so make them private.
Change-Id: I735bb39c10553885cc6051aebddeff150ba4caa9
Reviewed-on: https://skia-review.googlesource.com/59180
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This reverts commit 708ec81d7a.
Reason for revert: broke android
frameworks/base/core/jni/android/graphics/pdf/PdfEditor.cpp
frameworks/base/core/jni/android/graphics/pdf/PdfEditor.cpp:153:54: error: no member named 'kAScaleX' in 'SkMatrix'; did you mean 'kMScaleX'?
FS_MATRIX transform = {transformValues[SkMatrix::kAScaleX], transformValues[SkMatrix::kASkewY],
~~~~~~~~~~^~~~~~~~
Original change's description:
> move SkMatrix anonymous affine enum to private
>
> enum members aren't used by SkMatrix.h or by
> clients outside of Skia.
>
> R: reed@google.com, bungeman@google.com
> Bug: skia:6898
> Change-Id: I6873b4106e5ffe354caf5ec18cc613910304fa13
> Reviewed-on: https://skia-review.googlesource.com/59160
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Cary Clark <caryclark@skia.org>
TBR=bungeman@google.com,reed@google.com,caryclark@skia.org
Change-Id: I7fe80879e8b851c9036fc910a314129c299d82d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6898
Reviewed-on: https://skia-review.googlesource.com/59460
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Creates a static function on SkImage which converts the SkImage to a
GrBackendTexture. The texture is unowned by Skia, and must be deleted
by the caller. Allows for a no-copy / no-conversion fast path if the
provided image is unowned (unique()) and texture backed.
Change-Id: I8a48f9cc39de792725cd72057d98cd1c4594daab
Reviewed-on: https://skia-review.googlesource.com/52440
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Eric Karl <ericrk@chromium.org>
enum members aren't used by SkMatrix.h or by
clients outside of Skia.
R: reed@google.com, bungeman@google.com
Bug: skia:6898
Change-Id: I6873b4106e5ffe354caf5ec18cc613910304fa13
Reviewed-on: https://skia-review.googlesource.com/59160
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
no client still defines this
Bug: skia:
Change-Id: If55dade4207108241bbb1e3d6f7515ad12d36acc
Reviewed-on: https://skia-review.googlesource.com/59083
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
SkNWayCanvas cannot support virtuals which imply one-to-one proxying,
but SkPaintFilterCanvas can (and should).
Change-Id: If966aa4ec3fcc79e6355a82cc299fd1877e4cf53
Reviewed-on: https://skia-review.googlesource.com/58842
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
If we've got a crazy matrix, we can make dst arbitrarily crazy.
This should fix several of Kevin's fuzzes, e.g.
Bug: skia:7090
I don't see any uses of SkRRect::transform() that care about
the output rrect in case of failure, so I've just removed the
guarantee that we don't modify it when failing.
Change-Id: I4c81af59a093a984f0a02a0d3dc4bbbb1fb935f2
Reviewed-on: https://skia-review.googlesource.com/58620
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Implement getGrContext to return the context from the original
canvas.
Bug: b/66988832
Test: Ran Android HWUI on a non overlapping View with alpha,
Change-Id: I44ad48e3257004cc5c45c86529b167139f30621a
which is using SkPaintFilterCanvas to draw.
Reviewed-on: https://skia-review.googlesource.com/58841
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
Allows benchmarks to override GrContextOptions.
Removes the ability to use the same GrContext for all benchmarks in a config.
Change-Id: I5ab9f6e81055451ac912a66537843d1a49f3b479
Reviewed-on: https://skia-review.googlesource.com/34080
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This does not actually add any additional functionality to the generators.
Once this lands I will enable the generators one at a time to more easily
monitor the effects of each one.
Bug: skia:
Change-Id: I382a1acfaebcbf9ad44c9873b87cdbbe02a13602
Reviewed-on: https://skia-review.googlesource.com/57083
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:
Change-Id: I4f35413995cf73c6f130476d6b36e530120aa7ed
Reviewed-on: https://skia-review.googlesource.com/57901
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
W/o this fix the strict constraint on the specialImage draws can sometimes be removed. This CL ensures that the temporary SkImage always has the actual dimensions of the special Image.
Note: the replacement of full screen clears w/ draws revealed this bug b.c. the image filters were only drawing a rect for the content area of the special images. Thus when the final DAG result was drawn to the canvas some of the bleed through (from the removal of the strict constraint) was showing.
Bug: 755871, 768134
skbug.com/7122
Change-Id: Id67b7143225c24b716e260c973f3bbf68f20188a
Reviewed-on: https://skia-review.googlesource.com/57660
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit b6abb9b4e0.
Reason for revert: It doesn't make sense that this CL would affect the tests implicated in the perf regression in skia:7143, and the revert had no effect on the perf of those tests. Seems like the perf alert was either noise or due to a different CL.
Original change's description:
> Revert "Fix a couple float-cast-overflow in SkScan*."
>
> This reverts commit 3cd0bef0fd.
>
> Reason for revert: https://bugs.chromium.org/p/skia/issues/detail?id=7143
>
> Original change's description:
> > Fix a couple float-cast-overflow in SkScan*.
> >
> > Bug: skia:5060
> > Change-Id: I60a48993c77631aaad9354bb86b13204dc618bf4
> > Reviewed-on: https://skia-review.googlesource.com/47422
> > Commit-Queue: Ben Wagner <benjaminwagner@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
>
> TBR=benjaminwagner@google.com,reed@google.com
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: skia:7143
> Change-Id: I0f19720a7d8344789a375bbb6b9e28bf4f4e55ae
> Reviewed-on: https://skia-review.googlesource.com/57240
> Commit-Queue: Ben Wagner <benjaminwagner@google.com>
> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
TBR=benjaminwagner@google.com,reed@google.com
Change-Id: I29ac47d6665e2e52ee2a6500488dc407c8d2af1c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7143
Reviewed-on: https://skia-review.googlesource.com/57440
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Also adds a presubmit to prevent adding trailing whitespace to source
code in the future.
Change-Id: I41a4df81487f6f00aa19b188f0cac6a3377efde6
Reviewed-on: https://skia-review.googlesource.com/57380
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This reverts commit 196efbf71c.
Reason for revert: 1k SKPs GPU bot fails, perf regressions to look into.
Original change's description:
> Enable coverage counting path rendering except on Android framework
>
> Android framework will come after collecting a bit more data.
>
> Bug: skia:
> Change-Id: I6f4738e457f09c976b8bf282153ca75160a1d91c
> Reviewed-on: https://skia-review.googlesource.com/55563
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: I3f1a7022414ccec80541772d9912065fa4efd74e
Reviewed-on: https://skia-review.googlesource.com/57300
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
pre-CL to aid in changing the convention for when we overflow
Bug: skia:
Change-Id: I1e34a18fefb80187787a1c0c8ed7ee3516744d24
Reviewed-on: https://skia-review.googlesource.com/57103
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
All known callers of SkTypeface::MakeDefault call it with kNormal and
the only users specifying kNormal explicitly are in Skia, so remove the
parameter. There appear to be no users of SkTypeface::MakeFromTypeface,
so remove it. The current alternative is SkFontMgr::matchFaceStyle which
can do a better job anyway.
Change-Id: I89d94c77f9593407b0a319786848a8b823fcbae4
Reviewed-on: https://skia-review.googlesource.com/56762
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Android framework will come after collecting a bit more data.
Bug: skia:
Change-Id: I6f4738e457f09c976b8bf282153ca75160a1d91c
Reviewed-on: https://skia-review.googlesource.com/55563
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
We need this since we have texture generators that draw the base level
but nothing more. Thus we want them to be able to directly draw into
a pre allocated mipped target instead of doing a copy later.
TBR: bsalomon@google.com
Bug: skia:
Change-Id: I1dfae0da7153b21b30fdfa51a7061fc255739a1e
Reviewed-on: https://skia-review.googlesource.com/54100
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This reverts commit 01f8e41c13, and then
works around whatever issues were seen on Ubuntu 14 by continuing the
clean up.
Change-Id: I3523b12c83e4efef01a8142c00cde4e3e12189fa
Reviewed-on: https://skia-review.googlesource.com/55761
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Also, doing so exposed a couple of unused
variables in tests.
R: bsalomon@google.com
Bug: skia: 6898
Change-Id: I7b065e26a838fe55a1d772bcefaef5325e1baa61
Reviewed-on: https://skia-review.googlesource.com/55680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
SkBitmap is missing a couple of parameter names.
Parameter names make doxygen easier.
Also qualify hasHardwareMipMap and
setHasHardwareMipMap to Android framework.
R=djsollen@google.com
Bug: skia:6898
Change-Id: I502da35dc5761d73195b6a21dd4310cb001a6924
Reviewed-on: https://skia-review.googlesource.com/55161
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
BUG=skia:7107
Change-Id: I8ead98f7694faaed8e6f6f29b1fcd88501d36b66
Reviewed-on: https://skia-review.googlesource.com/54400
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
ANGLE bots were getting lots of corrupted GMs - we set fPreferVRAMUseOverFlushes
to false. In that case, multiple deferred proxies were instantiating to the same
scratch resource. Any proxy that we're going to fill with an ASAP upload needs
to have no pending IO - we hoist all those loads to the front of the flush, so
normal IO tracking doesn't really help.
Bug: skia:
Change-Id: Id36fd8700e522db412a3c992b93c778e2ebb1188
Reviewed-on: https://skia-review.googlesource.com/53940
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit fdd2cb52b7.
Reason for revert: ANGLE gold failures
Original change's description:
> Revert "Revert "Revert "Revert "Make threaded proxy generation MDB-friendly, and defer instantiation""""
>
> This reverts commit 9f8d4d36b5.
>
> Bug: skia:
> Change-Id: I8d7c1df24d8b13b94404f3d9ba69a1ab55ee00c0
> Reviewed-on: https://skia-review.googlesource.com/52920
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: Ie461de167fbd37323cabd4adf064f99204ba4878
Reviewed-on: https://skia-review.googlesource.com/53801
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I59dfb1c839a66a6aa6c954e4a544930fc1376a22
Reviewed-on: https://skia-review.googlesource.com/53560
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
So we can benchmark with given width/height dimensions.
Bug: skia:
Change-Id: I881c9f054cdcecc3e0b2bfb600afd778e1c57d95
Reviewed-on: https://skia-review.googlesource.com/51246
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
One of the nice bits of constexpr is that an expression is constexpr if
there exists any set of argument values that make it constant. It
doesn't have to be constant for _all_ argument values.
This means that this expression is constexpr:
condition ? constexpr_value
: []{ arbitrary non-constexpr code; }();
... it's constant when condition is true.
We can use this to rewrite SkASSERT(condition) as
( (condition) ? (void)0
: []{ SK_ABORT(#condition); }() )
Both sides of the ?: are void, and when condition is true at compile
time the right hand side disappears completely. In C++11 constexpr
functions we just have to use the comma operator to jam SkASSERT()
into the order of evaluation:
constexpr uint32_t foo(int x, int y) {
return SkASSERT(x > y),
x - y;
}
Change-Id: I21878d14fb2af76d93591d2ae229460ee825cfde
Reviewed-on: https://skia-review.googlesource.com/52663
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Trent Apted <tapted@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This reverts commit 9f8d4d36b5.
Bug: skia:
Change-Id: I8d7c1df24d8b13b94404f3d9ba69a1ab55ee00c0
Reviewed-on: https://skia-review.googlesource.com/52920
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
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>
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>
TBR=bsalomon@google.com
Bug: skia:
Change-Id: If12c3b44de76a2fed24dd527cb774fe5be270e8e
Reviewed-on: https://skia-review.googlesource.com/52260
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The TSAN bots fail regularly with races on fConvexity. Very annoying.
We used to have this very same problem with SkPath::fFirstDirection
until we made it atomic. This does the same to fConvexity.
This makes the field as lightly atomic as possible, with all operations
using a relaxed memory order. The value of fConvexity isn't guarding
any other non-atomic memory or implying any other writes have happened
so I don't think we need anything beyond relaxed here.
Change-Id: I0da1f892dc2b7072d692ce8b460fb1862aebef77
Reviewed-on: https://skia-review.googlesource.com/52180
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
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>
This relands commit cb4d587666
which was reverted by commit b6d2be1330
because the original CL broke some blink layout tests, and the first
reland was reverted by commit because it broke filterfastbounds gm.
This reland let SkImageSource::onFilterNodeBounds() return the dst rect
with ctm applied when mapping forward or otherwise the default value.
Original description:
> Previously SkImageSource::filterBounds() uses the default
> SkImageFilter::onFilterNodeBounds() which returns the input rect.
>
> Now override onFilterNodeBounds() in SkImageSource to return src
> or dst rect (with transform applied).
Change-Id: I4548981142b9a96beda8339d394cf9943c9f4c0f
Reviewed-on: https://skia-review.googlesource.com/50420
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Bug: skia:
Change-Id: I4003085fbb1cadc4aeb2e950f1a9f44f96d03a93
Reviewed-on: https://skia-review.googlesource.com/50240
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: Ifa67c3e5cc188db71fab389f20f55e7cbfc6de8d
Reviewed-on: https://skia-review.googlesource.com/49747
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
This is a step towards not trusting deserialized isoval/isrrect for general paths without losing the performance advantages of knowing that a path is a rrect/oval.
Change-Id: I1a8c0608c0f29f4bf7a118dfa1d475e2ab5802ea
Reviewed-on: https://skia-review.googlesource.com/49761
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This CL enables us to set the default visibility of the symbols
on Android to hidden. It is the intent that all of he SK_APIs
that have been added to /src directies should be removed as soon
as we can remove their callers within Android.
Bug: b/31971097
Change-Id: Ic787f94df0fb0c2b8d941aa7095a12b317c4b5de
Reviewed-on: https://skia-review.googlesource.com/49501
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Instead of teaching TSAN than SkMutex is a lock to get around it not
understanding Mach semaphore_t routines, teach it that there is a
happens-before relationship between semaphore_signal() and
semaphore_wait().
This reverts commit e395bf2d18.
New changes are entirely restricted to SkSemaphore.cpp.
Change-Id: I27f647b93c48e81e8327db849881d669c4cd3d04
Reviewed-on: https://skia-review.googlesource.com/49180
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Fresh off the griddle versions of:
SkPaint.h, SkCanvas.h, SkPath.h, and SkPixmap.h.
TBR=reed@google.com
Bug: skia: 9868
Change-Id: If3f0c1cd7973c53482772c2478b12f1070c9fc4d
Reviewed-on: https://skia-review.googlesource.com/46587
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
This moves closer to ensuring that all SkRRects are valid. It also checks for validity of deserialized SkRRects and sets the SkRRect to empty if the serialized data is invalid rather than asserting.
It is still possible to use mutators to create invalid SkRRects (e.g. outset() by large number, translate() so that type changes due to fp precision).
Bug: skia:
Change-Id: Ice5f73a020e99739ef4b3ce362181d3dbb35701c
Reviewed-on: https://skia-review.googlesource.com/49220
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:6173
Change-Id: I21042d484d9a7b3eee04aa3301d9793d00ad6908
Reviewed-on: https://skia-review.googlesource.com/48183
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
TSAN does not intercept Mach semaphore_t calls used to implement
SkBaseMutex's fSemaphore (its OSSemaphore field). We can teach
it that Sk[Base]Mutex is a mutex anyway with the same annotations
we use for SkSharedMutex.
Change-Id: Ib91928bb9fcfa94f5cea985b46dea31ff2b56963
Reviewed-on: https://skia-review.googlesource.com/48580
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Add missing param names so doxygen comments have
something to reference.
Add commas for all members in enums for
consistency across includes.
TBR=reed@google.com
Bug: skia: 6898
Change-Id: Ida92ed6144430072d52846001b2f618043b5b480
Reviewed-on: https://skia-review.googlesource.com/48046
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Android vendor requires this interface
so moving it back to public for now.
TBR=reed@google.com
Bug: skia: 6898
Change-Id: I4eb6da0b929227fcf327dac0626e9efd8f9a2705
Reviewed-on: https://skia-review.googlesource.com/48420
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
This reverts commit bf12c07970.
Reason for revert: broke the filterfastbounds GM (2nd column, 5th & 7th rows)
Original change's description:
> Reland "Fix SkImageSource::filterBounds()"
>
> This relands commit cb4d587666
> which was reverted by commit b6d2be1330
> because the original CL broke some blink layout tests.
>
> This reland let SkImageSource::filterBounds() return the dst rect with
> ctm applied regardless of direction.
>
> Original description:
>
> > Previously SkImageSource::filterBounds() uses the default
> > SkImageFilter::onFilterNodeBounds() which returns the input rect.
> >
> > Now override onFilterNodeBounds() in SkImageSource to return src
> > or dst rect (with transform applied).
>
> Change-Id: I915b7889ff59829ddbc4479cd66d75a0bb581e54
> Reviewed-on: https://skia-review.googlesource.com/47501
> Commit-Queue: Stephen White <senorblanco@chromium.org>
> Reviewed-by: Stephen White <senorblanco@chromium.org>
TBR=senorblanco@chromium.org,reed@google.com,wangxianzhu@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I698433de66cf3de145b9319e09cb9ec9e30d2fa9
Reviewed-on: https://skia-review.googlesource.com/48160
Reviewed-by: Florin Malita <fmalita@chromium.org>
This is the same behavior as SkScalarFloorToInt, SkScalarCeilToInt, and SkScalarRoundToInt.
Bug: skia:4632
Change-Id: Iec454e841b05c5b10f335b5b089718db56740323
Reviewed-on: https://skia-review.googlesource.com/47400
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
No API change.
Bug: skia:4632
Change-Id: Ic9cb9de7cce8aca43f0ce8066abcc44a0b04ca84
Reviewed-on: https://skia-review.googlesource.com/47681
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
I want to make sure we've got our reasoning straight
as we start to use this more.
Change-Id: I64b8351549a59e118f564e8505d42a0a620449c1
Reviewed-on: https://skia-review.googlesource.com/47840
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
This reverts commit 05d5a13fea.
Reason for revert: looks like it broke filterfastbounds
Original change's description:
> Revert "Revert "Switched highp float to highfloat and mediump float to half.""
>
> This reverts commit 1d816b92bb.
>
> Bug: skia:
> Change-Id: I388b5e5e9bf619db48297a80c9a80c039f26c9f1
> Reviewed-on: https://skia-review.googlesource.com/46464
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=bsalomon@google.com,ethannicholas@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: Iddf6aef2ab084aa73da7ceebdfc303a1d2b80cde
Reviewed-on: https://skia-review.googlesource.com/47441
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Bug: skia:4632
Change-Id: I0f8a7d7a11fc76fcb315c3f0183577c3f0958926
Reviewed-on: https://skia-review.googlesource.com/47421
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
This relands commit cb4d587666
which was reverted by commit b6d2be1330
because the original CL broke some blink layout tests.
This reland let SkImageSource::filterBounds() return the dst rect with
ctm applied regardless of direction.
Original description:
> Previously SkImageSource::filterBounds() uses the default
> SkImageFilter::onFilterNodeBounds() which returns the input rect.
>
> Now override onFilterNodeBounds() in SkImageSource to return src
> or dst rect (with transform applied).
Change-Id: I915b7889ff59829ddbc4479cd66d75a0bb581e54
Reviewed-on: https://skia-review.googlesource.com/47501
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This reverts commit 49f1f34438.
Reason for revert: broke win-chrome
../../third_party/skia/src/ports/SkFontMgr_win_dw.cpp(89): error C2228: left of '.release' must have class/struct/union
../../third_party/skia/src/ports/SkFontMgr_win_dw.cpp(89): note: type is 'SkStreamAsset *'
../../third_party/skia/src/ports/SkFontMgr_win_dw.cpp(89): note: did you intend to use '->' instead?
Original change's description:
> use unique_ptr for stream api
>
> Bug: skia:6888
> Change-Id: I3459b4913982a7cae1c0061697c82cc65ad9a2d8
> Reviewed-on: https://skia-review.googlesource.com/26740
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=mtklein@chromium.org,mtklein@google.com,bungeman@google.com,reed@google.com
Change-Id: Ic1e4af557317abd06b7f6b7f5056645df7e469f0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6888
Reviewed-on: https://skia-review.googlesource.com/47440
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Bug: skia:6888
Change-Id: I3459b4913982a7cae1c0061697c82cc65ad9a2d8
Reviewed-on: https://skia-review.googlesource.com/26740
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
older versions of webkit
use more of colorpriv than
contemporary chrome
TBR=reed@google.com
Bug: skia: 6898
Change-Id: I4adcc7d04e2cdd7bf3a85e7d591337144105ab48
Reviewed-on: https://skia-review.googlesource.com/47180
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Previously SkImageSource::filterBounds() uses the default
SkImageFilter::onFilterNodeBounds() which returns the input rect.
Now override onFilterNodeBounds() in SkImageSource to return src
or dst rect (with transform applied).
Change-Id: I6681e1ba97affb09ef1ca5bc03b3d0f66c10f149
Reviewed-on: https://skia-review.googlesource.com/46741
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Change-Id: I335fa9731cbf449989242f7e81096248abc90e90
Reviewed-on: https://skia-review.googlesource.com/46980
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
missed a couple of users
of SkColorPriv.h; restored
those functions
TBR=reed@google.com
NOTRY=true
Bug: skia: 6898
Change-Id: I64fc62905be0627c4ecdc39595bd0aaf1f60c5ac
Reviewed-on: https://skia-review.googlesource.com/47081
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
created new file src/core/SkColorData.h for
internal consumption. Note that many of the
functions there are unused as well.
Bug: skia: 6898
R: reed@google.com
Change-Id: I25bfd5a9c21f53558c4ca65a77eb5d322d897c6d
Reviewed-on: https://skia-review.googlesource.com/46848
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
kPathRefGenIDBitCnt is used only by SkPath.cpp and SkPathRef.cpp.
Curiously, there's no existing private declarations shared by
SkPath and SkPathRef, so I added kPathRefGenIDBitCnt to
SkPathPriv.h as the go-between. If there's an existing convention
I overlooked, please let me know.
R=reed@google.com,djsollen@google.com
Bug: skia: 6898
Change-Id: I929d780c3b4a10e5cf78e7176a7516abf912508e
Reviewed-on: https://skia-review.googlesource.com/46560
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
a couple of missing names
trip up bookmaker
TBR=reed@google.com
Bug: skia: 6898
Change-Id: I224f3a0422474cb6d4d3558abb3e800d5abedd12
Reviewed-on: https://skia-review.googlesource.com/46580
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Added a unit test too.
BUG=chromium:756563
Change-Id: Ic77a89b4a98d1a553877af9807a3d3bdcd077bb9
Reviewed-on: https://skia-review.googlesource.com/44420
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
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>
void reset(const SkImageInfo& info)
is not useful because it sets
rowBytes to zero while leaving
width alone.
This form of reset also doesn't
appear to have a caller.
TBR=reed@google.com
Bug: skia: 6898
Change-Id: I87019420ddc59107aefe0cac27a6b969976f1bf6
Reviewed-on: https://skia-review.googlesource.com/43480
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
SkPixmap.h is missing a couple
of parameter names. Named parameters
helps bookmaker generate markdown
and doxygen that describe methods
and functions.
TBR=reed@google.com
Bug: skia:6898
Change-Id: I8f9e1acd677e57e71c26c34759ce4647a5db0548
Reviewed-on: https://skia-review.googlesource.com/42380
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
SkCanvas.h generated from docs/SkCanvas.bmh using bookmaker.
Also added corrections to SkPaint.h, and generated SkPath.h.
Once these are functionally correct (e.g., they don't break
anything) I plan to check them in -- feel free to continue
to review them before and after the check in event.
R=brianosman@google.comTBR=reed@google.com
Bug: skia:6898
Change-Id: I6d01e9eee422304e5ab871b3870a7ed710efd645
Reviewed-on: https://skia-review.googlesource.com/30460
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Reviewed-by: Yuqian Li <liyuqian@google.com>
We like a LIFO default thread pool in tools like DM for better
memory/time locality... the bots use less memory this way, and
generally run faster.
But most use cases want a FIFO queue, so that they can get going
on the next parts of early work while later work is still running.
This splits the implementation into one using SkTArray and pop_back
for LIFO, and a new one using std::deque and pop_front for FIFO.
Change-Id: Ief203b6869a00f1f8084019431a781d15fc63750
Reviewed-on: https://skia-review.googlesource.com/41849
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I35bc08ad72fb94d8e47fe342d314c4496b954226
Reviewed-on: https://skia-review.googlesource.com/40881
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@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: I0d4166a4e9ea894f479755f9f7137c5941cf8a22
Reviewed-on: https://skia-review.googlesource.com/41081
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Work on SkPath.h documentation; fixed self-consistency
bugs identified by bookmaker. Fixed a couple of
minor typos in SkPath.h itself.
Also brought SkPaint and SkCanvas docs up to date.
TBR=reed@google.com
Docs-Preview: https://skia.org/?cl=39040
Bug: skia: 6898
Change-Id: Id89d4e2fa7fb6ee2e3cbec7ea762e06308b67d8b
Reviewed-on: https://skia-review.googlesource.com/39040
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
We're going to hide the path renderer bitfield behind a testing-only flag,
but clients may want to suppress this path renderer in particular, so a
dedicated flag makes sense.
Bug: skia:
Change-Id: I6cc4049243b5d3c129a824dfe7c1a65a70a05ccd
Reviewed-on: https://skia-review.googlesource.com/40083
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This (plus SW) ensures that we can always draw any path. Changed the path
renderer command line flags so that 'default' means everything but CCPR,
and 'All' really means 'every path renderer'.
Bug: skia:
Change-Id: I2801d1c50ab939f23efb4600e0f90e6add2891b7
Reviewed-on: https://skia-review.googlesource.com/40221
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I0372f7782124c096370b42624b6c0a3aff8a90b0
Reviewed-on: https://skia-review.googlesource.com/40101
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reduce path validation interfaces,
deferring the harder work of rewriting
the callers until later.
R=reed@google.com,enne@chromium.org
Change-Id: Iea56f1cd1be93bb1d96b50836a9bd3cd4872ad23
Reviewed-on: https://skia-review.googlesource.com/37541
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Adrienne Walker <enne@chromium.org>
This mainly consists of rm origin from GrSurface and the wrapBackEnd*
methods and then re-adding an explicit origin parameter to all the
GrGpu methods that need it.
TBR=bsalomon@google.com
Change-Id: I4248b2a4749ef844da4233ce53b0dc504bc9eb74
Reviewed-on: https://skia-review.googlesource.com/30280
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This was undone in an editor, but didn't get commited.
Change-Id: Id410de0a066b3fe65119d0b72c6f29a1f91d1ebb
Reviewed-on: https://skia-review.googlesource.com/39700
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This avoids the dangerous overload problem of
growToInclude(0, 0)
matching to (const SkPoint[], count) rather than growToInclude(x, y)
Bug: skia:
Change-Id: Iaba8b1a579638ff363fde62e4e3004052dd2b2ac
Reviewed-on: https://skia-review.googlesource.com/39501
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This was created by looking at warnings produced by clang's
-Wzero-as-null-pointer-constant. This updates most issues in
Skia code. However, there are places where GL and Vulkan want
pointer values which are explicitly 0, external headers which
use NULL directly, and possibly more uses in un-compiled
sources (for other platforms).
Change-Id: Id22fbac04d5c53497a53d734f0896b4f06fe8345
Reviewed-on: https://skia-review.googlesource.com/39521
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This is a prerequisite for being able to resize the atlas with impunity.
Change-Id: Iccc9c7ced43f38a7d8483a7bd12a458d59a3453a
Reviewed-on: https://skia-review.googlesource.com/38362
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
SkIsS16 can be replaced with SkTFitsIn<int16_t> and SkIsU16 is never
used.
Change-Id: I734f677149fab102cdb295a7b34faa3e3089134a
Reviewed-on: https://skia-review.googlesource.com/38600
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This changes the cases which require two compares into single compares
by relying on squirrely bits of the C++ specification.
Change-Id: I2c14e461b571bb94f586c14db4eaeadfd06b628b
Reviewed-on: https://skia-review.googlesource.com/38220
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit e84c087e62.
Reason for revert: ANGLE is unhappy
Original change's description:
> Switch atlas clients over to using absolute texture coordinates
>
> This is a prerequisite for being able to resize the atlas with impunity.
>
> Change-Id: I509816c8d6f38fbc92fa39aeab303b42ab09f58b
> Reviewed-on: https://skia-review.googlesource.com/37560
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,jvanverth@google.com,robertphillips@google.com,brianosman@google.com
Change-Id: I329efd642c22e11a5c576a4632fc557759b200d5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/38400
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is a prerequisite for being able to resize the atlas with impunity.
Change-Id: I509816c8d6f38fbc92fa39aeab303b42ab09f58b
Reviewed-on: https://skia-review.googlesource.com/37560
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: chromium: 758161
Change-Id: I2472ff59af2fab05d94d88d5effb44828e8a5132
Reviewed-on: https://skia-review.googlesource.com/37800
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
GrContextOptions has an SkExecutor field, allowing clients to supply a
thread pool. If present, the GrContext will create an SkTaskGroup that
can be used for internal threading work.
Bug: skia:
Change-Id: I8b01245515a21a83f9fe838caf0a01c9a26c0003
Reviewed-on: https://skia-review.googlesource.com/37580
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Make initializeColorXform private, and only call in the base class.
Add virtual method to skip initializeColorXform, for classes that do
not need one.
Change SkCodec::FrameInfo's SkAlphaType to an SkEncodedInfo::Alpha.
This allows proper checking internally whether SkCodec needs to do a
color correct premultiply.
Depends on https://chromium-review.googlesource.com/c/620947, for this
API change.
(Separated from review.skia.org/25746)
Bug: skia:5609
Bug: skia:6839
Change-Id: Icb0d46659c546060c34d32eaf792c86708726c7a
Reviewed-on: https://skia-review.googlesource.com/35880
Reviewed-by: Chris Blume <cblume@chromium.org>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Leon Scroggins <scroggo@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>
This macro is now an alias for SK_ABORT and appears to no longer be
used. Removing to clean up SkTypes.h a bit.
Change-Id: If2246f2bf5bab47dbb0b79dd8ebd29766ea0bc5e
Reviewed-on: https://skia-review.googlesource.com/35822
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
The sk_throw macro is now an alias to SK_ABORT, but is often used when
other macros better describe the situation. This change replaces
sk_throw with SK_ABORT or SkASSERT_RELEASE as appropriate.
Change-Id: I313facc6d535c8e8bec90ceeaf17ae3a381c48f3
Reviewed-on: https://skia-review.googlesource.com/35882
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Move common code into the base class, so subclasses need not call
conversion_possible.
Use SkEncodedInfo rather than SkImageInfo, and use the proper frame.
API Changes:
- SkAndroidCodec:
- Add getEncodedInfo(), for SkBitmapRegionCodec
- SkEncodedInfo:
- Add opaque() helper
- SkBitmapRegionDecoder:
- Remove unused conversionSupported
(Split off from skia-review.googlesource.com/c/25746)
Bug: skia:5601
Change-Id: If4a40d4b98a3dd0afde2b6058f92315a393a5baf
Reviewed-on: https://skia-review.googlesource.com/34361
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
These were used for debug only parameters, but no longer appear in any
code.
Change-Id: I91a25f0b40df02a66b0d7543339deafbf28dc06d
Reviewed-on: https://skia-review.googlesource.com/35703
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This macro just forwards to SK_ABORT. It appears there are now no users.
Change-Id: I25a736790d7799b8ff51d879a823ee1b6b9cb47e
Reviewed-on: https://skia-review.googlesource.com/35760
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This reverts commit 91b6ce3d80.
Reason for revert: Broke all the builders!
Original change's description:
> Remove SkFAIL.
>
> This macro just forwards to SK_ABORT. It appears there are now no users.
>
> Change-Id: Iab02109749eb9674a5f5c61752ef0588398d1b27
> Reviewed-on: https://skia-review.googlesource.com/35520
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>
TBR=djsollen@google.com,bungeman@google.com
Change-Id: I7afcd127c8aa07b0147bc9c980918f597378ffef
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/35740
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This macro just forwards to SK_ABORT. It appears there are now no users.
Change-Id: Iab02109749eb9674a5f5c61752ef0588398d1b27
Reviewed-on: https://skia-review.googlesource.com/35520
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
The ultimate goal is to end up with "float" and "half", but this
intermediate step uses "highfloat" so that it is clear if I missed a
"float" somewhere. Once this lands, a subsequent CL will switch all
"highfloats" back to "floats".
Bug: skia:
Change-Id: Ia13225c7a0a0a2901e07665891c473d2500ddcca
Reviewed-on: https://skia-review.googlesource.com/31000
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Now that our system supports more flexible and later creation of GrPiplines, GrOps should be able to access these methods without the redundant state variables incurred when using GrGpuResourceRef.
Change-Id: Ib9c025e1134617f96b9ebbb153c78e51c63914bf
Reviewed-on: https://skia-review.googlesource.com/35283
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
SkFAIL is a legacy macro which is just SK_ABORT. This CL mechanically
changes uses of SkFAIL to SK_ABORT in preparation for its removal. The
related sk_throw macro will be changed independently, due to needing to
actually clean up its users.
Change-Id: Id70b5c111a02d2458dc60c8933f444df27d9cebb
Reviewed-on: https://skia-review.googlesource.com/35284
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Change-Id: Ide445c73a5b14ea2e52decf85f5a2a9af0f2d242
Reviewed-on: https://skia-review.googlesource.com/34940
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
That GM has a path with 16k points, arranged in a rectangle. When we try
to draw it in Ganesh, we first check to see if it's a (closed) rectangle.
We eventually decide that it is a rectangle, but not closed, so it gets
passed along. Then we construct a GrShape, which tries to simplify the
shape, again asking if it's a rectangle...
Each isRect query was iterating over the 16k verbs, and for each one,
calling atVerb(i). That, internally, calls verbs(), which calls validate()
in debug builds. So we were walking all 16k points 16k times (to ensure
the bounds were correct). The end result is that the GM took over 11
seconds to draw, and now takes 3 ms.
Bug: skia:
Change-Id: If5f7a067b8c25f049dc64275d94a42ae4a50f6a9
Reviewed-on: https://skia-review.googlesource.com/34723
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I985e54a071338e99292a5aa2f42c92bc115b4008
Reviewed-on: https://skia-review.googlesource.com/32760
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
As a part of serializing SkPaths, I want to be able to know (without
asserting) whether or not a path is valid so that I can discard
potentially malicious deserialized paths.
Currently, SkPath(Ref) both just have asserting validation functions
which can't be used externally. This patch adds accessors that don't
assert.
Bug: chromium:752755 skia:6955
Change-Id: I4d0ceb31ec660b87e3fda438392ad2b60a27a0da
Reviewed-on: https://skia-review.googlesource.com/31720
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
This reverts commit 0f450acd76.
Bug: skia:
Change-Id: I97428fbbc6d82bf8b186ec5fdbf1a939c00e4126
Reviewed-on: https://skia-review.googlesource.com/32726
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 175af0d011.
Reason for revert: Chrome doesn't know about portable format specifiers. Sigh.
Original change's description:
> GrContext::dump that produces JSON formatted output
>
> Includes caps, GL strings, and extensions
>
> Bug: skia:
> Change-Id: I1e8b3dd50fb68357f9de8ca6149cf65443d027ef
> Reviewed-on: https://skia-review.googlesource.com/32340
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,brianosman@google.com
Change-Id: Ie280b25275725f0661da7541f54ed62897abb82f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/32861
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit b681a0f1b0.
Reason for revert: Seems to be messing up some MacMini & Nexus7 bots
Original change's description:
> Store discard request on the opList and remove GrDiscardOp
>
> Change-Id: Ic1f76bb91c16b23df1fe71c07a4d5ad5abf1dc26
> Reviewed-on: https://skia-review.googlesource.com/32640
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: I8a89fae7bb11791bd023d7444a074bb34d006fd0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/32704
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Includes caps, GL strings, and extensions
Bug: skia:
Change-Id: I1e8b3dd50fb68357f9de8ca6149cf65443d027ef
Reviewed-on: https://skia-review.googlesource.com/32340
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
rects are already auto-vectorized, so no need to explicitly write a 4f version of SkRect::round()
Bug: skia:
Change-Id: I098945767bfcaa7093d770c376bd17ff3bdc9983
Reviewed-on: https://skia-review.googlesource.com/32060
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
(re-land of https://skia-review.googlesource.com/c/30780)
Currently only the hard-stop specializations support tiling.
Consolidate the tiling code and expand to kTwo_ColorType,
kThree_ColorType also.
BUG=6925
Change-Id: I017b4accba30e87367e139333e96246cb362b6a4
Reviewed-on: https://skia-review.googlesource.com/31422
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>