Commit Graph

5694 Commits

Author SHA1 Message Date
Brian Salomon
cb1bbfe5a1 Fix breakage from merge conflict related to deleteTestingOnlyBackendTexture sig. change
Change-Id: I28c50efb9c7723df19041640809994bff8ea5041
Reviewed-on: https://skia-review.googlesource.com/113421
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-03-09 18:37:54 +00:00
Brian Salomon
26102cb604 Make GrGpu::deleteTestingOnlyBackendTexture() take const GrBackendTexture&
Change-Id: Ibd00d0dc6d8c73628f26851e102defdbafab149b
Reviewed-on: https://skia-review.googlesource.com/113164
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-09 18:20:40 +00:00
Greg Daniel
a8d9211bc3 Add promise images for deferred instantiation of wrapped gpu textures
This will allow a client to make an SkImage that "wraps" a gpu texture,
however the client does need to supply the actual gpu texture at Image
creation time. Instead it is retrieve at flush time via a callback.

Bug: skia:
Change-Id: I6267a55ab7102101a7bd80a6f547b6a870d2df08
Reviewed-on: https://skia-review.googlesource.com/109021
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2018-03-09 18:02:00 +00:00
Brian Salomon
f865b05fe5 Add GM configs that test rendering to a GL backend texture and render target
This also adds GrGpu::create/deleteTestingOnlyBackendRenderTarget. Implemented in GL only for now.

Change-Id: I9e5fdc953c4a249959af89e08332f520cefe9d90
Reviewed-on: https://skia-review.googlesource.com/113305
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-09 16:32:10 +00:00
Ben Wagner
03cd6e6dec Avoid serializing to 'typ1' on Mac.
CoreGraphics does not provide a means to get the original font data for a
CGFont, only the tables. As a result, Skia pieces the font data back
together when requested. The most awkward part of this is choosing the
first four bytes, and the CTFont suggestion seems to often be wrong.

This change doublechecks the selection of 'typ1', prefering to use 'OTTO'
if there are no 'TYP1' or 'CID ' tables. These sorts of fonts are
extremely old and unlikely to be in current use. It appears that CTFont
may report that it has this format if it is an 'OTTO' font with very few
glyphs. If Skia serializes such a font with 'typ1' as the first four
bytes, CoreGraphics will not create a CGFont from the resulting font data.

BUG=chromium:809763,skia:7630

Change-Id: I9979b9f0ebdd27c4ad0903e8ee6237241e755541
Reviewed-on: https://skia-review.googlesource.com/113306
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-03-09 15:03:20 +00:00
Cary Clark
74b4290861 some fuzzer fixes
should fix three or four of the PathOp asserts
triggered by the fuzzer tool.

R=kjlubick@google.com
Bug: skia:
Change-Id: I470895addf1e922da6a7c41d44d54eca92e68fb6
Reviewed-on: https://skia-review.googlesource.com/113163
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-03-09 14:54:30 +00:00
Mike Reed
d07e4a226a Change behavior of custom image serial/deserial
New behavior is to *always* call the client's deserial image proc for all data.
This allows the client to make decisions even on "std" image data like PNG.

The change also means that if there is no client deserial image proc, Skia will
still attempt to create an image from the data, even if it was written by a
custom serial proc.

Bug: skia:7706
Change-Id: Ia58bdd10b86d497f02187082c6373c029e9c8293
Reviewed-on: https://skia-review.googlesource.com/113302
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-03-08 21:50:51 +00:00
Greg Daniel
4684f82ebc Add ability to uninstantiate lazy proxies after every flush.
Bug: skia:
Change-Id: Id32540cda54a9c5e3e6cb721776699be3cc8ac1a
Reviewed-on: https://skia-review.googlesource.com/113263
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-03-08 21:05:21 +00:00
Greg Daniel
26b50a4cda Add testing only helper to flush and sync gpu.
The use case for this is mostly for Vulkan where we need to make sure the
gpu is done with resources before we delete or use them in some way.
Previously we used readPixels to do this which was just an ugly hack.

Bug: skia:
Change-Id: I7949ebc695032533675133aabca0e32840b417ba
Reviewed-on: https://skia-review.googlesource.com/113122
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-08 15:36:11 +00:00
Brian Salomon
f777897934 Delazify wrapped backend textures/render target proxies
These methods will fail on DDL contexts.

This is in preparation for removing the ability to specify origin for lazy proxies.

Change-Id: Iadcedfd4fce8ea2590729c974128e5c58cec38a8
Reviewed-on: https://skia-review.googlesource.com/112802
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-03-08 15:34:41 +00:00
Robert Phillips
5a66efbbab Remove GrRestrictedAtlasManager
Philosophically this relies on: https://skia-review.googlesource.com/c/skia/+/111807 (Revise Text & Small Path Atlas so instantiation failure is handled at flush time)

Change-Id: I4fdcf1af8c5e9ffefdfb973104045f4f5d223a4e
Reviewed-on: https://skia-review.googlesource.com/112702
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-08 14:29:11 +00:00
Brian Salomon
7578f3ecdd Rename wrap backend tex/rt methods on GrProxyProvider
This makes them more consistent with similar methods on GrResourceProvider.

Change-Id: Ice7e5dbe8100481781015b386445e9b7101bd75e
Reviewed-on: https://skia-review.googlesource.com/112821
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-07 20:00:20 +00:00
Mike Reed
b5e1f75580 Revert "Revert "add tiler for SkDraw""
This reverts commit 461ef7af88.

Prev CL to SkScan_Hairline.cpp fixed the bug that caused the earlier revert.

Bug: skia:
Change-Id: Ifd9a364c7546175be292f726e19465b72196b45e
Reviewed-on: https://skia-review.googlesource.com/112723
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-03-07 19:39:00 +00:00
Robert Phillips
d2e9f767bb Revise Text & Small Path Atlas so instantiation failure is handled at flush time
This paves the way to having the AtlasTextOps not need the RestrictedAtlasManager at op creation time.

Change-Id: I1028faba730d50d3d3349a4c0809465d036ed611
Reviewed-on: https://skia-review.googlesource.com/111807
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-07 19:25:10 +00:00
Brian Salomon
58389b90cd Initial texture data is never flipped when uploaded.
The first bytes of the data always refer to the pixel accessed by texture coord (0, 0).

Change-Id: I708702d90f35b3bc896a48c3c3fd6a0be73f505a
Reviewed-on: https://skia-review.googlesource.com/112261
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-03-07 18:22:40 +00:00
Brian Salomon
e64b064f87 Remove abandon param from GrGpu::deleteTestingOnlyBackendTexture.
Prior to the existence of GrBackendTexture this was required to delete a backend-specific blob. Now it's a no-op.

Change-Id: Iba0e4233e4d07235626f0ae14b0f7e77c073d8c0
Reviewed-on: https://skia-review.googlesource.com/112569
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-07 17:56:30 +00:00
Florin Malita
461ef7af88 Revert "add tiler for SkDraw"
This reverts commit be1b397180.

Reason for revert: 

Unexpected layout test diffs: https://test-results.appspot.com/data/layout_results/linux_trusty_blink_rel/24989/layout-test-results/results.html

Original change's description:
> add tiler for SkDraw
> 
> Bug: skia:2122
> Change-Id: I276de2064939151eef5fa14c53188e8b5728b7c9
> Reviewed-on: https://skia-review.googlesource.com/110840
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Yuqian Li <liyuqian@google.com>

TBR=liyuqian@google.com,reed@google.com

Change-Id: Ia598c0d7c4ac6cfcdb905b847040c250fa366402
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:2122
Reviewed-on: https://skia-review.googlesource.com/112740
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-03-07 14:23:01 +00:00
Alexander Midlash
77e3afc908 [SkSVGDevice] Add support for image shaders.
Below is an example of the generated svg for an image shader
that repeats in the x direction only:

<svg stroke="none" x="9" y="153" width="50" height="30">
  <defs>
    <pattern id="pattern_1_19" patternUnits="userSpaceOnUse" patternContentUnits="userSpaceOnUse" width="31" height="100%" x="0" y="0">
      <image id="img_2_19" x="0" y="0" width="31" height="30" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,LONG_B64_STRING_HERE"></image>
    </pattern>
  </defs>
  <rect fill="url(#pattern_1_19)" stroke="none" x="0" y="0" width="100%" height="100%"></rect>
</svg>

Matching the height of the pattern with the height of the container prevents it from repeating in the y direction.

R=fmalita@chromium.org

Bug: skia::7681
Change-Id: I43e4f19acda4bd40c7a8b5259d67c26a108d6f67
Reviewed-on: https://skia-review.googlesource.com/111420
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-03-07 02:25:30 +00:00
Mike Reed
be1b397180 add tiler for SkDraw
Bug: skia:2122
Change-Id: I276de2064939151eef5fa14c53188e8b5728b7c9
Reviewed-on: https://skia-review.googlesource.com/110840
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
2018-03-06 19:56:46 +00:00
Mike Klein
18e9ba1edd support 888x, 1010102, and 101010x in SkPixmap::erase()
... and a few more methods to make it possible to write the new test.

Bug: oss-fuzz:6606

Change-Id: Ie8dd221059579248405f165a93c324c8ba518fd4
Reviewed-on: https://skia-review.googlesource.com/112400
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-03-06 19:43:46 +00:00
Robert Phillips
94458ee0f2 Add SkSurfaceCharacterization::createResized
Change-Id: Ia98ce3cf6c0b9f9100eea9850af56048e43b8d07
Reviewed-on: https://skia-review.googlesource.com/112580
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-03-06 19:08:46 +00:00
Cary Clark
e041e31926 remove canvas internal private
interfaces not called externally
and aren't used internally

R=robertphillips@google.com,reed@google.com
Bug: skia:6455
Change-Id: Iee98ce4380a28a831d9bffe99932b54421dd339a
Reviewed-on: https://skia-review.googlesource.com/112481
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-03-06 19:06:16 +00:00
Ben Wagner
ba8feb56c3 Draw glyphs from paths if they have an empty path.
This distuguishes between glyphs which do not have a path and glyphs
which have a path but that path resolves to the empty path.

BUG=chromium:816763

Change-Id: Id6c7dd66cdad3868bf3fe15bcb6e5e6f2ca82405
Reviewed-on: https://skia-review.googlesource.com/112484
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-03-06 16:07:56 +00:00
Herb Derby
eb3f674d6d Add GetTypefaceOrDefault to SkPaintPriv
Remove most uses of GetDefaultTypeface. SkTypeface has
fewer friends.

BUG=skia:7515

Change-Id: Iedec5b39b9ef8c638772be4971075491b59b740b
Reviewed-on: https://skia-review.googlesource.com/112300
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-03-06 15:50:26 +00:00
Mike Reed
28d47731a1 make compute helper for blurs private
Precursor for moving blurmaskfilter into core, since it is referenced
by core code for drawShadow.

Bug: skia:
Change-Id: I900c6e10523115c75f45d2c410eb6a5ca56a6e4d
Reviewed-on: https://skia-review.googlesource.com/112301
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-03-06 15:12:16 +00:00
Robert Phillips
0c4b7b1f2f Move internal calls from GrContext to GrContextPriv
A mechanical bulk move just to get these out of the public API.

TBR=bsalomon@google.com
Change-Id: I813efbd54a09dd448275697c0e50947753a5cfd3
Reviewed-on: https://skia-review.googlesource.com/112262
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-03-06 14:23:45 +00:00
Leon Scroggins III
2f8622029d Fix drawing SkAnimatedImages with transparency
Bug: b/74195953

Do not use SkBlendMode::kSrc, which overwrites the pixels that were
already present. Instead, blend normally.

Change-Id: Ie6843c6278212fddddd0ba0ae292fdb5eaf2342e
Reviewed-on: https://skia-review.googlesource.com/112200
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-03-06 13:39:35 +00:00
Brian Salomon
9d28974d16 Reenable write pixels tests
Change-Id: I05580d3f51b83922e33e99e80f1b6a84cc7babf6
Reviewed-on: https://skia-review.googlesource.com/112201
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-05 21:06:05 +00:00
Brian Salomon
2a4f983c94 Remove GrSurfaceOrigin from GrSurfaceDesc.
This field has no interpretation at the GrTexture/GrGpu as the orientation is
handled at the GrSurfaceProxy level.

This change requires GrGpu to accept a GrSurfaceOrigin when creating a texture with initial data. The origin refers to the texel data to be uploaded. Longer term the plan is to remove this and require the data to be kTopLeft. Additionally, kBottomLeft will only be allowed for wrapped texture/RTs as this evolves.

Change-Id: I7d25b0199aafd9bf3b74c39b2cae451acadcd772
Reviewed-on: https://skia-review.googlesource.com/111806
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-05 18:50:25 +00:00
Mike Reed
f6188425c7 Extend math test to ensure our min/max/pin handle non-finites
Bug: skia:
Change-Id: I4fe544c32da071d161229b12f7b90a3296b0d499
Reviewed-on: https://skia-review.googlesource.com/112140
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-03-05 17:13:46 +00:00
Ben Wagner
1ebeefe246 IWYU for test files starting with 'A'.
While testing some changes to iwyu, started fixing some files. Made it
to AsADashTest.cpp before running into
https://github.com/include-what-you-use/include-what-you-use/issues/364

Change-Id: I42b65df4f1f8116e0ea1b2cd774651990db1b132
Reviewed-on: https://skia-review.googlesource.com/111861
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-03-02 22:39:59 +00:00
Brian Osman
10fc6fddf2 Revert "Revert "Add 1010102 support to Ganesh""
This reverts commit ded47a5014.

Bug: skia:
Change-Id: I7d7552e6ccc8591cae91426407ab13b628b93b68
Reviewed-on: https://skia-review.googlesource.com/111760
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-03-02 18:19:50 +00:00
Hal Canary
ee08b4a2e9 SkString: remove externally unused ::setUTF16() from API
Moved to SkStringUtils in src/

Change-Id: I026e3a325570bbf34e90797d921cb2f05b9a29f6
Reviewed-on: https://skia-review.googlesource.com/111602
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-03-01 22:16:34 +00:00
Ethan Nicholas
68dd2c1fa0 Fixed SkSL use-after-free fuzzer bug and added defensive code to catch such problems in the future.
Bug: skia:7558
Change-Id: I5098c0ed08f2328828969e819db7785270b26656
Reviewed-on: https://skia-review.googlesource.com/111460
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2018-03-01 20:42:04 +00:00
Brian Osman
ded47a5014 Revert "Add 1010102 support to Ganesh"
This reverts commit 44b61204d9.

Reason for revert: TSAN bot crashing

Original change's description:
> Add 1010102 support to Ganesh
> 
> Adds gl1010102, gles1010102, vk1010102, and mtl1010102
> configs to DM.
> 
> This uses the same saveLayer approach as CPU, switching
> to 8888 so that we have enough alpha precision.
> 
> Change-Id: I9f5b63747ec01031c8db97dadfc42f77e4863ccb
> Reviewed-on: https://skia-review.googlesource.com/110500
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: I782e740763044c1ae78fb219161e37eec7617c74
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/111580
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-03-01 20:10:15 +00:00
Robert Phillips
c4039ea466 Fission GrAtlasGlyphCache in two (take 2)
Reland all the things

This CL splits the old GrAtlasGlyphCache into a GrAtlasGlyphCache and an GrAtlasManager.

The GrAtlasManager itself is split into a rather limited base class (GrRestrictedAtlasManager)
and the all powerful GrAtlasManager. The GrRestrictedAtlasManager is available at op creation
time and provides access to the proxies backing the atlases. The full GrAtlasManager is
only available at flush time and allows instantiation of the proxies and uploading to them.

In the DDL world all of the DDL Contexts will receive a GrRestrictedAtlasManager-version of the
GrAtlasManager in the main thread. This future atlas manager will have had all of its
GrDrawOpAtlases created (but not instantiated) so there should be no race conditions.

TBR=jvanverth@google.com
Change-Id: I05c6cd8d301bf2decca39765e5cae62993d9da04
Reviewed-on: https://skia-review.googlesource.com/111362
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-01 19:09:14 +00:00
Hal Canary
2d0e1248d6 SkString: fix ::setUTF16
Change-Id: I7ab4af9ae55a43cc05f81b0c236f29a64beac982
Reviewed-on: https://skia-review.googlesource.com/111223
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-03-01 19:03:19 +00:00
Brian Osman
44b61204d9 Add 1010102 support to Ganesh
Adds gl1010102, gles1010102, vk1010102, and mtl1010102
configs to DM.

This uses the same saveLayer approach as CPU, switching
to 8888 so that we have enough alpha precision.

Change-Id: I9f5b63747ec01031c8db97dadfc42f77e4863ccb
Reviewed-on: https://skia-review.googlesource.com/110500
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-03-01 18:34:35 +00:00
Greg Daniel
f3a4ef91d8 Add unit test the explicit tests create a GrVkCopyPipeline
Bug: skia:7663
Change-Id: I9883d903302fbbcd42f73601f49af96b6cc875ba
Reviewed-on: https://skia-review.googlesource.com/111361
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2018-03-01 17:00:24 +00:00
Robert Phillips
4bc7011802 Separate creation time & flush time behavior in GrDrawOpAtlas (take 3)
This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.

For the GrDrawOpAtlas:
  At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.

  The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush

  GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.

  During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.

The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
  It now carries a GrProxyProvider for when it needs to create an atlas
  It passes in a GrResourceProvider* at flush time to allow instantiation.

  It does not, yet, allocate that GrDrawOpAtlases it might ever require.

TBR=bsalomon@google.com
Change-Id: I276d339d81e7b709140e082a7b58c5584f73ab70
Reviewed-on: https://skia-review.googlesource.com/111100
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-03-01 15:47:34 +00:00
Leon Scroggins III
9e8a594905 Support pngs with incorrect CMF bytes
Bug: chromium:807324

Though these pngs are technically incorrect, many such PNGs exist, and
they are supported in Chromium. Ensure that users of SkCodec (e.g.
Android, Flutter) display them as well.

Change-Id: I2f1e573b4b7039cea81f96397cc0aa4cbc9461c3
Reviewed-on: https://skia-review.googlesource.com/111082
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2018-02-28 21:46:03 +00:00
Hal Canary
691fd1bcdd SkPDF: encode metadata strings correctly
BUG=skia:7669
Change-Id: I3a90a2406854cc9bcfdd299e09ae3d6e610f2cc7
Reviewed-on: https://skia-review.googlesource.com/111121
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-02-28 19:52:43 +00:00
Robert Phillips
ba7a165194 Revert "Revert "Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)"""
This reverts commit 934c3d0c54.

Reason for revert: Chrome

Original change's description:
> Revert "Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)""
> 
> This reverts commit 84d823a5e2.
> 
> Reason for revert: The DFT diffs don't repro on Windows so I'm chalking it up to minor device differences
> 
> Original change's description:
> > Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)"
> > 
> > This reverts commit 96165ebeaa.
> > 
> > Reason for revert: DFT GMs w/ LCD text are slightly different
> > 
> > Original change's description:
> > > Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)
> > > 
> > > This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.
> > > 
> > > For the GrDrawOpAtlas:
> > >   At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.
> > > 
> > >   The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush
> > > 
> > >   GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.
> > > 
> > >   During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.
> > > 
> > > The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
> > >   It now carries a GrProxyProvider for when it needs to create an atlas
> > >   It passes in a GrResourceProvider* at flush time to allow instantiation.
> > > 
> > >   It does not, yet, allocate that GrDrawOpAtlases it might ever require.
> > > 
> > > Change-Id: Ie9b64b13e261b01ee14be09fbf7e17841b7781dc
> > > Reviewed-on: https://skia-review.googlesource.com/109749
> > > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> > > Commit-Queue: Robert Phillips <robertphillips@google.com>
> > 
> > TBR=jvanverth@google.com,robertphillips@google.com
> > 
> > Change-Id: I62efc61c8394477e54d6e79fa2f65180c91a4515
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/110220
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> 
> TBR=jvanverth@google.com,robertphillips@google.com
> 
> Change-Id: I7c87b4523f9b53285f0de5c2d741a25893522d9a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/110221
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

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

Change-Id: I7dd73ab0159f38595f21b21eef3becc10aa0934d
Reviewed-on: https://skia-review.googlesource.com/111080
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-02-28 17:42:11 +00:00
Robert Phillips
5c56af1790 Revert "Fission GrAtlasGlyphCache in two"
This reverts commit acf17904d6.

Reason for revert: Chrome

Original change's description:
> Fission GrAtlasGlyphCache in two
> 
> This CL splits the old GrAtlasGlyphCache into a GrAtlasGlyphCache and an GrAtlasManager.
> 
> The GrAtlasManager itself is split into a rather limited base class (GrRestrictedAtlasManager)
> and the all powerful GrAtlasManager. The GrRestrictedAtlasManager is available at op creation
> time and provides access to the proxies backing the atlases. The full GrAtlasManager is
> only available at flush time and allows instantiation of the proxies and uploading to them.
> 
> In the DDL world all of the DDL Contexts will receive a GrRestrictedAtlasManager-version of the
> GrAtlasManager in the main thread. This future atlas manager will have had all of its
> GrDrawOpAtlases created (but not instantiated) so there should be no race conditions.
> 
> Change-Id: I9967d3a4116af50128f390c5039a712b8cd4db08
> Reviewed-on: https://skia-review.googlesource.com/108001
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

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

Change-Id: I7c760ea1a9f041a310b96d552aa1497ee5902cd8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/111040
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-28 16:37:47 +00:00
Brian Salomon
3d86a19f42 Refactor GrCaps::renderTargetWritePixelsSupported to support for some GL workarounds
Make indirect path in writeSurfacePixels2 use a copy rather than a draw.

Fix issue in GrVkGpu where render target dirty region is not updated after copy-as-draw

Remove unnecessary resolve of MSAA RT in GrVkCopyManager.

Splits WritePixelsNonTexture_Gpu test into MSAA and non-MSAA variants. MSAA variant blacklisted
on Adreno because of:

Bug: skia:7663

~~~~~~AND~~~~~~~

Revert "Suppress CopySurface test on Nexus 7"

This reverts commit b42b6169d5.

Bug: skia:7658
Change-Id: I8337d718efb41e266537744bbf5ff8b1545322a7
Reviewed-on: https://skia-review.googlesource.com/110700
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-28 03:14:25 +00:00
Robert Phillips
acf17904d6 Fission GrAtlasGlyphCache in two
This CL splits the old GrAtlasGlyphCache into a GrAtlasGlyphCache and an GrAtlasManager.

The GrAtlasManager itself is split into a rather limited base class (GrRestrictedAtlasManager)
and the all powerful GrAtlasManager. The GrRestrictedAtlasManager is available at op creation
time and provides access to the proxies backing the atlases. The full GrAtlasManager is
only available at flush time and allows instantiation of the proxies and uploading to them.

In the DDL world all of the DDL Contexts will receive a GrRestrictedAtlasManager-version of the
GrAtlasManager in the main thread. This future atlas manager will have had all of its
GrDrawOpAtlases created (but not instantiated) so there should be no race conditions.

Change-Id: I9967d3a4116af50128f390c5039a712b8cd4db08
Reviewed-on: https://skia-review.googlesource.com/108001
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-02-27 22:05:55 +00:00
Mike Reed
bb586b2eeb fix crasher in path-->region
Bug: skia:7491
Change-Id: I7e8b9fbe43098094d5935331107c3f40fb6971ec
Reviewed-on: https://skia-review.googlesource.com/110721
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
2018-02-27 21:03:49 +00:00
Greg Daniel
f44cb48752 Fix unit tests that were causes vulkan unitialized memory warnings in validation
Bug: skia:
Change-Id: Id9df92b76c9f948f41f4108bcecdb2687233f841
Reviewed-on: https://skia-review.googlesource.com/110761
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-02-27 20:38:29 +00:00
Brian Salomon
5f33a8ccac Start on new GPU pixel ops implementation.
The new ops attempt to be less optimal by falling back to CPU conversions
rather than relying on intermediate draws and complex coordination between
GrContext and GrGpu to determine how conversions are performed.

This adds the new writePixels implementation.

Change-Id: I7496d86d5a40277ed2ca63668881c160e54d80d3
Reviewed-on: https://skia-review.googlesource.com/109880
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-26 20:43:18 +00:00
Mike Klein
0bf89269eb align f16 buffers in SkRasterPipeline_tail test
The load_f16 and store_f16 stages are assuming they can load
each pixel at a time with 8 byte alignment, but as declared
the buffers are only guaranteed 2 byte alignment.

Bug: skia:7497

Change-Id: I47b29f13b48f90d2b15540979c3d87ba25dcc506
Reviewed-on: https://skia-review.googlesource.com/110321
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-02-26 19:51:48 +00:00