Commit Graph

9247 Commits

Author SHA1 Message Date
Ben Wagner
4212a7d948 SkTypeface::onOpenStream to return unique_ptr.
This moves the smart pointer use up one more level in preparation for
changing SkTypeface::openStream to return unique_ptr as well.

Change-Id: Ib8173d59e03de38b06f6e1b4e6776f1961055ae7
Reviewed-on: https://skia-review.googlesource.com/c/195121
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-25 22:30:04 +00:00
Leon Scroggins III
194580dc60 Reland "Treat kWEBP encode with quality=100 as lossless"
This reverts commit 22170b3178.

It was reverted due to the test breaking Google3. This includes a
workaround.

    Original change's description:
    > Treat kWEBP encode with quality=100 as lossless
    >
    > In SkEncodeImage and friends, treat quality of 100 as a lossless encode
    > when using kWEBP. This seems a good fit for the intent - which is
    > presumably to save the highest quality image. This also matches
    > Chromium's blink::ImageEncoder::ComputeWebpOptions, which treats a
    > quality of 1 (on a float scale from 0 to 1) as a lossless encode.
    >
    > FWIW, Chromium has had this behavior since
    > https://codereview.chromium.org/1937433002, in response to
    > crbug.com/523098. The goal is to "maintain sharpness to
    > match the JPEG encoder behavior (use WEBP lossless encoding)".
    >
    > Add a test to verify the new behavior. This requires making tests
    > depend on libwebp to use WebPGetFeatures, since the Skia API does not
    > provide a way to determine whether an encoded webp file was encoded
    > lossless-ly or lossily.
    >
    > Bug: skia:8586
    > Change-Id: Ie9e09c2f7414ab701d696c4ad9edf405868a716f
    > Reviewed-on: https://skia-review.googlesource.com/c/175823
    > Commit-Queue: Leon Scroggins <scroggo@google.com>
    > Reviewed-by: Derek Sollenberger <djsollen@google.com>
    > Reviewed-by: Mike Reed <reed@google.com>

TBR=reed@google.com, based on prior approval

Bug: skia:8586
Change-Id: I09c73f71996422f797fd9456fef5dfad9af36839
Reviewed-on: https://skia-review.googlesource.com/c/194194
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
2019-02-25 18:42:22 +00:00
Leon Scroggins III
8546335d2d Allow setting an SkColorSpace on SkAnimatedImage
Add a new constructor which merges the SkISize scaledSize with the
SkImageInfo. This allows passing an SkColorSpace to the decode.

Update the test to call the new API.

Bug: b/123301872
Change-Id: I9fd89198e97ac9b8e6dc9fcfe89ed38913a0fe69
Reviewed-on: https://skia-review.googlesource.com/c/189303
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-02-22 18:58:05 +00:00
Robert Phillips
6989370877 Move DrawingManager to RecordingContext
This CL does make use of a new GrRecordingContextPriv backdoor to break CL deadlocks. This occurs when this CL tries to create GrContext-dependent objects outside its scope.

Change-Id: I278fe9d321f8e0a4f5e9b489b1a5cc01b8974521
Reviewed-on: https://skia-review.googlesource.com/c/191287
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-22 17:25:00 +00:00
Brian Salomon
8cabb327e7 Make it safe to enter the cache from a GrTexture idle proc.
This fixes an issue in Chrome where Skia is calling a promise SkImage
texture release proc from ~SkImage that in turn flushes a SkSurface.
Prior to this change this caused an assert because we had already
decremented the GrTexture's ref count priot to calling the release
proc. This made the GrTexture purgeable, but the cache had not yet
been notified that the texture was purgeable and still had it in its
array of non-purgeable resources. This triggered an assert in the
cache's self-validation checks during the flush.

Now we call the release proc just prior to decrementing the ref count.
This also makes it legal to re-ref the resources from the release proc.

Bug: chromium:933526
Change-Id: I8cd921b77ca3dfe112089f9a553c1a625160d16d
Reviewed-on: https://skia-review.googlesource.com/c/194000
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-02-22 16:12:35 +00:00
Mike Reed
aa76bc1388 update docs for backdrop
Bug: skia:
Change-Id: Ic3f7ad4b730d6aa616ec75dd6179d96327716b59
Reviewed-on: https://skia-review.googlesource.com/c/194003
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-22 16:07:25 +00:00
Robert Phillips
2184fb7bbd Move StrikeCache and TextBlobCache to RecordingContext
TBR=bsalomon@google.com
Change-Id: I09a918eee4fab2091b0cbbbe83bc66418e43045e
Reviewed-on: https://skia-review.googlesource.com/c/193471
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-21 23:01:32 +00:00
Brian Salomon
9a049e6ce3 SK_API SkExecutor
Change-Id: I8260d4c95d72f28b619145062f066fcd4e15589d
Reviewed-on: https://skia-review.googlesource.com/c/193960
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-21 16:59:41 +00:00
Nico Weber
ed632b14ad Remove another semicolon.
Bug: chromium:926235
Change-Id: Id0ead383e1bc11b9baeae61fa5fe94ad75d4e856
Reviewed-on: https://skia-review.googlesource.com/c/193691
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: Nico Weber <thakis@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-21 15:19:11 +00:00
Robert Phillips
bc42944741 Switch image filters over to GrRecordingContext
This CL does make use of a new GrRecordingContextPriv backdoor to break CL deadlocks. This occurs when this CL tries to create GrContext-dependent objects outside its scope.

Note that special images and surfaces are only created when drawing so they get GrRecordingContexts.

Change-Id: I1493c32604a2cbd8054c916334fa1186f3bfd918
Reviewed-on: https://skia-review.googlesource.com/c/192822
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-20 14:05:48 +00:00
Robert Phillips
9338c60013 Switch FP creation over to GrRecordingContext
This CL does make use of a new GrRecordingContextPriv backdoor to break CL deadlocks. This occurs when this CL tries to create GrContext-dependent objects outside its scope.

Change-Id: I925030c818f00559d4c953ae07af53667b44aab9
Reviewed-on: https://skia-review.googlesource.com/c/192032
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-19 18:24:27 +00:00
Michael Ludwig
136f45a636 Formalize edge-aa interaction with GrAA
With this formalization, the edge-AA APIs in GrRTC can distinguish
between tiling cases and regular drawing cases implemented using
kNone or kAll for the AA flags. This means fillRectToRect can be
implemented in terms of fillRectWithEdgeAA.

It also means the drawTexture cases will properly handle
isolated draws and tiled draws when drawing into MSAA.

Bug: skia:
Change-Id: I248dd001919228a958cf84b6bc91363b58b72c0b
Reviewed-on: https://skia-review.googlesource.com/c/192023
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-19 17:49:57 +00:00
Robert Phillips
1efecea71f Make asFragmentProcessor entry point only take a GrRecordingContext (take 2)
This is split out of: https://skia-review.googlesource.com/c/skia/+/192032 (Switch FP creation over to GrRecordingContext)

TBR=bsalomon@google.com

Change-Id: Iebe8dce00abf09485717f59daae1bfeb8ba6d5bc
Reviewed-on: https://skia-review.googlesource.com/c/193160
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-16 14:07:50 +00:00
Robert Phillips
a7f0013eca Revert "Make asFragmentProcessor entry point only take a GrRecordingContext"
This reverts commit e821d21e41.

Reason for revert: enh

Original change's description:
> Make asFragmentProcessor entry point only take a GrRecordingContext
> 
> This is split out of: https://skia-review.googlesource.com/c/skia/+/192032 (Switch FP creation over to GrRecordingContext)
> 
> TBR=bsalomon@google.com
> Change-Id: I48a5667b1ca31d5648571083fcda76564fae939b
> Reviewed-on: https://skia-review.googlesource.com/c/192687
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: I9041b3479ef5004f14eb5a97c0e25e60f8b8ba14
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/193039
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-15 21:54:20 +00:00
Mike Reed
9407e24c29 make float more primary API for paint (esp. for alpha)
Bug: skia:8773
Change-Id: I82b1f22f300eadc93f79a35a1638b7eb6376169a
Reviewed-on: https://skia-review.googlesource.com/c/193031
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-15 21:50:16 +00:00
Robert Phillips
e821d21e41 Make asFragmentProcessor entry point only take a GrRecordingContext
This is split out of: https://skia-review.googlesource.com/c/skia/+/192032 (Switch FP creation over to GrRecordingContext)

TBR=bsalomon@google.com
Change-Id: I48a5667b1ca31d5648571083fcda76564fae939b
Reviewed-on: https://skia-review.googlesource.com/c/192687
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-15 21:39:43 +00:00
Robert Phillips
d44146b2da Switch GrSurfaceProxy's Copy methods over to GrRecordingContext
Fragment broken out of: https://skia-review.googlesource.com/c/skia/+/192822 (Switch image filters over to GrRecordingContext)

Change-Id: Iddb9d10b686201820685d1650144b4444b14b6bf
Reviewed-on: https://skia-review.googlesource.com/c/193030
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-15 20:50:43 +00:00
Robert Phillips
c5058a61ae Add addOnFlushCallbackObject at GrRecordingContext level
The GrRecordingContext will (eventually) hold the drawManager so it is natural that it should accept onFlushCB objects

Change-Id: I48dc876bd18e5d5ebea75c33498e75faba1a0feb
Reviewed-on: https://skia-review.googlesource.com/c/193025
Auto-Submit: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-15 20:29:43 +00:00
Leon Scroggins III
34a2a76e20 Remove assert that BGRA and RGBA are not opaque
Bug: skia:7353
Bug: skia:8235

This should fix the Wuffs bot. A recent change set SkWuffsCodec's
SkEncodedInfo::Color to BGRA or RGBA even if they are opaque, which
resulted in this assert firing. As has been brought up previously,
SkEncodedInfo::Color is overspecified. The only code that cares
about the type is SkSwizzler, which will treat the alpha as
potentially non-opaque (whereas BGRX_Color (there is no RGBX_Color)
ignores the alpha channel, which is important for some BMPs).

TBR=reed@google.com

Change-Id: I3396b53aef114e09513579f829c5b5345acba4f0
Reviewed-on: https://skia-review.googlesource.com/c/193028
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-02-15 19:53:04 +00:00
Florin Malita
f2965060c3 add mixer colorfilter
BUG=skia:

Change-Id: Icbee96056b17c5396a9d3783055ddd0b7d4fd3ff
Reviewed-on: https://skia-review.googlesource.com/c/9514
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-02-15 19:22:33 +00:00
Robert Phillips
be9aff25bd Remove GrContextPriv.h from GrRenderTargetContext.h
Change-Id: Ib3afe6d8f2f9607eededb4dd4ef9dbe305741cfb
Reviewed-on: https://skia-review.googlesource.com/c/192829
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-15 17:29:03 +00:00
Brian Salomon
28bafb01c9 Add option to force GLSL string caching rather than program binaries.
Bug: chromium:924572
Change-Id: I055a6946528c75fa986c86fa562a2608b8958611
Reviewed-on: https://skia-review.googlesource.com/c/192827
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2019-02-15 15:32:09 +00:00
Brian Salomon
f5cdd9b7f8 Add SK_API to GrContextOptions and GrContextOptions::PersistentCache
Change-Id: I4ba5ae42fcb6c1d564be9bea2003c6c41627672f
Reviewed-on: https://skia-review.googlesource.com/c/192825
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-15 15:16:09 +00:00
Brian Salomon
c405c27b1a Remove unused fields related to old multitexturing TextureOp.
Change-Id: I6a48410f2203a0a88831d02713b9b7475fb6e5a6
Reviewed-on: https://skia-review.googlesource.com/c/192826
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-15 15:08:39 +00:00
Robert Phillips
292a6b2cf0 Allow GrRecordingContext to create surfaceContexts
This is pulled out of https://skia-review.googlesource.com/c/skia/+/191287 (Move DrawingManager to RecordingContext)

Change-Id: Iba16acd9295ef7ca9d8cc96d439a907050228b6b
Reviewed-on: https://skia-review.googlesource.com/c/192684
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-14 21:47:28 +00:00
Florin Malita
562017b086 [SVGCanvas] Clean up public factories
Remove the internal-only/XMLWriter-based factory.

Update SkSVGDevice to always own the xml writer.

The only internal client passing an interesting XMLWriter is
SVGDeviceTest - update to use the device factory directly.

While at it, update the SkSVGDevice factory to return smart pointers
(Create -> Make).

Change-Id: Ibda1ca86ef9fb81ab512822000835ace1af67978
Reviewed-on: https://skia-review.googlesource.com/c/192580
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-14 19:17:35 +00:00
Greg Daniel
f259b8ba17 Add kRGB_888X_GrPixelConfig
This is needed to support importing of RGBX AHB into skia's vulkan backend.
With this CL we only enable the new pixel config to be textureable.

Bug: skia:
Change-Id: Iba9180c14f3ef633ae846091cf453d68f82ce544
Reviewed-on: https://skia-review.googlesource.com/c/192035
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-14 15:01:55 +00:00
Mike Reed
729bb199dd Update examples to use SkFont
Bug: skia:
Change-Id: I104e1382a035f7b1e0d8f4bf37859e2544166788
Reviewed-on: https://skia-review.googlesource.com/c/192039
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-14 13:29:34 +00:00
KDr2
e77142e0d6 Fix bug of SkSVGCanvas::Make
The method `SkSVGCanvas::Make(const SkRect& bounds, SkWStream* writer)`
passes a pointer to a stack-allocated object to the returned SkCanvas.

TBR=
Change-Id: Ica7933adc59764a69eb2fb6312df91ffffd5627b
Reviewed-on: https://skia-review.googlesource.com/c/192040
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-02-14 02:09:30 +00:00
Mike Reed
186669c412 work to fix bookmaker
Bug: skia:
Change-Id: I2d2766e92b289d827984144b625b3da0fbfee58b
Reviewed-on: https://skia-review.googlesource.com/c/192033
Reviewed-by: Mike Reed <reed@google.com>
2019-02-13 20:07:33 +00:00
Mike Reed
62ad46b059 fix contour-measure for move-line-move
Use RawIter, so we can dependably peek() (since consumeDegenerates in
Iter() make peeking unreliable), which caused us to think there were two
real contours in the test case.

Bug: oss-fuzz:13013
Change-Id: I0d85f3e6a83cb972c4d801dd9b17f0e388b926d0
Reviewed-on: https://skia-review.googlesource.com/c/192025
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-02-13 17:14:09 +00:00
Robert Phillips
6f0e02f5d7 Switch path renderers over to using GrRecordingContext
The path renderers convert paths into Ganesh ops when recording so should also be able to make due with only the GrRecordingContext.

Change-Id: Ie796af73ca5aa2a074ebd037d6d558ec85ff5928
Reviewed-on: https://skia-review.googlesource.com/c/191568
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-13 16:58:29 +00:00
Robert Phillips
b97da530f0 Switch Ops over to using GrRecordingContext
Since, by definition, the ops are created when recording, it makes sense that they should be able to make due with only the GrRecordingContext.

TBR=bsalomon@google.com
Change-Id: If64353aee30b35d0a16401f7de00954f44ed8c59
Reviewed-on: https://skia-review.googlesource.com/c/190670
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-13 15:53:09 +00:00
Greg Daniel
60ea40c210 Remove private configs from GrPixelConfig.
GrPixelConfig is no longer public so there is no need for us to have the
special private configs.

Bug: skia:
Change-Id: Id732a3b2db3a7b9fd5d767e5548e796a4e670547
Reviewed-on: https://skia-review.googlesource.com/c/191572
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-12 19:08:01 +00:00
Hal Canary
59cf562826 SkPaint: clean up ctor, dtor, etc
Change-Id: I5a333112f68fcd001f39e646570a246875c03bc3
Reviewed-on: https://skia-review.googlesource.com/c/191566
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-02-12 18:55:30 +00:00
Mike Reed
233fc0b03c remove unused cruft
Bug: skia:
Change-Id: I41c66d87a82afaf0835b88ee8599e6da0d2a5f58
Reviewed-on: https://skia-review.googlesource.com/c/191424
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-12 03:53:25 +00:00
Brian Osman
7f3618a2c9 Use clang versions of SK_RESTRICT and SK_WARN_UNUSED_RESULT on Windows
Bug: skia:
Change-Id: I63bc32c7bba294d8698d17e1f178ca0eb0a84ddf
Reviewed-on: https://skia-review.googlesource.com/c/191295
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-11 20:38:33 +00:00
Robert Phillips
a9162dfb9c Plumb abandonment throughout GrContext hierarchy
When the GrImageContext & GrRecordingContext are actually GrDirectContexts it is useful for them to report the abandonment state of the GrDirectContext.

When the GrImageContext & GrRecordingContext are actually GrImageCreationContext or GrDDLContexts then they will just never be abandoned.

This CL also strips the GrProxyProvider and GrDrawingManager of their tracking on abandonment and centralizes it in the GrImageContext.

ImageContext
  can't abandon
  can only check abandonment privately

RecordingContext
  can't abandon
  can only check abandonment privately

DirectContext (aka GrContext)
  can abandon publicly
  can check abandonment publicly

Note that abandoning the DirectContext won't alter the abandonment status of any of
the other contexts in its group (e.g., DDL contexts that may be being used to record).

Change-Id: Ib790f74d90ab18da58a127fed2aad20e2477bd21
Reviewed-on: https://skia-review.googlesource.com/c/190669
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-11 20:26:22 +00:00
Michael Ludwig
b7d64b989e Implement drawImage in terms of drawImageRect
This will cause the raster backend to draw shadermask_image incorrectly since
drawImageRect implementation has the wrong semantics. bitmapshader's expected
behavior has changed: GPU will draw the new version correctly, but raster's
will not change from the old, incorrect behavior.

Bug: skia:8752
Change-Id: Iee89082e2fdf95c2ee42ca3b052e65556f327eff
Reviewed-on: https://skia-review.googlesource.com/c/190675
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-11 17:02:00 +00:00
Nico Weber
5257816bd3 Remove a few semicolons.
Bug: chromium:926235
Change-Id: I338323847c34dabdbd963efe631f7dc1351ed8cc
Reviewed-on: https://skia-review.googlesource.com/c/191143
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-11 14:40:37 +00:00
Mike Klein
cd9ef731fe Mask -> M
Just trying to get things mostly under 100 cols.

Change-Id: Ifc8f4f0b78a89dfc5ba6ca2e310e969f1880e194
Reviewed-on: https://skia-review.googlesource.com/c/191001
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-09 19:11:18 +00:00
Mike Reed
8d4594175c update dox for pathmeasure
Of note, the client need not keep the path around after creating/resetting the measure
object. The parts that are needed are copied, so the client is free to modify/delete
the path afterwards.

Bug: skia:
Change-Id: I9b9a0fd8e3cd6fd6c60de0017bcaee1fbc2fb893
Reviewed-on: https://skia-review.googlesource.com/c/190679
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-08 22:24:04 +00:00
Brian Salomon
1f05d459e2 Add GrContext::resetGLTextureBindings().
This function binds texture ID 0 to any texture unit/target combo that
Skia has modified.

Bug: chromium:926017
Change-Id: I3ac8f8050c863232886102886e60d3b91a5380c9
Reviewed-on: https://skia-review.googlesource.com/c/190663
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-08 21:26:51 +00:00
Robert Phillips
d6841487eb Move auditTrail and opMemoryPool from GrContext to GrRecordingContext
Any context that records ops (i.e., direct and/or DDL) will need these two objects.

Change-Id: Ifd3527c23a4015f7d469ad2222563508cccbd339
Reviewed-on: https://skia-review.googlesource.com/c/190307
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-08 16:07:56 +00:00
Mike Klein
9707e907ae move some methods out of line
This started because I noticed some repeated symbols while disassembling
object files.  I decided to fix up one or two to kill time while waiting
for Blink layout tests, but then I got a little quixotic.  In the end, I
ran:

    ninja -C out && git add -u && nm -U -j out/obj/gm/gm.*.o | sort | uniq -c | sort -g | c++filt | less

And then outlined things that stuck out as funny, either because they
were big, because they were virtual, because there were many copies of
them, or some combination of those factors.

I'm on the fence about moving a few of SkRefCnt's virtuals out of line,
so I've left SkRefCnt.h unchanged for now.

I'm not sure that this is important.

Change-Id: I425d05aa4beabbae40dd8df465155bfb909ef43a
Reviewed-on: https://skia-review.googlesource.com/c/190422
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-08 15:41:36 +00:00
Robert Phillips
a41c6858da Move proxyProvider and singleOwner to GrImageContext
This starts to beef up the capabilities of the GrImageContext in preparation for its future responsibilities (i.e., creating promise images w/o a recordingContext).

Note that the proxyProvider still has different behavior if it has a full context vs. a reduced context. I intend to just let this behavior remain as is.

Change-Id: Idb9d99a548ef928fc1b9dc1e5a34f74343bb0b4b
Reviewed-on: https://skia-review.googlesource.com/c/189490
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-08 15:20:06 +00:00
Mike Klein
dcfc3ef110 skvx wip
- remove ALWAYS_INLINE until we find we need it

 - make bit_puns explicit

 - implement everything recursively so, e.g.
   sqrt(float8) picks up sqrt(float4) when
   not otherwise specialized.

 - implement SSE specializations:
   of the operations I tested, only sqrt, rcp, and rsqrt
   needed any help.  The others look good as-is.

Change-Id: I1b679c7bd9a99f952272b118d7ade2469b55d604
Reviewed-on: https://skia-review.googlesource.com/c/190222
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-07 20:06:46 +00:00
Brian Salomon
8c8806f252 Default init GrGpuResource::UniqueID to invalid id.
Also remove unused invalid ID factory function.

Change-Id: Iacfb14a0a652ac6bf6a6c59d71144ed01463839e
Reviewed-on: https://skia-review.googlesource.com/c/190302
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-07 19:45:25 +00:00
Robert Phillips
fe0963c350 Move "matches" from GrContextThreadSafeProxy to GrContext_Base
This makes the "matches" functionality available to all the context flavors and uses it for SkImages

Change-Id: I1e3d55f19a7752a9da8789e93a848b7a7a64d180
Reviewed-on: https://skia-review.googlesource.com/c/190227
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-07 19:26:50 +00:00
Mike Reed
8619a34bb8 Revert "Hide setDrawLooper -- deprecate loopers"
This reverts commit c877ea2657.

Reason for revert: wow, this is going to be really hard to update callers

Original change's description:
> Hide setDrawLooper -- deprecate loopers
> 
> Guarded with SK_SUPPORT_LEGACY_DRAWLOOPER
> 
> Bug: skia:4783
> Change-Id: I4a47513624bc5c09816f44e107917dc8028adb94
> Reviewed-on: https://skia-review.googlesource.com/c/189871
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: Ia49f421c8a96a8091ab87533361fde4bf570d6e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:4783
Reviewed-on: https://skia-review.googlesource.com/c/190303
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-07 19:00:36 +00:00