| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 static SkGpuDevice* Create(GrSurface* surface, unsigned flags = 0); | 46 static SkGpuDevice* Create(GrSurface* surface, unsigned flags = 0); |
| 47 | 47 |
| 48 /** | 48 /** |
| 49 * New device that will create an offscreen renderTarget based on the | 49 * New device that will create an offscreen renderTarget based on the |
| 50 * ImageInfo and sampleCount. The device's storage will not | 50 * ImageInfo and sampleCount. The device's storage will not |
| 51 * count against the GrContext's texture cache budget. The device's pixels | 51 * count against the GrContext's texture cache budget. The device's pixels |
| 52 * will be uninitialized. On failure, returns NULL. | 52 * will be uninitialized. On failure, returns NULL. |
| 53 */ | 53 */ |
| 54 static SkGpuDevice* Create(GrContext*, const SkImageInfo&, int sampleCount); | 54 static SkGpuDevice* Create(GrContext*, const SkImageInfo&, int sampleCount); |
| 55 | 55 |
| 56 /** | |
| 57 * DEPRECATED -- need to make this private, call Create(surface) | |
| 58 * New device that will render to the specified renderTarget. | |
| 59 */ | |
| 60 SkGpuDevice(GrContext*, GrRenderTarget*, unsigned flags = 0); | |
| 61 | |
| 62 /** | |
| 63 * DEPRECATED -- need to make this private, call Create(surface) | |
| 64 * New device that will render to the texture (as a rendertarget). | |
| 65 * The GrTexture's asRenderTarget() must be non-NULL or device will not | |
| 66 * function. | |
| 67 */ | |
| 68 SkGpuDevice(GrContext*, GrTexture*, unsigned flags = 0); | |
| 69 | |
| 70 virtual ~SkGpuDevice(); | 56 virtual ~SkGpuDevice(); |
| 71 | 57 |
| 72 GrContext* context() const { return fContext; } | 58 GrContext* context() const { return fContext; } |
| 73 | 59 |
| 74 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE; | 60 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE; |
| 75 | 61 |
| 76 virtual SkImageInfo imageInfo() const SK_OVERRIDE { | 62 virtual SkImageInfo imageInfo() const SK_OVERRIDE { |
| 77 return fRenderTarget ? fRenderTarget->info() : SkImageInfo::MakeUnknown(
); | 63 return fRenderTarget ? fRenderTarget->info() : SkImageInfo::MakeUnknown(
); |
| 78 } | 64 } |
| 79 | 65 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 GrTextContext* fMainTextContext; | 153 GrTextContext* fMainTextContext; |
| 168 GrTextContext* fFallbackTextContext; | 154 GrTextContext* fFallbackTextContext; |
| 169 | 155 |
| 170 // state for our render-target | 156 // state for our render-target |
| 171 GrRenderTarget* fRenderTarget; | 157 GrRenderTarget* fRenderTarget; |
| 172 bool fNeedClear; | 158 bool fNeedClear; |
| 173 | 159 |
| 174 // remove when our clients don't rely on accessBitmap() | 160 // remove when our clients don't rely on accessBitmap() |
| 175 SkBitmap fLegacyBitmap; | 161 SkBitmap fLegacyBitmap; |
| 176 | 162 |
| 163 SkGpuDevice(GrContext*, GrRenderTarget*, unsigned flags = 0); |
| 164 |
| 165 SkGpuDevice(GrContext*, GrTexture*, unsigned flags = 0); |
| 166 |
| 177 // called from rt and tex cons | 167 // called from rt and tex cons |
| 178 void initFromRenderTarget(GrContext*, GrRenderTarget*, unsigned flags); | 168 void initFromRenderTarget(GrContext*, GrRenderTarget*, unsigned flags); |
| 179 | 169 |
| 180 virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE; | 170 virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE; |
| 181 | 171 |
| 182 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; | 172 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; |
| 183 | 173 |
| 184 virtual SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE; | 174 virtual SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE; |
| 185 | 175 |
| 186 // sets the render target, clip, and matrix on GrContext. Use forceIdenity t
o override | 176 // sets the render target, clip, and matrix on GrContext. Use forceIdenity t
o override |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 bool bicubic); | 216 bool bicubic); |
| 227 | 217 |
| 228 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); | 218 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); |
| 229 | 219 |
| 230 static SkPicture::AccelData::Key ComputeAccelDataKey(); | 220 static SkPicture::AccelData::Key ComputeAccelDataKey(); |
| 231 | 221 |
| 232 typedef SkBaseDevice INHERITED; | 222 typedef SkBaseDevice INHERITED; |
| 233 }; | 223 }; |
| 234 | 224 |
| 235 #endif | 225 #endif |
| OLD | NEW |