OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 SkSurface_Gpu_DEFINED | 8 #ifndef SkSurface_Gpu_DEFINED |
9 #define SkSurface_Gpu_DEFINED | 9 #define SkSurface_Gpu_DEFINED |
10 | 10 |
11 #include "SkSurface_Base.h" | 11 #include "SkSurface_Base.h" |
12 | 12 |
13 #if SK_SUPPORT_GPU | 13 #if SK_SUPPORT_GPU |
14 | 14 |
15 class SkGpuDevice; | 15 class SkGpuDevice; |
16 | 16 |
17 class SkSurface_Gpu : public SkSurface_Base { | 17 class SkSurface_Gpu : public SkSurface_Base { |
18 public: | 18 public: |
19 SK_DECLARE_INST_COUNT(SkSurface_Gpu) | 19 SK_DECLARE_INST_COUNT(SkSurface_Gpu) |
20 | 20 |
21 SkSurface_Gpu(GrRenderTarget*, const SkSurfaceProps*, bool doClear); | 21 SkSurface_Gpu(GrRenderTarget*, const SkSurfaceProps*, bool doClear); |
22 virtual ~SkSurface_Gpu(); | 22 virtual ~SkSurface_Gpu(); |
23 | 23 |
24 virtual SkCanvas* onNewCanvas() SK_OVERRIDE; | 24 SkCanvas* onNewCanvas() SK_OVERRIDE; |
25 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE; | 25 SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE; |
26 virtual SkImage* onNewImageSnapshot() SK_OVERRIDE; | 26 SkImage* onNewImageSnapshot() SK_OVERRIDE; |
27 virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y, | 27 virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y, |
28 const SkPaint*) SK_OVERRIDE; | 28 const SkPaint*) SK_OVERRIDE; |
29 virtual void onCopyOnWrite(ContentChangeMode) SK_OVERRIDE; | 29 void onCopyOnWrite(ContentChangeMode) SK_OVERRIDE; |
30 virtual void onDiscard() SK_OVERRIDE; | 30 void onDiscard() SK_OVERRIDE; |
31 | 31 |
32 SkGpuDevice* getDevice() { return fDevice; } | 32 SkGpuDevice* getDevice() { return fDevice; } |
33 | 33 |
34 private: | 34 private: |
35 SkGpuDevice* fDevice; | 35 SkGpuDevice* fDevice; |
36 | 36 |
37 typedef SkSurface_Base INHERITED; | 37 typedef SkSurface_Base INHERITED; |
38 }; | 38 }; |
39 | 39 |
40 #endif // SK_SUPPORT_GPU | 40 #endif // SK_SUPPORT_GPU |
41 | 41 |
42 #endif // SkSurface_Gpu_DEFINED | 42 #endif // SkSurface_Gpu_DEFINED |
OLD | NEW |