OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef Slide_DEFINED | 8 #ifndef Slide_DEFINED |
9 #define Slide_DEFINED | 9 #define Slide_DEFINED |
10 | 10 |
11 #include "SkRefCnt.h" | 11 #include "SkRefCnt.h" |
12 #include "SkSize.h" | 12 #include "SkSize.h" |
13 #include "SkString.h" | 13 #include "SkString.h" |
14 | 14 |
15 class SkCanvas; | 15 class SkCanvas; |
16 class SkAnimTimer; | 16 class SkAnimTimer; |
17 | 17 |
18 class Slide : public SkRefCnt { | 18 class Slide : public SkRefCnt { |
19 public: | 19 public: |
20 virtual ~Slide() {} | 20 virtual ~Slide() {} |
21 | 21 |
22 virtual SkISize getDimensions() const = 0; | 22 virtual SkISize getDimensions() const { |
| 23 return SkISize::Make(0, 0); |
| 24 } |
23 | 25 |
24 virtual void draw(SkCanvas* canvas) = 0; | 26 virtual void draw(SkCanvas* canvas) = 0; |
25 virtual bool animate(const SkAnimTimer&) { return false; } | 27 virtual bool animate(const SkAnimTimer&) { return false; } |
26 virtual void load() {} | 28 virtual void load(SkScalar winWidth, SkScalar winHeight) {} |
27 virtual void unload() {} | 29 virtual void unload() {} |
28 | 30 |
29 SkString getName() { return fName; } | 31 SkString getName() { return fName; } |
30 | 32 |
31 protected: | 33 protected: |
32 SkString fName; | 34 SkString fName; |
33 }; | 35 }; |
34 | 36 |
35 | 37 |
36 #endif | 38 #endif |
OLD | NEW |