This was introduced by removing SkValidatingReadBuffer::readBitmap in https://codereview.chromium.org/295793002/
Since SkReadBuffer::skip wasn't virtual, it was using the unsafe SkReadBuffer::skip within SkReadBuffer::readBitmap rather than using SkValidatingReadBuffer::skip. I also removed direct uses of fReader within SkReadBuffer::readBitmap so that it can use the virtual readInt / readFixed functions that have a version in SkValidatingReadBuffer.
Also, I changed SkReadBuffer::readPoint so that it uses the virtual readScalar, that way, it becomes redundant with SkValidatingReadBuffer::readPoint, which can then be removed.
BUG=380723
R=reed@google.com, mtklein@google.com, sugoi@google.com
Author: sugoi@chromium.org
Review URL: https://codereview.chromium.org/317003003
(
This is intended to facilitate efficient kMatrix_SaveFlags emulation
on restore():
* collect all clip stack elements for the current save count into a
side clip stack
* canvas.restore(everything)
* replay the collected clip ops to restore the initial clip state
=> we restored the matrix but the clip state is unchanged
)
Two main changes:
* expose the save count for SkClipStack::Element
* expose a replay method for the same (logic relocated from
SkCanvas::replayClips)
The SkCanvas::ClipVisitor shuffling is to enable forward decl
in SkClipStack.h (cannot fwdecl a nested class).
R=reed@google.com, robertphillips@google.comTBR=reed@google.com
Author: fmalita@chromium.org
Review URL: https://codereview.chromium.org/269693003
When using allocPixels to set the info and create a new pixelRef in one
shot, create the pixelRef with the corrected info of the bitmap (i.e.
alphatype).
Simplify the check to determine whether to copy the genID in SkBitmap::
copyTo's same configs/same sizes case. The old logic (only checking the
height and assuming the others must be the same) relied on a deep
(mis?)understanding of the rest of the function, and I cannot convince
myself that it has to be true, given that readPixels may have switched
src to a different SkBitmap. Instead, just compare the SkImageInfos,
which is much clearer. (This also caught a bug where a 565 bitmap had
the wrong alphatype, leading to the allocPixels fixes.)
If readPixels succeeds but the source is unpremultiplied, fail out
of copyTo, since readPixels assumes premultiplied.
When copying from 8888 to 4444 or in the fallback case of drawing,
return false if the alphatype is unpremul, which would have failed
anyway.
BUG=skia:2012
R=reed@google.com, bsalomon@google.com
Author: scroggo@google.com
Review URL: https://codereview.chromium.org/317053003
Adds optimization of Skia S32A_Opaque_Blitrow blitter using SSE4.2 SIMD
instruction set. Special case for when alpha is zero or opaque.
Performance increase of 10%-400% compared to the existing SSE2
optimization (measured on Silvermont architecture).
Noticeable in ~25 different skia bench subtests, especially in
bitmap_8888_*, repeatTile_*, and morph_*.
bitmap_8888_A - 100% faster
bitmap_8888_A_source_transparent - 250% faster
bitmap_8888_A_source_opaque - 25% faster
bitmap_8888_A_scale_bicubic - 75% faster
Signed-off-by: Henrik Smiding <henrik.smiding@intel.com>
R=reed@google.com, mtklein@google.com, tomhudson@google.com, djsollen@google.com, joakim.landberg@intel.com
Author: henrik.smiding@intel.com
Review URL: https://codereview.chromium.org/289473009
First bench: Simply render from a compressed ETC1 bitmap. This is roughly
equal between compressed and uncompressed data.
Second bench: Notify the bitmap that the pixels have changed (that's right,
like a liar) to force a re-upload to the GPU. On this bench, decompressed
textures seem to inexplicably do an order of magnitude better than
compressed textures when it should be the other way around, but that
investigation is reserved for a future CL.
R=robertphillips@google.com
Author: krajcevski@google.com
Review URL: https://codereview.chromium.org/317023002
The SkTransparentShader is just a placeholder that should not
actually be used, so its CTM is not meaningful. However, it needs
to be invertible in order to not assert in SkShader::Context's
constructor. So use SkMatrix::I().
This fixes a CTS test on Android.
R=reed@google.com
Author: scroggo@google.com
Review URL: https://codereview.chromium.org/315743003
From inside GrContext, we have a need to create an SkPath an original path and
some dashing info. We do not have access to the original path effect so we need
a way to make the FilterPath function accessible outside of the effect. So I moved
the core filterPath code (and all need helper functions) out of SkDashPathEffect
and created a SkDashPath in utils to store these helper functions.
BUG=skia:
R=bsalomon@google.com, reed@google.com, rmistry@google.com
Author: egdaniel@google.com
Review URL: https://codereview.chromium.org/314623004