1/* 2* Copyright 2016 Google Inc. 3* 4* Use of this source code is governed by a BSD-style license that can be 5* found in the LICENSE file. 6*/ 7 8#ifndef SKPSlide_DEFINED 9#define SKPSlide_DEFINED 10 11#include "include/core/SkPicture.h" 12#include "tools/viewer/Slide.h" 13 14class SKPSlide : public Slide { 15public: 16 SKPSlide(const SkString& name, const SkString& path); 17 SKPSlide(const SkString& name, std::unique_ptr<SkStream>); 18 ~SKPSlide() override; 19 20 SkISize getDimensions() const override { return fCullRect.size(); } 21 22 void draw(SkCanvas* canvas) override; 23 void load(SkScalar winWidth, SkScalar winHeight) override; 24 void unload() override; 25 26private: 27 std::unique_ptr<SkStream> fStream; 28 sk_sp<const SkPicture> fPic; 29 SkIRect fCullRect; 30}; 31 32#endif 33