Commit Graph

5306 Commits

Author SHA1 Message Date
Ethan Nicholas
c9472af858 SkSL FPs now support child processors, converted ArithmeticFP to SkSL
Bug: skia:
Change-Id: I34ed3480073d05762a7d4692aeee4b87e454ce52
Reviewed-on: https://skia-review.googlesource.com/57961
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-10-11 18:05:07 +00:00
nagarajan.n
0ec0bf045e Return error and exit from loop when there is error in compare bitmap test
This patch returns error and exit from loop when there is error in
comparing bitmap test.

Bug: skia:None
Change-Id: If7fe9d8cf6b936bf1fb84de69e73c453a6c253de
Reviewed-on: https://skia-review.googlesource.com/57600
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-10-11 16:51:57 +00:00
Mike Klein
b89c88311d keep SkRSXforms aligned in SkLiteDL
We've been copying the text first, then the transforms.
That's a good way to get the transforms out of alignment.

This CL swaps the order of the two.

Bug: skia:7133

Change-Id: If8cd402b9ffba1787345dc4b5ffd4ee6abb14f33
Reviewed-on: https://skia-review.googlesource.com/57941
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-10-11 13:06:19 +00:00
Herb Derby
5eb1528234 Add mulHi to SkNx
Add mulHi to base SkNx, and specialize implementations for Sk4u for
neon and sse.

Add casts for converting from uint8_t by 4 to uint32_t by 4.

Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
Change-Id: I29a32e2ad9812a47fff841ceca334e562362836f
Reviewed-on: https://skia-review.googlesource.com/57960
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
2017-10-11 08:21:09 +00:00
Mike Reed
e07622386b clone saturating cast code for doubles
Bug: skia:
Change-Id: I4f35413995cf73c6f130476d6b36e530120aa7ed
Reviewed-on: https://skia-review.googlesource.com/57901
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-10 19:58:13 +00:00
Hal Canary
c5b9498891 SkPDF: consolidate two functions in SkPDFObjNumMap
Change-Id: Id815920e664ba986258867b7c35a7618a6927b0f
Reviewed-on: https://skia-review.googlesource.com/54360
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-10-10 16:41:13 +00:00
Ben Wagner
3f98552933 Small pathops cleanup.
Newer clang compiler produces the diagnostic

../../tests/PathOpsDebug.cpp:1349:44:
error: comparison of unsigned enum expression >= 0 is always true
[-Werror,-Wtautological-unsigned-enum-zero-compare]
        if (!firstOp && c->operand() && op >= 0) {

The check seems to be defending against bad values of SkPathOp, but
this now seems unnecessary. This also adds 'rdiff' to kPathOpStr for
future debugging.

Change-Id: I08e5ba77c56e519ce4d9ae89491f7ccd5eb7f944
Reviewed-on: https://skia-review.googlesource.com/57104
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-10-09 22:01:34 +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
Brian Salomon
7f56d3d2d8 Revert "Revert "Disable GL buffer mapping on TSAN/Mac.""
This reverts commit 4e7cdd5a00.

Bug: skia:7058
Change-Id: I3b92c35835cf7a8c04e9218194bf293b790413e0
Reviewed-on: https://skia-review.googlesource.com/57222
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-10-09 20:24:04 +00:00
Mike Reed
df071d7885 use new computeByteSize api
Bug: skia:
Change-Id: I92ddb7768ace21afa45b3c2b07db556bf42f4f50
Reviewed-on: https://skia-review.googlesource.com/57261
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2017-10-09 17:18:07 +00:00
Ethan Nicholas
abff956455 initClassID no longer auto-allocates ids
Auto-allocated IDs mean that the IDs depend upon the order in which
classes happen to get initialized and are therefore not consistent
from run to run. This change paves the way for a persistent shader
cache by fixing the IDs in an enum.

Bug: skia:
Change-Id: I3e923c6c54f41b3b3eb616458abee83e0909c09f
Reviewed-on: https://skia-review.googlesource.com/56401
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-10-09 15:20:33 +00:00
Brian Salomon
4e7cdd5a00 Revert "Disable GL buffer mapping on TSAN/Mac."
This reverts commit c203e65265.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Disable GL buffer mapping on TSAN/Mac.
> 
> Also reverts 65e7063796 which disabled buffer mapping in GrResourceProvider::createPatternedIndexBuffer.
> 
> Bug: skia:7058
> Change-Id: I6816abe53251e1cd8e92eae41b8cdbe45218a341
> Reviewed-on: https://skia-review.googlesource.com/50100
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Icf0cf40ba4d6e7081971eee2eea0a41033790df7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7058
Reviewed-on: https://skia-review.googlesource.com/57220
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-10-09 15:18:45 +00:00
Brian Salomon
c203e65265 Disable GL buffer mapping on TSAN/Mac.
Also reverts 65e7063796 which disabled buffer mapping in GrResourceProvider::createPatternedIndexBuffer.

Bug: skia:7058
Change-Id: I6816abe53251e1cd8e92eae41b8cdbe45218a341
Reviewed-on: https://skia-review.googlesource.com/50100
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-10-09 13:33:54 +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
Chris Dalton
cc604e5e9e CCPR: Add workaround for PowerVR crash
Bug: skia:
Change-Id: Icd00f81fda5366813f9c959fdc91b0415894cbfc
Reviewed-on: https://skia-review.googlesource.com/55360
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-10-06 22:48:59 +00:00
Greg Daniel
e1da1d9a7d Add option to create a deferred render target context with mips
We need this since we have texture generators that draw the base level
but nothing more. Thus we want them to be able to directly draw into
a pre allocated mipped target instead of doing a copy later.

TBR: bsalomon@google.com
Bug: skia:
Change-Id: I1dfae0da7153b21b30fdfa51a7061fc255739a1e
Reviewed-on: https://skia-review.googlesource.com/54100
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-06 20:28:00 +00:00
Chris Dalton
f1b47bb299 Add a cap for geometry shader invocations
Bug: skia:7116
Change-Id: I3cc2ce7b2e5123c9adfd9781b2a5a8553747dfa5
Reviewed-on: https://skia-review.googlesource.com/56000
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-10-06 18:43:06 +00:00
Chris Dalton
1265894423 Don't execute onFlush op lists until after GPU data is uploaded
Bug: skia:
Change-Id: Ide85e802fd6e6a19412457dbaded3545b962c240
Reviewed-on: https://skia-review.googlesource.com/55562
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-10-06 16:04:14 +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
Brian Osman
b379dcd64e Sever fOriginalPath connection whenever a GrShape becomes a simple type
When drawing a round-rect, for example, we may end up in drawPath with a
temporary path that was created with the rrect added. We ended up putting
a genID listener on that (stack allocated) path, so we would evict cache
entries immediately. This restores the old behavior, where cache entries
for paths derived from simple types are never invalidated.

Bug: skia:7087
Change-Id: I3eed9c3a289241bfe1e42036be3362f592256693
Reviewed-on: https://skia-review.googlesource.com/54460
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-10-04 20:30:03 +00:00
Brian Osman
5fcd3913da Fix path renderer cache test logic to account for other resources
Bug: skia:
Change-Id: Iadf88cc07fac23544317166699138644218b38d1
Reviewed-on: https://skia-review.googlesource.com/55141
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-10-04 19:10:12 +00:00
Robert Phillips
fa8c080449 Use SK_DISABLE_DEFERRED_PROXIES to only disable deferred proxies for Chrome
This relies on https://chromium-review.googlesource.com/c/chromium/src/+/700475 (Readd SK_DISABLE_DEFERRED_PROXIES flag) landing in Chrome first.

It refines the changes made in: https://skia-review.googlesource.com/c/skia/+/54004 (Temporarily disable deferred texture proxies)

Change-Id: I12af50349516d32f74cd7f7dfd25a668284f64fa
Reviewed-on: https://skia-review.googlesource.com/55100
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-10-04 15:42:22 +00:00
Greg Daniel
c42b20b832 Revert "Revert "When flushing, reset flush state before op lists""
This reverts commit f8bc0018be.

Reason for revert: disabling failing test

Original change's description:
> Revert "When flushing, reset flush state before op lists"
> 
> This reverts commit 78bdee200c.
> 
> Reason for revert: breaking PathRendererCacheTests.cpp unit test
> 
> Original change's description:
> > When flushing, reset flush state before op lists
> > 
> > When we reset the flush state after executing the ops in a flush, we reset
> > the stored pipelines which may be holding refs to resources in their processors.
> > 
> > We want the resources that we wrote to in the op list to be freed last for caching
> > LRU purposes. Thus we make sure to free all the pipeline resources first before
> > resetting and freeing the op lists
> > 
> > Bug: skia:
> > Change-Id: I5b02e9b7532007b5854e906bf4d64e901e7e7e53
> > Reviewed-on: https://skia-review.googlesource.com/54760
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,robertphillips@google.com
> 
> Change-Id: If74a158e90316553a401386c8c7a6b3c2b29a7df
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/55080
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Bug: skia:
Change-Id: Ibdfe37c1f9e54956bf1725d1d7474a69efcd7673
Reviewed-on: https://skia-review.googlesource.com/55102
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-04 15:03:33 +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
Brian Osman
7ea46bf9d9 Remove test suppresion for ANGLE GLPrograms test
The NaN shader literal bug has been worked around, so lets get this test
coverage back.

Bug: skia:6842
Change-Id: I7b6b00972d9e00e49e5f2eccac9f2eda7fffbb6c
Reviewed-on: https://skia-review.googlesource.com/54362
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-10-03 17:42:05 +00:00
Robert Phillips
73f7e1dbdd Temporarily disable deferred texture proxies
Bug: 769760
Change-Id: Id4197a73737f3a8df9159d9eb081be094df1f731
Reviewed-on: https://skia-review.googlesource.com/54004
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-10-02 18:25:44 +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
Robert Phillips
3ec9573ac3 Add unit test for pinned SkImages
Change-Id: I2e14353bc865b5994cc90ad643a6a58604955957
Reviewed-on: https://skia-review.googlesource.com/53500
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-09-29 20:04:54 +00:00
Leon Scroggins III
4cdbf6056d Avoid uninitialized memory in readByteArrayAsData
Bug: 769134

readByteArray can fail (due to not having enough available or due to the
wrong alignment). If it does, do not return an uninitialized block of
memory.

Further, drop the initial size check, which is covered by readByteArray.

Add a test.

Change-Id: Ia101697c5bb1ca3ae3df1795f37a74b2f602797d
Reviewed-on: https://skia-review.googlesource.com/52742
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-09-28 19:51:32 +00:00
Chris Dalton
29011a2bda Remove tolerance form SkClassifyCubic
It's too inexact as-is. If the caller wants tolerance they can do
their own with knowledge of the pixel grid. The homogeneous math
is stable with infinities so it's really unnecessary here.

Bug: skia:7073
Change-Id: I4dc34ad96b859a138714b6d4f8804fec4f89f17a
Reviewed-on: https://skia-review.googlesource.com/51182
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-09-28 18:39:58 +00:00
Jim Van Verth
809cbedd4b Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"
This reverts commit 88757dacd4.

Reason for revert: Still seems to be failing Chromium "telemetry_perf_unittests (with patch) on Android" on android_n5x_swarming_rel.

Original change's description:
> guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
> 
> Now with legacy behavior for allocpixels
> 
> This was reverted, so the current CL is a "fix" on top of ...
> https://skia-review.googlesource.com/c/skia/+/50980
> 
> Related update to Chrome (in preparation for this change)
> https://chromium-review.googlesource.com/c/chromium/src/+/685719
> 
> Bug: skia:
> Change-Id: I4b370ee7e95083ab27421f008132219c9c7b86e9
> Reviewed-on: https://skia-review.googlesource.com/51341
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I827a0ca1d1e3909e648fde3342cdb8601d34da8d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/52381
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-09-27 23:15:07 +00:00
Chris Blume
0b5e7d16c2 Treat invalid indices as transparent in gifs
Other browsers (including old Chrome) treat invalid palette indices as
transparent for gifs. And there are gifs in the wild which rely on this.

As an example, if the palette only has 64 entries (0-63) then index 64
is treated as transparent.

BUG=skia:7069

Change-Id: I15e8919a953387506c9ac5945c3ae6a2b90189ab
Reviewed-on: https://skia-review.googlesource.com/51100
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Chris Blume <cblume@google.com>
2017-09-27 21:03:41 +00:00
Leon Scroggins III
e56774602c Fix truncated webp images
Bug: b/65290323

If a webp file is truncated such that no rows can be decoded,
WebPIDecGetRGB does not initialize its "last_y" parameter. We use
rowsDecoded (passed as last_y) to determine which remaining rows to
fill.

Check the return value of WebPIDecGetRGB. If it fails (returns null),
or rowsDecoded is <= 0 (matching Chromium's check), return
kInvalidInput, since there is nothing to draw.

Note that this is a change in behavior for Android. Previously we
would decode an empty webp to just a transparent/black rectangle,
whereas now we simply fail. I think this is a change for the better.

Add a test which truncates a file to have 0 rows available and attempts
to decode it. msan verifies that we no longer depend on the
uninitialized value.

Stop attempting to test decoding subsets from an incomplete webp (in
CodecTest.cpp). Unless we have decoded the portion covered by the
subset, this will fail.

Remove test images inc0.webp (from both dm/ and colorspace/) and
inc1.webp. These just decode to transparent rectangles. Replace them
with inc2.webp and inc3.webp, which decode part of the image and then
have to fill with transparent.

Change-Id: I64d40be91c574b45963f9a43d8dd8f4929dd2939
Reviewed-on: https://skia-review.googlesource.com/50303
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: James Zern <jzern@google.com>
2017-09-27 20:51:02 +00:00
Brian Osman
28c434b807 Handle instantiation of proxies with pending invalidation messages
Bug: skia:
Change-Id: Id6808734df2335c521d4a563122ceeca906b7601
Reviewed-on: https://skia-review.googlesource.com/52002
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-09-27 17:38:38 +00:00
Mike Reed
88757dacd4 guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
Now with legacy behavior for allocpixels

This was reverted, so the current CL is a "fix" on top of ...
https://skia-review.googlesource.com/c/skia/+/50980

Related update to Chrome (in preparation for this change)
https://chromium-review.googlesource.com/c/chromium/src/+/685719

Bug: skia:
Change-Id: I4b370ee7e95083ab27421f008132219c9c7b86e9
Reviewed-on: https://skia-review.googlesource.com/51341
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-27 14:36:07 +00:00
Ethan Nicholas
fa7ee2447e changed vertex attribute precisions to be actual types
Bug: skia:
Change-Id: Ic5555d9f1be7f24655bdea9f2a3677bfb128ef70
Reviewed-on: https://skia-review.googlesource.com/50221
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-09-27 14:04:17 +00:00
Greg Daniel
f46633f8af Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"
This reverts commit 98a6216b18.

Reason for revert: breaking the chrome roll. Looks like they may be writing data to create an image across all the row bytes and thus writing to unalloced data on the last row. Link to example failing bot:
 https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/539960

Original change's description:
> guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
> 
> Previously we had size_t and uint64_t variations.
> 
> The new (simpler) API always..
> - returns size_t, or 0 if the calculation overflowed
> - returns the trimmed size (does not include rowBytes padding for the last row)
> 
> Bug: skia:
> Change-Id: I05173e877918327c7b207d2f7f1ab0db36892e2e
> Reviewed-on: https://skia-review.googlesource.com/50980
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Leon Scroggins <scroggo@google.com>

TBR=mtklein@google.com,herb@google.com,scroggo@google.com,fmalita@chromium.org,reed@google.com

Change-Id: I726f6ab1b36b14979ba6f37105e0a469b3f0dbc0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/51262
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-09-26 20:08:07 +00:00
Ethan Nicholas
bed683addb switched gl_Position and gl_PointSize to sk_*
Bug: skia:
Change-Id: Ie7508991aa975c1400bac23ae49d81041a313968
Reviewed-on: https://skia-review.googlesource.com/51320
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-09-26 19:17:46 +00:00
Brian Osman
e9242ca695 Invalidate textures cached by SW path renderer when paths go away
Bug: skia:
Change-Id: Icfc2f1bd57c0cf7be54469b6d86cbd436b59155d
Reviewed-on: https://skia-review.googlesource.com/51201
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-09-26 19:07:46 +00:00
Greg Daniel
e2d76d5ffe Remove fIsMipMapped from GrSurfaceDesc
Part 3 of 3 for relanding of https://skia-review.googlesource.com/c/skia/+/42083

Bug: skia:
Change-Id: I98c5406015213df5d11a0101df8722da6845157e
Reviewed-on: https://skia-review.googlesource.com/44464
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-09-26 18:17:37 +00:00
Greg Daniel
cd87140111 Add ability to remove unique key from proxy and underlying surface.
Bug: skia:
Change-Id: I66b891ce9ca35906fdbddb36f565b35b25825112
Reviewed-on: https://skia-review.googlesource.com/51240
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-09-26 17:11:21 +00:00
Mike Reed
98a6216b18 guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
Previously we had size_t and uint64_t variations.

The new (simpler) API always..
- returns size_t, or 0 if the calculation overflowed
- returns the trimmed size (does not include rowBytes padding for the last row)

Bug: skia:
Change-Id: I05173e877918327c7b207d2f7f1ab0db36892e2e
Reviewed-on: https://skia-review.googlesource.com/50980
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-09-26 17:07:16 +00:00
Greg Daniel
90f28ec3da Add some asserts and explict setting of fIsMipMapped
Part 2 of 3 for relanding of https://skia-review.googlesource.com/c/skia/+/42083

Bug: skia:
Change-Id: Iddc2571d88486531c76ab47432c2a51f2ac79043
Reviewed-on: https://skia-review.googlesource.com/44463
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-09-26 15:17:07 +00:00
Mike Reed
592273965a Revert "Revert "migrate to sk_sp for SkFontMgr API""
This reverts commit f40ae1a4b5.

Bug: skia:
Change-Id: I752606de92ea405d6e50219c98030409b00a2841
Reviewed-on: https://skia-review.googlesource.com/51160
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-26 14:05:18 +00:00
Brian Osman
f6f7cf6098 Invalidate path VBs when paths are destroyed
For this to work, we need access to the "original" path,
before any style was applied. To that end, add an original
path to GrShape (and unit tests of that functionality).

Then add a version of addGenIDChangeListener to GrShape,
that propagates to the original path, and use that in
tessellating path renderer.

Includes unit tests of caching behavior in the PR, all
of which failed without this change.

Bug: skia:
Change-Id: I98bb505f521e8ff07184f5c3fbd3c5fd1a22d3d5
Reviewed-on: https://skia-review.googlesource.com/50300
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-09-26 12:52:36 +00:00
Mike Reed
f40ae1a4b5 Revert "migrate to sk_sp for SkFontMgr API"
This reverts commit 4bf296be28.

Reason for revert: need guard for flutter

Original change's description:
> migrate to sk_sp for SkFontMgr API
> 
> Bug: skia:
> Change-Id: I1bf2a13537f67938cdc9956080065d10ea0bd1d8
> Reviewed-on: https://skia-review.googlesource.com/48740
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: Ib0b2d00fcbcdb6131444f94d1046df6dae24f551
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/50940
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-25 20:00:41 +00:00
Mike Reed
4bf296be28 migrate to sk_sp for SkFontMgr API
Bug: skia:
Change-Id: I1bf2a13537f67938cdc9956080065d10ea0bd1d8
Reviewed-on: https://skia-review.googlesource.com/48740
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2017-09-25 19:45:09 +00:00
Xianzhu Wang
b449666fa2 Reland "Fix SkImageSource::filterBounds()" again
This relands commit cb4d587666
which was reverted by commit b6d2be1330
because the original CL broke some blink layout tests, and the first
reland was reverted by commit because it broke filterfastbounds gm.

This reland let SkImageSource::onFilterNodeBounds() return the dst rect
with ctm applied when mapping forward or otherwise the default value.

Original description:

> Previously SkImageSource::filterBounds() uses the default
> SkImageFilter::onFilterNodeBounds() which returns the input rect.
>
> Now override onFilterNodeBounds() in SkImageSource to return src
> or dst rect (with transform applied).

Change-Id: I4548981142b9a96beda8339d394cf9943c9f4c0f
Reviewed-on: https://skia-review.googlesource.com/50420
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-09-25 19:05:20 +00:00