| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 * If the requested surface cannot be created, or the request is not a | 54 * If the requested surface cannot be created, or the request is not a |
| 55 * supported configuration, NULL will be returned. | 55 * supported configuration, NULL will be returned. |
| 56 */ | 56 */ |
| 57 static SkSurface* NewRaster(const SkImageInfo&, const SkSurfaceProps* = NULL
); | 57 static SkSurface* NewRaster(const SkImageInfo&, const SkSurfaceProps* = NULL
); |
| 58 | 58 |
| 59 /** | 59 /** |
| 60 * Helper version of NewRaster. It creates a SkImageInfo with the | 60 * Helper version of NewRaster. It creates a SkImageInfo with the |
| 61 * specified width and height, and populates the rest of info to match | 61 * specified width and height, and populates the rest of info to match |
| 62 * pixels in SkPMColor format. | 62 * pixels in SkPMColor format. |
| 63 */ | 63 */ |
| 64 #ifdef SK_SUPPORT_LEGACY_NewRasterPMColor | |
| 65 static SkSurface* NewRasterPMColor(int width, int height, const SkSurfacePro
ps* props = NULL) { | 64 static SkSurface* NewRasterPMColor(int width, int height, const SkSurfacePro
ps* props = NULL) { |
| 66 return NewRaster(SkImageInfo::MakeN32Premul(width, height), props); | 65 return NewRaster(SkImageInfo::MakeN32Premul(width, height), props); |
| 67 } | 66 } |
| 68 #endif | |
| 69 static SkSurface* NewRasterN32Premul(int width, int height, const SkSurfaceP
rops* props = NULL) { | |
| 70 return NewRaster(SkImageInfo::MakeN32Premul(width, height), props); | |
| 71 } | |
| 72 | 67 |
| 73 /** | 68 /** |
| 74 * Return a new surface using the specified render target. | 69 * Return a new surface using the specified render target. |
| 75 */ | 70 */ |
| 76 static SkSurface* NewRenderTargetDirect(GrRenderTarget*, const SkSurfaceProp
s*); | 71 static SkSurface* NewRenderTargetDirect(GrRenderTarget*, const SkSurfaceProp
s*); |
| 77 | 72 |
| 78 static SkSurface* NewRenderTargetDirect(GrRenderTarget* target) { | 73 static SkSurface* NewRenderTargetDirect(GrRenderTarget* target) { |
| 79 return NewRenderTargetDirect(target, NULL); | 74 return NewRenderTargetDirect(target, NULL); |
| 80 } | 75 } |
| 81 | 76 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 private: | 226 private: |
| 232 const SkSurfaceProps fProps; | 227 const SkSurfaceProps fProps; |
| 233 const int fWidth; | 228 const int fWidth; |
| 234 const int fHeight; | 229 const int fHeight; |
| 235 uint32_t fGenerationID; | 230 uint32_t fGenerationID; |
| 236 | 231 |
| 237 typedef SkRefCnt INHERITED; | 232 typedef SkRefCnt INHERITED; |
| 238 }; | 233 }; |
| 239 | 234 |
| 240 #endif | 235 #endif |
| OLD | NEW |