BUG=skia:
Change-Id: Ic2fd767927172646c35dc6a4219717f7b71224ff
Reviewed-on: https://skia-review.googlesource.com/6097
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Started failing due to https://skia-review.googlesource.com/c/5758/
Explanation from scroggo@:
"""
The problem is that the image is truncated before receiving the color
table, which I recently changed (here) from resulting in
kIncompleteInput (which get_images_from_skps determines to be okay) to
resulting in kInvalidInput (which is a failure).
I downloaded the failed image (attached), and it looks as expected
(truncated prior to the color table).
"""
BUG=skia:
Change-Id: I1a0d2e4618afd8abb302d5e268984bb2641756b7
Reviewed-on: https://skia-review.googlesource.com/6145
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
In SkBmpCodec, if the header size does not match a known header,
stop trying to create an SkCodec. We do not know of any BMPs with
arbitrarily sized headers, so this should not cause any real
regressions.
In addition, this fixes a bug where we attempt to read too much data
from a file. Since we attempt to read the header size in one read,
and a size reported by the "BMP" may be larger than SSIZE_MAX, this
will crash when reading from a file.
Add a test.
BUG:b/33651913
Change-Id: I0f3292db3124dc5ac5cbdbc07196bda130a49ba7
Reviewed-on: https://skia-review.googlesource.com/6150
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Don't know why I thought this had to be so complicated before.
BUG=skia:6053
Change-Id: Ie714fed1cb47e9add166d4227d3d31f95eba2411
Reviewed-on: https://skia-review.googlesource.com/6121
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This also removes the "batch tracker" structs from the Op classes. Some tracker fields weren't used and some values were being stored per-path even though onCombineIfPossible assured they were the same. This also backs away from the generic "geometry" naming of batched items in favor of "path" or "shape".
Change-Id: Iabaa0cedf2bdf09ad135fc382ddfba8e5e94e4be
Reviewed-on: https://skia-review.googlesource.com/6152
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
It is untested and unused.
Change-Id: I010ff4ad942738f362d42a99af4edbbb1cb0cd71
Reviewed-on: https://skia-review.googlesource.com/6142
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
generateBitmap was used in one test, so it's easily converted to
tryGenerateBitmap. Then, all calls to tryGenerateBitmap supplied
an image info, so we don't need it to be optional.
BUG=skia:
Change-Id: I19e8f9da7e442a2d37af68b029b5ec85228766f7
Reviewed-on: https://skia-review.googlesource.com/6149
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Exclude complexclip4_bw and complexclip4_aa tests from tile_rt
config, because these tests invoke Skia API that does not support
picture recording.
BUG=skia:
Change-Id: Ia9c04b78b03819e7a060badf9c0fd138b7d66b75
Reviewed-on: https://skia-review.googlesource.com/6095
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
- move bytesWritten calculation to query the tail, allowing write() to be faster since it doesn't have to update anything extra per-write.
- enforce that all blocks are multiple-of-4 bytes big
- update the minimum block size to 4K
Before: 30ms
After: 23ms for non-4-bytes writes
13ms for 4-bytes writes
BUG=skia:
Change-Id: Id06ecad3b9fe426747e02accf1393595e3356ce3
Reviewed-on: https://skia-review.googlesource.com/6087
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
We'd like to fix bugs and make performance improvements to our hash tables. It's a lot easier if we can focus on one implementation, so I'd like to move users of SkTDynamicHash to SkTHashTable, SkTHashMap, or SkTHashSet. This is roughly outlined in the attached Skia bug.
In this case, the conversion from SkTDynamicHash to SkTHashTable is pretty trivial. The main change is that the values stored in the table are no longer assumed to be pointers, so we just need to sprinkle in a couple of * and ->.
SkResourceCache is particularly interesting as the locus of the attached Chromium bug. Porting this now means SkResourceCache will get any fixes we make as soon as we make them.
BUG=skia:6053,chromium:429375
Change-Id: If5dc8d331c62f1d4449fb8f9a7f7e9c746070213
Reviewed-on: https://skia-review.googlesource.com/5984
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Checking to invalidate this on every write() call has a measurable cost, so removing it both simplifies the class and speeds it up.
BUG=skia:
Change-Id: Idf0baa265c9a0b5d26d82fce948c61ed9b0810b1
Reviewed-on: https://skia-review.googlesource.com/6096
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
BUG=skia:
Change-Id: I09c99c58be39f5ce9b772265a469ce33e87b8ad8
Reviewed-on: https://skia-review.googlesource.com/6144
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Change-Id: I409048988cccb68daaeb66828e2772fcb6a0cb06
Reviewed-on: https://skia-review.googlesource.com/6104
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
BUG=skia:
Change-Id: I2328190da7fc1f2db10bb87684fb3a3e95751ec5
Reviewed-on: https://skia-review.googlesource.com/6111
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Remove the tests for gyp_to_android.py, which is going away anyway.
With a .bp file in the Android source tree, the Android build system
attempts and fails to build them.
Do not attempt to run the deleted tests.
Change-Id: Idfecd79917bf6e6d70b601bf36b0f1bdf69c90b6
Reviewed-on: https://skia-review.googlesource.com/6112
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Chromium may ask us to read back from locked IOSurfaces. Calling the command buffer's
glGetIntegerv() with GL_IMPLEMENTATION_COLOR_READ_FORMAT/_TYPE causes the command buffer
to make a call to check the framebuffer status which can hang the driver. So in Mac Chromium
we always use a temporary surface to test for glReadPixels format/type support.
BUG=chromium:662802
Change-Id: I034e24faf3d780b6243f95af66d03dd68e12633c
Reviewed-on: https://skia-review.googlesource.com/6113
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: I5934e189f72cbc9c1f306c719b4d6e3f5178a046
Reviewed-on: https://skia-review.googlesource.com/6101
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Hooked up existing to/from srgb, and to_2dot2 stages into
SkColorSpaceXform_A2B. Added a from_2dot2 stage to the raster pipeline
to complete the other direction.
BUG=skia:
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
Change-Id: I3887af3f59f67329d7e843e7355ff54e22cc4ed0
Reviewed-on: https://skia-review.googlesource.com/5840
Commit-Queue: Robert Aftias <raftias@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).
There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.
This is a reland of https://skia-review.googlesource.com/c/5773/ (Add a deferred copy surface)
Change-Id: Ib8fd96d0569274ef781366eb900ed8ee839ae9bd
Reviewed-on: https://skia-review.googlesource.com/6109
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Move the body of simple functions
out of line if they are used in
pointer to member function expressions.
This may fix a chromeos-reported bug.
TBR=reed@google.com
BUG=674047
Change-Id: Id2a080a6d047103a48ebe2319abdae444de413e3
Reviewed-on: https://skia-review.googlesource.com/6110
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Change-Id: I9930381465ebad690206e2251171004f9579fbcd
Reviewed-on: https://skia-review.googlesource.com/6100
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
We no longer support these platforms and no longer work on 10.6 anyway.
On 10.7 and 10.8 things will probably still mostly work, but there may be
some strangeness.
Change-Id: I6816a97d8a986ad3b762673d18cc973bbe7befcd
Reviewed-on: https://skia-review.googlesource.com/6093
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This should have been names 'overwrite' and appears to be unused.
Change-Id: Ic9dd21e6789fb079fcbc209ed5d074a77f3587cc
Reviewed-on: https://skia-review.googlesource.com/6092
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Change-Id: I5cbdc606170186d2d908d518af0e0fd1094fcf78
Reviewed-on: https://skia-review.googlesource.com/6089
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
I accidentally turned these off in:
https://skia-review.googlesource.com/c/6023/
Even though the decode color type does not match the canvas,
we still want to run the test.
BUG=skia:
Change-Id: Ia96069a44e20d62a58d37a98bac81cfab5470fc0
Reviewed-on: https://skia-review.googlesource.com/6088
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
Change-Id: Ic0e95a29f1e2479d3d79b7d175290cb20422b585
Reviewed-on: https://skia-review.googlesource.com/6082
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This adds support for playing back a picture image in a different
color space. This is currently limited to just the original space
(sRGB) or legacy mode. I think the best next step is to make them
fully flexible (playing back in the destination surface's space),
but that's going to involve changes to caching logic. I'd like to
keep that separate.
BUG=skia:
Change-Id: I15e6d44e977328b06a4da008ff7b2ed88d851a0b
Reviewed-on: https://skia-review.googlesource.com/5777
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
This CL again only really makes sense in the bigger picture of moving readPixels off of GrTexture
Change-Id: Ib76482d8a773144e8fc7c6e55b2c7fa7b3ea0ecf
Reviewed-on: https://skia-review.googlesource.com/6086
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Perf won't work because J is too old. But, we can at least run tests. Since we only have one
device, I decided to just do Debug instead of Debug/Release. We don't care about CPU things since
we have much faster arm devices to handle that for us.
BUG=skia:
Change-Id: I11e6f13a128b627bc2f2b2878c39c0fda8d310a9
Reviewed-on: https://skia-review.googlesource.com/6027
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
* Switch to linear probing - this allows delete to rearrange elements to fill in empty slots
* NULL -> nullptr
Change-Id: I741c2f3bb2734bf638d0c0a78c6cc549f563a5d9
Reviewed-on: https://skia-review.googlesource.com/5980
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Change-Id: I757c33d1cd17a7a7dda858f0fc5ab1094e3c2472
Reviewed-on: https://skia-review.googlesource.com/5985
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This makes it possible to target NDK API 18 (K) again.
Change-Id: Id3d1f19b2904792b4001d2ea0942cc1ab6cf732e
Reviewed-on: https://skia-review.googlesource.com/6081
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This is intended to position the writePixels in GrSWMaskHelper::toTexture for moving to GrSurfaceContext
Change-Id: I6c3d24eb3b1db3b0efc63f7f4f1240a7a00ee88a
Reviewed-on: https://skia-review.googlesource.com/6032
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
It escaped the chopping block when we deleted the decoder, but it is
currently untested and unused as far as we know. In addition to
removing effectively unsupported code, this simplifies build file
changes (i.e. don't build it on Android framework, but build it
elsewhere) as we narrow our build systems down to one.
Change-Id: I3b960fdcc369fb947be282933ddba48e407ab3ad
Reviewed-on: https://skia-review.googlesource.com/6031
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Leon Scroggins <scroggo@google.com>
This indicates whether the frame has been fully received, i.e. the
stream contains enough data to decode to the end of the frame.
A client may want to use this to know whether they should attempt to
decode this frame, if they do not want to decode partial frames.
Change-Id: I336c7031b0c0b8c1401ce040f5372aedc87fdc14
Reviewed-on: https://skia-review.googlesource.com/5703
Reviewed-by: Chris Blume <cblume@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Android plans to use 16-bit png to encode higher precision assets.
This CL should not change any behavior or cause diffs on Gold.
It simply moves the 16-bit -> 8-bit strip from libpng to SkSwizzler.
As a follow-up, I plan to add support for 16-bit input to
SkColorSpaceXform. This will require a new swizzler function that
just samples or subsets 16-bit values (but does not strip to 8-bit).
An alternative implementation could avoid the additional swizzler
functions by deciding whether or not to call png_set_strip() at
decode time (we would still need the swizzler fn to sample/subset
16-bit values). I find this strategy to be cleaner than that.
I would rather handle 16-bit rgb(a) all the time than *some* of
the time. And this is implementation is also more efficient
than libpng. Though it is also more skia code.
Gray and gray alpha are left alone until I know whether anyone
wants high precision gray support.
b/32984164
Change-Id: I44e307473526de3f4bba06879c5fffa25d480f56
Reviewed-on: https://skia-review.googlesource.com/6020
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
SkOpAngle::alignmentSameSide()
Shifting an edge to align it for angle sorting may move a compared edge to the opposite side.
For lines that are shifted, check to see if this is so.
class SkOpContourBuilder
If the path contains a pair of lines that cancel, skip them as early as possible.
While not strictly necessary, this optimization is cheap and makes debugging much easier.
SkOpEdgeBuilder::walk()
case SkPath::kCubic_Verb:
If max curvature or inflections break a cubic into pieces, make sure that the pieces are
large enough to process. If not, add the broken piece back to a neighbor.
Correct debugging that had gone stale.
Add active span debugging cache so only changes are shown.
TBR=reed@google.com
BUG=skia:6401
Change-Id: I766f77e4fb9b76537cf5464961addb103114f5db
Reviewed-on: https://skia-review.googlesource.com/5764
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>