This CL shrinks the bound computed for saveLayers that possess both an explicit
bound and a complex paint (e.g., one that affects transparent black). In this
case the bound of the layer should be the clipped explicit bound rather then
the clip prior/after the saveLayer/restore block.
In the following the first bound is the currently computed bound
while the second is the new/desired one:
For a 100x100 picture
saveLayer (no bound, no paint) [ 0 0 100 100 ] [ 50 50 100 100 ]
setMatrix (translate 50, 50) [ 0 0 100 100 ] [ 50 50 100 100 ]
saveLayer (bound of 0, 0, 50, 50 - complex paint) [ 0 0 100 100 ] [ 50 50 100 100 ]
restore [ 0 0 100 100 ] [ 50 50 100 100 ]
restore [ 0 0 100 100 ] [ 50 50 100 100 ]
Review URL: https://codereview.chromium.org/696763002
This will be a bit hairy to review.
The FillBounds and CollectLayers code has diverged significantly resulting in the rendering path seeing different bounds than the hoisting path. This CL merges the FillBounds changes into CollectLayers. A follow on CL will, hopefully, find a way to layer CollectLayers on top of FillBounds.
The only code in CollectLayers that is different from FillBounds is bracketed by "LAYER HOISTING" comments.
NOTREECHECKS=true
Review URL: https://codereview.chromium.org/685263004
This should produce tighter conservative bounding boxes for text than the
approximation code it replaces.
Recording performance is neutral on my desktop. Playback performance
improves by up to 15% on text heavy pages, e.g.
desk_pokemonwiki.skp_1 3.24ms -> 2.83ms 0.87x
desk_baidu.skp_1 1.91ms -> 1.58ms 0.83x
Committed: https://skia.googlesource.com/skia/+/bf8dc343df4fbdcb8af546eb68b640e011a33489
CQ_EXTRA_TRYBOTS=client.skia:Test-Win7-ShuttleA-HD2000-x86-Debug-Trybot
Review URL: https://codereview.chromium.org/680363003
The SkRectShaderImageFilter had the same bug as previously fixed for
SkBitmapSource and SkPictureImageFilter. Rather than copy-and-paste
the implementation, this change makes all filters with 0 inputs return
their source bounds, instead of returning false.
BUG=427251
Review URL: https://codereview.chromium.org/681643003
This should produce tighter conservative bounding boxes for text than the
approximation code it replaces.
Recording performance is neutral on my desktop. Playback performance
improves by up to 15% on text heavy pages, e.g.
desk_pokemonwiki.skp_1 3.24ms -> 2.83ms 0.87x
desk_baidu.skp_1 1.91ms -> 1.58ms 0.83x
Review URL: https://codereview.chromium.org/680363003
Reason for revert:
Compile errors on bots
Original issue's description:
> These tests stress pathops by describing the union of circle-like paths that have tiny line segments embedded and double back to create near-coincident conditions.
>
> The fixes include
> - detect when finding the active top loops between two possible answers
> - preflight chasing winding to ensure answer is consistent
> - binary search more often when quadratic intersection fails
> - add more failure paths when an intersect is missed
>
> While this fixes the chrome bug, reenabling path ops in svg should be deferred until additional fixes are landed.
>
> TBR=
> BUG=421132
>
> Committed: https://skia.googlesource.com/skia/+/6f726addf3178b01949bb389ef83cf14a1d7b6b2TBR=caryclark@google.com
NOTREECHECKS=true
NOTRY=true
BUG=421132
Review URL: https://codereview.chromium.org/686843002
The fixes include
- detect when finding the active top loops between two possible answers
- preflight chasing winding to ensure answer is consistent
- binary search more often when quadratic intersection fails
- add more failure paths when an intersect is missed
While this fixes the chrome bug, reenabling path ops in svg should be deferred until additional fixes are landed.
TBR=
BUG=421132
Review URL: https://codereview.chromium.org/633393002
This CL alters layer hoisting to defer creation of the free floating layers until they are actually needed (rather than creating _all_ the hoisted layers at the start).
It also fixes a pre vs. post Concat bug with how matrices were being accumulated.
BUG=skia:2315
Review URL: https://codereview.chromium.org/657383004
Reason for revert:
try again
Original issue's description:
> Fix bounds computation of all 0-input filters.
>
> The SkRectShaderImageFilter had the same bug as previously fixed for
> SkBitmapSource and SkPictureImageFilter. Rather than copy-and-paste
> the implementation, this change makes all filters with 0 inputs return
> their source bounds, instead of returning false.
>
> BUG=427251
>
> Committed: https://skia.googlesource.com/skia/+/ba036cc82b5a543a13cafd11a19ba0e3087fca38TBR=bsalomon@google.com,senorblanco@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=427251
Review URL: https://codereview.chromium.org/678273002
The SkRectShaderImageFilter had the same bug as previously fixed for
SkBitmapSource and SkPictureImageFilter. Rather than copy-and-paste
the implementation, this change makes all filters with 0 inputs return
their source bounds, instead of returning false.
BUG=427251
Review URL: https://codereview.chromium.org/681643003
- The expected case is now a single bulk-load insert() call instead of N;
- reserve() and flushDeferredInserts() can fold into insert() now;
- SkBBH subclasses may take ownership of the bounds
This appears to be a performance no-op on both my Mac and N5. I guess
even the simplest indirect branch predictor ("same as last time") can predict
the repeated virtual calls to SkBBH::insert() perfectly.
BUG=skia:
Review URL: https://codereview.chromium.org/670213002
This is basically how blink uses the filter. Currently, I can't use it for "ShadowOnly" mode with the filter at all, but instead of copying the code and risking to have the codepaths diverge, I'm simply going to add the option here.
BUG=skia:
Review URL: https://codereview.chromium.org/646213004
Reason for revert:
Test is SkASSERTing on Macs, e.g:
http://chromegw.corp.google.com/i/client.skia/builders/Test-Mac10.6-MacMini4.1-GeForce320M-x86_64-Debug/builds/257/steps/dm/logs/stdio
210 tasks left 1737M peak 1ms test FrontBufferedStream../../src/ports/SkImageDecoder_CG.cpp:43: failed assertion "data"
Signal 11:
_sigtramp (+0x1a)
SkStreamToCGImageSource(SkStream*) (+0x62)
SkImageDecoder_CG::onDecode(SkStream*, SkBitmap*, SkImageDecoder::Mode) (+0x2e)
SkImageDecoder::decode(SkStream*, SkBitmap*, SkColorType, SkImageDecoder::Mode) (+0x81)
SkImageDecoder::DecodeStream(SkStreamRewindable*, SkBitmap*, SkColorType, SkImageDecoder::Mode, SkImageDecoder::Format*) (+0xff)
SkImageDecoder::DecodeStream(SkStreamRewindable*, SkBitmap*) (+0x31)
test_ShortFrontBufferedStream(skiatest::Reporter*) (+0x97)
skiatest::ShortFrontBufferedStreamClass::onRun(skiatest::Reporter*) (+0x19)
skiatest::Test::run() (+0x7c)
DM::CpuTestTask::draw() (+0x5a)
DM::CpuTask::run() (+0x9e)
non-virtual thunk to DM::CpuTask::run() (+0x1c)
(anonymous namespace)::ThreadPool::Loop(void*) (+0xf4)
thread_start(void*) (+0x54)
_pthread_start (+0x14b)
Original issue's description:
> Add test for new FrontBufferedStream behavior.
>
> Test for https://skia.googlesource.com/skia/+/dd5a1e094c19fa10202c37c50a1f799e5af5dac0
>
> Verify that FrontBufferedStream does not attempt to read beyond the
> end of its underlying stream.
>
> Committed: https://skia.googlesource.com/skia/+/da59f05c6738dbb9a92cad21c608cdfae53a76b2TBR=reed@google.com,scroggo@google.com
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/649553003
CanvasTest only checks if the state of the different canvas
implementations are consistent with the one of the default
implementation.
Because most of the draw calls are stateless and already tested in GMs
the test steps that exercices them are not useful.
BUG=skia:3054
Review URL: https://codereview.chromium.org/672273002
Add a new enum to differentiate between a complete decode and a
partial decode (with the third value being failure). Return this
value from SkImageDecoder::onDecode (in all subclasses, plus
SkImageDecoder_empty) and ::decode.
For convenience, if the enum is treated as a boolean, success and
partial success are both considered true.
Note that the static helper functions (DecodeFile etc) still return
true and false (for one thing, this allows us to continue to use
SkImageDecoder::DecodeMemory as an SkPicture::InstallPixelRefProc in
SkPicture::CreateFromStream).
Also correctly report failure in SkASTCImageDecoder::onDecode when
SkTextureCompressor::DecompressBufferFromFormat fails.
BUG=skia:3037
BUG:b/17419670
Review URL: https://codereview.chromium.org/647023006
Add a unique-per-subclass namespace tag to make Keys from different
domains comparable.
Also drop the SkPictureShader cache and convert to using the global
resource cache instead.
R=reed@google.com,mtklein@google.com,robertphillips@google.com
Review URL: https://codereview.chromium.org/668223002
The accumulated matrix state of any enclosing SkPictures must be stored separate from the picture-local CTM. Any setMatrix calls inside a layer need to replace the picture-local CTM but concatenate with the enclosing SkPicture transform state (and the transform state needed to translate the layer to the correct location in the cached GrTexture).
Review URL: https://codereview.chromium.org/639863005
Currently, the PDF backend does not support image filters (since PDF
does not have that functionality), so it simply removes them. This is
causing Chrome print preview to render incorrectly (see bug). The fix
here is to fall back to a raster device for image filters, as we used
to do in Blink. The resulting bitmap will be drawn to the destination
device as a normal main-memory-backed bitmap.
Note: this change invalidates the PDF results of all GMs containing
image filters (since they'll actually be rendered).
BUG=422144
Review URL: https://codereview.chromium.org/644323006
This is once again an issue related to logo fonts, so I don't
see any easy way to add a regression test for this.
BUG=424824
Review URL: https://codereview.chromium.org/665103002
This CL adds the clip region to the GPU layer hoisting image cache. It also switches back to the old caching behavior of using the entire CTM in the cache key rather then just the upper 2x2. This latter change is to focus more on hoisting rather then caching.
It also includes 2 smaller fixes:
a) layer's that have an image filter are no longer atlased (b.c. doing so complicates applying the image filter)
b) the result of clipping the layer's bounds to the current clip is used as the hoisted layer's size. This reduces the amount of pixels drawn to match a normal (non-hoisted) draw pass.
Review URL: https://codereview.chromium.org/640773004
Refactor SkGLContext to be actually extendable. Before, non-trivial subclass
would need to destroy the GL connection upon running the destructor. However,
the base class would run GL commands in its own destructor (with destroyed GL
connection)
Refactor so that SkGLContext subclass object creation is completely done by
the factory function. If the factory function returns a non-NULL ptr, it means the context
is usable.
The destruction is done with the destructor instead of virtual function called
upon destruction. Make the destructors not to call virtual functions, for
clarity.
Remove custom 1x1 FBO setup code from the base class. It appears not to be used
anymore.
BUG=skia:2992
Review URL: https://codereview.chromium.org/640283004