This reverts commit d8b939e0b4.
Reason for revert: fix SkAndroidFrameworkUtils getDevice() reference
Original change's description:
> Revert "Rename getTopDevice/getDevice to topDevice/baseDevice"
>
> This reverts commit 632a23afa4.
>
> Reason for revert: breaking android roll
>
> Original change's description:
> > Rename getTopDevice/getDevice to topDevice/baseDevice
> >
> > This addresses nit from https://skia-review.googlesource.com/c/skia/+/344663
> > and also moves topDevice() to be private, since it's not really meant
> > for arbitrary subclasses to access anyways. Classes outside of SkCanvas
> > that need topDevice/baseDevice are already friended anyways.
> >
> > Bug: skia:10987
> > Change-Id: Ib0b0dffb5b1c35d5a0c78aeb8903e4cf0b8810a9
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344960
> > Reviewed-by: Mike Klein <mtklein@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> TBR=mtklein@google.com,reed@google.com,michaelludwig@google.com
>
> Change-Id: I9b70230f7db5d31cede2ea03e7abc7c154021204
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10987
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345158
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>
TBR=djsollen@google.com,mtklein@google.com,reed@google.com,michaelludwig@google.com
# Not skipping CQ checks because this is a reland.
Bug: skia:10987
Change-Id: Ibf6397b54655c25ef3d348210de5eb6dab416723
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345165
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This reverts commit 632a23afa4.
Reason for revert: breaking android roll
Original change's description:
> Rename getTopDevice/getDevice to topDevice/baseDevice
>
> This addresses nit from https://skia-review.googlesource.com/c/skia/+/344663
> and also moves topDevice() to be private, since it's not really meant
> for arbitrary subclasses to access anyways. Classes outside of SkCanvas
> that need topDevice/baseDevice are already friended anyways.
>
> Bug: skia:10987
> Change-Id: Ib0b0dffb5b1c35d5a0c78aeb8903e4cf0b8810a9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344960
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
TBR=mtklein@google.com,reed@google.com,michaelludwig@google.com
Change-Id: I9b70230f7db5d31cede2ea03e7abc7c154021204
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10987
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345158
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
This is a new base class for GrSurfaceDrawContext. It allows any
alpha-type but is restricted to non-blending fills of irects using FPs,
clears,and discards.
Bug: skia:11019
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341680
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: I696df3617719fcd8303faa73fb44b32b3fb4f71c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344896
This addresses nit from https://skia-review.googlesource.com/c/skia/+/344663
and also moves topDevice() to be private, since it's not really meant
for arbitrary subclasses to access anyways. Classes outside of SkCanvas
that need topDevice/baseDevice are already friended anyways.
Bug: skia:10987
Change-Id: Ib0b0dffb5b1c35d5a0c78aeb8903e4cf0b8810a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344960
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Adds a new kDirectionLight_ShadowFlag which indicates that lightPosition
is a vector pointing towards the light, and lightRadius is the blur
radius when the occluder is at z == 1. For other values of z it will
scale linearly. The direction is specified in device space.
Bug: skia:10781
Change-Id: I14d530f006e5541ed6e22bfbeb29c7441c21fb8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321792
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This is a reland of ad8b9fa2d7
Original change's description:
> Disable HW tessellation shaders by default
>
> The GLSL backdoor for tessellation shaders is only experimental at
> this point. In order to enable the tessellation path renderer, we need
> to turn off HW tessellation and let it use the indirect draw modes.
>
> Bug: skia:10419
> Change-Id: Ic979978a331c7ad016907cf42b2562b35caab8ab
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344336
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com
Bug: skia:10419
Change-Id: I0bdf34da134a3a34a5c78b35cc0eb86d6e989bb4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344796
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit ad8b9fa2d7.
Reason for revert: Benchmark failure
Original change's description:
> Disable HW tessellation shaders by default
>
> The GLSL backdoor for tessellation shaders is only experimental at
> this point. In order to enable the tessellation path renderer, we need
> to turn off HW tessellation and let it use the indirect draw modes.
>
> Bug: skia:10419
> Change-Id: Ic979978a331c7ad016907cf42b2562b35caab8ab
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344336
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com
Change-Id: Ia74dbcec582168870bd3ccc5e52b8dce0fb2bdfc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344698
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
This is a new base class for GrSurfaceDrawContext. It allows any
alpha-type but is restricted to non-blending fills of irects using FPs,
clears,and discards.
Bug: skia:11019
Change-Id: I229ce5f452e66796e2fa5c0e7a6ddccbf23bef5c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341680
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
The GLSL backdoor for tessellation shaders is only experimental at
this point. In order to enable the tessellation path renderer, we need
to turn off HW tessellation and let it use the indirect draw modes.
Bug: skia:10419
Change-Id: Ic979978a331c7ad016907cf42b2562b35caab8ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344336
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This definitely simplifies the drawing code, but always copies the input
SkPaint so that it can be modified if necessary. If we get perf hits, we
can just revert this. We could keep it using a copy-on-write, but with
this change, I believe we've removed the majority of instances of
SkCopyOnWrite<SkPaint> inside SkCanvas. There's just one LatticePaint
struct that's overly complex for what it does that I can clean up next.
A middle ground would be to keep the copy-on-write behavior, but drop
the branch on image-filter. Given the lack of perf needle movement on
some of the other simplifications that avoided technically unnecessary
paint copies, I doubt it's worth the complexity.
As part of this change, since the draw calls no longer branch based on
the presence of an image filter, the AutoLayerForImageFilter takes over
calling predrawNotify() in its various forms. We don't have to follow
through with that, if we'd rather have the notification be called out
explicitly within the draw call itself. I've found it easy to forget to
call predrawNotify(), or keep it in the right place while updating draws
so I may be biased.
Bug: skia:10987
Change-Id: I5204c175aae691f82cc45f3d9a04ef64dee5d80f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342920
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Folds the update of fQuickRejectBounds into the destructor of the Auto
object. So it's still a little magical, but less so than a macro.
Bug: skia:10987
Change-Id: I275b21718291c353e889da77e1e56ee6a0dbb72c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342922
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This reverts commit f760258654.
This version doesn't assume SK_BUILD_FOR_ANDROID_FRAMEWORK implies SK_SUPPORT_GPU
Cq-Include-Trybots: luci.skia.skia.primary:Canary-Android
Change-Id: Ib1d983d76f3258ed84aa2d6ef4a5cddf7f342cf3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343578
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
persp_shaders_ gm expected diff (in gpu backends only), due to change
from filterquality (which gpu and cpu interpreted differently for mips)
to samplingoptions (which both backends interpret the same).
Specifically for kMedium:
- gpu treated as SkMipmapMode::kLinear
- cpu treated as SkMipmapMode::kNearest
Bug: skia: 7650
Change-Id: Idc53ad8d01d9c928b425c092b36191153714d347
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343737
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This reverts commit 14a25eff99.
Reason for revert: breaking android roll.
Original change's description:
> Add new SkCanvas methods for Android Framework WebView queries.
>
> Existing queries will be deleted after Android framework update.
>
> This puts the queries behind SK_BUILD_FOR_ANDROID_FRAMEWORK and
> removes the need for the framework to hop through multiple levels
> of abstraction to get to the FBO info.
>
> Change-Id: Ia016b0d3044c803603e36bc1c5e1a644f50a7eaf
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343417
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,reed@google.com,stani@google.com
Change-Id: I40ac3b7eec101c246cc41a40d930b9a03ece3264
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343519
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Existing queries will be deleted after Android framework update.
This puts the queries behind SK_BUILD_FOR_ANDROID_FRAMEWORK and
removes the need for the framework to hop through multiple levels
of abstraction to get to the FBO info.
Change-Id: Ia016b0d3044c803603e36bc1c5e1a644f50a7eaf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343417
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Just the class/files. variable names and additional comments to follow.
Change-Id: Ic03d07fd5009eaf3d706c2536486a117328963fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342617
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
SkDrawIter goes away, as well as the DRAW_BEGIN, DRAW_END, and
FOR_EACH_TOP_DEVICE macros. A new macro TOP_DEVICE is added that
simplifies checking for a null device (which is currently only possible
if SkCanvas::init() was called with null). The intent is that this will
be replaced with just "this->getTopDevice()->" in the future.
The rest of the auto-layer magic that happened in DRAW_BEGIN is now
explicitly written out in the draw functions. Additionally, it has
been updated to check for an image filter. When there's no image
filter, it completely bypasses the construction of the AutoLayer object.
This extra check maybe isn't worth the code complexity, but some draw
methods had previously followed this pattern, so presumably stack
allocating the AutoLayer had some overhead in tight draw loops.
Bug: skia:10986, skia:10987
Change-Id: I9c48fe4645a6d2b46e1d0006a669fd073c0e1478
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341161
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Initially we restricted tessellated stroking to opaque solid colors.
This CL adds support for transparency by enabling a stencil test. The
stencil test also allows us to use mixed samples.
Bug: skia:10419
Change-Id: Ie40f3099d2b009f92ed49f7f43e5f269b1a479af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340798
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Follow-on to https://skia-review.googlesource.com/c/skia/+/342616
Assuming this survives, we can probably simplify other code in SkPath
(e.g. Iterators) that today worry about consing up moves after close.
Change-Id: I913d6be9c20547267230c287d394fd300b985d31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342619
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
In crbug.com/1155871, the audit trail is used during destruction of the
drawing manager.
Bug: chromium:1155871
Change-Id: I74015a033c7620bdad03ac7a3cf5a7ee671482f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342305
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Old workaround was never used by chrome and was insufficient for
SkiaRenderer bug on Adreno 3xx.
Use same name used by Chrome.
Always set the scissor state before every draw/clear when using FBO 0.
Bug: chromium:1152831
Change-Id: Ibf0453d949fa3d5cb964411da3bcc1ec62a3d3a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342076
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
It's no longer used by Chrome.
Inline helper that draws yuva->rgba into the now single use case.
Move yuva proxy making helper from SkImage_GpuBase to SkImage_GpuYUVA
since it is only used there now.
Remove gm that tested the API and associated helper code in YUVUtils.
Bug: skia:10632
Change-Id: If6bd49befa1d1098bb6a268b9d856794f7eb80c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342077
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This pares back SkDrawIter (will go further in follow-up CL) to take
advantage of no more unclipped layers. The canvas no longer needs to
maintain its own inline DeviceCM, but MCRec can point to a hidden
Layer struct. The first MCRec doesn't have a Layer (since there's
nothing to restore to), but gets its device from the explicitly
represented base device of the SkCanvas.
Bug: skia:10987, skia:10986
Change-Id: Ib004dfca42e4ccabe5f43b756d80f8eaa3f64e19
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341160
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
We added this hack years and years ago...
not something we'd do today.
Bug: skia:6592
Change-Id: Ib234dccbf98da8f1075cdcdec274c99c7cf00d78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341398
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Bug: skia:10987
Change-Id: I149bbe33b79848e010c35c94482131fd301f7837
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339992
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
ForceClose is a pain, and already removed from some
(hopefully all at some point) of our iterators
Follow-on plan: use raw iter, and output code compatible with
SkPath::Make()
Change-Id: Icda4ad2e605eb2fb9842dd35b5e0d4a0939e62eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341237
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
The LayerIter existed to iterate over the top-most device and any
unclipped layers connected to it. With unclipped layers gone,
SkCanvasStateUtils can just access the top-most device using other
APIs.
Bug: skia:10986
Change-Id: I260ec37fcc8e39d1ec2972a3297521d714649cb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339991
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
This removes the conditional behavior based on #defines, and the private
flag definitions. It removes GMs and updates tests that tested the
feature. Follow-up CLs will go through and simplify the internals of
SkCanvas to take advantage of this support removal.
Bug: skia:10986
Change-Id: Id42c9e7d134dd06507fabf6577e7872942ef9077
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339988
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Expand the SkImageAsset API to support controlling sampling options and
pass an additional transform.
Bug: skia:10944, skia:10942
Change-Id: I7bad0b2ab58ed40fe4b425de0eb6970a4c7d7117
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340097
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Bug: b/160984428
Add more fields to SkCodec::FrameInfo, which describes the properties of
an individual frame in an animated image. This allows a client that
wishes to seek to determine frame dependencies so that they can decode
an arbitrary frame, which in turn will allow SkCodec to remove
SkCodec::FrameInfo::fRequiredFrame. Currently, SkCodec seeks through the
stream to determine frame dependencies, but this is unnecessary work
(and storage) for a client that does not want to seek.
These fields also support the proposed APIs in go/animated-ndk.
Move SkCodecAnimation::Blend from SkCodecAnimationPriv (and delete that
file) into SkCodecAnimation.h. Rename its values to be more clear.
Merge common code for populating SkCodec::FrameInfo.
Add a test for a GIF with offsets outside the range of the image. Note
that libwebp rejects such an image.
Update libgifcodec.
Change-Id: Ie27e0531e7d62eaae153eccb3105bf2121b5aac4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339857
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Nigel Tao <nigeltao@google.com>
SkSamplingOptions has no methods, so there's no need
to use an fPrefix to distinguish its fields from locals.
They'll always be accessed by foo.filter, bar->mipmap, etc.
Change-Id: Ia27ebea26d03eba60036616508731c4d2020462c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340356
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This lets us trust the invariants that the constructors set up,
like if fUseCubic, then fMipmap == SkMipmapMode::kNone.
Gotta be slightly sneaky and implement operator= ourselves
with placement new.
Change-Id: I043cd56cbf9f1e2fa64ab585268b2799df65c31f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340179
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
We previously represented these as SkPMColor4f. However, upcoming
changes will add limited support for clearing/drawing to unpremul
dst. Just store the clear values as four floats without assigned
interpretation.
Also, noticed a bug by code inspection: we weren't accounting for
write view swizzle in GrRTC. Fixed and added gm to test.
Bug: skia:11019
Change-Id: I1bce1f6c97a156c0377ebad1b166eb641362b67a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340098
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>