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