| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 44      * New device that will create an offscreen renderTarget based on the ImageI
     nfo and | 44      * New device that will create an offscreen renderTarget based on the ImageI
     nfo and | 
| 45      * sampleCount. The Budgeted param controls whether the device's backing sto
     re counts against | 45      * sampleCount. The Budgeted param controls whether the device's backing sto
     re counts against | 
| 46      * the resource cache budget. On failure, returns NULL. | 46      * the resource cache budget. On failure, returns NULL. | 
| 47      */ | 47      */ | 
| 48     static SkGpuDevice* Create(GrContext*, SkSurface::Budgeted, const SkImageInf
     o&, | 48     static SkGpuDevice* Create(GrContext*, SkSurface::Budgeted, const SkImageInf
     o&, | 
| 49                                int sampleCount, const SkSurfaceProps*, unsigned 
     flags = 0); | 49                                int sampleCount, const SkSurfaceProps*, unsigned 
     flags = 0); | 
| 50 | 50 | 
| 51     virtual ~SkGpuDevice(); | 51     virtual ~SkGpuDevice(); | 
| 52 | 52 | 
| 53     SkGpuDevice* cloneDevice(const SkSurfaceProps& props) { | 53     SkGpuDevice* cloneDevice(const SkSurfaceProps& props) { | 
| 54         SkBaseDevice* dev = this->onCreateDevice(CreateInfo(this->imageInfo(), k
     Possible_TileUsage, | 54         SkBaseDevice* dev = this->onCreateCompatibleDevice(CreateInfo(this->imag
     eInfo(), | 
| 55                                                             props.pixelGeometry(
     )), | 55                                                                       kGeneral_U
     sage, | 
| 56                                                  NULL); | 56                                                                       props.pixe
     lGeometry())); | 
| 57         return static_cast<SkGpuDevice*>(dev); | 57         return static_cast<SkGpuDevice*>(dev); | 
| 58     } | 58     } | 
| 59 | 59 | 
| 60     GrContext* context() const { return fContext; } | 60     GrContext* context() const { return fContext; } | 
| 61 | 61 | 
| 62     // set all pixels to 0 | 62     // set all pixels to 0 | 
| 63     void clearAll(); | 63     void clearAll(); | 
| 64 | 64 | 
| 65     void replaceRenderTarget(bool shouldRetainContent); | 65     void replaceRenderTarget(bool shouldRetainContent); | 
| 66 | 66 | 
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 140     GrClip                          fClip; | 140     GrClip                          fClip; | 
| 141     GrTextContext*                  fTextContext; | 141     GrTextContext*                  fTextContext; | 
| 142     SkSurfaceProps                  fSurfaceProps; | 142     SkSurfaceProps                  fSurfaceProps; | 
| 143     GrRenderTarget*                 fRenderTarget; | 143     GrRenderTarget*                 fRenderTarget; | 
| 144     // remove when our clients don't rely on accessBitmap() | 144     // remove when our clients don't rely on accessBitmap() | 
| 145     SkBitmap                        fLegacyBitmap; | 145     SkBitmap                        fLegacyBitmap; | 
| 146     bool                            fNeedClear; | 146     bool                            fNeedClear; | 
| 147 | 147 | 
| 148     SkGpuDevice(GrRenderTarget*, const SkSurfaceProps*, unsigned flags); | 148     SkGpuDevice(GrRenderTarget*, const SkSurfaceProps*, unsigned flags); | 
| 149 | 149 | 
| 150     SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) SK_OVERRIDE; | 150     SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) SK_OVERRIDE; | 
| 151 | 151 | 
| 152     SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRIDE
     ; | 152     SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRIDE
     ; | 
| 153 | 153 | 
| 154     SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE; | 154     SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE; | 
| 155 | 155 | 
| 156     bool forceConservativeRasterClip() const SK_OVERRIDE { return true; } | 156     bool forceConservativeRasterClip() const SK_OVERRIDE { return true; } | 
| 157 | 157 | 
| 158     // sets the render target and clip on context | 158     // sets the render target and clip on context | 
| 159     void prepareDraw(const SkDraw&); | 159     void prepareDraw(const SkDraw&); | 
| 160 | 160 | 
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 203 | 203 | 
| 204     static SkPicture::AccelData::Key ComputeAccelDataKey(); | 204     static SkPicture::AccelData::Key ComputeAccelDataKey(); | 
| 205 | 205 | 
| 206     static GrRenderTarget* CreateRenderTarget(GrContext*, SkSurface::Budgeted, c
     onst SkImageInfo&, | 206     static GrRenderTarget* CreateRenderTarget(GrContext*, SkSurface::Budgeted, c
     onst SkImageInfo&, | 
| 207                                               int sampleCount); | 207                                               int sampleCount); | 
| 208 | 208 | 
| 209     typedef SkBaseDevice INHERITED; | 209     typedef SkBaseDevice INHERITED; | 
| 210 }; | 210 }; | 
| 211 | 211 | 
| 212 #endif | 212 #endif | 
| OLD | NEW | 
|---|