24df67d04e
This is a reland of dd29e20904
Original change's description:
> [svg] Plumb a ResourceProvider
>
> ... for image loading.
>
> Update the SVG tools to pass local/FS resource providers.
>
> Change-Id: I2c0e446047da87f177fde0f23b7ea1f0a856e808
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359996
> Commit-Queue: Florin Malita <fmalita@google.com>
> Reviewed-by: Tyler Denniston <tdenniston@google.com>
Change-Id: I28de60b299fc89f46b090812fc632105143fb6da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360607
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
36 lines
745 B
C++
36 lines
745 B
C++
/*
|
|
* Copyright 2018 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef SvgSlide_DEFINED
|
|
#define SvgSlide_DEFINED
|
|
|
|
#include "tools/viewer/Slide.h"
|
|
|
|
class SkSVGDOM;
|
|
|
|
class SvgSlide final : public Slide {
|
|
public:
|
|
SvgSlide(const SkString& name, const SkString& path);
|
|
|
|
void load(SkScalar winWidth, SkScalar winHeight) override;
|
|
void unload() override;
|
|
void resize(SkScalar, SkScalar) override;
|
|
|
|
SkISize getDimensions() const override;
|
|
|
|
void draw(SkCanvas*) override;
|
|
private:
|
|
const SkString fPath;
|
|
|
|
SkSize fWinSize = SkSize::MakeEmpty();
|
|
sk_sp<SkSVGDOM> fDom;
|
|
|
|
using INHERITED = Slide;
|
|
};
|
|
|
|
#endif // SvgSlide_DEFINED
|