We don't want to test small images on Gold because they are
not interested to look at. Instead, I wrote a unit test to
verify that scaling small images does not cause crashes.
BUG=skia:
Review URL: https://codereview.chromium.org/1287863004
If a curve has the identical start and control points, the
initial or final tangent can't be trivally determined. The
perpendicular to the tangent is used to measure coincidence.
Add logic for cubics, quadratics, and conics, to use the
secondary control points or the end points if the initial
control point alone can't determine the tangent.
Add debugging (currently untriggered by exhaustive testing)
to detect zero-length tangents which are not at the curve
endpoints.
Increase the number of temporary intersecions gathered from
10 to 12 but reduce the max passed in by cubic intersection from
27 to 12. Also, add checks if the max passed exceeds the
storage allocated.
When cleaning up parallel lines, choose the intersection which
is on the end of both segments over the intersection which
is on the end of a single segment.
TBR=reed@google.com
BUG=425140,516266
Review URL: https://codereview.chromium.org/1288863004
Currently, SkPaintFilterCanvas does not provide any help in cloning
target canvas state. While that could be handled in subclasses, it is
easy to miss (see linked bug).
This CL adds a new constructor variant which ensures that the initial
matrix and clip bounds are inherited from the target canvas.
BUG=516790
R=reed@google.com,robertphillips@google.com
Review URL: https://codereview.chromium.org/1294013002
Add more swizzling functions for swizzling to 565. Much of this
code was revived from crrev.com/1055743003 (for BMP). Also added
swizzling functions for WBMP.
Consolidate the static function conversion_possible.
In SkCodec::getPixels, check that the alphatype corresponds to the
colorType. This prevents requesting 565 + non-opaque.
In SkIcoCodec, report that the image is unpremul (instead of
whatever the largest embedded codec thinks), but modify the
requested info to have the alpha type expected/required by the
embedded codec.
Add tests for decoding to 565.
BUG=skia:3257
BUG=skia:3683
Review URL: https://codereview.chromium.org/1277213002
Prior to this patch clients who were solely uploading to textures (e.g., SW Mask Mgr) would cause extra flushes b.c., even though kPreferNoIO was being specified, resources with pending IO would still be returned even though there was plenty of space in the resource cache.
Review URL: https://codereview.chromium.org/1286203002
Rename to SkDeflate so Chromium builders continue to work
Next, we change remove SkFlate from Chromium build files, then we can delete SkFlate.
Review URL: https://codereview.chromium.org/1285913002
Add a static function to CodexTest, which consolidates decoding,
comparing to an expected SkCodec::Result, and optionally comparing to a
digest.
Test decoding non-opaque to opaque (fails) and premul to unpremul/vice
versa (succeeds).
BUG=skia:3475
Review URL: https://codereview.chromium.org/1277253003
Chromium's test suite contains an RLE image that reports a certain
file size in the header, but then contains additional encoded data.
Our bmp decoder would only decode half of the image, before stopping.
With this fix, we check for additional data before returning
kIncompleteInput.
If this lands, I will upload the test image to the bots.
Also adding an invalid image test to CodexTest.
BUG=skia:
Review URL: https://codereview.chromium.org/1273853004
When possible use run-time checks (via SkDocument::CreatePDF)
When PDF is disabled, do not compile tests/PDF*.cpp
Review URL: https://codereview.chromium.org/1278403006
Prepare_rt_for_external_access() grabs the render target and then fires
access notifications.
But the notification handlers may trigger copy-on-write, causing the
returned render target to be stale (pointing at the detached snapshot).
We should grab the render target after firing notifications.
R=reed@google.com,bsalomon@google.com
Review URL: https://codereview.chromium.org/1276713002
We are also changing the wbmp to use SkSwizzler. This
will allow us to take advantage of the sampling routines
that are being implemented in SkSwizzler.
The image in this upload came from:
https://commons.wikimedia.org/wiki/File:Android_robot.png
It is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
BUG=skia:
Review URL: https://codereview.chromium.org/1254483004
Motivation: maintaining this code doesn't seem worth the time,
since no one seems to be using it. If someone wants to use it
in the future, just revert this CL.
Review URL: https://codereview.chromium.org/1266093003
Paths are cached as tessellated triangle meshes in vertex buffers on the GPU. Stroked paths are not (yet) cached.
Paths containing no curved segments (linear paths) are reused at all scales. Paths containing curved segments are reused within a scale tolerance threshold.
In order to invalidate the cache when an SkPath is changed or deleted,
this required implementing genID change notification in SkPath. This is
modelled almost exactly on SkPixelRef::GenIDChangeListener.
However, It does not currently implement the check for unique genIDs,
so notifiers will fire when the first instance of an SkPathRef
using a given genID is destroyed.
Another caveat is that you cannot successfully add a change notifier
to an empty path, since it uses the "canonical" empty path which is
never modified or destroyed. For this reason, we prevent adding
listeners to it.
BUG=skia:4121,skia:4122, 497403
DOCS_PREVIEW= https://skia.org/?cl=1114353004
Committed: https://skia.googlesource.com/skia/+/468dfa72eb6694145487be17876804dfca3b7adb
Review URL: https://codereview.chromium.org/1114353004
Prior to this CL, if a client wanted to decode scanlines, they had to
create an SkCodec in order to get an SkScanlineDecoder. This introduces
complications if input data is not easily shared between the two
objects.
Instead, add methods to SkScanlineDecoder for creating a new one from
input data, and remove the creation functions from SkCodec.
Update DM and tests.
Review URL: https://codereview.chromium.org/1267583002
Does not try to cache calls to readPixels at the moment:
- not triggered by drawing
- not clear if we want to perform any pixel transformations (that readPixels allows) on the GPU or CPU
Can consider that another time.
BUG=513695
Review URL: https://codereview.chromium.org/1262923003
Paths are cached as tessellated triangle meshes in vertex buffers on the GPU. Stroked paths are not (yet) cached.
Paths containing no curved segments (linear paths) are reused at all scales. Paths containing curved segments are reused within a scale tolerance threshold.
In order to invalidate the cache when an SkPath is changed or deleted,
this required implementing genID change notification in SkPath. This is
modelled almost exactly on SkPixelRef::GenIDChangeListener.
However, It does not currently implement the check for unique genIDs,
so notifiers will fire when the first instance of an SkPathRef
using a given genID is destroyed.
Another caveat is that you cannot successfully add a change notifier
to an empty path, since it uses the "canonical" empty path which is
never modified or destroyed. For this reason, we prevent adding
listeners to it.
BUG=skia:4121,skia:4122, 497403
DOCS_PREVIEW= https://skia.org/?cl=1114353004
Review URL: https://codereview.chromium.org/1114353004