| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 * supported configuration, NULL will be returned. | 45 * supported configuration, NULL will be returned. |
| 46 */ | 46 */ |
| 47 static SkSurface* NewRaster(const SkImageInfo&); | 47 static SkSurface* NewRaster(const SkImageInfo&); |
| 48 | 48 |
| 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 SkImageInfo info = { | 55 return NewRaster(SkImageInfo::MakeN32Premul(width, height)); |
| 56 width, height, kPMColor_SkColorType, kPremul_SkAlphaType | |
| 57 }; | |
| 58 return NewRaster(info); | |
| 59 } | 56 } |
| 60 | 57 |
| 61 /** | 58 /** |
| 62 * Return a new surface whose contents will be recorded into a picture. | 59 * Return a new surface whose contents will be recorded into a picture. |
| 63 * When this surface is drawn into another canvas, its contents will be | 60 * When this surface is drawn into another canvas, its contents will be |
| 64 * "replayed" into that canvas. | 61 * "replayed" into that canvas. |
| 65 */ | 62 */ |
| 66 static SkSurface* NewPicture(int width, int height); | 63 static SkSurface* NewPicture(int width, int height); |
| 67 | 64 |
| 68 /** | 65 /** |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 171 |
| 175 private: | 172 private: |
| 176 const int fWidth; | 173 const int fWidth; |
| 177 const int fHeight; | 174 const int fHeight; |
| 178 uint32_t fGenerationID; | 175 uint32_t fGenerationID; |
| 179 | 176 |
| 180 typedef SkRefCnt INHERITED; | 177 typedef SkRefCnt INHERITED; |
| 181 }; | 178 }; |
| 182 | 179 |
| 183 #endif | 180 #endif |
| OLD | NEW |