Correctly initialize LayerIter's cached device origin.
Previously, LayerIter called the base device iterator's next() call during initialization. However, its next() call should be called instead, since it does both the base device iterator.next() AND caches the device's reported origin. Without calling this->next(), the first device's origin would never be fetched and the layer would report an incorrect origin. Bug: b/151328374 Change-Id: I889673e2e93e54618544d62333bd9d04438bea00 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279420 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
This commit is contained in:
parent
fd89e0bdd0
commit
2a8a3ff04e
@ -2969,7 +2969,9 @@ SkCanvas::LayerIter::LayerIter(SkCanvas* canvas) {
|
||||
SkASSERT(canvas);
|
||||
|
||||
fImpl = new (fStorage) SkDrawIter(canvas);
|
||||
fDone = !fImpl->next();
|
||||
// This advances the base iterator to the first device and caches its origin,
|
||||
// correctly handling the case where there are no devices.
|
||||
this->next();
|
||||
}
|
||||
|
||||
SkCanvas::LayerIter::~LayerIter() {
|
||||
|
Loading…
Reference in New Issue
Block a user