If getPixels returns an unexpected result, do not create a digest
and compare it to digests for premul and unpremul.
Print a better error message, including the name of the image and
string versions of the SkCodec::Result.
Change-Id: Ie98e350a1ef91c0745fe9de0855192e5793e033c
Reviewed-on: https://skia-review.googlesource.com/c/176582
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Nigel Tao <nigeltao@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
- add drop-in clang-tidy cxx wrapper
- get build clean for bugprone-use-after-move
The wrapper can be used by setting
cxx = "/path/to/skia/tools/clang-tidy.sh"
in GN.
Change-Id: Idbba911e23bd6ef7530b08fd31906b92c1c1b28c
Reviewed-on: https://skia-review.googlesource.com/c/176523
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit e7f165be2e.
Reason for revert: doesn't compile in google3
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=djsollen@google.com,scroggo@google.com,reed@google.com
Change-Id: I91680f65a2a5e6f0a13b84e97c9541ebe0606b33
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8586
Reviewed-on: https://skia-review.googlesource.com/c/176584
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Bug: skia:
Change-Id: Iee57bc970a026de2ad5a0758153e9cbb20753fa1
Reviewed-on: https://skia-review.googlesource.com/c/173105
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
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>
This reverts commit a34e6eac3c.
Reason for revert: Broken gold images on Adreno 530 and 540
Original change's description:
> Fix performance regresion on Mali, while preserving sk_FragCoord.w
>
> Bug: skia:
> Change-Id: I9269288bbb861cd02efa7b5dfe2c9434ec39064e
> Reviewed-on: https://skia-review.googlesource.com/c/174309
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,michaelludwig@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: Id344219c101564a5fd06477895386fad2d8dfa78
Reviewed-on: https://skia-review.googlesource.com/c/175986
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This fixes a crash we saw when we switch vulkan copies as draws to creating
their own secondary command buffer. The crash came from the perf blendmode
tests when using an advanced blend mode. They would do 1000 draws which forced
us into creating 2000 command buffers (since the dst copies and the normal draws
each used them). I tested without the copies as draws change and just increasing
the total number of draws we do and was able to repro the crash.
Besides fixing the above OOM crash, I am also seeing a 5-10% perf gain on the
blendmode micro benches which is nice
Bug: skia:
Change-Id: I9266ea0ba02a755f54dabd4ee804963ab0c9b684
Reviewed-on: https://skia-review.googlesource.com/c/175436
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Uninstantiated: a state of not being instantiated.
Deinstantiate: transition from instantiated to uninstantiated state.
Change-Id: Id7b6b295267674a9915f95105d73fabfcc3555de
Reviewed-on: https://skia-review.googlesource.com/c/175586
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:
Change-Id: I365c82a058c97e8741ee91e999cb6faab5a5ecf5
Reviewed-on: https://skia-review.googlesource.com/c/175422
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Follow-ups assuming this sticks:
- remove client overrides, so we can remove the (empty) base class virtuals
- mark as obsolete the .skp enums for these entrypoints, and note date
- remove glyphrunlist helpers that now may not have any callers
- remove DrawCommands related to these entrypoints
Bug: skia:
Change-Id: I44b4e6ef3bee61911e77b9b2ab73f82c0817536a
Reviewed-on: https://skia-review.googlesource.com/c/175240
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Bug: skia:
Change-Id: I9269288bbb861cd02efa7b5dfe2c9434ec39064e
Reviewed-on: https://skia-review.googlesource.com/c/174309
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 10273c1d5f.
Reason for revert: bad gms
Original change's description:
> Use unnormalized coords all the way through with GL_TEXTURE_RECTANGLE textures.
>
> We used to unnormalize them in the shader via SkSL.
>
> This allows us to support GL_TEXTURE_RECTANGLE without having textureSize()
> available in GLSL.
>
> Change-Id: Ibe63a302228811933ef000251db4cad9aaf4f2ea
> Reviewed-on: https://skia-review.googlesource.com/c/174068
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,brianosman@google.com
Change-Id: I9bf38e1040578becba28ac8cccd81e2af2844278
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/175252
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:7903
Change-Id: I69b65fc1cfcc2cc5045bb3b75395f9a256ade278
Reviewed-on: https://skia-review.googlesource.com/c/172979
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Read only textures and proxies fail writePixels, as copy dsts, and mip
regeneration.
Bug: skia:8509
Change-Id: Iaa0b473cc9a9930fde3ef0e91373d5040650de35
Reviewed-on: https://skia-review.googlesource.com/c/174316
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
We used to unnormalize them in the shader via SkSL.
This allows us to support GL_TEXTURE_RECTANGLE without having textureSize()
available in GLSL.
Change-Id: Ibe63a302228811933ef000251db4cad9aaf4f2ea
Reviewed-on: https://skia-review.googlesource.com/c/174068
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:8579
Zero-initialize the pixel buffer that wuffs uses inside the frame rect.
If the encoded image is incomplete, we will swizzle this memory into the
destination, so this prevents swizzling uninitialized memory.
In addition, zero-initialize the client's memory if the above buffer
will not fill it, and if the frame is independent.
Move decodeFrameConfig into onStartIncrementalDecode. This makes it
clear that we haven't begun decoding the pixels so rowsDecoded is
irrelevant. Update the documentation for onStartIncrementalDecode to
make it clear that it can be called more than once (and when to do so).
If a frame is incomplete and depends on prior frames, do not blend it.
This will overwrite pixels from the prior frames without a way to undo.
Current clients only want to show incomplete images for the first frame
anyway.
Add some debugging information to Codec_partialAnim test, including
writing out pngs when failing the test.
TBR=djsollen@google.com for documentation change in SkCodec.h
Change-Id: I85c8ca4075301306f4738ddfc2f5992a5745108b
Reviewed-on: https://skia-review.googlesource.com/c/174310
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Nigel Tao <nigeltao@google.com>
Change-Id: I4960b1cd055daf44637e95825f82cb7fe2ce134a
Reviewed-on: https://skia-review.googlesource.com/c/174285
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I11ff57dca2c48519bc3a23e36da01bf40d1b329c
Reviewed-on: https://skia-review.googlesource.com/c/174221
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:8410 chromium:876349
Change-Id: Ib97c82cd165f7e2f2e94c65fc307220b99053df3
Reviewed-on: https://skia-review.googlesource.com/c/174065
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: I04b6cbfe083c32a25205e04a4b15672d4b678a9c
Reviewed-on: https://skia-review.googlesource.com/c/174063
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
In theory, a convex shape is still convex if transformed by an affine
matrix. However, SkPath segments are specified using floats, and attributes
like collinearity can break under some transforms due to finite precision.
Computing convexity is non-trivial, so there is value in SkPath caching this
calculation. Convexity is useful, as both the CPU and GPU backends can draw
convex shapes faster than non-convex.
To balance these two (fragile float math and value of caching convexity),
this CL invalidates this cached state if the transform could change convexity.
In the general case, it is assumed that convexity could change. Special cases
where it is safe to keep the cached state after transform are:
- identity transform
- scale/translate transform if the path is known to be axis-aligned
All other combinations invalidate the cached state, forcing it to be
recomputed.
"axis-aligned" means the segments in the path are all axis-aligned, horizontal
or vertical (e.g. a rect or rrect)
Bug: 899689
Change-Id: I1381273eaff61d6b7134ae94b4f251c69991081a
Reviewed-on: https://skia-review.googlesource.com/c/173226
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
This reverts commit 26d8d77aae.
Reason for revert: speculative, in case this is blocking the chrome roll
Original change's description:
> don't trust convexity with affine transforms
>
> In theory, a convex shape transformed by an affine matrix should still
> be convex. However, due to numerical nastiness of floats, when we try
> to determine if something is convex, we can get different answers pre
> and post a transformation (think of two line segments nearly colinear).
>
> Convex paths take a faster scan converter, but it is only well behaved
> if the path is, in fact, convex. Thus we have to be conservative about
> which paths we mark as convex.
>
> This bug found a case where a "convex" path, after going through a transform,
> became (according to our measure) non-convex. The bug was that we *thought*
> that once convex always convex, but in reality it was not. The fix (hack) is
> to notice when we transform by an affine matrix (we're still assuming/hoping
> that scaling and translate keep things convex (1)...) and mark the convexity
> as "unknown", forcing us to re-compute it.
>
> This will slow down these paths, since it costs something to compute convexity.
> Hopefully non-scale-translate transforms are rare, so we won't notice the
> speed loss too much.
>
> (1) This is not proven. If we find scaling/translation to break our notion of
> convexity, we'll need to get more aggressive/clever to find a fix.
>
>
> Bug: 899689
> Change-Id: I5921eca247428bf89380bc2395fe373fa70deb1d
> Reviewed-on: https://skia-review.googlesource.com/c/173080
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Cary Clark <caryclark@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
TBR=mtklein@google.com,jvanverth@google.com,caryclark@google.com,reed@google.com,caryclark@skia.org
Change-Id: I5d846798f2c34c6576591a3c3125cfdc3c72dbdc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 899689
Reviewed-on: https://skia-review.googlesource.com/c/173162
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
In theory, a convex shape transformed by an affine matrix should still
be convex. However, due to numerical nastiness of floats, when we try
to determine if something is convex, we can get different answers pre
and post a transformation (think of two line segments nearly colinear).
Convex paths take a faster scan converter, but it is only well behaved
if the path is, in fact, convex. Thus we have to be conservative about
which paths we mark as convex.
This bug found a case where a "convex" path, after going through a transform,
became (according to our measure) non-convex. The bug was that we *thought*
that once convex always convex, but in reality it was not. The fix (hack) is
to notice when we transform by an affine matrix (we're still assuming/hoping
that scaling and translate keep things convex (1)...) and mark the convexity
as "unknown", forcing us to re-compute it.
This will slow down these paths, since it costs something to compute convexity.
Hopefully non-scale-translate transforms are rare, so we won't notice the
speed loss too much.
(1) This is not proven. If we find scaling/translation to break our notion of
convexity, we'll need to get more aggressive/clever to find a fix.
Bug: 899689
Change-Id: I5921eca247428bf89380bc2395fe373fa70deb1d
Reviewed-on: https://skia-review.googlesource.com/c/173080
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This should allow clients to include Skia and their vulkan files in any
order. However, it does require that when clients are building their
files that include skia with vulkan, they must have vulkan/vulkan_core.h
on their include path somewhere.
Bug: skia:
Change-Id: I969db396c92127be7c8df754926d175f38b8aafa
Reviewed-on: https://skia-review.googlesource.com/c/172147
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: I900a661f346a10dbd8002bfe383d1705138feb50
Reviewed-on: https://skia-review.googlesource.com/c/146401
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:
Change-Id: Ibd636b9e1bf932033c3161c862523f841cb85e79
Reviewed-on: https://skia-review.googlesource.com/c/171005
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
GrRenderTargetOpList maintains an array of op chains. When it receives a
new op it tries to add it to an existing chain, working backwards from
the end of the current array. If the op can be added to a chain it
additionally tries to merge the new op with ops already in the chain
before adding it to the tail of the chain.
In forward combining it tries to concatenate chains. If chains can
concatenate it also attempts to merge ops between the two chains.
Now op chaining results reported by Op subclasses must be transitive.
Moreover, if op A is able to merge with B then it must be the case that
any op that can chain with A will either merge or chain with any op that
can chain to B.
Bug: skia:8491
Change-Id: Ib6a2a669acd4257134a37d271289b8b3f247cd3f
Reviewed-on: https://skia-review.googlesource.com/c/170351
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Adds setVertexAttributes and setInstanceAttributes. These take a pointer
to the first attribute, and a count. The count is the total number of
possible attributes, though some may not be initialized. The base class
computes the number of initialized attributes, pre-computes the strides,
and only allows subsequent access to the initialized attributes.
The attributes need to be allocated contiguously. Some GPs place them in
an array, though most just place them as consecutive members, and pass
a pointer to the first one.
Indexed access would be possible, but now it makes more sense to iterate
over all attributes, so enable that, and use range-based for everywhere.
Completely remove the per-attribute offset helper (again - possible, but
not real helpful), and make the stride always available. In many ops,
just use the GP's computed stride, rather than re-computing it.
Bug: skia:
Change-Id: Ie4cccb7969a98ee5a10b373e714fbd702e875b3e
Reviewed-on: https://skia-review.googlesource.com/c/169241
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
edging settings are needed for metrics calls, as well as drawing, hence
we really have to include them in almost every SkFont call/usage, so I
guess we can just accept them as real.
This seems to imply that we have to document what happens in drawTextBlob,
since it has a bunch of SkFonts (runs) AND a paint. This is the situation
today of course, and I had hoped to simplify it, but I think I've failed.
Proposal dox for drawTextBlob.
drawTextBlob respects the paint when drawing the blog, but it IGNORES the
paint's antialias (and lcdrender) flags, as these are already specified in
the blob's runs.
Bug: skia:2664, skia:8494
Change-Id: I8f69186c9c337d98d058919f53b7901ff830a16e
Reviewed-on: https://skia-review.googlesource.com/c/170352
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
It *seems* that chrome only ever uses glyphs, so I hope we can skip the encoding parameter.
Bug: skia:
Change-Id: I3b6857ba6a37050a9fd0913a16b980bc45d54bda
Reviewed-on: https://skia-review.googlesource.com/c/170341
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This is a reland of b07aba4214
Original change's description:
> Move remove ptr args to MakeRecAndEffects
>
> Move this conversion out through the transitive closure of calls. As you
> move up the stack, everything becomes refs instread of pointers.
>
> Reorder args of MakeRecAndEffects and setupCache to match the majority of other
> calls.
>
> Change-Id: I72baf457cd9140f76ee5f7122493284c4be5bcd0
> Reviewed-on: https://skia-review.googlesource.com/c/169765
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
Change-Id: I2ff7f218ecc7b18ae6a2b293cecdb059eea77562
Reviewed-on: https://skia-review.googlesource.com/c/170222
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This reverts commit b07aba4214.
Reason for revert: Changes GMs
Original change's description:
> Move remove ptr args to MakeRecAndEffects
>
> Move this conversion out through the transitive closure of calls. As you
> move up the stack, everything becomes refs instread of pointers.
>
> Reorder args of MakeRecAndEffects and setupCache to match the majority of other
> calls.
>
> Change-Id: I72baf457cd9140f76ee5f7122493284c4be5bcd0
> Reviewed-on: https://skia-review.googlesource.com/c/169765
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
TBR=bungeman@google.com,herb@google.com
Change-Id: I29e54cea5b7b5709dd6db6816cb6556d73e003e0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/170221
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Move this conversion out through the transitive closure of calls. As you
move up the stack, everything becomes refs instread of pointers.
Reorder args of MakeRecAndEffects and setupCache to match the majority of other
calls.
Change-Id: I72baf457cd9140f76ee5f7122493284c4be5bcd0
Reviewed-on: https://skia-review.googlesource.com/c/169765
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
SkBlend::RowFactory is only ever used to pass these function
pointers from SkBlitMask_D32.cpp to SkBlitMask_ARGB32.cpp,
so let's eliminate the middleman.
Change-Id: If74af775bb3cdc3eec9dc4ebeb180ac42b184a54
Reviewed-on: https://skia-review.googlesource.com/c/170062
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit 51b1c12bbc.
Reason for revert: reverting till flutter gets to 1.1 to fix build issues.
Original change's description:
> Have a GrBackendFormat be stored on gpu proxies.
>
> Bug: skia:
> Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
> Reviewed-on: https://skia-review.googlesource.com/c/168021
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
Change-Id: I574fdc084ef5994596c51fb0d60423b5dc01b885
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:903701 chromium:903756
Reviewed-on: https://skia-review.googlesource.com/c/169835
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This resolves many scoping issues, which complicate this code.
Change-Id: Ib0d283d95ff8a563176a333c8d388947650df4d2
Reviewed-on: https://skia-review.googlesource.com/c/169761
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Bug: skia:
Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
Reviewed-on: https://skia-review.googlesource.com/c/168021
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This reverts commit 6bd19df9fa.
Restores original CL, but adds guards for flutter.
Bug: skia:
Change-Id: I380b4ea87d293355026d734249aa2b8c397da144
Reviewed-on: https://skia-review.googlesource.com/c/169345
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Do not compile in non-gpu unit tests.
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Debian9-Clang-NUC7i5BNK-CPU-Emulator-x86-devrel-All-Android_SKQP
Change-Id: I134806c50d8aec317b72f8c7b31d7ef9c5490219
Reviewed-on: https://skia-review.googlesource.com/c/169245
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Unused except in unit tests.
Change-Id: I07bb70515a383898ad59c0fa918461052b582e35
Reviewed-on: https://skia-review.googlesource.com/c/168860
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Change-Id: I9ba1caa4862bdf9ffc9c0e637bd69cce91fd8468
Reviewed-on: https://skia-review.googlesource.com/c/168740
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: I395395b1cd81a1d45ca779b2273015c8ed9fb882
Reviewed-on: https://skia-review.googlesource.com/c/168361
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: I5386e27edbcf39233880d869841a6632ecb9416c
Reviewed-on: https://skia-review.googlesource.com/c/168261
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
We're already not testing these giants sizes on 32-bit machines because
they overrun memory. I'm not sure it's important to test them at all.
Change-Id: I322d46add8024760fc71939abe09430f77cbd69d
Reviewed-on: https://skia-review.googlesource.com/c/165767
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
SkRefCntBase is an implementation detail of SkRefCnt, so let's not
mention it in SkContext_Compute.h. While I'm here, I notice SkNVRefCnt
would work fine too.
No one else calls internal_dispose_restore_refcnt_to_1(), so we can
inline it. While here, I notice it's resetting the ref count to 1 even
in release builds. I'm not sure if that is/can be optimized away, but
in any case I think we can wrap with #ifdef SK_DEBUG, if only to make it
clear that it's only there to support the assert in the destructor.
I've removed validate(). Most of the places it's called read pretty
weird, and I think suggest some sort of class-specific validation than
just checking that we're holding a ref. SkWeakRefCnt::validate() isn't
called anywhere.
There were few users of getRefCnt() outside SkRefCnt itself, so I
removed the rest and made it private.
I've added a few this-> to self calls while at it.
Change-Id: I98be06677a6e8b8e66f44cbb17d14e38b0f39d38
Reviewed-on: https://skia-review.googlesource.com/c/167160
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
- Mechanical replacement of GrColor4h (used throughout Ops) with
SkPMColor4f.
- API adaptation (to/FromGrColor -> to/From_BytesRGBA).
- Complete removal of FromFloats (source was already SkPMColor4f),
and toFloats (setting uniforms can directly access .vec()).
Bug: skia:
Change-Id: I37eece1fa7ed2545dc6843e840d4cc3c60f19747
Reviewed-on: https://skia-review.googlesource.com/c/166620
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Previously we relied on GrRenderTargetOpList returning an ID if and only
if it did not merge the op. Upcoming changes to GrRenderTargetOpList will
make it harder to track whether the op was merged.
Only CCPR (and related unit test) requires the op list ID. Now CCPR passes
a callback that is called when the op list is deterimined but before
we know if the op merges or not.
Change-Id: Iead1c3eff8de5a4183e330dd7b57362cbffe0ebb
Reviewed-on: https://skia-review.googlesource.com/c/166624
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Bug: skia:
Change-Id: I8486d0631e4723f1a457a607bc21abd2581133d8
Reviewed-on: https://skia-review.googlesource.com/c/166562
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>
Bug: skia:7903
Change-Id: If5acd50711ed8bd4a49efcb93db66fd3d14c8992
Reviewed-on: https://skia-review.googlesource.com/c/164681
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Our srgb_roundtrip_extended unit test has shown that our from_srgb and
to_srgb stages start to break down outside a range of about [-2,2], and
they appear to asymptote to roundtripping to y=8, not an identity y=x.
We'll continue to use these stages where we know ahead of time that
the inputs are all in [0,1], and otherwise fall back on ::parametric.
Guarded by SK_LEGACY_SRGB_STAGE_CHOICE.
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I046b2d37a629df9b0ea687f8df6cad864110430f
Reviewed-on: https://skia-review.googlesource.com/c/165766
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
We still degrade to bytes when creating vertices (tagged TODO4F).
Note: Guarded for Chrome (by making GrColor4h a wrapper around
GrColor).
Bug: skia:
Change-Id: Id8a1d9eec7978d52b059cd9952666bc1217ee073
Reviewed-on: https://skia-review.googlesource.com/c/165527
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Change-Id: Iaddc62452156231349f56218ab18ee5729f57cb3
Reviewed-on: https://skia-review.googlesource.com/c/166040
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
GrPremulColor is only use in test code, and is redundant
Bug: skia:
Change-Id: I4a22941d28cbec3eb203bca393cfeccffe04e053
Reviewed-on: https://skia-review.googlesource.com/c/165524
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Step 1 of many to (eventually) use SkFont to make blobs, and not paint.
Bug: skia:2664
Change-Id: Iaa0682f9d947e18afa96b448519f2f60ffe104cc
Reviewed-on: https://skia-review.googlesource.com/c/165521
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
We're going to use half-floats, which are far more future-proof.
Bug: skia:
Change-Id: I6e098017381256d6e750ac546c353072802282cb
Reviewed-on: https://skia-review.googlesource.com/c/165522
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 7d20bc42f4.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Remove memory used by unique glyphs
>
> Change-Id: I789e9093e3fea9648b77a1bfda9d7b4b03b7f19d
> Reviewed-on: https://skia-review.googlesource.com/c/165025
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
TBR=mtklein@google.com,herb@google.com
Change-Id: If6d658fa348e55a4f1995ef0bd9025da6bb4d3cf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/165311
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Updated the existing tests to use Steps too.
Change-Id: I7d793a06b587e8e9da00b69a2bfd699437f4e67a
Reviewed-on: https://skia-review.googlesource.com/c/165401
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: I789e9093e3fea9648b77a1bfda9d7b4b03b7f19d
Reviewed-on: https://skia-review.googlesource.com/c/165025
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This reverts commit 7d1c9ec49f.
Bug: skia:8235
Change-Id: I830ba00a87e85c80f7e8583f5dfa105cd60029b2
Reviewed-on: https://skia-review.googlesource.com/c/165301
Commit-Queue: Leon Scroggins <scroggo@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit 2d123ad73f.
Reason for revert: Android roll?
Original change's description:
> Remove unique glyph IDs from glyph runs
>
> The unique calculation is to costly to do for SkTextBlobs every
> time because there may be a cache hit in the GrTextBlob cache.
> In the future I will move the unique ID calculation to the GrTextBlob
> creation.
>
> Change-Id: I7e10e8f22a3bc729fab12b2cf7e9732441be7f31
> Reviewed-on: https://skia-review.googlesource.com/c/164623
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
TBR=mtklein@google.com,herb@google.com
Change-Id: I8424e12e1ad1abd9e40699aa34e1062f5c7bf94a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/165060
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I91b9816aae74726762c123d9f3454c5961382b7b
Reviewed-on: https://skia-review.googlesource.com/c/164680
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
The unique calculation is to costly to do for SkTextBlobs every
time because there may be a cache hit in the GrTextBlob cache.
In the future I will move the unique ID calculation to the GrTextBlob
creation.
Change-Id: I7e10e8f22a3bc729fab12b2cf7e9732441be7f31
Reviewed-on: https://skia-review.googlesource.com/c/164623
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
It violates painter's order when merging/chaining an op that is already
in a chain.
Improve OpChainTest so that it would have caught painter's order bug.
Bug: skia:8491
Bug: chromium:894015
Change-Id: Ibfec2d377c903abbb40136e16804137c76d1844c
Reviewed-on: https://skia-review.googlesource.com/c/164609
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
The distinction between SkJumper and SkRasterPipeline used
to be important, but it's no longer. This CL moves everything
under src/jumper to the appropriate SkRasterPipeline file.
Change-Id: I1181fffafccb3dc4c4eb5f33b442c719ee370462
Reviewed-on: https://skia-review.googlesource.com/c/164627
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Wrap SkBitSet in a thin SkPDFGlyphUse class that manages new mapping.
Change-Id: Id97d42b8961f49c93fd45fdefad69d0aa9e273c5
Reviewed-on: https://skia-review.googlesource.com/c/163882
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Tentative roadmap:
- land this
- extend TextBlobBuilder to take SkFont for its runs (eventually removing paint option)
- change SkTextBlob to store SkFont instead of SkRunFont (not critical, but makes sense)
After the above, (or during) also work towards:
- removing callers of SkPaint set... (textsize, textscalex, typeface, etc.)
- eventually physically remove those setters/getters/fields
- rev as desired the SkFont API to clean up flags, hinting, etc.
Bug: skia:2664
Change-Id: I0e323c58aef055e26d697911b078797453cb3626
Reviewed-on: https://skia-review.googlesource.com/c/163783
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Bug: skia:7903
Change-Id: I7301d943b679a4670511b6cf60c594baf615834a
Reviewed-on: https://skia-review.googlesource.com/c/164261
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
The 8K table in SkFDot6Constants.cpp is only used by SkAnalyticEdge and
its unit test, so to help LTO trim this when SkAnalyticEdge isn't used,
move it to SkAnalyticEdge.cpp and delete the unit test. (I suspect the
table is never going to change.)
I've also moved setLine() out-of-line into SkAnalyticEdge.cpp to make
this work, and done a little bit of refactoring and renaming.
Change-Id: If1d234f387d100dd58d8860dccac000e5493a2c1
Reviewed-on: https://skia-review.googlesource.com/c/164182
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Initialize felt a little too nebulous, and I think
the verb for "define registrar entry" is "register".
Change-Id: I52f2eb5df5acd46a8b38bb9ea9bb07f4ac8f3789
Reviewed-on: https://skia-review.googlesource.com/c/163990
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
No need to keep the list of all those old unsupported version tags.
Everything related to SkDeduper.h was dead code.
fMemoryPtr was just an always null pointer.
SkReadBuffer::clone() doesn't do anything interesting.
DEBUG_NON_DETERMINISTIC_ASSERT doesn't do anything at all.
The whole custom factory feature was unused except by its unit test
and one other, which was using it to avoid a race to register those
types as deserializable. I think some good old fashioned static
initialization can come to our rescue here...
Change-Id: Ie99dc957fc1035886bb55eaa3fc3339e73f9c320
Reviewed-on: https://skia-review.googlesource.com/c/163984
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This also includes adding drawable Op and plumbing it through to the GPU.
BUG=skia:
Change-Id: I0b2464c5a458c2fbf05b9528e47b9e6e3ac27d57
Reviewed-on: https://skia-review.googlesource.com/c/9645
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Just expose colorSpace on the GrTextureProducer, and if a client needs
it, they can get it from there.
Bug: skia:
Change-Id: I5134b1c9b2780274f3d6571d9fe8cd2a6b6ce7e9
Reviewed-on: https://skia-review.googlesource.com/c/163888
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This should let getTypeName() and serialization work even
when deserialization factories haven't been registered.
I've made getTypeName() pure virtual like getFactory(),
and moved all the overrides into SK_FLATTENABLE_HOOKS,
cleaning up all the various ways we've done it before.
All the subclasses override getTypeName() and getFactory()
privately, so there should be no need to document them?
Change-Id: I723cb20099d250c2f2a10be266e3aacc6a061937
Reviewed-on: https://skia-review.googlesource.com/c/163543
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
All unused.
Bug: skia:
Change-Id: I35b32874b0865ff7a33560f9a7b80df603eac6f4
Reviewed-on: https://skia-review.googlesource.com/c/163885
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
It seems that the maximum memory size was never really respected.
Calculate everything off the max dimensions capablility of
the GPU.
Change-Id: I2f2ebe2a16220844a57f3c4d403b17af996ea1f8
Reviewed-on: https://skia-review.googlesource.com/c/163445
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Bug: skia:7901
Change-Id: Ic83e9f0c2a493335671fe431ffba6f649812d406
Reviewed-on: https://skia-review.googlesource.com/c/163481
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 0c583af06d.
Reason for revert: DDL is failing
Original change's description:
> Widen internal API to support more complex YUV formats
>
> Bug: skia:7901
> Change-Id: I46fec08711b8b483cf58ccae733e4dc2a9689231
> Reviewed-on: https://skia-review.googlesource.com/c/162280
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com
Change-Id: Ibe3dd7abbce4a3b6afe74c565198dadc61a9f439
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7901
Reviewed-on: https://skia-review.googlesource.com/c/163257
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:7901
Change-Id: I46fec08711b8b483cf58ccae733e4dc2a9689231
Reviewed-on: https://skia-review.googlesource.com/c/162280
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Same deal as before, just swap_rb where needed.
The change to SkWebpCodec could probably land independently if we want.
Change-Id: Idd53ab76232cb95eb2f41cd65c6903fa7c5b01d6
Reviewed-on: https://skia-review.googlesource.com/c/163440
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
(fixing msan/asan/ubsan failure)
Pathops used templates for curve intersection.
Since only one template is required if curves share
an abstract base, remove the template altogether.
This makes the code easier to read, and incidentally
makes it slightly smaller and much faster.
This also removes debugging code specific to templates,
and removes Simplify code which isn't covered by tests
or fuzz.
This shaves the execution time of
pathops_unittest -V -x from 6m to 3m23s.
R=kjlubick@google.com
Bug: skia:
Change-Id: I3392df98244083d0327ce9c787dfe24d326ef4ed
Reviewed-on: https://skia-review.googlesource.com/c/162742
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
All uses have been converted to SkPMColor4f (or similar).
Bug: skia:
Change-Id: I220bd5eaf6c35b17321c1e8bc92ace7ff92908c4
Reviewed-on: https://skia-review.googlesource.com/c/162749
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This adds SkPMColor4f conversions to/from RGBA bytes (ie GrColor).
I had previously made some free functions that did the same thing.
I'm ambivalent about which option is nicer, but wanted to have one
method, so I converted everything to use the new versions.
Bug: skia:
Change-Id: I4194c44b5bd12228075fd1932a14cf31c8d6a3c1
Reviewed-on: https://skia-review.googlesource.com/c/162560
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 521f1ed0b6.
Reason for revert: msan ubsan errors
Original change's description:
> remove pathop template
>
> Pathops used templates for curve intersection.
> Since only one template is required if curves share
> an abstract base, remove the template altogether.
>
> This makes the code easier to read, and incidentally
> makes it slightly smaller and much faster.
>
> This also removes debugging code specific to templates,
> and removes Simplify code which isn't covered by tests
> or fuzz.
>
> This shaves the execution time of
> pathops_unittest -V -x from 6m to 3m23s.
>
> R=kjlubick@google.com
>
> Bug: skia:
> Change-Id: I00c08210e47efed83295276ae89ad64e7ec07ade
> Reviewed-on: https://skia-review.googlesource.com/c/162021
> Commit-Queue: Cary Clark <caryclark@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Cary Clark <caryclark@google.com>
TBR=kjlubick@google.com,caryclark@google.com,caryclark@skia.org
Change-Id: Ic5828f7affb7df96ed4ca79f037cdbcfaea24384
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/162643
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Pathops used templates for curve intersection.
Since only one template is required if curves share
an abstract base, remove the template altogether.
This makes the code easier to read, and incidentally
makes it slightly smaller and much faster.
This also removes debugging code specific to templates,
and removes Simplify code which isn't covered by tests
or fuzz.
This shaves the execution time of
pathops_unittest -V -x from 6m to 3m23s.
R=kjlubick@google.com
Bug: skia:
Change-Id: I00c08210e47efed83295276ae89ad64e7ec07ade
Reviewed-on: https://skia-review.googlesource.com/c/162021
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
This reverts commit 222e275b0a.
Reason for revert: perf regression
Original change's description:
> converted AARectEffect to new FP system
>
> Bug: skia:
> Change-Id: I0e4141c7f547bab92c65a6abff120ed04d5c2c66
> Reviewed-on: https://skia-review.googlesource.com/c/153550
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=bsalomon@google.com,ethannicholas@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: I3d7036a78d8582d6790c77b20a60e6e5257d1881
Reviewed-on: https://skia-review.googlesource.com/c/162283
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This reverts commit f7ddaa8a1b.
Bug: skia:
Change-Id: Idc0459e119cefbf580aea1f27dda9836d16bb293
Reviewed-on: https://skia-review.googlesource.com/c/162039
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 087c917670.
Reason for revert: ASAN reporting memory leak.
Original change's description:
> Use SkImage to manage mip map cache purging, not Bitmap/PixelRef
>
> Lazy and GPU images manage the notification themselves, but raster
> images now forward the notification request to the pixelRef.
>
> Bug: skia:
> Change-Id: I93e0ebd3749e3f7dbd506466299fde8923982435
> Reviewed-on: https://skia-review.googlesource.com/c/161830
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,brianosman@google.com,reed@google.com
Change-Id: I355b8caeaae3096e52f5fd2359f4ad39cddaa383
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/162034
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Lazy and GPU images manage the notification themselves, but raster
images now forward the notification request to the pixelRef.
Bug: skia:
Change-Id: I93e0ebd3749e3f7dbd506466299fde8923982435
Reviewed-on: https://skia-review.googlesource.com/c/161830
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit 11422c63d3.
Reason for revert: Perf regression
Original change's description:
> Tie mip map cache purging to Images, not Bitmaps/PixelRefs
>
> We were potentially using different keys for lookup vs. add, because we
> were adding with a key based on the pixelRef, which may not have the
> same uniqueID as the originating image.
>
> Bug: skia:
> Change-Id: Ib4d3d5ead9f5a574cf6d1920080bc9c4ae66c1d0
> Reviewed-on: https://skia-review.googlesource.com/c/161625
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
TBR=mtklein@google.com,brianosman@google.com,reed@google.com
Change-Id: I9bdce1c6b1d9bf13cc477d2e7f20f7cc0f204b2f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/161828
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
* Fixes isTextureBacked() for SkImage_GpuYUVA
* Hooks in SkImage_GpuYUVA::MakePromiseYUVATexture()
* Pass down plane texture sizes to MakePromiseYUVATexture()
* Move some other methods to SkImage_GpuBase.
Bug: skia:7901
Change-Id: I33d62c16b426abba5830f7168f9f8fd54a0cb093
Reviewed-on: https://skia-review.googlesource.com/c/161149
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
are not recyclable.
Change-Id: I5ff9c48b3d7b37531a3f052bd5188a8afcacf3cb
Reviewed-on: https://skia-review.googlesource.com/c/161860
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
The argument is unused (and in future CLs will be removed entirely)
Bug: skia:
Change-Id: Iec6b757992f7e27d8f929b000227ec5bd3a8f8d5
Reviewed-on: https://skia-review.googlesource.com/c/161841
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
One less SkCanvas subclass to deal with...
Change-Id: I21e81648026be5d732e8d9a28baed55015492a04
Reviewed-on: https://skia-review.googlesource.com/c/161584
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
We were potentially using different keys for lookup vs. add, because we
were adding with a key based on the pixelRef, which may not have the
same uniqueID as the originating image.
Bug: skia:
Change-Id: Ib4d3d5ead9f5a574cf6d1920080bc9c4ae66c1d0
Reviewed-on: https://skia-review.googlesource.com/c/161625
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:8461
According to skbug.com/7069, we should allow GIFs to use a transparent
index outside of the range of the color table. Add a test to verify
support for this.
The GIF is 2x2 with the following pixels:
-------------------------------------------------
| black | white |
-------------------------------------------------
| transparent | transparent |
-------------------------------------------------
The color table only has 2 entries (black and white), and the
transparent index is 2.
Change-Id: I16574a61e2982b6628c3eca96cb7b3e1f57d3b2a
Reviewed-on: https://skia-review.googlesource.com/c/161561
Reviewed-by: Nigel Tao <nigeltao@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Pathops uses a template to intersect a pair of curves.
This generates six copies: quad/quad, quad/conic, quad/cubic,
conic/conic, conic/cubic, cubic/cubic.
This CL rewrites the template to generate a single copy,
and leverages a new abstract class, SkTCurve, to dispatch
to one of SkTQuad, SkTConic, or SkTCubic. These classes
are thin wrappers on the existing double curves classes
SkDQuad, SkDConic, and SkDCubic, which do work.
Kevin's BuildStats bot says this saves around 180K on the
release build. Running pathops_unittest shows no significant
performance difference, and the smaller version may be
slightly faster.
Bug: skia:
Change-Id: I17f94fd57a317035bc105cd43a06be6da9541cb6
Reviewed-on: https://skia-review.googlesource.com/c/161146
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
Also remove the unit tests that were enforcing those rules,
and the blacklist of that unit test.
Bug: skia:
Change-Id: I802c9e81a412fe0b19d02f9224b801f4fbd901f2
Reviewed-on: https://skia-review.googlesource.com/c/161562
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
This reverts commit 031ca213e0.
Reason for revert: breaking angle surfacetest unit test
Original change's description:
> Stop using color space xform canvas in picture image generator
>
> Direct rasterization should produce similar (or identical) results.
> See: https://chromium-review.googlesource.com/c/chromium/src/+/1273815
>
> Bug: skia:
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: I252ec5d5ecb19704f33c0f6cb65d12c2ec927c1d
> Reviewed-on: https://skia-review.googlesource.com/c/161140
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,brianosman@google.com
Change-Id: Ib5667f0d315c4f2877c1f0c38e9c62d37335d511
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://skia-review.googlesource.com/c/161560
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
The previous version would reject valid configs (like non-N32 8888).
This changes the results of some unit tests:
- Creating a zero-sized canvas via MakeRasterDirect now fails (like
it would if you tried to create a zero-sized surface).
- The picture image generator can now produce BGRA and RGBA results,
regardless of N32, and can produce unpremul.
Bug: skia:
Change-Id: Ifd9fe98adf56748f73eaea01118c928b0a13606b
Reviewed-on: https://skia-review.googlesource.com/c/161120
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 9ff04c00f3.
Bug: skia:
Change-Id: If35b2f6ea306f93d01350e7bd2de1756935fcc32
Reviewed-on: https://skia-review.googlesource.com/c/160840
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 274a89e0f5.
Reason for revert: Failing unit tests
Original change's description:
> Include color type and color space in bitmap cache key
>
> Lazy images will soon support decoding to multiple color types and
> color spaces. To avoid cache collisions, we need to fold the decoded
> color type and color space into the key.
>
> To avoid storing multiple (different) bitmaps with the same gen ID,
> stop propagating the image's ID to the one allocated in the cache.
>
> Bug: skia:
> Change-Id: I06714725d4309ec813b75e42cc76eda2cda3d2e0
> Reviewed-on: https://skia-review.googlesource.com/c/160380
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
TBR=mtklein@google.com,brianosman@google.com,reed@google.com
Change-Id: I6c5834b5b65b85dbb7661f526920d9a140ba5737
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/160801
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Lazy images will soon support decoding to multiple color types and
color spaces. To avoid cache collisions, we need to fold the decoded
color type and color space into the key.
To avoid storing multiple (different) bitmaps with the same gen ID,
stop propagating the image's ID to the one allocated in the cache.
Bug: skia:
Change-Id: I06714725d4309ec813b75e42cc76eda2cda3d2e0
Reviewed-on: https://skia-review.googlesource.com/c/160380
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I6896df2f46d530afbda752894a3fc414ade661df
Reviewed-on: https://skia-review.googlesource.com/c/159521
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This should trim the code size of a WASM CanvasKit by 10-20KB.
Bug: skia:
Change-Id: Ibf0f8596c04e891e8f7cbc2fa4f1d1852f7cb462
Reviewed-on: https://skia-review.googlesource.com/c/159261
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Coping paints take significant time. The ApplyFontToPaint
idiom requires a copy and a dtor. This CL keeps the paint and
font in parallel through the code until a paint is actually
needed, then a special ctor is used to create it.
Also, inline a bunch of text blob calls that were showing up
in perf.
Change-Id: I7da746a287e4d3942e45e9536ef9acdc64f084d4
Reviewed-on: https://skia-review.googlesource.com/c/159222
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
- We always read from (0, 0), even if the subset had a different origin
- We also cached the results ignoring the origin, so future reads of
same-sized but differently positioned subsets could return previous
and wrong bitmaps.
Added a unit test that checks for both behaviors. Originally, both
asserts triggered. Adjusting the origin in readPixels, the first assert
was fixed, but the second continued to trigger. Adding the full subset
rect to the bitmap cache key fixed the second assert.
Bug: skia:8448 skia:8449
Change-Id: Ic6e8c0976bd59e86827be89105bd02845ad0d7cd
Reviewed-on: https://skia-review.googlesource.com/c/159981
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
All special images use proxies, so this test was now identical to the
one right above it.
Bug: skia:
Change-Id: Id0358ed2417269d2f26fd255ed192e0ccbd9bcaf
Reviewed-on: https://skia-review.googlesource.com/c/159943
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Looks like this was accidentally renamed as part of
https://codereview.chromium.org/1885623002
Bug: skia:
Change-Id: Ie38d8e3e64d11f0bcbe388622f0b96b2672cd8b0
Reviewed-on: https://skia-review.googlesource.com/c/159663
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
We noticed a hash collision scenario we'd like to avoid, and it looks
pretty easy. The new test failed on my desktop at both asserts,
depending on whether I build 32- or 64-bit, and also on my
CRC-supporting phone. The Murmur3 path should be fine.
Change-Id: I005de38d68f9b0461536c29e48cf7e5be5caac3e
Reviewed-on: https://skia-review.googlesource.com/c/159621
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Convert GrConstColorProcessor to store SkPMColor4f
Bug: skia:
Change-Id: I6c505856653a02e576ae11fca59dc307545437f7
Reviewed-on: https://skia-review.googlesource.com/c/159152
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
It's been driving me nuts that I can't just write `SkMatrix44 m;`,
and I often don't care whether it's initialized or not. The default
identity constructor would be nice to use, but it's deprecated.
By tagging this constructor deprecated, we're only hurting ourselves;
our big clients disable warnings about deprecated routines and use it
freely.
A quick tally in Skia shows we mostly use the uninitialized constructor,
but sometimes the identity constructor, and there is a spread of all
three in Chromium. So I've left the two explicit calls available.
I switched a bunch of calls in Skia to use the less verbose constructor
where it was clear that it didn't matter if the matrix was initialized.
Literally zero of the kUninitialized constructor calls looked important
for performance, so the only place I've kept is its lone unit test.
A few places read clearer with an explicit "identity" to read.
Change-Id: I0573cb6201f5a36f3b43070fb111f7d9af92736f
Reviewed-on: https://skia-review.googlesource.com/c/159480
Reviewed-by: Brian Osman <brianosman@google.com>
There's one more to replace in Chromium,
then the method and cached SkMatrix44 can go.
Change-Id: I20cfac8b7bd26216f66f6d70fa9d117d0b17cee5
Reviewed-on: https://skia-review.googlesource.com/c/159302
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I5e40d9c334c959e1a777251e1ac25f3703f9b7f9
Reviewed-on: https://skia-review.googlesource.com/c/159327
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:
Change-Id: I3ff965644a0a59af1e2a2b1ea226a1417a234ced
Reviewed-on: https://skia-review.googlesource.com/c/158342
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This object is now redundant with fEncodedInfo. It holds an
SkColorSpace, which is never used now that SkCodec uses skcms.
SkCodec::getInfo() no longer returns a reference, but creates an
SkImageInfo from the SkEncodedInfo the same way fSrcInfo was
previously created.
Add SkCodec::bounds() and ::dimensions() to replace calling these
methods on getInfo().
Remove srcInfo from SkMaskSwizzler::Create, which just wants to know
whether the src is opaque.
Remove the srcColorType from conversionSupported. Only the base class
version used it. Make it look at fEncodedInfo.color() instead.
Bug: skia:6839
Bug: chromium:887372
Change-Id: I2c0583cae76121211c1a6b49979972fa86daf077
Reviewed-on: https://skia-review.googlesource.com/c/157563
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
We'd really like to converge on SkRGBA4f everywhere. This CL continues
to store GrColor4f in the GPU backend, but changes the constantColor
optimization logic to use SkPMColor4f.
GrColor[4f] have "unknown" alpha type, but in this context, they are
nearly always premul, so let's take advantage of our SkRGBA4f type
safety. We lose some of the semantic benefits and helpers that are
present in GrColor4f (OpaqueWhite, TransparentBlack).
The biggest thing that would probably help is a direct path to/from
bytes (GrColor).
Bug: skia:
Change-Id: Ic0838ad3f95d207163b3af51e5f5cf6f499c2047
Reviewed-on: https://skia-review.googlesource.com/157840
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Moves SkBitmap to base64 uri code into test utils
Bug: skia:
Change-Id: I4f92761fd2e643c38ed00a200b1cb62778a85948
Reviewed-on: https://skia-review.googlesource.com/158340
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Also adds support for uint32_t CLI flags, parsed as octal, hex, or dec.
Bug: skia:
Change-Id: I87112beb6506a65d6f541c7ca4cfb38641d55aa5
Reviewed-on: https://skia-review.googlesource.com/158040
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
After sk_imageinfo was initially created, we have added a colorspace to it,
and that object is a smart-pointer. In response to that, this CL upgrades
imageinfo to an "object" (like paint), so we can manage the ref-counting of
its colorspace, and to allow for future changes/expansion (like paint).
Bug: skia:
Change-Id: I629ff99c0820fdbe83f062d9fb768c15cda68e18
Reviewed-on: https://skia-review.googlesource.com/157156
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Converts GrResourceProvider::Flags and GrResourceCache::ScratchFlags
to "enum class" and fixes a case where we were accidentally using the
wrong type of flag. Makes sure to allocate GrSWMaskHelper proxies with
kNoPendingIO.
Bug: skia:8351
Change-Id: Ibcaa26314a53d0cb31ae22915ab94ab0fc07e76d
Reviewed-on: https://skia-review.googlesource.com/157280
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Adds an interface for the document creator to pass in a tree
of tags indicating the structure of the document, each with a type
(from a predetermined enum of possible types) and a node ID.
It also adds a setNodeId function to SkCanvas so that page content
can be associated with a particular tag. If both the tag tree and
marked content are present, Skia can now output a properly tagged
PDF.
An example program is included. When used properly, the PDF generated
by this patch is valid and the tags are parsed properly by Adobe
Acrobat. It handles many corner cases like content that spans more
than one page, or tags that don't correspond to any marked content, or
marked content that doesn't correspond to any tags.
However, it doesn't implement all of the features of PDF accessibility
yet, there are some additional attributes that can be associated with
some tags that need to be supported, too, in order to properly tag
things like figures and tables.
Bug: skia:8148
Change-Id: I2e448eca8ded8e1b29ba685663b557ae7ad7e23e
Reviewed-on: https://skia-review.googlesource.com/141138
Reviewed-by: Hal Canary <halcanary@google.com>
Spoiler alert... it doesn't.
Bug: oss-fuzz:10488
Change-Id: Ifafd92f40aed55ff14a5198ea7d79a20751e40aa
Reviewed-on: https://skia-review.googlesource.com/156661
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This template is only used in practice for SkBitmaps. There is already a
public API that does the same thing, so there's no need for this one.
Change-Id: I20b10aa8bc87a56face947689e1f0eaf4c3cc4e8
Reviewed-on: https://skia-review.googlesource.com/156540
Reviewed-by: Hal Canary <halcanary@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
This is a reland of f3ebd312f2
PS 2: use faster half->float routine
PS 3: relax tolerance to 2^-10 for half, keeping others 2^-12
Original change's description:
> add getAlphaf() to pixmap/bitmap
>
> Convenient for just extracting alpha (and more efficient than getColor()) and
> works for super-normal formats w/o loss of precision.
>
> Somewhat inspired by examining multiple chrome call-sites for getColor(), where
> chrome only really cared about the alpha. This new method runs about twice
> as fast as getColor() for the simple cases (i.e. no colorspace xforms), and
> even faster in the complex cases (since retrieving alpha doesn't care about
> colorspaces).
>
> Bug: skia:
> Change-Id: I7cd5a2c7f78de781aaa69dd1aa0dba3c532fcb73
> Reviewed-on: https://skia-review.googlesource.com/155606
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
Cq-Include-Trybots: skia.primary:Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Debug-All-Android,Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_CPU_LIMIT_SSE2,Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-All,Test-Win2016-MSVC-GCE-CPU-AVX2-x86_64-Release-All,Test-Win8-Clang-Golo-CPU-AVX-x86_64-Debug-All
Bug: skia:
Change-Id: Ie94e5c89e185fde12cbd6c56ed4026c4dc5a1623
Reviewed-on: https://skia-review.googlesource.com/156242
Commit-Queue: Ravi Mistry <rmistry@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Added SkColor4f premul/unpremul that just return SkColor4f.
Renamed existing premul to toPM4f. For many uses of SkPM4f,
conversion to pure SkColor4f code was simple. In all other
cases, continue to use SkPM4f for now.
Also convert usage of one-off SkRGBAf class in SkPatchUtils,
and delete that class, along with some truly tautological
unit tests that were the only thing keeping some PM4f API
around.
Bug: skia:
Change-Id: I344c3290ee7af6bbe86c3ff74a2df2f5e87afa38
Reviewed-on: https://skia-review.googlesource.com/156005
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit f3ebd312f2.
Reason for revert: unhappy bots
Original change's description:
> add getAlphaf() to pixmap/bitmap
>
> Convenient for just extracting alpha (and more efficient than getColor()) and
> works for super-normal formats w/o loss of precision.
>
> Somewhat inspired by examining multiple chrome call-sites for getColor(), where
> chrome only really cared about the alpha. This new method runs about twice
> as fast as getColor() for the simple cases (i.e. no colorspace xforms), and
> even faster in the complex cases (since retrieving alpha doesn't care about
> colorspaces).
>
> Bug: skia:
> Change-Id: I7cd5a2c7f78de781aaa69dd1aa0dba3c532fcb73
> Reviewed-on: https://skia-review.googlesource.com/155606
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,reed@google.com
Change-Id: I82ce00c09d16bf3e9b04f1c1bccd8cc6aa706ab2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/156000
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Convenient for just extracting alpha (and more efficient than getColor()) and
works for super-normal formats w/o loss of precision.
Somewhat inspired by examining multiple chrome call-sites for getColor(), where
chrome only really cared about the alpha. This new method runs about twice
as fast as getColor() for the simple cases (i.e. no colorspace xforms), and
even faster in the complex cases (since retrieving alpha doesn't care about
colorspaces).
Bug: skia:
Change-Id: I7cd5a2c7f78de781aaa69dd1aa0dba3c532fcb73
Reviewed-on: https://skia-review.googlesource.com/155606
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: I94defb54899bba4c2ef54bc970d5f35d12073788
Reviewed-on: https://skia-review.googlesource.com/155923
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>