Commit Graph

9541 Commits

Author SHA1 Message Date
Stan Iliev
8231031613 Small fixes to C API. Add SK_API and fix function signature mismatch.
Test: Built and linked C API so
Change-Id: I1a4126851fb2e70b7592e0d7d21d771eb9c26440
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218798
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
2019-06-07 01:29:23 +00:00
Greg Daniel
992df579a4 Revert "Experimental: Add R_16 and RG_1616 to Ganesh"
This reverts commit 93d0146dc6.

Reason for revert: revertting so we can revert previous change

Original change's description:
> Experimental: Add R_16 and RG_1616 to Ganesh
> 
> This is to support the P016 and P010 YUV formats. Initially, only Vulkan and GL support these formats.
> 
> Change-Id: Ie9609e59c12528079f8d379359ddb9bac85b6a29
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218546
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,robertphillips@google.com

Change-Id: I00e1bf32404983b09f0933b2a9d65aa40a5ee754
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218959
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-06 18:47:53 +00:00
Herb Derby
36a54c1b1a Rename SkStrikeSpecStorage -> SkStrikeSpec
SkStrikeSpecStorage was a temporary name until all uses of
SkStrikeSpec were cleaned up. Do the final rename.

Change-Id: Iaba987ecdfe46ca9eee8d530d5095840cdca300d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219209
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-06 18:01:02 +00:00
Greg Daniel
4c6f9b7670 Revert "Reland "Remove support for copyAsDraw in gpu copySurface.""
This reverts commit 84ea04949c.

Reason for revert: nexus 7 and android one broken

Original change's description:
> Reland "Remove support for copyAsDraw in gpu copySurface."
>
> This reverts commit c5167c053b.
>
> Reason for revert: fixed
>
> Original change's description:
> > Revert "Remove support for copyAsDraw in gpu copySurface."
> >
> > This reverts commit 6565506463.
> >
> > Reason for revert: seems to break things?
> >
> > Original change's description:
> > > Remove support for copyAsDraw in gpu copySurface.
> > >
> > > The major changes on a higher lever are:
> > > 1) The majority of all copies now go through GrSurfaceProxy::Copy which
> > > takes in a proxy and returns a new one with the data copied to it. This
> > > is the most common use case within Ganesh.
> > >
> > > 2) The backend copy calls no longer do draws, require origins to be the
> > > same, and won't do any swizzling or adjustment of subrects. They are
> > > all implemented to be dumb copy this data to this other spot.
> > >
> > > 3) The GrSurfaceContext copy call has now been moved to priv and renamed
> > > copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.
> > >
> > > 4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
> > > of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
> > > call the priv methods on GrSurfaceContext.
> > >
> > > Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> >
> > Change-Id: Id43aa8aa1451e794342e930441d9975b90e6b59f
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218549
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: I1a96f85ae2ff7622a6b57406755d478e7fbcf56e
> No-Presubmit: true
> No-Tree-Checks: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218797
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: I310930a9df30535f45a065263a40239141e15562
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219384
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-06 17:42:02 +00:00
Greg Daniel
84ea04949c Reland "Remove support for copyAsDraw in gpu copySurface."
This reverts commit c5167c053b.

Reason for revert: fixed

Original change's description:
> Revert "Remove support for copyAsDraw in gpu copySurface."
>
> This reverts commit 6565506463.
>
> Reason for revert: seems to break things?
>
> Original change's description:
> > Remove support for copyAsDraw in gpu copySurface.
> >
> > The major changes on a higher lever are:
> > 1) The majority of all copies now go through GrSurfaceProxy::Copy which
> > takes in a proxy and returns a new one with the data copied to it. This
> > is the most common use case within Ganesh.
> >
> > 2) The backend copy calls no longer do draws, require origins to be the
> > same, and won't do any swizzling or adjustment of subrects. They are
> > all implemented to be dumb copy this data to this other spot.
> >
> > 3) The GrSurfaceContext copy call has now been moved to priv and renamed
> > copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.
> >
> > 4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
> > of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
> > call the priv methods on GrSurfaceContext.
> >
> > Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: Id43aa8aa1451e794342e930441d9975b90e6b59f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218549
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: I1a96f85ae2ff7622a6b57406755d478e7fbcf56e
No-Presubmit: true
No-Tree-Checks: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218797
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-06 13:56:31 +00:00
Robert Phillips
93d0146dc6 Experimental: Add R_16 and RG_1616 to Ganesh
This is to support the P016 and P010 YUV formats. Initially, only Vulkan and GL support these formats.

Change-Id: Ie9609e59c12528079f8d379359ddb9bac85b6a29
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218546
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-06 11:57:14 +00:00
Greg Daniel
c5167c053b Revert "Remove support for copyAsDraw in gpu copySurface."
This reverts commit 6565506463.

Reason for revert: seems to break things?

Original change's description:
> Remove support for copyAsDraw in gpu copySurface.
> 
> The major changes on a higher lever are:
> 1) The majority of all copies now go through GrSurfaceProxy::Copy which
> takes in a proxy and returns a new one with the data copied to it. This
> is the most common use case within Ganesh.
> 
> 2) The backend copy calls no longer do draws, require origins to be the
> same, and won't do any swizzling or adjustment of subrects. They are
> all implemented to be dumb copy this data to this other spot.
> 
> 3) The GrSurfaceContext copy call has now been moved to priv and renamed
> copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.
> 
> 4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
> of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
> call the priv methods on GrSurfaceContext.
> 
> Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: Id43aa8aa1451e794342e930441d9975b90e6b59f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218549
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-05 17:37:11 +00:00
Greg Daniel
6565506463 Remove support for copyAsDraw in gpu copySurface.
The major changes on a higher lever are:
1) The majority of all copies now go through GrSurfaceProxy::Copy which
takes in a proxy and returns a new one with the data copied to it. This
is the most common use case within Ganesh.

2) The backend copy calls no longer do draws, require origins to be the
same, and won't do any swizzling or adjustment of subrects. They are
all implemented to be dumb copy this data to this other spot.

3) The GrSurfaceContext copy call has now been moved to priv and renamed
copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.

4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
call the priv methods on GrSurfaceContext.

Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-05 17:04:31 +00:00
Greg Daniel
4d74f605d7 Make feature structs on GrVkBackendContext const.
Change-Id: I6655c2458a4a9b007cb3d5e100f5368697a0f6bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218547
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-05 15:56:00 +00:00
Greg Daniel
6eb8c24009 Move readSurfacePixels and writePixelSurface into GrSurfaceContext.
Change-Id: I22770826e973a0e4c881bc74bcb3793c604887c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218193
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-05 14:34:04 +00:00
Jim Van Verth
90ef39f806 Add GrCFResource::reset() to allow Chrome to transition to sk_cf_obj.
Chrome is using operator= to set the Metal texture resource, but
sk_cf_obj doesn't support that for the bare object. This will allow
me to transition them to reset() instead.

Change-Id: Iadfb9624fac2ee6292e3d3f16057a19c683923e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218537
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-06-05 13:55:05 +00:00
Brian Salomon
e2826ab59c Add API to invalidate GL texture parameters from GrBackendTexture.
This is modeled on how we coordinate VkImage layout changes between
GrContext and clients.

A type GrGLTextureParameters is used to track the current parameter
state.

When a client creates a GrBackendTexture in order to wrap a resource
they created a new GrGLTextureParameters is created and the wrapped
GrGLTexture will share ownership.

When GrContext creates a non-wrapped GrGLTexture, the GrGLTexture
creates a new GrGLTextureParameters and any GrBackendTextures created
from that GrGLTexture will share ownership.

Clients indicate parameter changes by calling
GrBackendTexture::glTextureParametersModified().

We still assume all texture parameters may have changed after a call
to GrContext::resetContext() (for now). The "timestamp" that is used
to implement this has been moved from GrGpu to GrGLGpu as there were
no other use cases.

Change-Id: Ic24e00488fad254a29d5eec6890278b67df6efae
Bug: skia:7966
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217385
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-05 13:50:25 +00:00
Robert Phillips
4bdd36f625 Make color initialization version of createBackendTexture public
Mechanical.

Change-Id: I48be78a12684fc5243ee509e391984daa190fb7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218182
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-04 20:12:22 +00:00
Herb Derby
baf64786ba Convert over more sites to SkStrikeSpecStorage, and remove unused calls
Convert over remaining callsights for strike lookup, and reduce the SkStrikeCache
API.

- one friend decl.

Change-Id: I109a747061030f26ff908472ea55a4424d5c10f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209109
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-04 14:11:45 +00:00
Jeremy Roman
89068ce78f Don't mark inline functions in SkString.h as static.
This can generate spurious warnings like:

  In included file: unused function 'SkStrStartsWith'
  ../../third_party/skia/include/core/SkString.h:23:13: note: error occurred here
  [-Wunused-function]

Change-Id: I4bdfc054d1d24dddf2f8ed68b0a8ebd2cb1a746b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217986
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-04 11:40:02 +00:00
Mike Reed
ede7e99465 add simpler addFrame api (helps with threaded producers)
Change-Id: I458dc2fb59aa32e084b0b03945afd74ff5ee42ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217861
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-06-03 15:40:35 +00:00
Brian Salomon
eca66b32fd SkVector4 as ctype for half4
Use in GrColorMatrixFragmentProcessor.

Also make GrColorMatrixFragmentProcessor::Make() call
SkMatrix44::set4x4().


9bf803677ea133368178e1eb23e120dd823da151

Bug: skia:8962
Change-Id: I2476f4af03b4e43cc843e6eda28673d1c2454acc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217496
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-06-02 18:32:45 +00:00
Brian Salomon
d6f3f18d51 Color matrix effect rewritten as .fp
Also adds flexibility to unpremul the input, clamp the output, premul the
output or not.

Also fixes SkMatrix44 as a ctype.

The intent is to reuse this for rgb->yuv conversion in async rescale and
read.

Bug: skia:3962
Change-Id: I470d1cfebdbd79d8541b633c1747d510a5549ac4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217128
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-05-31 14:25:05 +00:00
Jim Van Verth
dac1e55862 Use GrCFResource class to manage backend surface MtlTexture resources.
The texture resource in MtlTextureInfo is a CoreFoundation object,
so we have to manage the refcounting ourselves. GrCFResource is a
wrapper class which will automatically take care of this for us on
creation, assignment, and destruction.

Bug: chromium:964498
Change-Id: I9a3768833744d4aaaec2142200283f0e7eaad165
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216351
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Christopher Cameron <ccameron@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-05-31 14:00:12 +00:00
Heather Miller
655ee0f015 Update Skia milestone to 77
Change-Id: I997f82ec6d61b896b332c9cd0c731500a99a38f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216860
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
Auto-Submit: Heather Miller <hcm@google.com>
2019-05-30 11:15:58 +00:00
Mike Reed
c0ee21feb8 skia helper for encoding video
Change-Id: I36aef5872fc8f5938854ab18b754f3800b9879ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215165
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-05-28 20:39:21 +00:00
Jim Van Verth
7730d7cb8f Revert "Change Metal to not take ownership of objects"
This reverts commit 186a295111.

Reason for revert: Metal bots failing

Original change's description:
> Change Metal to not take ownership of objects
> 
> Prior to this change, Skia/Metal interfaces take ownership of the Metal
> objects passed in (that is, the caller should count passing the object
> to Skia as "freeing" the object).
> 
> Change this behavior so that Skia/Metal retains its own separate
> ownership of the Metal objects.
> 
> Make GrBackendTexture and GrBackendRenderTarget maintain their own
> references to the underlying MTLTexture by using the CFRetain/CFRelease
> interfaces. Do this by adding a private GrMtlBackendSurfaceInfo.
> 
> Move GrMtlBackendSurfaceInfo (formerly GrMtlTextureInfo) out of the
> union in GrBackendTexture and GrBackendRenderTarget because unions
> cannot have nontrivial constructors and destructors (how fVkInfo isn't
> causing a compile error is unclear).
> 
> Change-Id: Iae3719c0715825d86503d03c766e47f0f6015bdf
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215685
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,ccameron@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ie569fe1938857706b5413876a9480ef1eb3314ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216221
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-05-28 03:30:23 +00:00
Christopher Cameron
186a295111 Change Metal to not take ownership of objects
Prior to this change, Skia/Metal interfaces take ownership of the Metal
objects passed in (that is, the caller should count passing the object
to Skia as "freeing" the object).

Change this behavior so that Skia/Metal retains its own separate
ownership of the Metal objects.

Make GrBackendTexture and GrBackendRenderTarget maintain their own
references to the underlying MTLTexture by using the CFRetain/CFRelease
interfaces. Do this by adding a private GrMtlBackendSurfaceInfo.

Move GrMtlBackendSurfaceInfo (formerly GrMtlTextureInfo) out of the
union in GrBackendTexture and GrBackendRenderTarget because unions
cannot have nontrivial constructors and destructors (how fVkInfo isn't
causing a compile error is unclear).

Change-Id: Iae3719c0715825d86503d03c766e47f0f6015bdf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215685
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-05-25 01:53:25 +00:00
Hal Canary
be67a17c77 add SkNamedTransferFn::kRec2020
Change-Id: I674ab82845f5e6db56412d36e2d146d1208032af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215824
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-05-24 16:03:03 +00:00
Brian Salomon
0858e96df4 Enable GL by default if GPU enabled and no backend selected.
Change-Id: I0e4b1d56edc364217b753886caeea9c158d8be28
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215644
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-05-24 15:48:50 +00:00
Hal Canary
c4c812c273 replace SkFont::glyphsToUnichars with SkFontPriv::GlyphsToUnichars
Change-Id: Ideea45d7b23eb9e821664be96d480a7d64c69a42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215826
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-05-24 15:46:30 +00:00
Brian Salomon
aad8315aeb Reland "Allow swapping out of GrBackendTexture used by SkSurface"
This reverts commit f73b8db50b.

Reason for revert: Fixed SK_GL issue

Original change's description:
> Revert "Allow swapping out of GrBackendTexture used by SkSurface"
>
> This reverts commit 9456f7aba5.
>
> Reason for revert: Breaking layout tests
>
> Original change's description:
> > Allow swapping out of GrBackendTexture used by SkSurface
> >
> > Change-Id: I67f26efaee87536f3faf51ca164bf003013c7c8a
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215428
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: I0ff5e63d47cd3e536f9fe656503d74965ce6dbfd
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215822
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: Ie87d84ac4c08d67bcd276330f1af087bc532aad2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215825
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-05-24 15:20:01 +00:00
Brian Salomon
f73b8db50b Revert "Allow swapping out of GrBackendTexture used by SkSurface"
This reverts commit 9456f7aba5.

Reason for revert: Breaking layout tests

Original change's description:
> Allow swapping out of GrBackendTexture used by SkSurface
> 
> Change-Id: I67f26efaee87536f3faf51ca164bf003013c7c8a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215428
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: I0ff5e63d47cd3e536f9fe656503d74965ce6dbfd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215822
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-05-24 14:01:23 +00:00
Mike Reed
6a5f7e29a8 split RGB into YUV planes
Change-Id: Ifd1d010068691e187561a25aff45d8b67ae62c39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215442
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-23 19:57:30 +00:00
Brian Salomon
9456f7aba5 Allow swapping out of GrBackendTexture used by SkSurface
Change-Id: I67f26efaee87536f3faf51ca164bf003013c7c8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215428
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-23 18:38:28 +00:00
Ben Wagner
965de68dd7 Remove SkTextEncoding and SkFontHinting macros.
It appears all known users have been mirgrated to the new enums.

Change-Id: Id64083c18bf8aa5f2ec935c80af3babebad90a2d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215459
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-05-22 20:44:28 +00:00
Hal Canary
db5863c24c SkMatrix: get rid of AggregateMatrix
Change-Id: I9bb7b1f0f238937b59539d1b60e0f9b106498201
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215444
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-05-22 17:48:04 +00:00
Ben Wagner
ab6eefe60e Move SkLeanWindows.h to src.
This file pulls in Windows headers in a custom way, which is somewhat
awkward for a library header. The only use in include/ has been replaced
with a single forward declaration.

Change-Id: Ibef4cf7a2d1c9957a6a5b145b95aca1a6868cb5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214689
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-05-21 13:48:00 +00:00
Mike Klein
fe0aeb3691 update SkUserConfig.h a bit
- tweak comments to be immune to tools/rewrite_headers.py
    - remove a few bonkers settings no user should change

While I'm at it, re-run tools/rewrite_headers.py.

Change-Id: Ie588d604010dd26abcdd277c586cd6c58568dcf5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214740
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-05-20 17:52:22 +00:00
Mike Reed
dc2b98fd29 simplify setColor, without needing the 4f or the colorspace
Change-Id: I7f6fe83cfb653819c1b5d865421f4fd2121e9b4d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212418
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-05-20 16:59:26 +00:00
Robert Phillips
5c7a25bd2f Move explicit backend object allocation API to GrContext
This initial portion of the API should be ready to go. Follow on CLs will add the other entry points.

Change-Id: Ia9c708046ba08b16f9a71558e2bf2c38279abe5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-20 15:31:56 +00:00
Ben Wagner
729a23f50f Move ccpr headers for display list out of include/private.
This partially undoes 774168efac "Allow
CCPR in DDL mode (take 2)". The issue appears to have been the use of a
not fully defined type (destructor could not be instantiated) because
the private fields were also dllexported, requiring the destructors to
exist in all translation units which included the header. Only the parts
of the class which are actually public are now marked as exported.

Change-Id: I8a79bd5d8962e94c24f7563d496744bb278153fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214020
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-05-20 14:50:56 +00:00
Mike Klein
a8ceb775c1 Revert "remove SkMiniPicture and co."
This reverts commit 046ecb1b5e.

Reason for revert: Flutter

Original change's description:
> remove SkMiniPicture and co.
> 
> This was an optimization for Chromium that I believe is no longer
> relevant in a world of PaintOpBuffers.
> 
> Change-Id: Ic7526715a0ef1c3cec387a44189b7d56d5107af5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213680
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,reed@google.com,chinmaygarde@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ibf1ccee88c9ea140210cb9258ec96f9841e84c24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214661
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-05-20 13:18:48 +00:00
Brian Salomon
201700fa86 Initial version of rescaling async readback API
This is implemented at backend-neutral level and so misses some
opportunities to reduce the number of passes in the GPU backend.

Filter quality is interpreted as:
none - single nearest neighbor resampling
low - chain of bilinear resamplings. 2x up/down except for one
step which may be smaller than 2x.
medium - same as low
high - when both scale factors are up then same as low but with bicubic
filtering rather than linear. Otherwise, same as low.

Bug: skia:8962

Change-Id: I4467636c14b802d6a0d9b5c363c1ad9e87a1a44b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213831
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-05-17 16:39:10 +00:00
Michael Ludwig
08b260c27b Refactor complex CTM management for image filters
This consolidates the scale decomposition and SkMatrixImageFilter logic
that SkCanvas did during a layer save into an applyCTM function. It is
expanded to handle the extra transformation steps for backdrops.

The backdrop logic in SkCanvas has also been updated to only snap the
necessary portion of the buffer, and also use applyCTM. Previously any
backdrop filter with a CTM beyond scale/translate would do no filtering.

Unfortunately, perspective has caused too many headaches to solve in a
single CL, so its issues are recorded at skbug.com/9074.

Other minor fixes that were encountered while working on this:
- Raster's CopyFromRaster() incorrectly held onto the subset after copying.
  (unfortunately it looks like snapBackImage() needs to copy; referencing
   the subset directly corrupted the output).
- SkLocalMatrixImageFilter now supports complex CTMs assuming its input
  supports CTMs.
- CropRects need to apply in the source coordinate system, but are not
  aware of complex CTMs when performing clipping. For a simple fix, any
  filter with a crop rect set cannot support complex CTMs until that's
  updated.

Bug: skia:9074, chromium:959412
Change-Id: I1276a4ec400dfefb958c14beda078bdf1d087baa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213080
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-17 16:12:11 +00:00
Mike Klein
4bf6fd68db Revert "add runtime registration for encoders"
This reverts commit 940c3f136d.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> add runtime registration for encoders
> 
> If we want to make these external dependencies mix-and-match in Google3,
> we'll need to group together the encoders and decoders, everything that
> dependends on each external library.
> 
> I was tempted to try to remove these generic encoder entrypoints and
> replace them with calls to the direct equivalents, but I'm not sure
> that's necessary.  I think we can just register encoders like decoders.
> 
> Change-Id: I41d2d1bb3ceb1daafa62c95d345eb6a70249be75
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213880
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=mtklein@google.com,scroggo@google.com,brianosman@google.com

Change-Id: I3ee9353ca6b3c6c11feba0503b672d8986a347be
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214107
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-05-15 22:02:39 +00:00
Brian Salomon
fc1dddbb8d Reland "Get EGLimage functions out of GrGLInterface."
This reverts commit 753836fcad.

Reason for revert: fixed

Original change's description:
> Revert "Get EGLimage functions out of GrGLInterface."
>
> This reverts commit bc233135e4.
>
> Reason for revert:
> EGLImageTest and TextureBindingTest broken on Windows ANGLE
> Build failures on Debian9, unable to link
>   ld.lld: error: undefined symbol: eglCreateImageKHR
>
> Original change's description:
> > Get EGLimage functions out of GrGLInterface.
> >
> > Only used in test code which can just directly call these.
> >
> > Also removed related code in interface assemble/validate generator.
> >
> > Change-Id: I7e821ebb9328bdd2a54d8ab3af929399ca0517d5
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213480
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com
>
> Change-Id: I622fadf22c5d79f5b1d335a8a81455978d49a86a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213960
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

EXTRA_TRYBOTS=Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE

Change-Id: I71397072fa79ae3c72f3835c5e991b9ef2465a9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214040
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-05-15 19:58:45 +00:00
Mike Klein
940c3f136d add runtime registration for encoders
If we want to make these external dependencies mix-and-match in Google3,
we'll need to group together the encoders and decoders, everything that
dependends on each external library.

I was tempted to try to remove these generic encoder entrypoints and
replace them with calls to the direct equivalents, but I'm not sure
that's necessary.  I think we can just register encoders like decoders.

Change-Id: I41d2d1bb3ceb1daafa62c95d345eb6a70249be75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213880
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-05-15 18:52:43 +00:00
Michael Ludwig
753836fcad Revert "Get EGLimage functions out of GrGLInterface."
This reverts commit bc233135e4.

Reason for revert:
EGLImageTest and TextureBindingTest broken on Windows ANGLE
Build failures on Debian9, unable to link
  ld.lld: error: undefined symbol: eglCreateImageKHR

Original change's description:
> Get EGLimage functions out of GrGLInterface.
>
> Only used in test code which can just directly call these.
>
> Also removed related code in interface assemble/validate generator.
>
> Change-Id: I7e821ebb9328bdd2a54d8ab3af929399ca0517d5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213480
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: I622fadf22c5d79f5b1d335a8a81455978d49a86a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213960
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-05-15 17:45:48 +00:00
Brian Salomon
bc233135e4 Get EGLimage functions out of GrGLInterface.
Only used in test code which can just directly call these.

Also removed related code in interface assemble/validate generator.

Change-Id: I7e821ebb9328bdd2a54d8ab3af929399ca0517d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213480
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-15 16:29:18 +00:00
Mike Klein
945d1e538c simplify rtree loops in Skia too
Sorry for yanking you around on whether on not this is worth doing.
Seems like SkRTrees are going to stick around for now for Flutter,
so I think we might as well keep both implementations up to date.

This ripples out a little further than in Chromium, as the math we're
deleting here was the only use of the aspect ratio of the passed-in
bounds, that itself the only use of those bounds themselves.  So we can
un-plumb all that too.  I'd still like to see how much we can minimize
the need for those user-provided bounds at all, especially when we're
calculating them all here.

Change-Id: Iea07e8e3d23a4dd31da8bcde512b24caabc96a10
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213840
Reviewed-by: James Bankoski <jimbankoski@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-05-15 15:42:10 +00:00
Ben Wagner
21bca28bda Move SkMessageBus.h into src/core
Not used by anything else in the include directory, probably don't want
to accidentially expose it either.

Change-Id: I50d255e2cac43d8405305a825fd194bb36edd8fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213826
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-05-15 15:33:48 +00:00
Michael Ludwig
6e17f1d4d1 Revert "Clear and discard stencil buffers on tilers"
This reverts commit 7b2c85577d.

Reason for revert: nanobench hangs on chromebook bots during mipmap regeneration

Original change's description:
> Clear and discard stencil buffers on tilers
>
> Bug: skia:
> Change-Id: I42e99cb75567825ac7751fc0ec56e4c45132628b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210425
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=egdaniel@google.com,robertphillips@google.com,csmartdalton@google.com

Change-Id: I69e04c4797b6bde934d86c83bf0348c8abadcfc3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213824
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-05-15 15:17:19 +00:00
Ben Wagner
8bd6e8f198 Move SkTSearch.h into src.
No public headers are using it anymore, so move it from include/private
into src/core where SkTSearch.cpp resides.

Change-Id: I4499c629487ff1b8c391b44708616d67567a3e9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213674
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-05-15 14:15:07 +00:00
Mike Klein
ad44dd500f preserve comments past the #include ""
Tacking on parts[2] lets us keep things like IWYU comments

    #include "something.h" // IWYU pragma: keep

Rerun the script too... not much interesting.

Change-Id: I9f02c81ffece0ecf3e99730d4a12d49e01417ddc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213697
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-05-14 19:35:34 +00:00