Commit Graph

4529 Commits

Author SHA1 Message Date
Cary Clark
60aaeb2b55 create imagepriv and name params
Named all parameters and made the names consistent
for documentation.

Moved SK_IMAGEFILTER_UNFLATTEN_COMMON to private file.

TBR=reed@google.com
Bug: skia:6898
Change-Id: I1343d2b16d4217088fa3bc9c40f1f4177fa32740
Reviewed-on: https://skia-review.googlesource.com/66521
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-11-03 13:56:30 +00:00
Mike Reed
88ea5b9c66 add client-context to SkWriteBuffer
Bug: skia:
Change-Id: I56c36060442c4008b09f322fb1d19e81cd75f910
Reviewed-on: https://skia-review.googlesource.com/66860
Reviewed-by: Khusal Sagar <khushalsagar@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-11-02 16:39:51 +00:00
Brian Osman
61b43daa85 Plumb internal helper to enable more GPU GMs w/SkColorSpaceXformCanvas
API change isn't really public.

TBR:bsalomon@google.com
Bug: skia:
Change-Id: I3a1ae5d7ddb562387e8b8e1248b347704f88037b
Reviewed-on: https://skia-review.googlesource.com/66144
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-01 15:16:30 +00:00
Robert Phillips
a097173bb1 Add a GM to test out odd matrix draws (take 2)
TBR=bsalomon@google.com
Bug: skia:7075
Change-Id: I87efa058916fe0305b57eb4dd14b479e8a8d2c6d
Reviewed-on: https://skia-review.googlesource.com/65507
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-10-31 16:58:05 +00:00
Robert Phillips
9d15b07dc4 Revert "Add a GM to test out odd matrix draws"
This reverts commit 761f44853f.

Reason for revert: preabandonContext failures

Original change's description:
> Add a GM to test out odd matrix draws
> 
> Bug: skia:7075
> Change-Id: I90c15bf019161abc5dab78e0af20ef15ff1395d9
> Reviewed-on: https://skia-review.googlesource.com/64761
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I9ecb2e2dcd74685e2c707c04bb52279e1d5cc55c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7075
Reviewed-on: https://skia-review.googlesource.com/65740
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-10-31 16:13:55 +00:00
Brian Osman
f06ead925c Add support for transfer functions to GrColorSpaceXform
With this change, untagged sources (eg N32) are treated as
sRGB data, which causes a huge number of GMs to render more
correctly in GPU sRGB/F16/etc... configs. Also, because the
sources are treated as having a color space, we actually do
gamut conversion for wide or narrow gamut outputs.

This change also applies the transfer function math to
individual colors in the case of gradient stops and color
shaders. (The CPU backend doesn't do this yet, but I think
we've decided there's no reason not to support it).

Bug: skia:
Change-Id: If76e9e4a268f9f74110ff4bbe4fe189ba5d19d9f
Reviewed-on: https://skia-review.googlesource.com/64100
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-10-31 14:55:14 +00:00
Robert Phillips
761f44853f Add a GM to test out odd matrix draws
Bug: skia:7075
Change-Id: I90c15bf019161abc5dab78e0af20ef15ff1395d9
Reviewed-on: https://skia-review.googlesource.com/64761
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-10-31 14:51:14 +00:00
Cary Clark
cc309eb9b1 generated include refresh
The latest, minor changes on includes already
generated, plus four new ones.

TBR=reed@google.com
Bug: skia:6898
Change-Id: If06ae9b9aaa3a0a9fae570aa7a6698ff340c43b8
Reviewed-on: https://skia-review.googlesource.com/62862
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-10-30 16:30:49 +00:00
Mike Reed
6566b97b76 add Type enum to SkColorSpace
Bug: 727128
Change-Id: I116de4efd6e64504a4e1892f431f528533b1173a
Reviewed-on: https://skia-review.googlesource.com/64261
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-10-27 14:59:02 +00:00
Brian Salomon
4cbb6e6d55 Pass GrRenderTargetContext's GrColorSpaceInfo to SkShader and SkColorFilter.
Also to SkColorTo(Premul|Unpremul)GrColor4f.

This can avoid cache lookups to find GrColorSpaceXforms as the xform pointer is stored in GrColorSpaceInfo after the first lookup.

Also uses GrColorSpaceInfo to construct GrTextUtils::Paint.

Bug: skia:
Change-Id: Idf19d512a60d2269e6921c7fb54d93aee499a70d
Reviewed-on: https://skia-review.googlesource.com/63660
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-10-25 19:32:20 +00:00
Greg Daniel
e252f08982 Add hint to SkSurface::MakeRenderTarget that we will use mips
Additionally this changed triggered a cascade of plumbing GrMipMapped
down throughout Ganesh.

Bug: skia:
Change-Id: I4181f44d9046d66139bb491c7abf86703305aaeb
Reviewed-on: https://skia-review.googlesource.com/63000
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-23 20:25:59 +00:00
Cary Clark
6d6d603c81 make matrix serialization private
Moves readFromMemory, writeToMemory to private section.
No sign that these are called from google3, android,
chromium, but function names are common enough that
it's hard to know for sure.

These are used inside templates internally and for
testing, so it is not quite as simple as adding alternate
entry points in SkMatrixPriv.

R=reed@google.com
Bug: skia:6898
Change-Id: I1fac142f4bf0f38608ea93438c46f39147606c4d
Reviewed-on: https://skia-review.googlesource.com/62361
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-10-20 16:49:57 +00:00
Cary Clark
9480d822f2 make skmatrix getmapproc private
Make SkMatrix MapXYProc MapPtsProc and friends private.
Code search turned up no clients in chromium, google3,
android. Fingers crossed.

R:reed@google.com
Bug: skia:6898
Change-Id: Iee20fe5150499215a09f67cc6f117b685f38f455
Reviewed-on: https://skia-review.googlesource.com/62140
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-10-20 15:14:05 +00:00
Florin Malita
5f379a8b11 Avoid 2PtConical gradient flipping
Currently, when startRadius > endRadius conical gradients are inverting their data
(start/end points and radii, colors and positions) to guarantee r0 < r1 at raster time.

But the radii ordering is only mildly interesting to the impl: it controls which of the
two quadratic solutions we select for the inside case, but doesn't fundamentally change
the algorithm.

Furthermore, for the "outside" case, inverting the order is already inconvenient and
needs to be taken into account (both CPU/GPU impls are already tracking this bit of
info).

Instead of transforming the gradient definition, we can detect the inverted case and
adjust the quadratic solution selector.

In practice this means:

  * |edge|    case - no change, the equation is linear
  * |inside|  case - select the smaller root instead of largest
  * |outside| case - [gpu-only] invert the clamp/limiting function

Change-Id: Ie3106464e39a4dd3848dc43671d973f7e1958e63
Reviewed-on: https://skia-review.googlesource.com/61660
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-10-19 19:18:54 +00:00
Cary Clark
e4442cb0b5 convert mapHomogeneousPoints to SkPoint3
SkMatrix::mapHomogeneousPoints takes an array of SkScalar,
but expects essentially SkPoint3, so make it so.


R: robertphillips@google.com, reed@google.com
Bug: skia:6898
Change-Id: Ibaf8b05c08b7df16c67d6a77d914667ace9a70da
Reviewed-on: https://skia-review.googlesource.com/58380
Commit-Queue: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-10-18 16:09:46 +00:00
Brian Salomon
57caa660c0 Revert "Revert "Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans.""
This reverts commit 62563deb6b.

Reason for revert: change that affected similar set of GMs reverted, relanding now that this is more easily triagable.

Original change's description:
> Revert "Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans."
> 
> This reverts commit fa2d604a7d.
> 
> Reason for revert: <INSERT REASONING HERE>
> 
> Original change's description:
> > Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans.
> > 
> > Right now when we turn rects into quads we use a vertex order compatible with a tri fan rather than a tri strip.
> > 
> > I wanted it to be the case that the same code could be used to generate a non-indexed mesh for a single rect or indexed using the quad index buffer when batching. Triangle fanning is not available in all APIS (e.g. is emulated in ANGLE and not supported in Metal) so it seems better to use a triangle strip over a fan in the single rect case.
> > 
> > 
> > Change-Id: I31eebd794e7328f4b39e3ec3377bf2ec556360ca
> > Reviewed-on: https://skia-review.googlesource.com/60081
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: I7c4c23aa418da09c9708b28cce64ab58e282dd3a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/60683
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Iefcd16676a7617d32e89fc84206cd4e88e9a06e1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/61160
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-10-18 12:21:17 +00:00
Ben Wagner
d71c6d1994 Make SkTFitsIn and SkTo constexpr.
Because what can be better than marking things that can be constexpr as
constexpr. Also, I have a change where this would be nice to have.

Change-Id: Ie313b19d1930b98ddcd60cc17a320971625f18e3
Reviewed-on: https://skia-review.googlesource.com/60862
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-10-17 22:48:51 +00:00
Brian Salomon
62563deb6b Revert "Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans."
This reverts commit fa2d604a7d.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans.
> 
> Right now when we turn rects into quads we use a vertex order compatible with a tri fan rather than a tri strip.
> 
> I wanted it to be the case that the same code could be used to generate a non-indexed mesh for a single rect or indexed using the quad index buffer when batching. Triangle fanning is not available in all APIS (e.g. is emulated in ANGLE and not supported in Metal) so it seems better to use a triangle strip over a fan in the single rect case.
> 
> 
> Change-Id: I31eebd794e7328f4b39e3ec3377bf2ec556360ca
> Reviewed-on: https://skia-review.googlesource.com/60081
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I7c4c23aa418da09c9708b28cce64ab58e282dd3a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/60683
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-10-17 19:14:15 +00:00
Brian Salomon
fa2d604a7d Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans.
Right now when we turn rects into quads we use a vertex order compatible with a tri fan rather than a tri strip.

I wanted it to be the case that the same code could be used to generate a non-indexed mesh for a single rect or indexed using the quad index buffer when batching. Triangle fanning is not available in all APIS (e.g. is emulated in ANGLE and not supported in Metal) so it seems better to use a triangle strip over a fan in the single rect case.


Change-Id: I31eebd794e7328f4b39e3ec3377bf2ec556360ca
Reviewed-on: https://skia-review.googlesource.com/60081
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-10-17 17:30:12 +00:00
Derek Sollenberger
1bd76c468c Cleanup references to AHardwareBuffer to match NDK declarations.
Change-Id: Iaf796be04a5ac04873d420960238ea06294518f7
Reviewed-on: https://skia-review.googlesource.com/60240
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2017-10-16 17:17:11 +00:00
Cary Clark
71ff4b94e5 remove unused SkMatrix setIDiv
Unused setIDiv, untested internally.
Unused by google3, android, chromium.

R: reed@google.com
Bug: skia: 6898
Change-Id: I57101b147272ed198746afc298cc0f5a6434abe0
Reviewed-on: https://skia-review.googlesource.com/59960
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-10-16 14:30:44 +00:00
Ben Wagner
d40b3b0af1 Make SkTypeface::Style and FromOldStyle private.
These are no longer used outside of Skia, so make them private.

Change-Id: I735bb39c10553885cc6051aebddeff150ba4caa9
Reviewed-on: https://skia-review.googlesource.com/59180
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-10-13 15:49:18 +00:00
Mike Reed
3bd0fece5f remove dead code for getSize, getSafeSize, etc.
Bug: skia:
Change-Id: I7dcdfaa539040b95e5b62174ccd22a94212980e0
Reviewed-on: https://skia-review.googlesource.com/59442
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-13 14:03:07 +00:00
Mike Reed
f0cb7a09ab Revert "move SkMatrix anonymous affine enum to private"
This reverts commit 708ec81d7a.

Reason for revert: broke android

frameworks/base/core/jni/android/graphics/pdf/PdfEditor.cpp
frameworks/base/core/jni/android/graphics/pdf/PdfEditor.cpp:153:54: error: no member named 'kAScaleX' in 'SkMatrix'; did you mean 'kMScaleX'?
    FS_MATRIX transform = {transformValues[SkMatrix::kAScaleX], transformValues[SkMatrix::kASkewY],
                                           ~~~~~~~~~~^~~~~~~~


Original change's description:
> move SkMatrix anonymous affine enum to private
> 
> enum members aren't used by SkMatrix.h or by
> clients outside of Skia.
> 
> R: reed@google.com, bungeman@google.com
> Bug: skia:6898
> Change-Id: I6873b4106e5ffe354caf5ec18cc613910304fa13
> Reviewed-on: https://skia-review.googlesource.com/59160
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Cary Clark <caryclark@skia.org>

TBR=bungeman@google.com,reed@google.com,caryclark@skia.org

Change-Id: I7fe80879e8b851c9036fc910a314129c299d82d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6898
Reviewed-on: https://skia-review.googlesource.com/59460
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-13 13:26:08 +00:00
Eric Karl
914a36b248 MakeBackendTextureFromSkImage
Creates a static function on SkImage which converts the SkImage to a
GrBackendTexture. The texture is unowned by Skia, and must be deleted
by the caller. Allows for a no-copy / no-conversion fast path if the
provided image is unowned (unique()) and texture backed.

Change-Id: I8a48f9cc39de792725cd72057d98cd1c4594daab
Reviewed-on: https://skia-review.googlesource.com/52440
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Eric Karl <ericrk@chromium.org>
2017-10-12 20:05:31 +00:00
Cary Clark
708ec81d7a move SkMatrix anonymous affine enum to private
enum members aren't used by SkMatrix.h or by
clients outside of Skia.

R: reed@google.com, bungeman@google.com
Bug: skia:6898
Change-Id: I6873b4106e5ffe354caf5ec18cc613910304fa13
Reviewed-on: https://skia-review.googlesource.com/59160
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-10-12 19:56:31 +00:00
Mike Reed
9b64f97776 remove dead flag
no client still defines this

Bug: skia:
Change-Id: If55dade4207108241bbb1e3d6f7515ad12d36acc
Reviewed-on: https://skia-review.googlesource.com/59083
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-12 19:23:16 +00:00
Mike Klein
20d479c088 abort SkRRect::transform() before dst->scaleRadii() asserts
If we've got a crazy matrix, we can make dst arbitrarily crazy.

This should fix several of Kevin's fuzzes, e.g.
Bug: skia:7090

I don't see any uses of SkRRect::transform() that care about
the output rrect in case of failure, so I've just removed the
guarantee that we don't modify it when failing.

Change-Id: I4c81af59a093a984f0a02a0d3dc4bbbb1fb935f2
Reviewed-on: https://skia-review.googlesource.com/58620
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-10-12 15:29:11 +00:00
Heather Miller
298143ebdf Update Skia milestone to 64
Bug: skia:
Change-Id: I381323606f92a5388b3fd76c232e35c492a23dc4
Reviewed-on: https://skia-review.googlesource.com/58840
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
2017-10-12 14:57:31 +00:00
Greg Daniel
f88c12ea20 Add api for passing mipped hint into ImageGenerator onGenerateTexture
This does not actually add any additional functionality to the generators.
Once this lands I will enable the generators one at a time to more easily
monitor the effects of each one.

Bug: skia:
Change-Id: I382a1acfaebcbf9ad44c9873b87cdbbe02a13602
Reviewed-on: https://skia-review.googlesource.com/57083
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-11 17:11:07 +00:00
Mike Reed
3758c755d4 remove dead code for returning 0 on overflow
Bug: skia:
Change-Id: I6e7aae1b09cf3a1c9728bdaaa4dbf4df4b2ec16d
Reviewed-on: https://skia-review.googlesource.com/58341
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-11 15:54:37 +00:00
Ben Wagner
1c35e571c3 Revert "Revert "Fix a couple float-cast-overflow in SkScan*.""
This reverts commit b6abb9b4e0.

Reason for revert: It doesn't make sense that this CL would affect the tests implicated in the perf regression in skia:7143, and the revert had no effect on the perf of those tests. Seems like the perf alert was either noise or due to a different CL.

Original change's description:
> Revert "Fix a couple float-cast-overflow in SkScan*."
> 
> This reverts commit 3cd0bef0fd.
> 
> Reason for revert: https://bugs.chromium.org/p/skia/issues/detail?id=7143
> 
> Original change's description:
> > Fix a couple float-cast-overflow in SkScan*.
> > 
> > Bug: skia:5060
> > Change-Id: I60a48993c77631aaad9354bb86b13204dc618bf4
> > Reviewed-on: https://skia-review.googlesource.com/47422
> > Commit-Queue: Ben Wagner <benjaminwagner@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> 
> TBR=benjaminwagner@google.com,reed@google.com
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: skia:7143
> Change-Id: I0f19720a7d8344789a375bbb6b9e28bf4f4e55ae
> Reviewed-on: https://skia-review.googlesource.com/57240
> Commit-Queue: Ben Wagner <benjaminwagner@google.com>
> Reviewed-by: Ben Wagner <benjaminwagner@google.com>

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

Change-Id: I29ac47d6665e2e52ee2a6500488dc407c8d2af1c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7143
Reviewed-on: https://skia-review.googlesource.com/57440
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2017-10-09 22:59:06 +00:00
Ben Wagner
63fd760a37 Remove trailing whitespace.
Also adds a presubmit to prevent adding trailing whitespace to source
code in the future.

Change-Id: I41a4df81487f6f00aa19b188f0cac6a3377efde6
Reviewed-on: https://skia-review.googlesource.com/57380
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-10-09 21:20:34 +00:00
Ben Wagner
b6abb9b4e0 Revert "Fix a couple float-cast-overflow in SkScan*."
This reverts commit 3cd0bef0fd.

Reason for revert: https://bugs.chromium.org/p/skia/issues/detail?id=7143

Original change's description:
> Fix a couple float-cast-overflow in SkScan*.
> 
> Bug: skia:5060
> Change-Id: I60a48993c77631aaad9354bb86b13204dc618bf4
> Reviewed-on: https://skia-review.googlesource.com/47422
> Commit-Queue: Ben Wagner <benjaminwagner@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

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

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

Bug: skia:7143
Change-Id: I0f19720a7d8344789a375bbb6b9e28bf4f4e55ae
Reviewed-on: https://skia-review.googlesource.com/57240
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
2017-10-09 16:48:04 +00:00
Mike Reed
7281801849 Revert "Revert "change computeByteSize to return max_size_t on overflow""
This reverts commit 384f0a7d66.

Bug: skia:
Change-Id: I392ef5c1a5172181caf81ae270befeba6e778241
Reviewed-on: https://skia-review.googlesource.com/57084
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2017-10-09 16:05:34 +00:00
Mike Reed
c5eb97dd88 add helper to check for overflow
pre-CL to aid in changing the convention for when we overflow

Bug: skia:
Change-Id: I1e34a18fefb80187787a1c0c8ed7ee3516744d24
Reviewed-on: https://skia-review.googlesource.com/57103
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-09 15:04:34 +00:00
Ben Wagner
67ef5d7640 Remove SkTypeface::Style use in API.
All known callers of SkTypeface::MakeDefault call it with kNormal and
the only users specifying kNormal explicitly are in Skia, so remove the
parameter. There appear to be no users of SkTypeface::MakeFromTypeface,
so remove it. The current alternative is SkFontMgr::matchFaceStyle which
can do a better job anyway.

Change-Id: I89d94c77f9593407b0a319786848a8b823fcbae4
Reviewed-on: https://skia-review.googlesource.com/56762
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-10-09 03:13:33 +00:00
Ben Wagner
3cd0bef0fd Fix a couple float-cast-overflow in SkScan*.
Bug: skia:5060
Change-Id: I60a48993c77631aaad9354bb86b13204dc618bf4
Reviewed-on: https://skia-review.googlesource.com/47422
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-10-07 18:26:51 +00:00
Mike Reed
384f0a7d66 Revert "change computeByteSize to return max_size_t on overflow"
This reverts commit 2429546272.

Reason for revert: broke running dm on google3

Original change's description:
> change computeByteSize to return max_size_t on overflow
> 
> Bug: skia:7132
> Change-Id: I41045640ee62b2c988a84370ead5034bbccc6daf
> Reviewed-on: https://skia-review.googlesource.com/56620
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=bungeman@google.com,herb@google.com,reed@google.com

Change-Id: I5f58ec37241d2fae3ebdb7a3d6b41f9fd6d3c2ee
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7132
Reviewed-on: https://skia-review.googlesource.com/56880
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-06 21:24:10 +00:00
Mike Reed
2429546272 change computeByteSize to return max_size_t on overflow
Bug: skia:7132
Change-Id: I41045640ee62b2c988a84370ead5034bbccc6daf
Reviewed-on: https://skia-review.googlesource.com/56620
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-06 19:36:17 +00:00
Ben Wagner
eccda1ceca Clean up SkString reference counting a bit.
This reverts commit 01f8e41c13, and then
works around whatever issues were seen on Ubuntu 14 by continuing the
clean up.

Change-Id: I3523b12c83e4efef01a8142c00cde4e3e12189fa
Reviewed-on: https://skia-review.googlesource.com/55761
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-10-05 18:15:44 +00:00
Cary Clark
583dd2bbc0 add constexpr to SkRect, SkIRect Make functions
Also, doing so exposed a couple of unused
variables in tests.

R: bsalomon@google.com
Bug: skia: 6898
Change-Id: I7b065e26a838fe55a1d772bcefaef5325e1baa61
Reviewed-on: https://skia-review.googlesource.com/55680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-10-05 16:55:34 +00:00
Robert Phillips
01f8e41c13 Revert "Clean up SkString reference counting a bit."
This reverts commit a910c847e9.

Reason for revert: Compilation failure on Ubuntu14 bots

../../../../../work/skia/src/core/SkString.cpp:200:55: error: could not convert ‘{0, {0}, 0}’ from ‘<brace-enclosed initializer list>’ to ‘const SkString::Rec’
 const SkString::Rec SkString::gEmptyRec = { 0, {0}, 0 };

Original change's description:
> Clean up SkString reference counting a bit.
> 
> BUG=skia:7107
> 
> Change-Id: I47072bf31b902c79dbb850179ff6d35940de3e63
> Reviewed-on: https://skia-review.googlesource.com/54720
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

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

Change-Id: I6ec327511e8e1c1fd7e4c1bd5839c0547d4ab609
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7107
Reviewed-on: https://skia-review.googlesource.com/55640
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-10-05 11:28:35 +00:00
Ben Wagner
a910c847e9 Clean up SkString reference counting a bit.
BUG=skia:7107

Change-Id: I47072bf31b902c79dbb850179ff6d35940de3e63
Reviewed-on: https://skia-review.googlesource.com/54720
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-10-04 21:38:33 +00:00
Cary Clark
490847e209 add missing params
SkBitmap is missing a couple of parameter names.
Parameter names make doxygen easier.

Also qualify hasHardwareMipMap and
setHasHardwareMipMap to Android framework.

R=djsollen@google.com
Bug: skia:6898
Change-Id: I502da35dc5761d73195b6a21dd4310cb001a6924
Reviewed-on: https://skia-review.googlesource.com/55161
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2017-10-04 15:33:23 +00:00
Mike Reed
f0ffb8943b Revert[4] "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"
This reverts commit 5a2e50edc5.

Bug: skia:
Change-Id: I8d28b5c07d90130e5a1653923740eaf189ecb954
Reviewed-on: https://skia-review.googlesource.com/53900
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-03 20:03:35 +00:00
Ben Wagner
af89366cb8 Make SkString reference counting thread/TSAN safe.
BUG=skia:7107

Change-Id: I8ead98f7694faaed8e6f6f29b1fcd88501d36b66
Reviewed-on: https://skia-review.googlesource.com/54400
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-10-03 18:34:35 +00:00
Mike Reed
5a2e50edc5 Revert "Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"""
This reverts commit cd284c5323.

Reason for revert:

assert fired in SkMallocPixelRef.cpp:61: fatal error: "assert(info.computeByteSize(rowBytes) == info.getSafeSize(rowBytes))"

google3 thinks it was from surface_rowbytes

Original change's description:
> Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap""
> 
> This reverts commit 809cbedd4b.
> 
> Bug: skia:
> Change-Id: I680d8daeeeeb15526b44c1305d8fb0c6bfa38e1d
> Reviewed-on: https://skia-review.googlesource.com/52665
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I41e3f7a3f791cc8183291847e783ed8a53bc91d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/53802
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-02 13:44:18 +00:00
Mike Reed
cd284c5323 Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap""
This reverts commit 809cbedd4b.

Bug: skia:
Change-Id: I680d8daeeeeb15526b44c1305d8fb0c6bfa38e1d
Reviewed-on: https://skia-review.googlesource.com/52665
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-10-02 12:55:37 +00:00
Mike Reed
e74dafc74d Just add new safe size apis
Update skia (and then hide the older versions) to come later
Inspired by https://skia-review.googlesource.com/c/skia/+/52665

Bug: skia:
Change-Id: I15c7395557fb49c4163cb3b323b5428abd2c752d
Reviewed-on: https://skia-review.googlesource.com/53520
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-29 18:20:14 +00:00