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

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

Issue 18574002: SkiaExamples improvements. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Support for multiple SkExamples Created 7 years, 5 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 | « no previous file | experimental/SkiaExamples/BaseExample.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 *
8 */
9
10 #ifndef BaseExample_DEFINED
11 #define BaseExample_DEFINED
12
13 #include "SkWindow.h"
14
15 class GrContext;
16 struct GrGLInterface;
17 class GrRenderTarget;
18 class SkCanvas;
19
20 class BaseExample : public SkOSWindow {
21 public:
22 enum DeviceType {
23 kRaster_DeviceType,
24 kGPU_DeviceType,
25 };
26 BaseExample(void* hWnd, int argc, char** argv);
27
28 // Changes the device type of the object.
29 bool setupBackend(DeviceType type);
30 void tearDownBackend();
31
32 DeviceType getDeviceType() const { return fType; }
33
34 protected:
35 // Your class should override this method to do its thing.
36 virtual void draw(SkCanvas* canvas) SK_OVERRIDE;
37
38 virtual void onSizeChange() SK_OVERRIDE;
39
40 #ifdef SK_BUILD_FOR_WIN
41 virtual void onHandleInval(const SkIRect&) SK_OVERRIDE;
42 #endif
43
44 SkCanvas* createCanvas() SK_OVERRIDE;
45
46 private:
47 void setupRenderTarget();
48
49 DeviceType fType;
50
51 GrContext* fContext;
52 GrRenderTarget* fRenderTarget;
53 AttachmentInfo fAttachmentInfo;
54 const GrGLInterface* fInterface;
55 typedef SkOSWindow INHERITED;
56 };
57 #endif
OLDNEW
« no previous file with comments | « no previous file | experimental/SkiaExamples/BaseExample.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698