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 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 * different than its actual width/height (e.g., approx-match scratch textur
e). | 45 * different than its actual width/height (e.g., approx-match scratch textur
e). |
46 */ | 46 */ |
47 static SkGpuDevice* Create(GrRenderTarget* target, int width, int height, | 47 static SkGpuDevice* Create(GrRenderTarget* target, int width, int height, |
48 const SkSurfaceProps*, InitContents); | 48 const SkSurfaceProps*, InitContents); |
49 | 49 |
50 /** | 50 /** |
51 * 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 |
52 * 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 |
53 * the resource cache budget. On failure, returns nullptr. | 53 * the resource cache budget. On failure, returns nullptr. |
54 */ | 54 */ |
55 static SkGpuDevice* Create(GrContext*, SkBudgeted, const SkImageInfo&, | 55 static SkGpuDevice* Create(GrContext*, SkSurface::Budgeted, const SkImageInf
o&, |
56 int sampleCount, const SkSurfaceProps*, | 56 int sampleCount, const SkSurfaceProps*, |
57 InitContents, GrTextureStorageAllocator = GrTextu
reStorageAllocator()); | 57 InitContents, GrTextureStorageAllocator = GrTextu
reStorageAllocator()); |
58 | 58 |
59 ~SkGpuDevice() override {} | 59 ~SkGpuDevice() override {} |
60 | 60 |
61 SkGpuDevice* cloneDevice(const SkSurfaceProps& props) { | 61 SkGpuDevice* cloneDevice(const SkSurfaceProps& props) { |
62 SkBaseDevice* dev = this->onCreateDevice(CreateInfo(this->imageInfo(), k
Possible_TileUsage, | 62 SkBaseDevice* dev = this->onCreateDevice(CreateInfo(this->imageInfo(), k
Possible_TileUsage, |
63 props.pixelGeometry(
)), | 63 props.pixelGeometry(
)), |
64 nullptr); | 64 nullptr); |
65 return static_cast<SkGpuDevice*>(dev); | 65 return static_cast<SkGpuDevice*>(dev); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 const SkMatrix& viewMatrix, | 249 const SkMatrix& viewMatrix, |
250 const SkMatrix& srcToDstMatrix, | 250 const SkMatrix& srcToDstMatrix, |
251 const GrClip&, | 251 const GrClip&, |
252 const SkPaint&); | 252 const SkPaint&); |
253 | 253 |
254 void drawProducerNine(const SkDraw&, GrTextureProducer*, const SkIRect& cent
er, | 254 void drawProducerNine(const SkDraw&, GrTextureProducer*, const SkIRect& cent
er, |
255 const SkRect& dst, const SkPaint&); | 255 const SkRect& dst, const SkPaint&); |
256 | 256 |
257 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); | 257 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); |
258 | 258 |
259 static GrRenderTarget* CreateRenderTarget(GrContext*, SkBudgeted, const SkIm
ageInfo&, | 259 static GrRenderTarget* CreateRenderTarget(GrContext*, SkSurface::Budgeted, c
onst SkImageInfo&, |
260 int sampleCount, GrTextureStorageA
llocator); | 260 int sampleCount, GrTextureStorageA
llocator); |
261 | 261 |
262 friend class GrAtlasTextContext; | 262 friend class GrAtlasTextContext; |
263 friend class SkSurface_Gpu; // for access to surfaceProps | 263 friend class SkSurface_Gpu; // for access to surfaceProps |
264 typedef SkBaseDevice INHERITED; | 264 typedef SkBaseDevice INHERITED; |
265 }; | 265 }; |
266 | 266 |
267 #endif | 267 #endif |
OLD | NEW |