SKPSlide.h 717 B

12345678910111213141516171819202122232425262728293031
  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. #ifndef SKPSlide_DEFINED
  8. #define SKPSlide_DEFINED
  9. #include "include/core/SkPicture.h"
  10. #include "tools/viewer/Slide.h"
  11. class SKPSlide : public Slide {
  12. public:
  13. SKPSlide(const SkString& name, const SkString& path);
  14. ~SKPSlide() override;
  15. SkISize getDimensions() const override { return fCullRect.size(); }
  16. void draw(SkCanvas* canvas) override;
  17. void load(SkScalar winWidth, SkScalar winHeight) override;
  18. void unload() override;
  19. private:
  20. SkString fPath;
  21. sk_sp<const SkPicture> fPic;
  22. SkIRect fCullRect;
  23. };
  24. #endif