OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
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 #ifndef SkGpuDevice_DEFINED | 9 #ifndef SkGpuDevice_DEFINED |
10 #define SkGpuDevice_DEFINED | 10 #define SkGpuDevice_DEFINED |
11 | 11 |
12 #include "SkGr.h" | 12 #include "SkGr.h" |
13 #include "SkBitmap.h" | 13 #include "SkBitmap.h" |
14 #include "SkDevice.h" | 14 #include "SkDevice.h" |
15 #include "SkPicture.h" | 15 #include "SkPicture.h" |
16 #include "SkRegion.h" | 16 #include "SkRegion.h" |
17 #include "SkSurface.h" | 17 #include "SkSurface.h" |
18 #include "GrContext.h" | 18 #include "GrContext.h" |
19 #include "GrSurfacePriv.h" | 19 #include "GrSurfacePriv.h" |
20 | 20 |
21 struct SkDrawProcs; | 21 struct SkDrawProcs; |
22 struct GrSkDrawProcs; | 22 struct GrSkDrawProcs; |
23 | 23 |
24 class GrAccelData; | 24 class GrAccelData; |
25 struct GrCachedLayer; | 25 struct GrCachedLayer; |
26 class GrTextContext; | |
27 | 26 |
28 /** | 27 /** |
29 * Subclass of SkBaseDevice, which directs all drawing to the GrGpu owned by th
e | 28 * Subclass of SkBaseDevice, which directs all drawing to the GrGpu owned by th
e |
30 * canvas. | 29 * canvas. |
31 */ | 30 */ |
32 class SK_API SkGpuDevice : public SkBaseDevice { | 31 class SK_API SkGpuDevice : public SkBaseDevice { |
33 public: | 32 public: |
34 enum Flags { | 33 enum Flags { |
35 kNeedClear_Flag = 1 << 0, //!< Surface requires an initial clear | 34 kNeedClear_Flag = 1 << 0, //!< Surface requires an initial clear |
36 }; | 35 }; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 /** PRIVATE / EXPERIMENTAL -- do not call */ | 142 /** PRIVATE / EXPERIMENTAL -- do not call */ |
144 virtual bool EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* pic
ture, | 143 virtual bool EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* pic
ture, |
145 const SkMatrix*, const SkPaint*) overr
ide; | 144 const SkMatrix*, const SkPaint*) overr
ide; |
146 | 145 |
147 private: | 146 private: |
148 GrContext* fContext; | 147 GrContext* fContext; |
149 GrSkDrawProcs* fDrawProcs; | 148 GrSkDrawProcs* fDrawProcs; |
150 SkAutoTUnref<const SkClipStack> fClipStack; | 149 SkAutoTUnref<const SkClipStack> fClipStack; |
151 SkIPoint fClipOrigin; | 150 SkIPoint fClipOrigin; |
152 GrClip fClip; | 151 GrClip fClip; |
153 GrTextContext* fTextContext; | |
154 SkAutoTUnref<GrDrawContext> fDrawContext; | 152 SkAutoTUnref<GrDrawContext> fDrawContext; |
155 SkSurfaceProps fSurfaceProps; | 153 SkSurfaceProps fSurfaceProps; |
156 GrRenderTarget* fRenderTarget; | 154 GrRenderTarget* fRenderTarget; |
157 // remove when our clients don't rely on accessBitmap() | 155 // remove when our clients don't rely on accessBitmap() |
158 SkBitmap fLegacyBitmap; | 156 SkBitmap fLegacyBitmap; |
159 bool fNeedClear; | 157 bool fNeedClear; |
160 | 158 |
161 SkGpuDevice(GrRenderTarget*, int width, int height, const SkSurfaceProps*, u
nsigned flags); | 159 SkGpuDevice(GrRenderTarget*, int width, int height, const SkSurfaceProps*, u
nsigned flags); |
162 | 160 |
163 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; | 161 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 SkCanvas::DrawBitmapRectFlags flags, | 209 SkCanvas::DrawBitmapRectFlags flags, |
212 int tileSize, | 210 int tileSize, |
213 bool bicubic); | 211 bool bicubic); |
214 | 212 |
215 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); | 213 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); |
216 | 214 |
217 static GrRenderTarget* CreateRenderTarget(GrContext*, SkSurface::Budgeted, c
onst SkImageInfo&, | 215 static GrRenderTarget* CreateRenderTarget(GrContext*, SkSurface::Budgeted, c
onst SkImageInfo&, |
218 int sampleCount); | 216 int sampleCount); |
219 | 217 |
220 friend class GrAtlasTextContext; | 218 friend class GrAtlasTextContext; |
221 friend class GrTextContext; | |
222 typedef SkBaseDevice INHERITED; | 219 typedef SkBaseDevice INHERITED; |
223 }; | 220 }; |
224 | 221 |
225 #endif | 222 #endif |
OLD | NEW |