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 "GrDrawContext.h" | 18 #include "GrDrawContext.h" |
19 #include "GrContext.h" | 19 #include "GrContext.h" |
20 #include "GrSurfacePriv.h" | 20 #include "GrSurfacePriv.h" |
| 21 #include "GrTypes.h" |
21 | 22 |
22 class GrAccelData; | 23 class GrAccelData; |
23 class GrTextureProducer; | 24 class GrTextureProducer; |
24 struct GrCachedLayer; | 25 struct GrCachedLayer; |
25 | 26 |
26 /** | 27 /** |
27 * 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 |
28 * canvas. | 29 * canvas. |
29 */ | 30 */ |
30 class SK_API SkGpuDevice : public SkBaseDevice { | 31 class SK_API SkGpuDevice : public SkBaseDevice { |
(...skipping 14 matching lines...) Expand all Loading... |
45 */ | 46 */ |
46 static SkGpuDevice* Create(GrRenderTarget* target, int width, int height, | 47 static SkGpuDevice* Create(GrRenderTarget* target, int width, int height, |
47 const SkSurfaceProps*, InitContents); | 48 const SkSurfaceProps*, InitContents); |
48 | 49 |
49 /** | 50 /** |
50 * New device that will create an offscreen renderTarget based on the ImageI
nfo and | 51 * New device that will create an offscreen renderTarget based on the ImageI
nfo and |
51 * sampleCount. The Budgeted param controls whether the device's backing sto
re counts against | 52 * sampleCount. The Budgeted param controls whether the device's backing sto
re counts against |
52 * the resource cache budget. On failure, returns nullptr. | 53 * the resource cache budget. On failure, returns nullptr. |
53 */ | 54 */ |
54 static SkGpuDevice* Create(GrContext*, SkSurface::Budgeted, const SkImageInf
o&, | 55 static SkGpuDevice* Create(GrContext*, SkSurface::Budgeted, const SkImageInf
o&, |
55 int sampleCount, const SkSurfaceProps*, InitConte
nts); | 56 int sampleCount, const SkSurfaceProps*, |
| 57 InitContents, GrTextureStorageAllocator = GrTextu
reStorageAllocator()); |
56 | 58 |
57 ~SkGpuDevice() override {} | 59 ~SkGpuDevice() override {} |
58 | 60 |
59 SkGpuDevice* cloneDevice(const SkSurfaceProps& props) { | 61 SkGpuDevice* cloneDevice(const SkSurfaceProps& props) { |
60 SkBaseDevice* dev = this->onCreateDevice(CreateInfo(this->imageInfo(), k
Possible_TileUsage, | 62 SkBaseDevice* dev = this->onCreateDevice(CreateInfo(this->imageInfo(), k
Possible_TileUsage, |
61 props.pixelGeometry(
)), | 63 props.pixelGeometry(
)), |
62 nullptr); | 64 nullptr); |
63 return static_cast<SkGpuDevice*>(dev); | 65 return static_cast<SkGpuDevice*>(dev); |
64 } | 66 } |
65 | 67 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 const SkMatrix& srcToDstMatrix, | 250 const SkMatrix& srcToDstMatrix, |
249 const GrClip&, | 251 const GrClip&, |
250 const SkPaint&); | 252 const SkPaint&); |
251 | 253 |
252 void drawProducerNine(const SkDraw&, GrTextureProducer*, const SkIRect& cent
er, | 254 void drawProducerNine(const SkDraw&, GrTextureProducer*, const SkIRect& cent
er, |
253 const SkRect& dst, const SkPaint&); | 255 const SkRect& dst, const SkPaint&); |
254 | 256 |
255 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); | 257 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); |
256 | 258 |
257 static GrRenderTarget* CreateRenderTarget(GrContext*, SkSurface::Budgeted, c
onst SkImageInfo&, | 259 static GrRenderTarget* CreateRenderTarget(GrContext*, SkSurface::Budgeted, c
onst SkImageInfo&, |
258 int sampleCount); | 260 int sampleCount, GrTextureStorageA
llocator); |
259 | 261 |
260 friend class GrAtlasTextContext; | 262 friend class GrAtlasTextContext; |
261 friend class SkSurface_Gpu; // for access to surfaceProps | 263 friend class SkSurface_Gpu; // for access to surfaceProps |
262 typedef SkBaseDevice INHERITED; | 264 typedef SkBaseDevice INHERITED; |
263 }; | 265 }; |
264 | 266 |
265 #endif | 267 #endif |
OLD | NEW |