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 | 9 |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 public: | 30 public: |
31 | 31 |
32 /** | 32 /** |
33 * Creates an SkGpuDevice from a GrSurface. This will fail if the surface is
not a render | 33 * Creates an SkGpuDevice from a GrSurface. This will fail if the surface is
not a render |
34 * target. The caller owns a ref on the returned device. | 34 * target. The caller owns a ref on the returned device. |
35 */ | 35 */ |
36 static SkGpuDevice* Create(GrSurface* surface); | 36 static SkGpuDevice* Create(GrSurface* surface); |
37 | 37 |
38 /** | 38 /** |
39 * New device that will create an offscreen renderTarget based on the | 39 * New device that will create an offscreen renderTarget based on the |
| 40 * ImageInfo and sampleCount. The device's storage will not |
| 41 * count against the GrContext's texture cache budget. The device's pixels |
| 42 * will be uninitialized. On failure, returns NULL. |
| 43 */ |
| 44 static SkGpuDevice* Create(GrContext*, const SkImageInfo&, int sampleCount); |
| 45 |
| 46 #ifdef SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG |
| 47 /** |
| 48 * New device that will create an offscreen renderTarget based on the |
40 * config, width, height, and sampleCount. The device's storage will not | 49 * config, width, height, and sampleCount. The device's storage will not |
41 * count against the GrContext's texture cache budget. The device's pixels | 50 * count against the GrContext's texture cache budget. The device's pixels |
42 * will be uninitialized. TODO: This can fail, replace with a factory funct
ion. | 51 * will be uninitialized. TODO: This can fail, replace with a factory funct
ion. |
43 */ | 52 */ |
44 SkGpuDevice(GrContext*, SkBitmap::Config, int width, int height, int sampleC
ount = 0); | 53 SkGpuDevice(GrContext*, SkBitmap::Config, int width, int height, int sampleC
ount = 0); |
| 54 #endif |
45 | 55 |
46 /** | 56 /** |
47 * DEPRECATED -- need to make this private, call Create(surface) | 57 * DEPRECATED -- need to make this private, call Create(surface) |
48 * New device that will render to the specified renderTarget. | 58 * New device that will render to the specified renderTarget. |
49 */ | 59 */ |
50 SkGpuDevice(GrContext*, GrRenderTarget*); | 60 SkGpuDevice(GrContext*, GrRenderTarget*); |
51 | 61 |
52 /** | 62 /** |
53 * DEPRECATED -- need to make this private, call Create(surface) | 63 * DEPRECATED -- need to make this private, call Create(surface) |
54 * New device that will render to the texture (as a rendertarget). | 64 * New device that will render to the texture (as a rendertarget). |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // state for our render-target | 166 // state for our render-target |
157 GrRenderTarget* fRenderTarget; | 167 GrRenderTarget* fRenderTarget; |
158 bool fNeedClear; | 168 bool fNeedClear; |
159 | 169 |
160 // called from rt and tex cons | 170 // called from rt and tex cons |
161 void initFromRenderTarget(GrContext*, GrRenderTarget*, bool cached); | 171 void initFromRenderTarget(GrContext*, GrRenderTarget*, bool cached); |
162 | 172 |
163 // used by createCompatibleDevice | 173 // used by createCompatibleDevice |
164 SkGpuDevice(GrContext*, GrTexture* texture, bool needClear); | 174 SkGpuDevice(GrContext*, GrTexture* texture, bool needClear); |
165 | 175 |
166 // override from SkBaseDevice | 176 virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE; |
167 virtual SkBaseDevice* onCreateCompatibleDevice(SkBitmap::Config config, | |
168 int width, int height, | |
169 bool isOpaque, | |
170 Usage usage) SK_OVERRIDE; | |
171 | 177 |
172 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; | 178 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; |
173 | 179 |
174 // sets the render target, clip, and matrix on GrContext. Use forceIdenity t
o override | 180 // sets the render target, clip, and matrix on GrContext. Use forceIdenity t
o override |
175 // SkDraw's matrix and draw in device coords. | 181 // SkDraw's matrix and draw in device coords. |
176 void prepareDraw(const SkDraw&, bool forceIdentity); | 182 void prepareDraw(const SkDraw&, bool forceIdentity); |
177 | 183 |
178 /** | 184 /** |
179 * Implementation for both drawBitmap and drawBitmapRect. | 185 * Implementation for both drawBitmap and drawBitmapRect. |
180 */ | 186 */ |
(...skipping 28 matching lines...) Expand all Loading... |
209 const GrTextureParams& params, | 215 const GrTextureParams& params, |
210 const SkPaint& paint, | 216 const SkPaint& paint, |
211 SkCanvas::DrawBitmapRectFlags flags, | 217 SkCanvas::DrawBitmapRectFlags flags, |
212 int tileSize, | 218 int tileSize, |
213 bool bicubic); | 219 bool bicubic); |
214 | 220 |
215 typedef SkBitmapDevice INHERITED; | 221 typedef SkBitmapDevice INHERITED; |
216 }; | 222 }; |
217 | 223 |
218 #endif | 224 #endif |
OLD | NEW |