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