OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 * | 7 * |
8 */ | 8 */ |
9 | 9 |
10 #ifndef SkExample_DEFINED | 10 #ifndef SkExample_DEFINED |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 class SkExample : public SkNoncopyable { | 22 class SkExample : public SkNoncopyable { |
23 public: | 23 public: |
24 SkExample(SkExampleWindow* window) : fWindow(window) {} | 24 SkExample(SkExampleWindow* window) : fWindow(window) {} |
25 | 25 |
26 // Your class should override this method to do its thing. | 26 // Your class should override this method to do its thing. |
27 virtual void draw(SkCanvas* canvas) = 0; | 27 virtual void draw(SkCanvas* canvas) = 0; |
28 | 28 |
29 SkString getName() { return fName; }; | 29 SkString getName() { return fName; }; |
30 // Use this public registry to tell the world about your sample. | 30 // Use this public registry to tell the world about your sample. |
31 typedef SkTRegistry<SkExample*, SkExampleWindow*> Registry; | 31 typedef SkTRegistry<SkExample*(*)(SkExampleWindow*)> Registry; |
32 | 32 |
33 protected: | 33 protected: |
34 SkExampleWindow* fWindow; | 34 SkExampleWindow* fWindow; |
35 SkString fName; | 35 SkString fName; |
36 }; | 36 }; |
37 | 37 |
38 class SkExampleWindow : public SkOSWindow { | 38 class SkExampleWindow : public SkOSWindow { |
39 public: | 39 public: |
40 enum DeviceType { | 40 enum DeviceType { |
41 kRaster_DeviceType, | 41 kRaster_DeviceType, |
(...skipping 29 matching lines...) Expand all Loading... |
71 const SkExample::Registry* fRegistry; | 71 const SkExample::Registry* fRegistry; |
72 GrContext* fContext; | 72 GrContext* fContext; |
73 GrRenderTarget* fRenderTarget; | 73 GrRenderTarget* fRenderTarget; |
74 AttachmentInfo fAttachmentInfo; | 74 AttachmentInfo fAttachmentInfo; |
75 const GrGLInterface* fInterface; | 75 const GrGLInterface* fInterface; |
76 | 76 |
77 typedef SkOSWindow INHERITED; | 77 typedef SkOSWindow INHERITED; |
78 }; | 78 }; |
79 | 79 |
80 #endif | 80 #endif |
OLD | NEW |