Commit Graph

306 Commits

Author SHA1 Message Date
Stephen White
fdba6c8b76 Modify SurfaceTest to only test readbacks from supported surfaces.
Dawn: support readbacks in caps only from Texture-based surfaces.
Change-Id: I3681b9418f592d9c511931cb422f0f8fb113ff73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291973
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-05-29 16:21:45 +00:00
Greg Daniel
0a2464f51f Update internal skia uses to use flushAndSubmit and submit calls.
Bug: skia:10118
Change-Id: Ieb7c0eece56d3d9df56ecb52e00e76c01f038de8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289888
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-14 20:26:44 +00:00
Stephen White
dbb3e1dc2e Remove some asserts that prevent Dawn from completing a DM run.
Dawn does not support readback from a bare render target, so it will
continued to fail those tests. But it should fail without dm halting
execution.

Change-Id: If7955106d5dbb4eaea86af58de96bcc7e74aac85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288902
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-05-14 17:15:23 +00:00
Greg Daniel
c1ad77cf48 Add finisehd proc to backend texture creation.
The callback lets the caller know when the data uploads to the texture
from the create call are finished. This is important since the caller
cannot delete the backend texture till the gpu is finished on vulkan
and d3d.

This change also removes the hard sync in vulkan during creation.

Change-Id: I660d142219474e22b1337d2b0c81cda66fe18a4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286517
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-05-06 16:50:33 +00:00
Mike Reed
fdf94044ff Remove exotic legacy bitmap drawing entry points: Nine, Lattice
follow-ups:
- remove associated virtuals in canvas

Change-Id: I3efa7a88ed0905ebf080712993e7f43148df36dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276282
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-03-11 13:11:47 +00:00
Greg Daniel
7c9021185c Remove SkImage getTexture call.
Change-Id: Ib9f3d8c58ee5736bfee03eaedff20f24b51d5ff9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275625
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-03-06 18:53:00 +00:00
Greg Daniel
37c127f558 Rename view getters in various image subclasses.
This also changes the SkImage_Base header to return a const& view and
then removes the equivalent version in SkImage_GpuBase.

Bug: skia:9556
Change-Id: Ica096693a22c0fc590786058c055fb28387c80a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268624
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2020-02-05 16:02:27 +00:00
Greg Daniel
3912a4b1da Update GrSurface/RenderTargetContexts to take and store GrSurfaceProxyViews.
Bug: skia:9556
Change-Id: Ie1aed1b16c237e9c9d1b582ac4ff02fdaaad238f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263205
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-01-14 15:31:07 +00:00
Greg Daniel
bfa19c4e76 Add factories to GrSurfaceContext and clean up creation flow.
This CL updates all callers that ending up in GrDrawingManager::makeSurfaceContext
to use the new factory or directly call ctors.

A follow on change will get the rest of the calls which go to
GrDrawingManager::makeRenderTargetContext

Change-Id: I662da654a1ec8b8972c50fe9ce45a9185d4c3dc1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260901
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-12-20 15:05:56 +00:00
Brian Salomon
28a8f28b3e Rename functions in TestUtils.h
Change-Id: Iaa8a4ac57e967c6429473fb3a738d377a47fc2c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250799
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-10-25 00:36:28 +00:00
Robert Phillips
66944404ce Make SkPixmap-variant of createBackendTexture public
Change-Id: I51d916d2410428113e29d2fc374e5f1f7f4010b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244676
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-30 18:06:14 +00:00
Brian Salomon
f2ebdd91bf Rename GrPixelInfo to GrImageInfo.
Give it its own header file.

Make it store SkISize rather than separate int w/h.

Change-Id: I732f2774c561decac743a950959a70cbc162b67b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245163
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-09-30 17:10:18 +00:00
Robert Phillips
429f0d380c Add kRG_1616 and kAlpha_16 SkColorTypes
This also switches GrColorType::kR_16 to kAlpha_16 to more closely match raster.

Bug: skia:9121
Change-Id: I03c6e6c52c90aa4223478c5ea6c8b2ed8558f677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239930
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-12 12:20:09 +00:00
Brian Salomon
bf6b9795f6 GrSurfaceContext not ref counted.
Also don't specify redundant width/height to SkGpuDevice.

Change-Id: I389df5c4b073c2c05632ba6b7c95b02a22dfaf98
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235824
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-21 15:31:23 +00:00
Greg Daniel
6fa62e2ab3 Remove use of GrColorType on GrCaps::getRenderTargetSampleCount.
Additionally this changes removes the version of the call that that takes
a GrPixelConfig.

As part of this change many call sites that were calling getRTSampleCount
to just check renderability have been changed to call
isFormat[AsColorType]Renderable instead. This change has also started to
move us to just checking format renderability (without GrCT) in classes
that are specifically dealing with GrSurface (GrResourceProvider, GrGpu, etc.).

Bug: skia:6718
Change-Id: Icf4a1a21a81a44e6863a7cd2059d21b9833d581f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233039
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-08 13:15:28 +00:00
Robert Phillips
d344284e77 More SkAutoPixmapStorage
A left over code review request

Change-Id: Ib58abaee4761d14b8ec67f88dc903ac1ed06a58e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232016
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-08-02 16:59:04 +00:00
Robert Phillips
4d87b2bdf6 Address TODO in testing code (i.e., cleanup create_backend_texture)
This is left over from:

https://skia-review.googlesource.com/c/skia/+/212408 (Add test for DDLs and SkSurface::flush)

Change-Id: I45797385d5ce33d4197284d53c9ec73e1a9c5e2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212506
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-23 18:10:46 +00:00
Chris Dalton
effee20657 Use mixed samples internally for default coverage AA
Lays the infrastructure to use mixed samples internally, and begins
using nvpr with mixed samples on the default "gl" and "gles" configs.

In this rendition, we take the simplest approach possible re: stencil
attachments. We initially create a render target without stencil
(i.e., 0 samples). Then, any time a proxy needs a stencil buffer with
more samples than its target currently has, we create and attach a new
stencil buffer. However, we never "downgrade" a render target's
stencil attachment to one with fewer samples. So if the proxy only
needs one sample and the target has many, we leave it.

Bug: skia:
Change-Id: I8558ba799ac3dee457f349f77d4517c11413c9a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224456
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-02 06:04:09 +00:00
Robert Phillips
da2e67a357 Add GrProtected parameter to all createBackendTexture variants
Change-Id: I667bc730e321b579bef98f3d6003f7a7b29c9890
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224957
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-01 19:46:18 +00:00
Brian Salomon
1d43530aa2 Pass alpha type to GrSurfaceContext::read/writePixels and remove flags.
We deduce whether to premul or unpremul based on the the input/output
alpha types. This means we also now support unpremuling on write and
premuling on read.

Class-ify former struct GrPixelInfo. Remove origin and instead pass a
flip bool to GrConvertPixels.

Unifies read/write methods on GrSurfaceContext via automatic conversion
of SkImageInfo to GrPixelInfo and making GrDirectContext an optional
parameter.

Bug: skia:7580

Change-Id: I42f6997852b4b902fb81264c6de68ca9537606aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224281
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-01 17:30:40 +00:00
Brian Salomon
d628747dfb Make GrColorSpaceInfo store GrColorType.
This is largely redundant with GrPixelConfig. However, we intend to
remove GrPixelConfig.

Bug: skia:7580

Change-Id: I03d92303be832711f7821f8a97d36387c9b04a9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222883
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-25 14:29:09 +00:00
Robert Phillips
d8f79a27b0 Reduce GrCaps' reliance on GrPixelConfig
By itself this CL isn't all that compelling but I believe we need some intermediate path to wean ourselves off of GrPixelConfig. In particular, I believe isFormatTexturable will not need an SkColorType parameter in the future.

This is pulled out of:

https://skia-review.googlesource.com/c/skia/+/222781/ (Add bridge between GrContext::createBackendTexture and SkSurface::MakeFromBackendTexture)

which adds SkSurface::isCompatible - so the SkSurface_Gpu::isCompatible calls have been removed from this CL.

Change-Id: I6c2b8a2c4af98c1437b92c58513f34014e551b2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223188
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-24 18:29:15 +00:00
Brian Salomon
e7499c7e8a GrColorSpaceInfo stores SkAlphaType.
This means GrSurfaceContext's know their alpha type.
All GrRenderTargetSurfaceContexts are kPremul.

Make GrTextureProducer store GrColorSpaceInfo.

Bug: skia:7580
Change-Id: I5ff321ef52c0edd32e5fac99dff95d44aa66f592
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223184
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-24 17:48:01 +00:00
Chris Dalton
6ce447a4ec Eliminate mixed samples as an FBO type or AA type
From now on, sample counts always refer to the number of actual color
samples, and render targets don't have separate color and stencil
sample counts.

If mixed samples support is available when making a
"GrAAType::kCoverage" draw, then an op may attach and use a mixed
sampled stencil buffer internally. But this will all be invisible to
the client.

After this CL, we temporarily won't have a mode to use nvpr with mixed
samples. That will soon be fixed by a follow-on CL that enables nvpr
with mixed samples in the normal "gl" and "gles" configs.

Bug: skia:
Change-Id: I1cb8277f0d2d0d371f24bb9f39cd473ed5c5c83b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221878
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-24 04:08:45 +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
Robert Phillips
806267973f Switch all internel uses of GrContext::createBackendTexture over to initialized versions
For Skia's testing we always want an initialized backend texture. Except for the
BackendAllocationTests of course.

Change-Id: I47b5e4c9845b3f58ebad5ba052780a69d6cd6954
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216348
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-04 14:42:27 +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
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
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
Robert Phillips
9b16f81858 Switch over to using new direct allocation API in our tests (as much as possible at least)
To fully switch over we need the entry point that uploads data but most of the old call
sites can be switched over now.

Change-Id: I362b1dfde7d88bf8d3f8f90155f53d9ac442a329
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214300
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-17 15:41:50 +00:00
Robert Phillips
9dbcdcc8ba Alter createTestingOnlyBackendTexture methods
This intended to bring this API more into line with the proposed GrBackendObject API with an eye towards replacing the former with the latter.

TBR=bsalomon@google.com
Change-Id: I4367f03fb10fff788749f21c4843060111a6df1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213220
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-13 15:39:33 +00:00
Robert Phillips
ee5fd13ea2 Add test for DDLs and SkSurface::flush
Bug: 958055
Change-Id: I9abffd09344a731efbd29dce23db76d56d258622
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212408
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-07 19:22:20 +00:00
Mike Klein
c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00
Mike Klein
ea3f014e2b sk_tool_utils -> ToolUtils, and git clang-format
sk_tool_utils doesn't really fit the naming convention
the rest of code under tools/ tends to use.

Change-Id: I45326a174101c6eb4b6149e9c742f658f2fd23b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202313
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:05:42 +00:00
Robert Phillips
6603a1743e Make SkImage_Base::asTextureProxyRef take a GrRecordingContext parameter
In future Ganesh the SkImage's will only have GrImageContexts. asTextureProxyRef, however, may need to perform some rendering thus requires an external GrRecordingContext.

Change-Id: I893573e9f3462b4c4cf5e29a7f8ee74027a2ce6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197134
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-05 19:49:40 +00:00
Greg Daniel
8ce7991242 Add release proc apis to SkSurface::MakeFromBackend* calls.
Bug: skia:
Change-Id: I0e6cd8895c328a89cd0fa50260fe4e8adbff5990
Reviewed-on: https://skia-review.googlesource.com/c/188634
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-05 15:36:14 +00:00
Robert Phillips
9da87e0e98 Rename GrContext::contextPriv to priv
Mechanical. This makes the priv() accessor the same for all the context types.

Change-Id: I40850eb05a33b8d7cc3eabdd42226d24b2ba58aa
Reviewed-on: https://skia-review.googlesource.com/c/189164
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-04 22:13:14 +00:00
Hal Canary
89a644b635 sed s/drawSimpleText/drawString/
for f in $(git grep -l drawSimpleText); do
    sed -i 's/wSimpleText(\([[:alnum:]]\), strlen(\1), kUTF8_SkTextEncoding,/wString(\1,/g' "$f"
    sed -i 's/wSimpleText(\([[:alnum:]]*\)\.c_str(), \1\.size(), kUTF8_SkTextEncoding,/wString(\1,/g' "$f"
done
git checkout @~ include/core/SkCanvas.h samplecode/SampleCusp.cpp
git cl format

Change-Id: Ibc0c3afd30f86465a645fadb26177d61919f57fd
Reviewed-on: https://skia-review.googlesource.com/c/181561
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2019-01-08 19:50:09 +00:00
Mike Reed
212e9060ed don't use drawPosText
Skia can now build if we mark drawPosText as private,
Will hide/remove next (after Chrome CL)

Bug: skia:
Change-Id: I156560b025c119af302545bb5bd60678f7b8e8f7
Reviewed-on: https://skia-review.googlesource.com/c/179985
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-12-25 23:07:35 +00:00
Michael Ludwig
72ab3461b7 Consolidate stroke-rect ops and use GrFillRectOp instead of GrNonAA/AARectOp
Bug: skia:
Change-Id: Iee57bc970a026de2ad5a0758153e9cbb20753fa1
Reviewed-on: https://skia-review.googlesource.com/c/173105
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-12-11 16:33:35 +00:00
Mike Klein
e978ca2979 limit range of surface sizes in surface_image_unity
We're already not testing these giants sizes on 32-bit machines because
they overrun memory.  I'm not sure it's important to test them at all.

Change-Id: I322d46add8024760fc71939abe09430f77cbd69d
Reviewed-on: https://skia-review.googlesource.com/c/165767
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
2018-11-01 20:17:39 +00:00
Mike Klein
ff0e8409e1 clean up some odd SkRefCnt features
SkRefCntBase is an implementation detail of SkRefCnt, so let's not
mention it in SkContext_Compute.h.  While I'm here, I notice SkNVRefCnt
would work fine too.

No one else calls internal_dispose_restore_refcnt_to_1(), so we can
inline it.  While here, I notice it's resetting the ref count to 1 even
in release builds.  I'm not sure if that is/can be optimized away, but
in any case I think we can wrap with #ifdef SK_DEBUG, if only to make it
clear that it's only there to support the assert in the destructor.

I've removed validate().  Most of the places it's called read pretty
weird, and I think suggest some sort of class-specific validation than
just checking that we're holding a ref.  SkWeakRefCnt::validate() isn't
called anywhere.

There were few users of getRefCnt() outside SkRefCnt itself, so I
removed the rest and made it private.

I've added a few this-> to self calls while at it.

Change-Id: I98be06677a6e8b8e66f44cbb17d14e38b0f39d38
Reviewed-on: https://skia-review.googlesource.com/c/167160
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-10-31 20:47:16 +00:00
Brian Osman
38a62bdf64 Remove obsolete checks about colorType and colorSpace
Also remove the unit tests that were enforcing those rules,
and the blacklist of that unit test.

Bug: skia:
Change-Id: I802c9e81a412fe0b19d02f9224b801f4fbd901f2
Reviewed-on: https://skia-review.googlesource.com/c/161562
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
2018-10-11 19:38:53 +00:00
Greg Daniel
f421685918 Revert "Stop using color space xform canvas in picture image generator"
This reverts commit 031ca213e0.

Reason for revert: breaking angle surfacetest unit test

Original change's description:
> Stop using color space xform canvas in picture image generator
> 
> Direct rasterization should produce similar (or identical) results.
> See: https://chromium-review.googlesource.com/c/chromium/src/+/1273815
> 
> Bug: skia:
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: I252ec5d5ecb19704f33c0f6cb65d12c2ec927c1d
> Reviewed-on: https://skia-review.googlesource.com/c/161140
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: Ib5667f0d315c4f2877c1f0c38e9c62d37335d511
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://skia-review.googlesource.com/c/161560
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-10-11 17:47:21 +00:00
Brian Osman
031ca213e0 Stop using color space xform canvas in picture image generator
Direct rasterization should produce similar (or identical) results.
See: https://chromium-review.googlesource.com/c/chromium/src/+/1273815

Bug: skia:
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I252ec5d5ecb19704f33c0f6cb65d12c2ec927c1d
Reviewed-on: https://skia-review.googlesource.com/c/161140
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-10-11 16:47:27 +00:00
Mike Klein
4429a4f82c re-precate SkMatrix44::SkMatrix44()
It's been driving me nuts that I can't just write `SkMatrix44 m;`,
and I often don't care whether it's initialized or not.  The default
identity constructor would be nice to use, but it's deprecated.

By tagging this constructor deprecated, we're only hurting ourselves;
our big clients disable warnings about deprecated routines and use it
freely.

A quick tally in Skia shows we mostly use the uninitialized constructor,
but sometimes the identity constructor, and there is a spread of all
three in Chromium.  So I've left the two explicit calls available.

I switched a bunch of calls in Skia to use the less verbose constructor
where it was clear that it didn't matter if the matrix was initialized.
Literally zero of the kUninitialized constructor calls looked important
for performance, so the only place I've kept is its lone unit test.

A few places read clearer with an explicit "identity" to read.

Change-Id: I0573cb6201f5a36f3b43070fb111f7d9af92736f
Reviewed-on: https://skia-review.googlesource.com/c/159480
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-04 14:01:11 +00:00
Mike Klein
ae5e864134 remove internal uses of SkColorSpace::toXYZD50()
There's one more to replace in Chromium,
then the method and cached SkMatrix44 can go.

Change-Id: I20cfac8b7bd26216f66f6d70fa9d117d0b17cee5
Reviewed-on: https://skia-review.googlesource.com/c/159302
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-04 13:11:59 +00:00
Robert Phillips
646f637f4c Add rowBytes to createTestingOnlyBackendTexture
This is pulled out of:

https://skia-review.googlesource.com/c/skia/+/151983 (Test YUV images in DDL)

The YUV images seem to like to have row padding.

Change-Id: I517d2b63678beeafef88f86148fca15862176780
Reviewed-on: https://skia-review.googlesource.com/156367
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-09-25 13:48:29 +00:00
Hal Canary
8a00144035 test,tools: whitespace changes for clang-format
Change-Id: I67529f6c0ac26da603f60af22c620f8f603d8a19
Reviewed-on: https://skia-review.googlesource.com/155564
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2018-09-19 17:50:51 +00:00