2016-04-08 14:24:09 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SKPSlide_DEFINED
|
|
|
|
#define SKPSlide_DEFINED
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkPicture.h"
|
|
|
|
#include "tools/viewer/Slide.h"
|
2016-04-08 14:24:09 +00:00
|
|
|
|
|
|
|
class SKPSlide : public Slide {
|
|
|
|
public:
|
2016-04-08 19:51:45 +00:00
|
|
|
SKPSlide(const SkString& name, const SkString& path);
|
2020-05-27 23:31:12 +00:00
|
|
|
SKPSlide(const SkString& name, std::unique_ptr<SkStream>);
|
2016-04-08 14:24:09 +00:00
|
|
|
~SKPSlide() override;
|
|
|
|
|
2016-04-21 14:59:44 +00:00
|
|
|
SkISize getDimensions() const override { return fCullRect.size(); }
|
|
|
|
|
2016-04-08 14:24:09 +00:00
|
|
|
void draw(SkCanvas* canvas) override;
|
2016-06-16 16:52:35 +00:00
|
|
|
void load(SkScalar winWidth, SkScalar winHeight) override;
|
2016-04-08 19:51:45 +00:00
|
|
|
void unload() override;
|
2016-04-08 14:24:09 +00:00
|
|
|
|
|
|
|
private:
|
2020-05-27 23:31:12 +00:00
|
|
|
std::unique_ptr<SkStream> fStream;
|
2016-04-08 14:24:09 +00:00
|
|
|
sk_sp<const SkPicture> fPic;
|
2020-05-27 23:31:12 +00:00
|
|
|
SkIRect fCullRect;
|
2016-04-08 14:24:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|