| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkSurface_DEFINED | 8 #ifndef SkSurface_DEFINED |
| 9 #define SkSurface_DEFINED | 9 #define SkSurface_DEFINED |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 /** | 49 /** |
| 50 * Helper version of NewRaster. It creates a SkImageInfo with the | 50 * Helper version of NewRaster. It creates a SkImageInfo with the |
| 51 * specified width and height, and populates the rest of info to match | 51 * specified width and height, and populates the rest of info to match |
| 52 * pixels in SkPMColor format. | 52 * pixels in SkPMColor format. |
| 53 */ | 53 */ |
| 54 static SkSurface* NewRasterPMColor(int width, int height) { | 54 static SkSurface* NewRasterPMColor(int width, int height) { |
| 55 return NewRaster(SkImageInfo::MakeN32Premul(width, height)); | 55 return NewRaster(SkImageInfo::MakeN32Premul(width, height)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * Return a new surface whose contents will be recorded into a picture. | |
| 60 * When this surface is drawn into another canvas, its contents will be | |
| 61 * "replayed" into that canvas. | |
| 62 */ | |
| 63 static SkSurface* NewPicture(int width, int height); | |
| 64 | |
| 65 /** | |
| 66 * Return a new surface using the specified render target. | 59 * Return a new surface using the specified render target. |
| 67 */ | 60 */ |
| 68 static SkSurface* NewRenderTargetDirect(GrRenderTarget*); | 61 static SkSurface* NewRenderTargetDirect(GrRenderTarget*); |
| 69 | 62 |
| 70 /** | 63 /** |
| 71 * Return a new surface whose contents will be drawn to an offscreen | 64 * Return a new surface whose contents will be drawn to an offscreen |
| 72 * render target, allocated by the surface. | 65 * render target, allocated by the surface. |
| 73 */ | 66 */ |
| 74 static SkSurface* NewRenderTarget(GrContext*, const SkImageInfo&, int sample
Count = 0); | 67 static SkSurface* NewRenderTarget(GrContext*, const SkImageInfo&, int sample
Count = 0); |
| 75 | 68 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 178 |
| 186 private: | 179 private: |
| 187 const int fWidth; | 180 const int fWidth; |
| 188 const int fHeight; | 181 const int fHeight; |
| 189 uint32_t fGenerationID; | 182 uint32_t fGenerationID; |
| 190 | 183 |
| 191 typedef SkRefCnt INHERITED; | 184 typedef SkRefCnt INHERITED; |
| 192 }; | 185 }; |
| 193 | 186 |
| 194 #endif | 187 #endif |
| OLD | NEW |