Reapply "[rust png] Extract `SkPngEncoderBase::onEncodeRows`."

This reverts commit ccfe075e1eb8dad8a32abcacf9f5940fa0f9fdcf.  This is
effectively a reland of http://review.skia.org/923336 that also includes
a Bazel fix from http://review.skia.org/927418.

Original CL description follows:

This CL extracts some `src/encode/SkPngEncoderImpl.cpp` code and moves
it into a reusable `src/encode/SkPngEncoderBase.h/.cpp` (continuing the
effort from http://review.skia.org/922676).  In particular,
`SkPngEncoderImpl::onEncodeRows` has been moved into
`SkPngEncoderBase::onEncodeRows` and the `libpng`-specific parts have
been abstracted away into `onEncodeRow` and `onFinishEncode` virtual
methods.  The motivation is the desire to reuse this code from
`SkPngRustEncoderImpl` in a future CL.

Bug: chromium:379312510
Bug: b/382576498
Change-Id: I23214cfbebf4d01d217a01649f9a28578544fca7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/927457
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Ɓukasz Anforowicz <lukasza@google.com>
5 files changed