Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: experimental/SkiaExamples/SkExample.h

Issue 23453031: Rewrite SkTRegistry to take any trivially-copyable type. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: reed+scroggo Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « bench/SkBenchmark.h ('k') | gm/gm.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « bench/SkBenchmark.h ('k') | gm/gm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698